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

Cargo Git configuration improvements #256

Conversation

dominic-mulligan-arm
Copy link
Member

@dominic-mulligan-arm dominic-mulligan-arm commented Nov 5, 2021

Configured Cargo to:

  • Use the Git command line tool rather than the Rust libgit2 library,
  • Retry all network attempts 3 times.

@dominic-mulligan-arm dominic-mulligan-arm added enhancement New feature or request build-process Something related to the Veracruz build process labels Nov 5, 2021
@egrimley-arm
Copy link
Contributor

There's an RFC, at least, for sharing stuff between Cargo.toml files, but I don't think it's been implemented yet, unfortunately: rust-lang/cargo#8415

@nspin
Copy link
Member

nspin commented Nov 5, 2021

I think this is actually a .cargo/config option:

https://doc.rust-lang.org/cargo/reference/config.html#net

I think we'll only need to include it once, just in the top-level .cargo/config:

https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure

@dominic-mulligan-arm
Copy link
Member Author

Ah, that makes more sense than amending every Cargo.toml file. I'll push a change in a bit.

@dominic-mulligan-arm dominic-mulligan-arm marked this pull request as draft November 5, 2021 13:06
@egrimley-arm
Copy link
Contributor

So I tried putting the git-fetch-with-cli in veracruz/.cargo/config and running cargo clean; cargo build in sdk/freestanding-execution-engine, and it made no difference, though the config was parsed because I got a warning when I deliberately mistyped the thing.

When I say it made no difference I mean the script called git that was on my path got executed just two times, with the arguments rev-parse HEAD, in each case, with or without the config change. Also I didn't seen any signs of git being invoked when I tried strace -f -o log.

What am I doing wrong?

@egrimley-arm
Copy link
Contributor

What I'm doing wrong is not deleting the cache from my ~/.cargo/!

@egrimley-arm
Copy link
Contributor

It now seems to work, though the retry = 3 probably won't make it retry git or cause git to retry. But presumably it doesn't hurt, either.

@egrimley-arm
Copy link
Contributor

Conclusion: Just add the three lines to veracruz/.cargo/config instead.

Also configured network attempts to retry 3 times
@dominic-mulligan-arm dominic-mulligan-arm marked this pull request as ready for review November 5, 2021 14:41
@dominic-mulligan-arm
Copy link
Member Author

OK, done!

@dominic-mulligan-arm
Copy link
Member Author

+1+1 = +1 reached, merging.

@dominic-mulligan-arm dominic-mulligan-arm merged commit d70b331 into veracruz-project:main Nov 5, 2021
@dominic-mulligan-arm dominic-mulligan-arm deleted the cargo-git-improvements branch November 5, 2021 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-process Something related to the Veracruz build process enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants