Uh oh!
There was an error while loading. Please reload this page.
Detect configuration for LLVM during setup - #77756
Conversation
rust-highfive
commented
Oct 9, 2020
(rust_highfive has picked a reviewer for you, use r? to override) |
Mark-Simulacrum
commented
Oct 9, 2020
I would not want to add a dependency for this sort of thing, it shouldn't be necessary to just scan PATH and append llvm-config to it. I don't think appending to the file is going to work well, I think the if-available approach is the one we should pursue. |
050b60a to
004fd4cComparealarsyo
commented
Oct 9, 2020
Is that better? Hopefully the |
004fd4c to
8f88847CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
8f88847 to
b3f6336Comparebors
commented
Oct 12, 2020
☔ The latest upstream changes (presumably #77867) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels: |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Could we just duplicate this across the actual default files? I would prefer to avoid adding even more layers of places where defaults are getting set.
There was a problem hiding this comment.
Yeah, in my mind setup.rs is for setting defaults that are not the same for everyone, while src/bootstrap/defaults are for things that can reasonably be shared.
There was a problem hiding this comment.
Done! Added to all default configs. I just have a doubt for the config.codegen.toml, maybe people working close to codegen don't want the CI built one by default?
There was a problem hiding this comment.
Ah, it seems moving these lines to the default profiles broke the bootstrap, because bootstrap.py doesn't know about the profile setting (I'm guessing it's only handled in the config.rs file)
There was a problem hiding this comment.
Looking further into this, it seems bootstrap only has a basic regex mechanism to lookup toml keys, and returns the first key that matches, which means appending the contents of our default file should work as expected, allowing the main config.toml to override these defaults if needed. Definitely feels like a hack though :D I'll push some code soon
There was a problem hiding this comment.
Got it, thanks.
@Mark-Simulacrum how hard would it be to move that into rustbuild instead of bootstrap.py? Doesn't need to block this, but I'd like to do as little as possible in python anyway.
There was a problem hiding this comment.
That error comes from the Rust portion of rustbuild, I think? It looks like a Rust error...
Presumably LLVM was not downloaded or not unpacked which led to this problem.
There was a problem hiding this comment.
FWIW, I'd be interested in tackling this to get more familiar with the bootstrap code, if you decide to move this to rustbuild :)
There was a problem hiding this comment.
Presumably LLVM was not downloaded or not unpacked which led to this problem.
Yes, the rust code doesn't find the executable because it wasn't downloaded by bootstrap.py, because bootstrap.py didn't know about the default file, so the get_toml('download-ci-llvm') returned None
There was a problem hiding this comment.
Let's tackle this in a follow-up, it seems reasonable to have bootstrap.py read profiles anyway.
Uh oh!
There was an error while loading. Please reload this page.
7345c61 to
c39c869Compare7a8deec to
e65f720CompareThere was a problem hiding this comment.
I'm 90% sure this will break - this causes invalid syntax if there's already anything in the config.toml. #76628 (comment)
There was a problem hiding this comment.
It would break if parsed by a real TOML parser, but that's not the case, the basic regex parser will just match the first relevant key
There was a problem hiding this comment.
(and since the aggregation of the two files is only stored as a string in memory, not written to a toml file somewhere, I don't think it should break anything else?)
e65f720 to
b8ae4c5CompareUh oh!
There was an error while loading. Please reload this page.
alarsyo
commented
Oct 14, 2020
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
jyn514
commented
Oct 14, 2020
@bors r+ In a follow-up I'd like to move handling of LLVM from bootstrap.py to rustbuild, but that doesn't need to block this change. |
bors
commented
Oct 14, 2020
📌 Commit b8ae4c5 has been approved by |
bors
commented
Oct 14, 2020
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
alarsyo
commented
Oct 14, 2020
@jyn514 should I open an issue about a follow-up change for rustbuild ? |
Mark-Simulacrum
commented
Oct 14, 2020
It would mean a curl or other "http talker" dep in rustbuild which I'm opposed to at this point I think, but I don't mind an issue. |
bors
commented
Oct 15, 2020
bors
commented
Oct 15, 2020
☀️ Test successful - checks-actions, checks-azure |
This is a first draft to address #77579, setting
download-ci-llvmto true on Linux, but I could also implement theif-availablesetting mentioned in the issue.On other platforms I was thinking about using the which crate, if adding a dependency on it is considered okay of course, to detect the presence of
llvm-configin the path, and use it if found. Still a work in progress of course.