Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal files silently compiled #5822

Closed
schwa opened this issue Oct 18, 2022 · 5 comments
Closed

Metal files silently compiled #5822

schwa opened this issue Oct 18, 2022 · 5 comments
Labels

Comments

@schwa
Copy link

schwa commented Oct 18, 2022

Description

SwiftPM 5.3 added support to process .metal files using the resource functionality.

It seems that somewhere between SwiftPM 5.3 and 5.7 all .metal files in a package are compiled into a default.metallib file

I cannot find any documentation on this behaviour. Is it expected? What swiftpm version was this feature added?

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version && uname -a)

No response

@neonichu
Copy link
Contributor

Resources of known types are automatically handled, as per the resources proposal.

Could you elaborate more on what the issue is? Also it sounds like you're saying the behavior changed between versions, what changed exactly?

@schwa
Copy link
Author

schwa commented Oct 18, 2022

Ah it was my understanding that the only way to compile metal was via resource.process. From the sounds of it seems SPM has always automagically compiled .metal files then?

TBH it's kind of unclear from proposal that what the expectations of metal files are. Maybe some clarity on what files are considered known and are handled automatically?

Is it possible to opt out of automatic handling? (so we could process metal files ourselves with a plugin?)

@neonichu
Copy link
Contributor

You should be able to use excludes.

I'm not 100% sure, but it might also mean the Target APIs wouldn't include these files and you would need to look for them manually on the file system in your plugin implementation.

@neonichu
Copy link
Contributor

BTW, the proposal was intentionally not descriptive about specific file types since we didn't want to (and couldn't) define concrete Xcode behavior in there. The documentation on resources in Xcode is a little bit more clear, but it unfortunately also doesn't really have an exhaustive list of file types which are handled automatically.

@schwa
Copy link
Author

schwa commented Oct 18, 2022

Yeah fair enough. Maybe then make .process() fail if it tries to process file that should be automatically handled? Can probably close out this ticket but yeah it is a bit confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants