Skip to content

bootstrap: skip llvm-tools install when externally provided #109196

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

Closed
wants to merge 2 commits into from

Conversation

filnet
Copy link

@filnet filnet commented Mar 15, 2023

fixes #109194

@rustbot
Copy link
Collaborator

rustbot commented Mar 15, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ozkanonur (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 15, 2023
Comment on lines 213 to 220
if let Some(tarball) = builder.ensure(dist::LlvmTools { target: self.target }) {
install_sh(builder, "llvm-tools", self.compiler.stage, Some(self.target), &tarball);
} else {
// LlvmTools can be externally provided
builder.info(
&format!("skipping Install LlvmTools stage{} ({})", self.compiler.stage, self.target),
);
}
Copy link
Member

@onur-ozkan onur-ozkan Mar 16, 2023

Choose a reason for hiding this comment

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

We should check if llvm is provided or not. If llvm isn't provided externally and there is a problem with tarballs, we want to panic the process instead of skipping it. With this diff any problem with tarball will skip the process regardless.

Copy link
Author

@filnet filnet Mar 16, 2023

Choose a reason for hiding this comment

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

I agree, but I don't know how to do what you suggest.
All other installs (Miri, etc..) either panic or skip if the tarball is not defined.
There is no example of a conditional skip.

Edit: I based my fix on a recent and similar fix: e5c92bc

Copy link
Member

Choose a reason for hiding this comment

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

You can implement a function in Config that checks if any of the configure_args items starts with --llvm-root, and returns bool value depend on that.

Copy link
Author

Choose a reason for hiding this comment

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

Done. Had to move some code around.

@onur-ozkan
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 16, 2023
@@ -251,6 +251,11 @@ install!((self, builder, _config),
};
);

fn should_build_llvm(config: &Config) -> bool {
// additionaly check that llvm is not externally provided
LlvmTools::should_build(config) && config.is_rust_llvm(config.build)
Copy link
Author

Choose a reason for hiding this comment

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

That code is not correct : the config.build is not the one we want...

Copy link
Member

Choose a reason for hiding this comment

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

if any of the configure_args items starts with --llvm-root

Can you do this check in here? It should do the work

@@ -251,6 +251,11 @@ install!((self, builder, _config),
};
);

fn should_build_llvm(config: &Config) -> bool {
// additionaly check that llvm is not externally provided
Copy link
Member

Choose a reason for hiding this comment

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

Can you write this as a doc-comment on top of this function? It will be better for other devs to directly read this via LSP/rust-analyzer.

@bors
Copy link
Collaborator

bors commented Mar 18, 2023

☔ The latest upstream changes (presumably #109284) made this pull request unmergeable. Please resolve the merge conflicts.

@filnet
Copy link
Author

filnet commented Mar 18, 2023

fixed by #109256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

build: bootstrap panics when using the --llvm-root option
4 participants