feat: add swap-size parameter for Wasm builds that need more memory#64
Open
georgeharker wants to merge 1 commit into
Open
feat: add swap-size parameter for Wasm builds that need more memory#64georgeharker wants to merge 1 commit into
georgeharker wants to merge 1 commit into
Conversation
Some grammars (e.g. tree-sitter-zsh) exceed available memory during Wasm compilation on GitHub Actions runners. Rather than forcing consumers to maintain local copies of these workflows just to insert a swap resize step, expose an optional `swap-size` input on the release and package-npm workflows. The default value `normal` skips the resize entirely, keeping existing behaviour unchanged. Setting it to a size like `64G` allocates that much swap before the Wasm build step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some grammars (e.g.
tree-sitter-zsh) exceed available memory during Wasm compilation on GitHub Actions runners. Currently consumers work around this by maintaining local copies ofrelease.ymlandpackage-npm.ymlwith a swap resize step injected before the Wasm build — which means tracking upstream changes manually.This PR adds an optional
swap-sizeinput to both workflows:normal— skips the resize entirely; no behaviour change for existing consumers.64G— allocates that much swap before the Wasm build step.Usage
Changes
.github/workflows/release.yml- Newswap-sizeinput; conditional "Increase swap space" step before "Build Wasm binaries".github/workflows/package-npm.yml- Same —swap-sizeinput and conditional swap step in thebuild_wasmjobWhy not just fix the compiler?
This may become unnecessary if upstream changes decrease appetite for memory for wasm compiles. It's also likely that grammar optimization may help. However, this allows folks with issues to keep using the official treesitter workflows rather than having to copy and modify them.