Repository navigation
id(roc): pin and rebuild checked-in example modules (#541) #3883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
11f9608
ci(id): pin Roc example builds and verify rebuilt modules (#541)
dezren39 efea21a
Merge remote-tracking branch 'origin/main' into fix/id-541
dezren39 facde68
ci(id): scope Roc example tests to sandbox features (#541)
dezren39 37d9c15
Fix Roc examples rebuild script cwd
dezren39 10bcbd1
Follow tic-tac-toe move to apps/ in Roc pin enforcement (#541)
dezren39 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Binary file not shown.
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
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env bash | ||
| # Shared compiler guard for every checked-in Roc example module. | ||
|
|
||
| ID_ROC_VERSION_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/nix/roc-version" | ||
| ID_ROC_EXPECTED_VERSION="$(<"$ID_ROC_VERSION_FILE")" | ||
| ID_ROC_EXPECTED_OUTPUT="Roc compiler version $ID_ROC_EXPECTED_VERSION" | ||
| ID_ROC_BIN="${ROC:-roc}" | ||
|
|
||
| if ! ID_ROC_ACTUAL_OUTPUT="$("$ID_ROC_BIN" version 2>&1)"; then | ||
| printf 'Roc toolchain check failed: could not run %s version:\n%s\n' \ | ||
| "$ID_ROC_BIN" "$ID_ROC_ACTUAL_OUTPUT" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ $ID_ROC_ACTUAL_OUTPUT != "$ID_ROC_EXPECTED_OUTPUT" ]]; then | ||
| printf 'Roc toolchain mismatch: expected %s from %s, got %s from %s; refusing to build.\n' \ | ||
| "$ID_ROC_EXPECTED_OUTPUT" "$ID_ROC_VERSION_FILE" "$ID_ROC_ACTUAL_OUTPUT" "$ID_ROC_BIN" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Using pinned Roc compiler $ID_ROC_EXPECTED_VERSION" |
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
Binary file not shown.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| nightly-2026-10-04-130536d |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| cd "$(dirname "${BASH_SOURCE[0]}")/.." | ||
|
|
||
| examples=( | ||
| examples/lounge | ||
| examples/roc-chat | ||
| examples/roc-counter | ||
| examples/roc-grid | ||
| examples/roc-screen | ||
| examples/territory | ||
| apps/tic-tac-toe/program | ||
| ) | ||
|
|
||
| for example in "${examples[@]}"; do | ||
| echo "=== Rebuilding Roc example: $example ===" | ||
| (cd "$example" && bash ./build.sh) | ||
| done |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Nix sandboxing enabled on Linux, this rebuild reaches
examples/lounge/build.sh:32, which executes../roc-world/build-host.shdirectly. That script uses#!/usr/bin/env bash, but/usr/bin/envis absent in the sandbox—the existing workaround innix-common.nix:32–36explicitly invokes the same script with Bash for this reason. Invoking the outer rebuild script with Bash does not fix the nested invocation, and this check does not patch its shebang before building. Consequently, the new PR-matrix check fails on the first example before reaching the tests. Invoke the nested host builds with Bash or patch their shebangs before rebuilding.Useful? React with 👍 / 👎.