Conversation
|
(rustbot has picked a reviewer for you, use r? to override) |
886c2ef to
b33b610
Compare
|
Regarding to #102282 (comment)
Since this is one of the long-term defined task, I believe this should be done in a seperated PR as a seperated task.
This should work just fine with this PR.
I used
I am not sure if this should be covered in this PR. cc @jyn514 |
|
r? @jyn514 |
|
The correct syntax is @rustbot ready, not the other way around. |
8c36d7a to
8411dd1
Compare
|
☔ The latest upstream changes (presumably #108096) made this pull request unmergeable. Please resolve the merge conflicts. |
|
|
15fc13e to
a445f80
Compare
|
@rustbot ready |
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
I get the feeling that this PR is trying to do too much which both makes it harder to review and as such harder to land. But given the very sparse PR description, it's not clear to me what the minimal step this PR is taking is; it looks like it (roughly speaking):
- Introduces a notion of a minimal configuration
- Adds a new component to be distributed (bootstrap-shim)
- Refactors a bunch of code (mostly I think a result of minimal config, but seemingly not only - parts feel independent).
I'm having a hard time with this coupling, is there a chance we can avoid it? I've left a few comments inline that I think will help factor things out a little.
src/bootstrap/min_config.rs
Outdated
| }; | ||
|
|
||
| /// The bare minimum config, suitable for `bootstrap-shim`, but sharing code with the main `bootstrap` binary. | ||
| /// We only want to include indispensable parts of configuration to have highest possible BC for bootstrap-shim. |
There was a problem hiding this comment.
Can we avoid "BC" here? I assume that means "build caching", but it does not feel like a standard term to me.
There was a problem hiding this comment.
It means "backward compatibility". Pretty common and popular term. I will explicitly update it as "backward compatibility".
There was a problem hiding this comment.
Never seen it before, but I think in that case we need more here - what are the implications if we break compatibility? Shouldn't it be the same across both configs?
There was a problem hiding this comment.
I see, will provide more detailed informations
There was a problem hiding this comment.
I was quite wrong about backwards compatibility. Just realised that.
rust/src/bootstrap/min_config.rs
Lines 20 to 24 in d3039c7
Is this clear enough?
There was a problem hiding this comment.
Unlike bootstrap itself, bootstrap-shim needs to be compatible across multiple versions of the Rust repo. I thought separating the fields it reads into another struct and adding a big "DO NOT CHANGE THIS LOGIC WITHOUT CHANGING THE SHELL SCRIPTS" comment would make it easier to maintain without accidentally regressing the shim.
I think this is a good start to such a comment -- but I think we also should dig a little deeper in the comment. In particular, I think this "must be compatible" piece is a distinct requirement from the one we typically have -- usually we always are checking the current commit and searching back to find the latest change to some tool and then downloading that.
But, the plan for bootstrap-shim is, I guess, different : we will be using a global install of it? I forget the details now, but this seems like exactly the content I would want in a comment on the minimal config so that we can read that and understand what the compatibility story should be. I'm also not sure how the shell scripts play into this yet, but in any case good to reflect into the comment I'm looking for here.
I don't have a huge stake in what we ship or don't ship, but it seems to me that at least in theory if the shim is a separate binary we should see LLVM/linkers cut out any unused dependencies. On the other hand, maybe that doesn't give us that much - seems like the shim ends up at least pulling in decompression (xz + gzip?), tar, etc, so it probably won't be tiny.
Anyway to summarize it seems to me that probably the next step is for @jyn514 to maybe either point to a hackmd (I seem to recall one) or otherwise reflect some of these thoughts into the comment, so we can move forward based on that. I think there's also some other comments on this PR I've left that seem to still be warranted to resolve from my perspective, but it's possible that with a more detailed description of the purpose/rationale/strategy for the shim and minimal config I'll change my mind :)
Sounds like we're making definite progress though.
There was a problem hiding this comment.
Here's the hackmd you're remembering: https://hackmd.io/j-XXBeYERuajJknd6zErPA?both
There was a problem hiding this comment.
once the blocker PR is merged, I will re-update the doc-comments by the given updates from @jyn514
Here's the hackmd you're remembering: https://hackmd.io/@jynelson/S1Aa4cozo/edit
FYI the link is broken for me. Returns 404 Not Found.
There was a problem hiding this comment.
rust/src/bootstrap/min_config.rs
Lines 20 to 26 in 8ad8906
I didn't want to leave it as to be filled, because devs(who needs to make a change on config) might still be confused until we make the shim default. So I give the idea why it shouldn't be changed directly, and left a FIXME to update it once shim is default.
What do you think about the current change? @Mark-Simulacrum
src/bootstrap/min_config.rs
Outdated
|
|
||
| /// The bare minimum config, suitable for `bootstrap-shim`, but sharing code with the main `bootstrap` binary. | ||
| /// We only want to include indispensable parts of configuration to have highest possible BC for bootstrap-shim. | ||
| /// Prefer adding new fields to `bootstrap::config::Config` if possible. |
There was a problem hiding this comment.
"if possible" feels like it's not very clear to me. For example, I see comments below about verbose and dry_run not being used in the shim, yet they are here. So that seems odd - why are they here?
There was a problem hiding this comment.
I believe it's clear enough. We simply say "the reason we have this minimal version is to avoid breaking backward compatibility". (for now it's written as BC, I guess that's why you thought it's not clear).
| ) | ||
| }; | ||
|
|
||
| config.minimal_config = MinimalConfig::parse(&flags, toml.build.clone()); |
There was a problem hiding this comment.
This feels like the wrong approach to me. We should always start with MinimalConfig::parse, and then take that as an argument for the big Config struct. Any processing that is necessary for the minimal config is likely to also be necessary here, and can be read from fields in that struct as needed.
I think that will help remove the helper functions shared between the two (e.g., set_cfg_path_and_return_toml_cfg) and make the relationship between the two clearer in general.
There was a problem hiding this comment.
We should always start with MinimalConfig::parse, and then take that as an argument for the big Config struct.
Right now min_config module is short and simple. If I apply the refactoring based on this suggestion, this will cause having a lot of Config field calculations in min_config module which will kill the seperation between them. Which will make the maintenance harder for both Config and MinConfig. Are you sure you want me to do this?
There was a problem hiding this comment.
I don't understand. Why would Config field calculations need to move into MinConfig for this refactoring? It seems like only the calculations for the fields already in MinConfig would need to move; nothing else should. And those calculations already need to be in MinConfig anyway, as otherwise we can't just parse it?
There was a problem hiding this comment.
So you want MinConfig field mapping to be moved in config module then. I am still unsure if this will be better. We intentionally did this seperation with 54b7ff2, but I can do it if you want.
|
☔ The latest upstream changes (presumably #109332) made this pull request unmergeable. Please resolve the merge conflicts. |
90f7294 to
d3039c7
Compare
|
@rustbot ready |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #110324) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #111017) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #111231) made this pull request unmergeable. Please resolve the merge conflicts. |
|
#107812 (comment) seems still unresolved here, but it may merit more synchronous discussion - I feel like we're not yet aligned in fact (even if there's no objections) on the exact trajectory here, and that makes me reluctant to merge PRs that create future implications (in particular I still don't think the comments align with a global install). |
I agree, let's talk about this on the next team meeting. |
- Pass `dist bootstrap-shim` explicitly in CI This makes it possible to run `dist bootstrap` without also building bootstrap-shim, and more importantly works around a bug where currently two steps aren't allowed to have the same path. - Add `check::BootstrapShim` - [wip] start unifying parsing for Config and MinimalConfig
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: ozkanonur <work@onurozkan.dev>
|
☔ The latest upstream changes (presumably #111566) made this pull request unmergeable. Please resolve the merge conflicts. |
Helps with #94829.
For now this needs you to manually opt in with
cargo run --manifest-path src/bootstrap/Cargo.toml -p bootstrap-shim.