Skip to content

Give RUSTC_BOOTSTRAP a list of crates #404

Closed

Description

@ojeda

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.

Activity

  1. added
    • kbuildRelated to building the kernel, `make`, `Kbuild`, `Kconfig` options...
    on Jun 30, 2021
  2. changed the title [-]Give `RUSTC_BOOTSTRAP` with a list of crates[/-] [+]Give `RUSTC_BOOTSTRAP` a list of crates[/+] on Jun 30, 2021
  3. ojeda commented on Jun 30, 2021

    @ojeda
    MemberAuthor

    @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.

  4. bjorn3 commented on Jun 30, 2021

    @bjorn3
    Member

    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.

  5. ojeda commented on Jun 30, 2021

    @ojeda
    MemberAuthor

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

  6. ojeda commented on Jul 2, 2021

    @ojeda
    MemberAuthor

    -Zallow-features done in #416.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    • kbuildRelated to building the kernel, `make`, `Kbuild`, `Kconfig` options...

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions