Skip to content

fix(vm): use bash 3.2-safe empty array expansion in supervisor build#1311

Merged
maxamillion merged 1 commit into
NVIDIA:mainfrom
benoitf:fix-shell-script
May 11, 2026
Merged

fix(vm): use bash 3.2-safe empty array expansion in supervisor build#1311
maxamillion merged 1 commit into
NVIDIA:mainfrom
benoitf:fix-shell-script

Conversation

@benoitf
Copy link
Copy Markdown
Contributor

@benoitf benoitf commented May 11, 2026

Summary

Fix mise run vm:supervisor silently failing on macOS. Bash 3.2 (the macOS default) treats empty array expansion ("${arr[@]}") as an unbound variable error under set -u. Unlike set -e, this error bypasses if-constructs and kills the shell immediately with no output. The fix uses the ${arr[@]+"${arr[@]}"} idiom, which is safe on both bash 3.2 and 4+.

Related Issue

#635

Changes

  • Replace "${cargo_prefix[@]}" with ${cargo_prefix[@]+"${cargo_prefix[@]}"} on both cargo zigbuild and cargo build invocation lines in tasks/scripts/vm/build-supervisor-bundle.sh

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

…script

macOS ships bash 3.2, which treats empty array expansion ("${arr[@]}")
as an unbound variable error under set -u. Unlike set -e, this error
is not caught by if-constructs — it kills the shell immediately with
no output, causing mise run vm:supervisor to fail silently.

Use the ${arr[@]+"${arr[@]}"} idiom so the script works on both
bash 3.2 (macOS default) and bash 4+.

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 11, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@benoitf benoitf changed the title fix(vm): use bash 3.2-safe empty array expansion in supervisor build … fix(vm): use bash 3.2-safe empty array expansion in supervisor build May 11, 2026
Copy link
Copy Markdown
Collaborator

@maxamillion maxamillion left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@maxamillion maxamillion merged commit 764d930 into NVIDIA:main May 11, 2026
2 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.

2 participants