Skip to content

fix: avoid mapfile in upload-release-to-gcs.sh#22

Merged
ValentaTomas merged 3 commits into
mainfrom
fix/upload-script-bash3-compat
May 11, 2026
Merged

fix: avoid mapfile in upload-release-to-gcs.sh#22
ValentaTomas merged 3 commits into
mainfrom
fix/upload-script-bash3-compat

Conversation

@ValentaTomas
Copy link
Copy Markdown
Member

`mapfile` is bash 4+; macOS ships bash 3.2 at `/bin/bash`, so running the script locally errored with `mapfile: command not found`. Swap for a portable `while IFS= read -r line; do ASSETS+=("$line"); done < <(…)` loop.

Verified on `GNU bash 3.2.57` (macOS):

```
$ ./scripts/upload-release-to-gcs.sh --hash c1a568c --dry-run --bucket e2b-staging-fc-kernels
Release: 2026.05.11 (commit c1a568c)
Target: gs://e2b-staging-fc-kernels
Mode: dry-run
WOULD vmlinux-6.1.102-amd64.bin -> gs://e2b-staging-fc-kernels/vmlinux-6.1.102-c1a568c/amd64/vmlinux.bin
... (3 more)
Dry run complete. Already in GCS: 0.
```

mapfile is bash 4+; macOS ships bash 3.2 at /bin/bash, so the script
errored with "mapfile: command not found" when run locally. Replace
with a portable read loop.
@cla-bot cla-bot Bot added the cla-signed label May 11, 2026
@cursor
Copy link
Copy Markdown

cursor Bot commented May 11, 2026

PR Summary

Low Risk
Low risk doc and scripting changes; main impact is altering the GCS object path convention and the way release assets are enumerated.

Overview
Fixes upload-release-to-gcs.sh failing on macOS bash 3.x by replacing mapfile with a portable read loop, and changes the GCS destination path to use vmlinux-<version>_<short_hash> (underscore) instead of vmlinux-<version>-<short_hash>. Updates README/docs to match the new upload path.

Reviewed by Cursor Bugbot for commit 1738214. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Last line silently dropped if input lacks trailing newline
    • Added '|| [[ -n "$line" ]]' to the while loop condition to ensure the last line is processed even without a trailing newline.

Create PR

Or push these changes by commenting:

@cursor push dd8718b61c
Preview (dd8718b61c)
diff --git a/scripts/upload-release-to-gcs.sh b/scripts/upload-release-to-gcs.sh
--- a/scripts/upload-release-to-gcs.sh
+++ b/scripts/upload-release-to-gcs.sh
@@ -74,7 +74,7 @@
 $DRY_RUN && echo "Mode:    dry-run"
 
 ASSETS=()
-while IFS= read -r line; do
+while IFS= read -r line || [[ -n "$line" ]]; do
   [[ -n "$line" ]] && ASSETS+=("$line")
 done < <(gh release view "$RELEASE_TAG" --repo "$REPO" --json assets \
   --jq '.assets[] | select(.name | test("^vmlinux-.*\\.bin$")) | .name')

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit ce2d4f3. Configure here.

Comment thread scripts/upload-release-to-gcs.sh
@ValentaTomas ValentaTomas marked this pull request as ready for review May 11, 2026 23:11
@ValentaTomas ValentaTomas enabled auto-merge (squash) May 11, 2026 23:11
@ValentaTomas ValentaTomas force-pushed the fix/upload-script-bash3-compat branch from 0cf91b6 to 3e32eb2 Compare May 11, 2026 23:17
Matches fc-versions naming (e.g. v1.14.1_458ca91), so the convention
is consistent across firecracker and kernel artifacts:
  vmlinux-<version>_<short_hash>/<arch>/vmlinux.bin
@ValentaTomas ValentaTomas disabled auto-merge May 11, 2026 23:18
@ValentaTomas ValentaTomas enabled auto-merge (squash) May 11, 2026 23:18
@ValentaTomas ValentaTomas merged commit c8324f8 into main May 11, 2026
14 checks passed
@ValentaTomas ValentaTomas deleted the fix/upload-script-bash3-compat branch May 11, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants