Skip to content

Add a new download-ci-llvm = if-unchanged option and enable it by default for profile = codegenΒ #110087

Closed
@jyn514

Description

@jyn514

The codegen profile is intended not just for people working on LLVM itself, but also anyone who touches codegen but not LLVM. For example, anyone who modifies rustc_codegen_ssa or rustc_codegen_llvm is only changing the IR we send to LLVM, not LLVM itself. We should keep llvm.debug-assertions on for them but not for profile = "compiler", but ideally we wouldn't build LLVM from source if it's unmodified.

@majaha points out some things that we should fix before enabling that option by default for the codegen profile:

### Tasks
- [ ] Add a new `if-unchanged` option for `download-ci-llvm`. This should be modeled off the existing option for `download-rustc`, and imply `if-available` (i.e. we should treat this the same as `false` for tier 3 platforms). It may be as simple as extracting out the same `last_modified_commit` function used in https://github.com/rust-lang/rust/blob/8ad89068e2558940b4184d46763ff9c6b325883b/src/bootstrap/min_config.rs#L178-L180 and calling it with `["src/llvm-project"]`, then adding the option in config.toml.
- [ ]  The downloadable llvm for this profile should include all the build artifacts that you get with a source build, so that the build dir is left in a state _as if_ you've just run a full source build. See https://github.com/rust-lang/rust/pull/110074#issuecomment-1500888030 for a full list of artifacts that should be included.
- [ ] The submodule should be downloaded during `./x.py setup` after you select the `codegen` profile.

Originally posted by @jyn514 in #110074 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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