Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.rs]
indent_size = 4
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ jobs:
- name: Build and test
run: |
nix flake check --all-systems --eval-cores 0 -L

- name: Ensure no changes to generated Wasm
run: |
rm -rf ./wasm
nix build
cp -rL --no-preserve=all ./result ./wasm
git diff --exit-code
Comment on lines +34 to +39
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

cp --no-preserve is not portable to macOS.

The --no-preserve=all flag is GNU coreutils-specific. BSD cp on macOS doesn't support this option, causing the workflow to fail on macos-latest runners.

🐛 Proposed fix using a portable approach
       - name: Ensure no changes to generated Wasm
         run: |
           rm -rf ./wasm
           nix build
-          cp -rL --no-preserve=all ./result ./wasm
+          mkdir -p ./wasm
+          cp -rL ./result/* ./wasm/
           git diff --exit-code

Alternatively, if you need to reset ownership/permissions explicitly, use rsync which is available on both platforms:

       - name: Ensure no changes to generated Wasm
         run: |
           rm -rf ./wasm
           nix build
-          cp -rL --no-preserve=all ./result ./wasm
+          rsync -rL ./result/ ./wasm/
           git diff --exit-code
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Ensure no changes to generated Wasm
run: |
rm -rf ./wasm
nix build
cp -rL --no-preserve=all ./result ./wasm
git diff --exit-code
- name: Ensure no changes to generated Wasm
run: |
rm -rf ./wasm
nix build
mkdir -p ./wasm
cp -rL ./result/* ./wasm/
git diff --exit-code
Suggested change
- name: Ensure no changes to generated Wasm
run: |
rm -rf ./wasm
nix build
cp -rL --no-preserve=all ./result ./wasm
git diff --exit-code
- name: Ensure no changes to generated Wasm
run: |
rm -rf ./wasm
nix build
rsync -rL ./result/ ./wasm/
git diff --exit-code
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 34 - 39, The CI step "Ensure no
changes to generated Wasm" uses GNU-only `cp --no-preserve=all` which breaks on
macOS; replace the `cp -rL --no-preserve=all ./result ./wasm` line with a
portable copy using `rsync` (e.g., `rsync -aL --delete ./result/ ./wasm/`) so
ownership/permission differences are normalized across runners, keep the
preceding `rm -rf ./wasm` and subsequent `git diff --exit-code` unchanged, and
ensure you use trailing slashes on source/dest to copy contents rather than the
directory itself.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.wasm
result
result*
/target/
*~
/*/tests/*.out
/wasi/target/
/wasi/target/
Loading
Loading