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

Give RUSTC_BOOTSTRAP a list of crates #404

Open
ojeda opened this issue Jun 30, 2021 · 4 comments
Open

Give RUSTC_BOOTSTRAP a list of crates #404

ojeda opened this issue Jun 30, 2021 · 4 comments
Labels
• kbuild Related to building the kernel, `make`, `Kbuild`, `Kconfig` options...

Comments

@ojeda
Copy link
Member

ojeda commented Jun 30, 2021

From #402 (comment):

You can give the name of specific crates (separated with spaces I think). Rustc will then only allow unstable features for those crates. This could be used as a roadblock to prevent depending on unstable features outside of libcore, liballoc and libkernel. Driver code shouldn't ever rely on unstable features IMO. It is much easier to update only a few core crates than update many drivers as unstable features change.

This is blocked on allocator_api (at least) becoming stable (or a way to e.g. enable some unstable features from the command line but not allowing any other in source code), but as soon as we can do it, it can be a very good idea, specially when we are in mainline where others will be writing Rust drivers independently of us.

@ojeda ojeda added • kbuild Related to building the kernel, `make`, `Kbuild`, `Kconfig` options... prio: normal labels Jun 30, 2021
@ojeda ojeda changed the title Give RUSTC_BOOTSTRAP with a list of crates Give RUSTC_BOOTSTRAP a list of crates Jun 30, 2021
@ojeda
Copy link
Member Author

ojeda commented Jun 30, 2021

@bjorn3 I edited the post above to add another possibility: having a way to enable unstable features from the command-line but at the same time disallow any further features to be enabled in the actual source code. This would allow us to e.g. enable allocator_api globally, but disallow kernel module writers any other feature.

@bjorn3
Copy link
Member

bjorn3 commented Jun 30, 2021

There is -Zallow-features which can restrict the list of allowed features. (names separated by spaces) This still requires RUSTC_BOOTSTRAP and #![feature] though, but at least prevents drivers from using any features other than allocator_api.

@ojeda
Copy link
Member Author

ojeda commented Jun 30, 2021

That is actually perfect for us -- thanks a lot, I will add it.

@ojeda
Copy link
Member Author

ojeda commented Jul 2, 2021

-Zallow-features done in #416.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• kbuild Related to building the kernel, `make`, `Kbuild`, `Kconfig` options...
Development

No branches or pull requests

2 participants