Skip to content

rustbuild: LLVM is not partially rebuilt anymore #68715

Closed

Description

@petrochenkov

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.

Activity

  1. added
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Jan 31, 2020
  2. cuviper commented on Jan 31, 2020

    @cuviper
    Member

    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.

  3. cuviper commented on Feb 1, 2020

    @cuviper
    Member

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

  4. tmiasko commented on Feb 23, 2020

    @tmiasko
    Contributor

    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.

  5. added a commit that references this issue on Mar 1, 2020
    1e25878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.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

      Development

      No branches or pull requests

      Issue actions