Skip to content
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

bootstrap: Improve the UX when run from a git worktree #77621

Open
jyn514 opened this issue Oct 6, 2020 · 4 comments
Open

bootstrap: Improve the UX when run from a git worktree #77621

jyn514 opened this issue Oct 6, 2020 · 4 comments
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-feature-request Category: A feature request, i.e: not implemented / a PR. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Oct 6, 2020

it would be nice if bootstrap could auto-detect when it's being run from a git worktree and share

original issue description

It should look something like this behind the scenes:

$ x.py setup --worktree ../rustc2
Setting up a new worktree at `/home/joshua/rustc2`  # runs `git worktree add ../rustc2`
# all the current prompts, but config.toml is written to rustc2 instead of the current directory
# does *not* suggest to set up a git hook

This would make https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=worktree#working-on-multiple-branches-at-the-same-time a lot more discoverable.

It should also use the submodule suggestions from https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/script.20to.20quickly.20generate.20complete.20git.20worktree (cc @lzutao), which would prevent cloning llvm more than once.

This would help work around #77620.

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-feature-request Category: A feature request, i.e: not implemented / a PR. A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels Oct 6, 2020
@jyn514
Copy link
Member Author

jyn514 commented Oct 12, 2020

This could also suggest to copy over the existing config.toml as one of the profile choices.

@jyn514
Copy link
Member Author

jyn514 commented Jun 19, 2023

This could also suggest to copy over the existing config.toml as one of the profile choices.

i think this is good and useful, but rather than making it opt-in with --worktree, we should do it automatically when we detect the current git checkout is in a worktree:

(bash@pop-os) ~/src/rust2
; file $(git worktree list | grep -v ~/src/rust2 | head -n1 | awk '{print $1}')/config.toml
/home/jyn/src/rust/config.toml: ASCII text, with very long lines (634)

@jyn514
Copy link
Member Author

jyn514 commented Jun 19, 2023

actually

rather than adding an extra step, we could fall back to the config.toml of the primary worktree if it doesn't exist in the current worktree. it's a little more implicit, but it seems like a more useful behavior, and it will always get overridden if someone's already made a config.toml.

@jyn514
Copy link
Member Author

jyn514 commented Jun 19, 2023

rather than adding an extra step, we could fall back to the config.toml of the primary worktree if it doesn't exist in the current worktree. it's a little more implicit, but it seems like a more useful behavior, and it will always get overridden if someone's already made a config.toml.

we could do something similar for checking out submodules so we don't have to re-fetch the history in each worktree

@jyn514 jyn514 changed the title Add x.py setup --worktree bootstrap: Improve the UX when run from a git worktree Jun 19, 2023
@jyn514 jyn514 added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Jun 19, 2023
@jieyouxu jieyouxu added E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. and removed E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-feature-request Category: A feature request, i.e: not implemented / a PR. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants