Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove support for "module libraries" #6837

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tangent-vector
Copy link
Contributor

This change also removes support for the -r command-line option to slangc, and the ability to pass .slang-module files as command-line arguments.

It may turn out that some (or all) of the functionality being removed in this change is required by at least some existing users of the slang API or command-line compiler. The intention of this change is to provide a way to evaluate whether these changes would break any user code that is being tested by various automated CI processes.

This change *also* removes support for the `-r` command-line option to
`slangc`, and the ability to pass `.slang-module` files as
command-line arguments.

It may turn out that some (or all) of the functionality being removed
in this change is required by at least some existing users of the
slang API or command-line compiler. The intention of this change is
to provide a way to evaluate whether these changes would break any
user code that is being tested by various automated CI processes.
@tangent-vector tangent-vector added the pr: breaking change PRs with breaking changes label Apr 16, 2025
@tangent-vector
Copy link
Contributor Author

/format

@slangbot
Copy link
Contributor

🌈 Formatted, please merge the changes from this PR

@juliusikkala
Copy link
Contributor

I'm using .slang-modules as input to slangc to compile CPU-targeting Slang using a custom CMake toolchain, and would like this feature to stay. I can probably somehow work around it though if necessary.

Particularly, CMake toolchains need a way for the compiler to generate object files from sources (CMAKE_Slang_COMPILE_OBJECT). I use this to generate .slang-module files. Then, a linking stage is needed (CMAKE_Slang_LINK_EXECUTABLE), which I've implemented by feeding these object files (.slang-modules) to slangc with -target executable. Splitting them this way allows for parallel compilation (or in reality, mostly just parallel parsing I guess) of the sources in CMake.

I think I could live with CMAKE_Slang_COMPILE_OBJECT just copying the Slang source as-is, so removing this feature would likely just be a slight inconvenience.

@tangent-vector
Copy link
Contributor Author

@juliusikkala Thanks for the feedback!

This PR is definitely just an attempt on my part to find the boundaries between what is and isn't being used when it comes to this functinality, so knowing that passing a .slang-module on the command line is a useful behavior helps a lot.

Also, FWIW, I strongly agree that the behavior you describe is desirable, for the reasons you went into. It's not that I don't think slangc should have that behavior, and its more just that the way that behavior is currently implemented in the compiler is tangled up in several overly-complicated features, so that ideally we could do something a lot more narrow that would meet your needs.

I'm going to keep iterating on this work, but for now your comment plus the various test failures (including some user code integration tests I've run internally) tell me that I can't just do the easy thing and eliminate this functionality entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: breaking change PRs with breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants