Skip to content

Add Josh sync scripts #1835

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add Josh sync scripts #1835

wants to merge 2 commits into from

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Jun 26, 2025

This pretty much 1:1 mirrors the sync scripts of rustc-dev-guide. If you want, I can also setup a CI bot (similar to rdg or miri) that will attempt to create PRs with pull synces once every few days, and post to Zulip if there is a merge conflict.

@rustbot
Copy link
Collaborator

rustbot commented Jun 26, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Kobzol
Copy link
Member Author

Kobzol commented Jun 26, 2025

r? @RalfJung

@rustbot
Copy link
Collaborator

rustbot commented Jun 26, 2025

Failed to set assignee to RalfJung: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@tgross35
Copy link
Contributor

I have a couple changes from the RDG version in https://github.com/rust-lang/compiler-builtins/tree/674910e0fa6f0fb2cc055f4f7051ff0eb53c7735/crates/josh-sync that might be worth picking up here. The biggest thing is dropping clap since that adds 30 extra deps to the lockfile, bit of overkill for parsing two possible commands. (anyhow and xshell are dropped too , but those are lighter weight to start).

Also just updating the commit messages to crosslink the original ref (e.g. rust-lang/compiler-builtins@6e475af). You can figure this out from the rust-version file but it's nice to have it show up in the log of anything that got touched in the sync. Similar for the PR message (will probably add an option to just open a PR via gh at some point to avoid percent encoding something more detailed).

@Kobzol
Copy link
Member Author

Kobzol commented Jun 26, 2025

My original plan was to create a separate repo that would contain the josh sync scripts, and they could be reused for all subtrees, either as a library or as a binary that could be cargo install-ed. Now that we have probably all of the submodules that we wanted to have as subtrees (maybe with the exception of Cargo), I wonder if it would maybe be better to create this repo, to avoid having N separate copies of these scripts scattered across various repositories 🤔

@RalfJung
Copy link
Member

Yeah, that sounds like a good idea.

I'd prefer not to have to install gh on my machine if that's an option. :)

@Kobzol
Copy link
Member Author

Kobzol commented Jun 26, 2025

This script doesn't use gh (haven't looked at Trevor's script yet). Ideally it should install everything on its own, i.e. download and run josh and then just do operations using the git binary.

@tgross35
Copy link
Contributor

Oh, yeah, mine only needs josh+git as well (only the deps and commit messages are different). I was just thinking a "would you like to open a PR via gh? Y/N" option alternative to the link.

@RalfJung
Copy link
Member

If it generates the link it might as well open it then rather than relying on gh. ;)

@Amanieu
Copy link
Member

Amanieu commented Jun 26, 2025

My original plan was to create a separate repo that would contain the josh sync scripts, and they could be reused for all subtrees, either as a library or as a binary that could be cargo install-ed. Now that we have probably all of the submodules that we wanted to have as subtrees (maybe with the exception of Cargo), I wonder if it would maybe be better to create this repo, to avoid having N separate copies of these scripts scattered across various repositories 🤔

Would it make sense to centralize all the sync scripts in rust-lang/rust since this is where all the repos are synced as sub-trees?

@Kobzol
Copy link
Member Author

Kobzol commented Jun 26, 2025

Would it make sense to centralize all the sync scripts in rust-lang/rust since this is where all the repos are synced as sub-trees?

I was thinking about that, but I'm not sure it's that useful, because both pulls and pushes are invoked from the subtree repo, not from the rust-lang/rust repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants