-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add if-identical
mode for download-ci-llvm
#113761
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -2297,6 +2297,48 @@ impl Step for RustDev { | |||||||
} | ||||||||
} | ||||||||
|
||||||||
// Tarball intended for internal consumption to ease rustc/std development. | ||||||||
// | ||||||||
// Should not be considered stable by end users. | ||||||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)] | ||||||||
pub struct RustDevConfig { | ||||||||
pub target: TargetSelection, | ||||||||
} | ||||||||
|
||||||||
impl Step for RustDevConfig { | ||||||||
type Output = Option<GeneratedTarball>; | ||||||||
const DEFAULT: bool = true; | ||||||||
const ONLY_HOSTS: bool = true; | ||||||||
|
||||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { | ||||||||
run.alias("rust-dev-config") | ||||||||
} | ||||||||
|
||||||||
fn make_run(run: RunConfig<'_>) { | ||||||||
run.builder.ensure(RustDevConfig { target: run.target }); | ||||||||
} | ||||||||
|
||||||||
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> { | ||||||||
let target = self.target; | ||||||||
|
||||||||
/* run only if llvm-config isn't used */ | ||||||||
if let Some(config) = builder.config.target_config.get(&target) { | ||||||||
if let Some(ref _s) = config.llvm_config { | ||||||||
builder.info(&format!("Skipping RustDevConfig ({}): external LLVM", target)); | ||||||||
return None; | ||||||||
} | ||||||||
} | ||||||||
Comment on lines
+2324
to
+2330
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you make this a default instead of a skip, so that we can give a hard error if someone runs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like this? fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let config = run.builder.config.target_config.get(&<how to get target?>).map(|c| c.llvm_config);
run.alias("rust-dev-config").default_condition(config.is_none())
} I'm not sure how to get the target, because |
||||||||
|
||||||||
let mut tarball = Tarball::new(builder, "rust-dev-config", &target.triple); | ||||||||
tarball.set_overlay(OverlayKind::LLVM); | ||||||||
|
||||||||
let config = t!(serde_json::to_string_pretty(&builder.build.config.llvm)); | ||||||||
t!(std::fs::write(tarball.image_dir().join("llvm-opts.json"), config)); | ||||||||
jyn514 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
|
||||||||
Some(tarball.generate()) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this panics when running Lines 305 to 307 in 0a1b983
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I really update LLVM submodule in a function that creates a tarball? Shouldn't this be in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, i suppose doing it in this Step is fine. i was imaging you'd check overlay_kind in Tarball so each calling Step doesn't have to worry about it but in practice they're probably all doing the right thing. |
||||||||
} | ||||||||
} | ||||||||
|
||||||||
// Tarball intended for internal consumption to ease rustc/std development. | ||||||||
// | ||||||||
// Should not be considered stable by end users. | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is true but confusing when
llvm_from_ci
is set. maybe we can improve it a bit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. However, I realized that this shouldn't fail when
llvm_from_ci
istrue
? Because this has to succeed whendownload-ci-llvm
isif-identical
. We should probably makellvm_from_ci
an enum to distinguish these situations?