-
Notifications
You must be signed in to change notification settings - Fork 77
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
Convert shell scripts to Rust #891
Conversation
f4fb896
to
4d1c22c
Compare
You'll need to resolve the merge conflicts first before we can see whether CI passes. |
4d1c22c
to
e4327ff
Compare
.github/workflows/ci.yml
Outdated
@@ -109,8 +109,8 @@ jobs: | |||
# | |||
# ...to: | |||
# | |||
# toolchain: $ {{ ./cargo.sh --version matrix.toolchain }} # hypothetical syntax | |||
ZC_TOOLCHAIN="$(./cargo.sh --version ${{ matrix.toolchain }})" | |||
# toolchain: $ {{ cargo run -p cargos --version matrix.toolchain }} # hypothetical syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with Windows enough to know: Is there a way that we could keep a script that would be compatible with both Windows and POSIX, and would just be a thin wrapper around cargo run -p cargos
? The latter is more verbose, which isn't great for the command we run the most frequently during development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just publish this as a separate package and cargo install
it. Another option would be to leave the cargo.sh
file in place and make it a thin wrapper over cargo run -p cargos
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the cargo.sh
option makes sense. If we can make it so that its invocation is unchanged relative to what it currently is on main
, that'd be ideal.
CI is failing with:
Although the I don't think we should require the tooling to have the same MSRV as zerocopy and zerocopy-derive, but since it's in the workspace it gets added to package resolution. We could remove them from the workspace, but that would also be annoying and make the tools difficult to invoke. It would be nice if we could ignore these crates on Another approach would be to bump the MSRV, but I don't know what the motivation for such a low MSRV is (1.56.0 is about two years and four months old). Up to you @joshlf how you want me to approach resolving it. |
.github/workflows/ci.yml
Outdated
@@ -109,8 +109,8 @@ jobs: | |||
# | |||
# ...to: | |||
# | |||
# toolchain: $ {{ ./cargo.sh --version matrix.toolchain }} # hypothetical syntax | |||
ZC_TOOLCHAIN="$(./cargo.sh --version ${{ matrix.toolchain }})" | |||
# toolchain: $ {{ ./cargos.sh --version matrix.toolchain }} # hypothetical syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to leave this named cargo.sh
? (I'll be honest I'm not sure what the etymology of cargos
is as opposed to cargo
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an unfortunately mundane one. I originally kept it named cargo.sh
and made cargo.bat
to match. As it turns out though, when cargos
runs a cargo
command, Windows will run cargo.bat
and not the installed cargo
binary. So it effectively causes cargos
to recursively call itself when it intends to invoke cargo
. The easy fix was to use a different name, and I figured if I had to call it cargos
on Windows then I should probably just make it uniform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense. My preference would be to keep cargo.sh
named as-is, and rename the .bat
file. Maybe win-cargo.bat
? I'll leave it up to you what you want to name it.
36c92d0
to
6e444c9
Compare
It looks like the invocation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a new commit that should hopefully fix (some of) the CI errors. Feel free to delete it, squash it, etc.
Since these are in their own workspace now, can you update ci/check_fmt.sh
to format that workspace as well?
ac19afc
to
64b2c16
Compare
|
442f6ad
to
bfb89ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last comments that I'm aware of - once these addressed, we should be ready to merge.
Can you also squash all of these commits together? Otherwise, the entire set of commits shows up in the commit message that GitHub generates.
`cargo.sh` is now a thin wrapper around a new `cargo-zerocopy` tool located in the `tools` directory. README generation is now done by a similar `generate-readme` tool. A wrapper script for running `cargo-zerocopy` on Windows has been added as `win-cargo.bat`, effectively allowing the test suites to be run on Windows.
bfb89ea
to
610a38a
Compare
I primarily dev on Windows, and I'd prefer to not have to use WSL to work on zerocopy.