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

allow configuring rust toolchain branch #1721

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

austinabell
Copy link
Contributor

@austinabell austinabell commented Apr 25, 2024

Not sure if this is correct, just opening for visibility to help unblock someone needing to build the toolchain given the updated Rust version (1.70 too low).

Also changes the clone to minimize data fetched. Removed this for simplicity, it was causing weird edge case issues

Ignore this PR, unless you also want this.

Tested with:

cargo install --force --path risc0/cargo-risczero
cargo risczero build-toolchain --git-tag v2024-04-22.0

Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-website ✅ Ready (Inspect) Visit Preview Apr 25, 2024 10:31pm
reports-and-benchmarks ✅ Ready (Inspect) Visit Preview Apr 25, 2024 10:31pm

Comment on lines +93 to +96
Command::new("git")
.args(["fetch", "origin", tag])
.current_dir(path)
.run_verbose()?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed because if the branch/tag is created after you clone, it won't resolve? Maybe I'm overlooking something, though

@flaub
Copy link
Member

flaub commented Apr 25, 2024

I think we should try to use a git ref rather than a branch name so that it's more generic. Some adjustments might need to be made to allow for this.

@austinabell
Copy link
Contributor Author

I think we should try to use a git ref rather than a branch name so that it's more generic. Some adjustments might need to be made to allow for this.

This does work with tags and refs, just tested refs also to double check, that's why I had the naming as tags (seemed most generic).

@flaub
Copy link
Member

flaub commented Apr 25, 2024

My understanding is that git clone --branch only takes branches and tags, but not a commit hash: https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---branchltnamegt

Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting repository.

So my thinking is to drop the --branch on clone and let the following checkout command do the switch.

@austinabell
Copy link
Contributor Author

My understanding is that git clone --branch only takes branches and tags, but not a commit hash: git-scm.com/docs/git-clone#Documentation/git-clone.txt---branchltnamegt

Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting repository.

So my thinking is to drop the --branch on clone and let the following checkout command do the switch.

You're right! I missed testing that case without a cloned branch. That was more of an artifact from trying to pull only what was needed.

I'll run the cases in the background and make that change now, good catch

@flaub flaub changed the title feat: allow configuring rust toolchain branch, minimize clone download allow configuring rust toolchain branch, minimize clone download Apr 25, 2024
@austinabell austinabell changed the title allow configuring rust toolchain branch, minimize clone download allow configuring rust toolchain branch Apr 26, 2024
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.

None yet

2 participants