Skip to content

Don't rebuild LLVM on non-related changes to config.toml #42444

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Mark-Simulacrum opened this issue Jun 5, 2017 · 3 comments · Fixed by #42985
Closed

Don't rebuild LLVM on non-related changes to config.toml #42444

Mark-Simulacrum opened this issue Jun 5, 2017 · 3 comments · Fixed by #42985
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Mark-Simulacrum
Copy link
Member

#42429 closed #35199; but ideally we don't want to rebuild LLVM no matter what; since that has a high overhead for changes that aren't related. See the pull request for more details (#42429 (comment)).

@Mark-Simulacrum Mark-Simulacrum added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jun 5, 2017
@venkatagiri
Copy link
Contributor

@Mark-Simulacrum Now that rust-lang/cargo#4125 has landed, would below solution work to fix this issue?
In bootstrap, set env var CFG_LLVM_CONFIG to llvm-config path specified in config.toml and in rustc_llvm, print cargo:rerun-if-env-changed=CFG_LLVM_CONFIG?

@Mark-Simulacrum
Copy link
Member Author

Sounds reasonable! I think we'd need to be careful we only read the llvm-config path, but I believe that's true today. Would you like to make a PR?

@venkatagiri
Copy link
Contributor

Yes. I will. Looking at the code again, I feel we can use the LLVM_CONFIG env var (which points to llvm-config based on config.toml or custom llvm build) to trigger llvm rebuild by printing cargo:rerun-if-env-changed=LLVM_CONFIG and removing all changes done in #42429.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 30, 2017
…ulacrum

rustc_llvm: re-run build script when env var LLVM_CONFIG changes

This removes the changes done in rust-lang#42429 and use the newly introduced `cargo:rerun-if-env-changed` in rust-lang/cargo#4125.
As `LLVM_CONFIG` env var points to the `llvm-config` and changes when it gets configured in `config.toml` or removed from it, we can re-run the build script if this env var changes.

closes rust-lang#42444

r? @alexcrichton
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 30, 2017
…ulacrum

rustc_llvm: re-run build script when env var LLVM_CONFIG changes

This removes the changes done in rust-lang#42429 and use the newly introduced `cargo:rerun-if-env-changed` in rust-lang/cargo#4125.
As `LLVM_CONFIG` env var points to the `llvm-config` and changes when it gets configured in `config.toml` or removed from it, we can re-run the build script if this env var changes.

closes rust-lang#42444

r? @alexcrichton
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 30, 2017
…ulacrum

rustc_llvm: re-run build script when env var LLVM_CONFIG changes

This removes the changes done in rust-lang#42429 and use the newly introduced `cargo:rerun-if-env-changed` in rust-lang/cargo#4125.
As `LLVM_CONFIG` env var points to the `llvm-config` and changes when it gets configured in `config.toml` or removed from it, we can re-run the build script if this env var changes.

closes rust-lang#42444

r? @alexcrichton
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.

2 participants