Skip to content

Add x.py option to skip rebuilding LLVM #65612

Closed
@varkor

Description

@varkor
Member

The compiler LLVM is rebuilt whenever the built version of LLVM doesn't have the right hash. (Previously it was rebuilt based on a special marker file, which was easier to work around.)

if done_stamp.exists() {
if let Some(llvm_commit) = llvm_info.sha() {
let done_contents = t!(fs::read(&done_stamp));
// If LLVM was already built previously and the submodule's commit didn't change
// from the previous build, then no action is required.
if done_contents == llvm_commit.as_bytes() {
return build_llvm_config;
}
} else {
builder.info(
"Could not determine the LLVM submodule commit hash. \
Assuming that an LLVM rebuild is not necessary.",
);
builder.info(&format!(
"To force LLVM to rebuild, remove the file `{}`",
done_stamp.display()
));
return build_llvm_config;
}
}

However, most of the time, having the latest LLVM version is not necessary, but makes rebuilding rustc after rebasing take significantly longer, which is a pain. It would be good to be able to disable this as an option in x.py for convenience.

This issue has been assigned to @matthew-healy via this comment.

Activity

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
on Oct 19, 2019
varkor

varkor commented on Oct 19, 2019

@varkor
MemberAuthor

To fix this, you'll want to add another option: you should be able to look at the logic for something like --keep-stage.

rust/src/bootstrap/flags.rs

Lines 130 to 131 in f042687

opts.optmulti("", "keep-stage", "stage(s) to keep without recompiling \
(pass multiple times to keep e.g., both stages 0 and 1)", "N");

Centril

Centril commented on Oct 20, 2019

@Centril
Contributor

It would be good if this could be changed in the config file so you don't have to pass in the option all the time.

varkor

varkor commented on Oct 20, 2019

@varkor
MemberAuthor

@Centril: if it's a config file option, then there should be an x.py option to rebuild it if necessary. I.e. it shouldn't be necessarily to temporarily change the Config.toml to rebuild.

Centril

Centril commented on Oct 20, 2019

@Centril
Contributor

@varkor sure that seems good, although they can be implemented separately.

spadaval

spadaval commented on Oct 20, 2019

@spadaval

The line you would need to change is near this one: (line 735 of bootstrap.py)

if self.get_toml('llvm-config') and self.get_toml('lld') != 'true':
        continue

It would probably be much easier to add a check against a key in the config, than to add a new flag.

Walther

Walther commented on Oct 26, 2019

@Walther

@rustbot claim 🙂

rustbot

rustbot commented on Oct 26, 2019

@rustbot
Collaborator

Error: Parsing assign command in comment failed: ...tbot claim|error: expected end of command at >| 🙂 ...

Please let @rust-lang/release know if you're having trouble with this bot.

Walther

Walther commented on Oct 26, 2019

@Walther

...sorry, my bad!

@rustbot claim

EDIT: oh dear, I'm making it worse 🤦‍♂

assigned and unassigned on Oct 26, 2019

16 remaining items

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

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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

    Participants

    @Centril@jonas-schievink@Walther@varkor@matthew-healy

    Issue actions

      Add `x.py` option to skip rebuilding LLVM · Issue #65612 · rust-lang/rust