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

rustbuild: LLVM is not partially rebuilt anymore #68715

Closed
petrochenkov opened this issue Jan 31, 2020 · 3 comments · Fixed by #69397
Closed

rustbuild: LLVM is not partially rebuilt anymore #68715

petrochenkov opened this issue Jan 31, 2020 · 3 comments · Fixed by #69397
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@petrochenkov
Copy link
Contributor

Even tiny changes like #68570 cause a full rebuild.

This is a regression from the few recent months (?).
Before that partial rebuilds worked, I remember it because I implemented them back in 2017 (#40329).

I didn't yet investigate what happens exactly.

@petrochenkov petrochenkov added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 31, 2020
@cuviper
Copy link
Member

cuviper commented Jan 31, 2020

I think it's because the git hash is set in LLVM_VERSION_SUFFIX here:

if let Some(ref suffix) = builder.config.llvm_version_suffix {
// Allow version-suffix="" to not define a version suffix at all.
if !suffix.is_empty() {
cfg.define("LLVM_VERSION_SUFFIX", suffix);
}
} else {
let mut default_suffix =
format!("-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel,);
if let Some(sha) = llvm_info.sha_short() {
default_suffix.push_str("-");
default_suffix.push_str(sha);
}
cfg.define("LLVM_VERSION_SUFFIX", default_suffix);
}

This propagates to PACKAGE_VERSION in llvm/Config/config.h, which affects the entire build.

@cuviper
Copy link
Member

cuviper commented Feb 1, 2020

There's a cmake variable LLVM_APPEND_VC_REV that would probably behave better for this.

@tmiasko
Copy link
Contributor

tmiasko commented Feb 23, 2020

The LLVM_VERSION_SUFFIX is indeed responsible for complete rebuilds.
The intent behind PR that introduced it was to disambiguate between versions of
LLVM library that are incompatible yet previously could share the same name.

Unfortunately LLVM_APPEND_VC_REV doesn't help, since it is about stashing
version control revision information somewhere inside the library, rather than
changing the library name itself.

Removing commit SHA from default version suffix should be enough to address
the original issue while resolving this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants