-
Notifications
You must be signed in to change notification settings - Fork 5
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
Enable usage of machine set CRATES var #13
Enable usage of machine set CRATES var #13
Conversation
ec4ccd7
to
7fb5d9c
Compare
Using |
I'll come back to this after #11 merges. |
Repos using the `run_task` script would like to set the `CRATES` env var by using CRATES="$(cargo metadata --no-deps --format-version 1 | jq -j -r '.packages | map(.manifest_path | rtrimstr("/Cargo.toml") | ltrimstr("'"$PWD"'/")) | join(" ")')" I don't know exactly why but this results in some sort of square braces data type that seems to only work in a loop using `for crate in $CRATES` instead of the `for crate in ${CRATES[@]}` like we currently have.
7fb5d9c
to
534e497
Compare
The commit hash from this branch is now used in rust-bitcoin/rust-bitcoin#3201 to verify this works using CI. |
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.
ACK 534e497
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.
ACK 534e497
Shall we give @Kixunil a chance to take a look, especially since I copied his code to get the looping to work? |
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.
ACK 534e497
However I wonder why a global variable is used and why isn't the command to obtain the list of crates ran by this script.
@@ -64,7 +64,7 @@ main() { | |||
# can't find the file because of the ENV var | |||
# shellcheck source=/dev/null | |||
. "$crates_script" | |||
for crate in "${CRATES[@]}"; do | |||
for crate in $CRATES; do |
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.
A different way to do that would be to just load the output of that command into an array. However doing that just so you can have a space in crate directory is silly, so this is fine.
It would be nice if it would default to using the command-generated list of crates (and same for a feature matrix) but we'll definitely want a way to override the command for some repos, at least temporarily. |
Also Kix ought to be a maintainer on this repo. |
Repos using the
run_task
script would like to set theCRATES
env var by usingI don't know exactly why but this results in some sort of square braces data type that seems to only work in a loop using
for crate in $CRATES
instead of thefor crate in ${CRATES[@]}
like we currently have.