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

Mark rust-analyzer as a host-only tool #103246

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

pietroalbini
Copy link
Member

All tools meant to be shipped with host toolchains only should be marked as ONLY_HOSTS = true, but rust-analyzer was marked as ONLY_HOSTS = false incorrectly. This meant that bootstrap attempted to build rust-analyzer for cross-compilation-only targets, causing errors because libstd is not present on some of them.

It will still be possible to cross-compile rust-analyzer by passing a different --host flag to ./x, like you can cross-compile other tools.

The problem can be reproduced by running:

./x build src/tools/rust-analyzer --target x86_64-unknown-linux-gnu,aarch64-unknown-none

All tools meant to be shipped with host toolchains only should be marked
as `ONLY_HOSTS = true`, but rust-analyzer was marked as `ONLY_HOSTS =
false` incorrectly. This meant that bootstrap attempted to build
rust-analyzer for cross-compilation-only targets, causing errors because
libstd is not present on some of them.

It will still be possible to cross-compile rust-analyzer by passing a
different --host flag to ./x, like you can cross-compile other tools.
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Oct 19, 2022
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2022
@@ -742,7 +742,7 @@ pub struct RustAnalyzerProcMacroSrv {
impl Step for RustAnalyzerProcMacroSrv {
type Output = Option<PathBuf>;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = false;
const ONLY_HOSTS: bool = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is right. Isn't this libproc_macro but for rust-analyzer? IOW, shouldn't it be shipped whenever we ship std?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we should ship this wherever we ship a host compiler. The binary provides a stable interface between rust-analyzer and the current compiler's proc macro implementation, so there should be no point in shipping it outside of host toolchains.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 19, 2022

📌 Commit 5b7bd2f has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 19, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 19, 2022
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#103211 (rustdoc: remove class name `location` from sidebar sibling nav)
 - rust-lang#103223 (Use already checked RHS ty for LHS deref suggestions)
 - rust-lang#103237 (Clean up codeblock-tooltip rustdoc-gui test)
 - rust-lang#103239 (Allow #[unstable] impls for fn() with unstable abi.)
 - rust-lang#103246 (Mark `rust-analyzer` as a host-only tool)
 - rust-lang#103257 (rustdoc: move `setting-line` color CSS to settings.css)
 - rust-lang#103258 (Make miri read_dir test a little more robust)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e85def7 into rust-lang:master Oct 20, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 20, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#103211 (rustdoc: remove class name `location` from sidebar sibling nav)
 - rust-lang#103223 (Use already checked RHS ty for LHS deref suggestions)
 - rust-lang#103237 (Clean up codeblock-tooltip rustdoc-gui test)
 - rust-lang#103239 (Allow #[unstable] impls for fn() with unstable abi.)
 - rust-lang#103246 (Mark `rust-analyzer` as a host-only tool)
 - rust-lang#103257 (rustdoc: move `setting-line` color CSS to settings.css)
 - rust-lang#103258 (Make miri read_dir test a little more robust)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants