Skip to content

Add Utilities/setup-dev.sh for one-command contributor setup#726

Merged
kateinoigakukun merged 1 commit intoswiftwasm:mainfrom
matthewa26:chore/setup-dev-script
Apr 26, 2026
Merged

Add Utilities/setup-dev.sh for one-command contributor setup#726
kateinoigakukun merged 1 commit intoswiftwasm:mainfrom
matthewa26:chore/setup-dev-script

Conversation

@matthewa26
Copy link
Copy Markdown
Contributor

Summary

Adds Utilities/setup-dev.sh, a wrapper around the manual setup steps already documented in CONTRIBUTING.md. Re-running it is idempotent.

The script:

  • Verifies required tools (swiftly, swift, jq, npm, make, curl) and prints actionable hints if any are missing.
  • If a .swift-version file is present at the repo root, installs that toolchain via swiftly.
  • Resolves a matching Wasm SDK from swift-sdk-index and installs it (skipped if already installed).
  • Runs make bootstrap.
  • Prints SWIFT_SDK_ID for use with make unittest.

The script runs under bash via the shebang; the printed export instructions work unchanged in both bash and zsh.

CONTRIBUTING.md now opens with a "Quick start" section pointing at the script, and keeps the original manual instructions as a "Manual setup" fallback for anyone who wants to follow each step by hand.

Notes

  • The repo does not track .swift-version; contributors who want it ignored locally can add it to .git/info/exclude.
  • No Swift files changed, so Utilities/format.swift does not apply.
  • Tested locally on macOS (zsh): idempotent re-run, fresh install after swift sdk remove, and invocation from a different working directory.

Test plan

  • On a fresh clone with an OSS Swift toolchain installed via swiftly, run ./Utilities/setup-dev.sh and confirm it installs the Wasm SDK, runs make bootstrap, and prints a usable SWIFT_SDK_ID.
  • Re-run the script and confirm it no-ops (SDK already installed).
  • make unittest SWIFT_SDK_ID=<printed-id> runs the Wasm test suite.

Wraps the manual steps already documented in CONTRIBUTING.md:

  - Verifies required tools (swiftly, swift, jq, npm, make, curl).
  - If a .swift-version file is present, installs the pinned toolchain via
    swiftly.
  - Resolves and installs a matching Wasm SDK from swift-sdk-index
    (idempotent — skipped if already installed).
  - Runs `make bootstrap` to install JS deps.
  - Prints SWIFT_SDK_ID for use with `make unittest`.

The script runs under bash via shebang; the export instructions it prints
work unchanged in zsh and bash. The repo does not track .swift-version;
contributors who want it ignored locally can add it to .git/info/exclude.
The original manual instructions are kept in CONTRIBUTING.md as a fallback.
@kateinoigakukun kateinoigakukun merged commit 8d279a0 into swiftwasm:main Apr 26, 2026
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