-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace submodules with subtrees #70651
Comments
Cc @rust-lang/miri because we have that now :D |
Hmm, I was led to believe that
|
I moved to git subtree. |
In case it gets lost on the PR, I said: #70655 (comment)
|
Would be good to get the pro's and con's of that decision documented somewhere. (Also I have no idea in which thread to post now, there's at least this issue and 2 PRs. It's very confusing.^^) |
I don't know why
|
|
Is this true in both directions (subtree pull/push)? Does |
no, The only downside of |
I would prefer the history preserving option. I was under the impression that subrepo had a no squash mode but that could be subtree. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
subtree doesn't squash by default and has a sqash option. |
@oli-obk IIUC, Clippy can then fix a nightly version and doesn't have to use the rustc master anymore (correct?). If that's the case, I'd go ahead and make these changes to the Clippy CI/infra, so it will be ready once the |
This comment has been minimized.
This comment has been minimized.
well, only if we make the synchronization at specific commits that work on the current nightly. Between two nightlies there can be many states where the clippy subtree will only compile with a master-rustc. |
IMO we want to do this, since otherwise, we would have to do rustup commits in Clippy just as often as before. It will just be easier, since it will only be a |
Well, we can do it at random points in time, but yes, we can target those points in time to the commit that caused the most recent nightly to be created. |
Right, we can have a nightly clippy CI job that notices when clippy stops building with master, and sync then. |
at that point we can just have a nightly job that synchronizes once a night automatically to ensure that even nonbreaking changes get synchronized as often as possible. |
Clippy's CI could perform pull every time it tries to merge PR. Edit: There would be still Rustups necessary for lints added to Clippy shortly before breaking changes since Clippy in Rust repo won't have them yet. |
@oli-obk @RalfJung What do you think of this logic? Just thought of it, not sure where to leave it.
|
Though I guess this doesn't actually need to be versioned with Rust so a cargo install makes more sense |
I marked this as "looking for participation". Working on this git subcommand that can be installed via Ideally you test the crate by talking with the clippy team on zulip and doing a clippy sync with the "new" tool. If all that works, we'll update the documentation on our |
I'd like to work on this issue! |
great! If you have any questions, feel free to ping me on zulip or just ask here. There's also a bot, so if you write |
@rustbot claim |
I'm wondering if we need this to actually be on crates.io. We could vendor the script in the repository and call |
I like having it as an independent thing. Others may want to use it, too. It's not rustc specific |
Here's the |
The crate metadata doesn't refer to the repo, so posting it here for others trying to find it: https://github.com/mominul/gitree |
Using subtrees can lead to spuriously re-closing issues that were re-opened. This just happened to #82080:
I am not sure what to do about this, but we have a notable risk here of losing track of issues by accidentally closing them. Can we make it so that the commit that is synthesized for clippy doesn't just have its non-clippy changes removed, but also has its commit message "sanitized" to ensure that it will not cause any automatic actions by GitHub? |
I think git subtree would then consider it a different commit and try to pull the original conmit every time you sync. |
There's the option in subtree to squash-sync the commits to rustc. But that way we would lose the Clippy history in rustc. If we want to keep the history of Clippy and keep using subtree, we just have to live with this, I guess... |
Why that, doesn't it have some kind of bookeeping to match up the commits? Relying on commit messages seems rather fragile? |
I assumed it required the commit to be identical where possible. Based on a cursory reading of the source it seems to only require the tree to be the same: https://github.com/gitgitgadget/git/blob/fe2e4819b869725f870cd3ce99f1f8150fe17dc1/contrib/subtree/git-subtree.sh#L598 |
Copying comments from #82080: @jplatte wrote:
@flip1995 wrote:
|
Good point. Not doing that for the "active" messages could also help. (It'd also cut down on notifications, if bors removed @mentions as well.) |
I feel like that's a pretty rare occurrence and unfortunately the tooling doesn't support doing such a transform currently. We could tweak the bors thing though |
Well, it's also something that has a high chance of flying below the radar when it happens. All we know is it happened at least once. |
…crum Convert rustfmt from a submodule to a subtree r? `@calebcartwright` cc `@Manishearth` `@Mark-Simulacrum` The motivation is that submodule updates cause rustfmt to not be available on nightly a lot; most recently it was unavailable for over 10 days, causing the beta release to be delayed. Additionally this is much less work on the part of the rustfmt maintainers to keep the rustfmt compiling, since now people making breaking changes will be responsible for fixing them. I kept the rustfmt git history so it looks like there are thousands of commits. The important commits are https://github.com/rust-lang/rust/compare/851dee3af9404bf399c3c4ffefe5105edb3debad~..pull/82208/head. This adds about 10 MB of git history, which is not terribly much compared to the 702 MB that already exist. - Add `src/tools/rustfmt` to `x.py check` - Fix CRLF issues with rustfmt tests (see commit for details) - Use `rustc_private` instead of crates.io dependencies This was already switched upstream and would have landed in the next submodule bump anyway. This just updates Cargo.lock for rust-lang/rust. - Add `yansi-term` to the list of allowed dependencies. This is a false positive - rustc doesn't actually use it, only rustfmt, but because it's activated by the cargo feature of a dependency, tidy gets confused. It's fairly innocuous in any case, it's used for color printing. This would have happened in the next submodule bump. - Remove rustfmt from the list of toolstate tools. - Give a hard error if testing or building rustfmt fails. - Update log to 0.4.14 This avoids a warning about semicolons in macros; see the commit for details. - Don't add tools to the sysroot when they finish building. This is the only change that could be considered a regression - this avoids a "colliding StableCrateId" error due to a bug in resolve (rust-lang#56935). The regression is that this rebuilds dependencies more often than strictly necessary. See the commit for details. Fixes rust-lang#85226 (permanently). Closes rust-lang#82385. Helps with rust-lang#70651. Helps with rust-lang#80639.
FYI there's been some discussion of experimenting with miri on Fuchsia, and transitioning miri to an always-green subtree is one of the primary blockers. |
Clippy is now using subtree, miri is using https://github.com/josh-project/josh/ (a Rust thing that is better and more powerful in various ways than subtree) |
cc @rust-lang/clippy @RalfJung
cc @rust-lang/compiler @rust-lang/infra we gate on clippy soon, so if you break clippy you need to fix it immediately in the same PR. This is trivial now though, since we are basically in a monorepo state, so you just edit stuff in
src/tools/clippy/
until everything works again.Synchronizations of the remote repo and the local subtree is explained in CONTRIBUTING.md
The first port (clippy) is being done in #70655
The text was updated successfully, but these errors were encountered: