web/build-app-wasm.sh fails on stock macOS (BSD sed -i, empty array under set -u in bash 3.2)

Open Beginner friendly
#1,315 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, rust, shell

Research direction

Start with web/build-app-wasm.sh, especially the sed -i calls and the PROFILE_ARGS expansion near line 104; check how the script is invoked by web/check-app-page.sh. Run both scripts with macOS /bin/bash and BSD sed, then confirm they also work on Linux and Git Bash.

Written by the indexing model from the issue text.

Description

area:build bug effort:low P7 source:agent

Found while working #31 (PR #1314) on macOS.

What happens: web/build-app-wasm.sh stops on a stock Mac for two reasons.

  • It calls sed -i in GNU form (no suffix argument). BSD sed reads the next argument as the backup suffix and fails or edits the wrong thing.
  • Line ~104 expands "${PROFILE_ARGS[@]}" while the array is empty under set -u. bash 3.2, the macOS /bin/bash, treats that as an unbound variable and exits.

Expected: the script runs on Linux, macOS (bash 3.2, BSD sed) and Git Bash alike.

Fix: use sed -i.bak ... && rm -f *.bak (or a temp file plus mv), and expand the array as ${PROFILE_ARGS[@]+"${PROFILE_ARGS[@]}"}.

Done means: web/build-app-wasm.sh and web/check-app-page.sh run unmodified on macOS with /bin/bash and BSD sed.

Dominant language
Rust
Stars
8
Forks
11
Avg merge
6h 39m
Merged PRs (30d)
603

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NeoTech/Camcraft

All issues in NeoTech/Camcraft

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.