Skip to content

Feature/Stability staging is flaky #21230

Closed
@nagisa

Description

@nagisa

NB: This refers to the feature of making #[unstable] APIs unusable in release channels.

Currently, to allow bootstrap compilers to build standard library, the CFG_BOOTSTRAP_KEY environment variable (see #20663) should match some secret value decided at compile time of rustc. This has several problems:

  1. The key is very easy to find out (looking at build logs, running strings etc);
  2. Key generation is not cross platform. On BSDs and OS Xs the generated key is well known and currently is equal to N;
  3. It broke snapshots.

The proposed solution is to build two different versions of rustc for stage2/3 instead, depending on the situation:

  1. stage2/3 src/driver/driver.rs which can process unstable libraries (e.g. using `--cfg enable_unstable);
  2. stage2/3 libraries are built;
  3. stage2/3 src/driver/driver.rs which cannot process unstable libraries;
  4. Proper binary is packaged/shipped depending on the channel.

This has benefits of not having to do any environment variable dance during the build. It is also not really workaround-able without manually rebuilding rustc, unlike the current approach.

(also see logs)

cc @brson, @eddyb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions