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

scripts: Change features_build variable type to array #6249

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

alex-matei
Copy link
Contributor

@alex-matei alex-matei commented Feb 28, 2024

Because of double quotes the current value is passed as a single argument with a space in it to cargo. This commit changes it to an array so each element is passed as a different arguments.

@alex-matei alex-matei requested a review from a team as a code owner February 28, 2024 16:37
@@ -298,7 +298,7 @@ cmd_build() {
--env RUSTFLAGS="$rustflags" \
--env TARGET_CC="$target_cc" \
"$CTR_IMAGE" \
cargo build --all "$features_build" \
cargo build --all $features_build \
Copy link
Member

Choose a reason for hiding this comment

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

This change is triggering the shell script check - maybe it should be $(features_build) - @rmstoi ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the features_build var type to an array. It should pass the checks now.

Copy link
Contributor

Choose a reason for hiding this comment

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

This could be solved by using bash parameter substitution to pass null string (and not quotes) to cargo if features_build is null or unset. For example:

-        cargo build --all "$features_build" \
+        cargo build --all ${features_build:+"$features_build"} \

Changing features_build to an array should also work.

@alex-matei alex-matei force-pushed the fix/dev-cli-build branch 2 times, most recently from 40400d3 to f052974 Compare February 28, 2024 20:43
@alex-matei alex-matei changed the title scripts: Remove double quotes around features_build var scripts: Change features_build variable type to an array Feb 28, 2024
Because of double quotes the current value is passed
as a single argument with a space in it to cargo.
This commit changes it to an array so each element
is passed as a different arguments.

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
@alex-matei alex-matei changed the title scripts: Change features_build variable type to an array scripts: Change features_build variable type to array Feb 28, 2024
@rbradford rbradford added this pull request to the merge queue Feb 29, 2024
Merged via the queue into cloud-hypervisor:main with commit 3f2ca53 Feb 29, 2024
28 checks passed
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

3 participants