Skip to content

rustc is not building for custom targets #151729

@DeepeshWR

Description

@DeepeshWR

rustc is not building for custom targets with the current nightly branch. I suspect this is related to the following commit

As mentioned in the commit, I tried passing the -Zunstable-options flag using the following methods:

export RUSTFLAGS="-Zunstable-options"
export RUSTFLAGS_BOOTSTRAP="-Zunstable-options"
config.set("rust", "rustflags", e(["-Zunstable-options",]))

However, none of these approaches worked. The failure occurs during the stage1 build. My understanding
is that the stage1 build may be stripping or ignoring these flags.

Am I missing something here, or is there a different way to ensure -Zunstable-options is honoured during
the stage1 build?

The error I see is:

Created at: src/bootstrap/src/core/builder/mod.rs:1403:23
Executed at: src/bootstrap/src/core/build_steps/compile.rs:1143:25

--- STDERR vvv
error: error loading target specification: custom targets are unstable and require `-Zunstable-options`
  |
  = help: run `rustc --print target-list` for a list of built-in targets

So, once this commit landed in stable releases, how are custom targets expected to be built using the stable channel? Are there any alternative mechanisms or future plans to support this use case?
The full log is attached below for reference.

rust.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-targetsArea: Concerning the implications of different compiler targetsC-discussionCategory: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions