Skip to content

cargo fmt and other tools don't work for a linked toolchain. #81431

Description

@vext01

This is derived from this issue, in which we concluded that the bug should be filed against rustc, as it's an x.py problem.

In rustc:

$ ./x.py build --stage 1 src/tools/rustfmt/
...
$ find 'build' -name rustfmt
build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/rustfmt
build/x86_64-unknown-linux-gnu/stage1-tools-bin/rustfmt
build/x86_64-unknown-linux-gnu/stage0/share/doc/rustfmt
build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt
build/tmp-rustbuild-tests/main/tmp/tarball/rustfmt
build/tmp-rustbuild-tests/main/tmp/tarball/rustfmt/B/image/share/doc/rustfmt

Then in a project using this toolchain via a rustup link:

$ cargo fmt
error: 'cargo-fmt' is not installed for the toolchain 'yk-stage1'
note: this is a custom toolchain, which cannot use `rustup component add`
help: if you built this toolchain from source, and used `rustup toolchain link`, then you may be able to build the component with `x.py`                                                                           

But note that cp build/x86_64-unknown-linux-gnu/stage1-tools-bin/rustfmt build/x86_64-unknown-linux-gnu/stage1/bin/rustfmt does not make this work either, so there is probably more to it?

Thanks

Activity

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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions