Skip to content

Commit 7af4df6

Browse files
release: Implement macOS npm Nix dylib portability fix
Add native release binary portability auditing and macOS libiconv install-name sanitization so npm-installed @crocoder-dev/sce no longer aborts from Nix store dyld references on clean macOS hosts. Co-authored-by: SCE <sce@crocoder.dev>
1 parent f9a8eb5 commit 7af4df6

22 files changed

Lines changed: 630 additions & 40 deletions

.claude/settings.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release-sce-linux-arm.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,36 @@ jobs:
3636
--version "${{ inputs.release_version }}" \
3737
--out-dir dist
3838
39+
- name: Validate packaged Linux ARM CLI release artifact
40+
run: |
41+
set -euo pipefail
42+
43+
version="${{ inputs.release_version }}"
44+
target_triple="aarch64-unknown-linux-gnu"
45+
archive_root="sce-v${version}-${target_triple}"
46+
archive_path="dist/${archive_root}.tar.gz"
47+
48+
if [ ! -f "$archive_path" ]; then
49+
printf 'Expected release archive at %s\n' "$archive_path" >&2
50+
exit 1
51+
fi
52+
53+
extract_dir="$(mktemp -d "${RUNNER_TEMP:-/tmp}/sce-release-validate.XXXXXX")"
54+
cleanup() {
55+
rm -rf "$extract_dir"
56+
}
57+
trap cleanup EXIT
58+
59+
tar -xzf "$archive_path" -C "$extract_dir"
60+
release_binary="$extract_dir/$archive_root/bin/sce"
61+
if [ ! -x "$release_binary" ]; then
62+
printf 'Expected executable release binary at %s\n' "$release_binary" >&2
63+
exit 1
64+
fi
65+
66+
"$release_binary" version --format json
67+
nix run .#native-portability-audit -- --platform linux --binary "$release_binary"
68+
3969
- name: Allow Flatpak build sandbox
4070
run: |
4171
sudo sysctl -w kernel.unprivileged_userns_clone=1

.github/workflows/release-sce-linux.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,36 @@ jobs:
3636
--version "${{ inputs.release_version }}" \
3737
--out-dir dist
3838
39+
- name: Validate packaged Linux CLI release artifact
40+
run: |
41+
set -euo pipefail
42+
43+
version="${{ inputs.release_version }}"
44+
target_triple="x86_64-unknown-linux-gnu"
45+
archive_root="sce-v${version}-${target_triple}"
46+
archive_path="dist/${archive_root}.tar.gz"
47+
48+
if [ ! -f "$archive_path" ]; then
49+
printf 'Expected release archive at %s\n' "$archive_path" >&2
50+
exit 1
51+
fi
52+
53+
extract_dir="$(mktemp -d "${RUNNER_TEMP:-/tmp}/sce-release-validate.XXXXXX")"
54+
cleanup() {
55+
rm -rf "$extract_dir"
56+
}
57+
trap cleanup EXIT
58+
59+
tar -xzf "$archive_path" -C "$extract_dir"
60+
release_binary="$extract_dir/$archive_root/bin/sce"
61+
if [ ! -x "$release_binary" ]; then
62+
printf 'Expected executable release binary at %s\n' "$release_binary" >&2
63+
exit 1
64+
fi
65+
66+
"$release_binary" version --format json
67+
nix run .#native-portability-audit -- --platform linux --binary "$release_binary"
68+
3969
- name: Allow Flatpak build sandbox
4070
run: |
4171
sudo sysctl -w kernel.unprivileged_userns_clone=1

.github/workflows/release-sce-macos-arm.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,36 @@ jobs:
3636
--version "${{ inputs.release_version }}" \
3737
--out-dir dist
3838
39+
- name: Validate packaged macOS ARM CLI release artifact
40+
run: |
41+
set -euo pipefail
42+
43+
version="${{ inputs.release_version }}"
44+
target_triple="aarch64-apple-darwin"
45+
archive_root="sce-v${version}-${target_triple}"
46+
archive_path="dist/${archive_root}.tar.gz"
47+
48+
if [ ! -f "$archive_path" ]; then
49+
printf 'Expected release archive at %s\n' "$archive_path" >&2
50+
exit 1
51+
fi
52+
53+
extract_dir="$(mktemp -d "${RUNNER_TEMP:-/tmp}/sce-release-validate.XXXXXX")"
54+
cleanup() {
55+
rm -rf "$extract_dir"
56+
}
57+
trap cleanup EXIT
58+
59+
tar -xzf "$archive_path" -C "$extract_dir"
60+
release_binary="$extract_dir/$archive_root/bin/sce"
61+
if [ ! -x "$release_binary" ]; then
62+
printf 'Expected executable release binary at %s\n' "$release_binary" >&2
63+
exit 1
64+
fi
65+
66+
"$release_binary" version --format json
67+
nix run .#native-portability-audit -- --platform macos --binary "$release_binary"
68+
3969
- name: Upload macOS ARM CLI release artifacts
4070
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
4171
with:

.opencode/plugins/sce-agent-trace.ts

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.opencode/plugins/sce-bash-policy.ts

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/.claude/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@
5252
}
5353
]
5454
}
55-
}
55+
}

config/.opencode/plugins/sce-agent-trace.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ async function runDiffTraceHook(
337337

338338
child.on("error", (err: NodeJS.ErrnoException) => {
339339
if (err.code === "ENOENT") {
340-
console.warn(
341-
`sce CLI not found. Install it from ${SCE_INSTALL_URL}`,
342-
);
340+
console.warn(`sce CLI not found. Install it from ${SCE_INSTALL_URL}`);
343341
}
344342
resolve();
345343
});
@@ -364,9 +362,7 @@ async function runConversationTraceHook(
364362

365363
child.on("error", (err: NodeJS.ErrnoException) => {
366364
if (err.code === "ENOENT") {
367-
console.warn(
368-
`sce CLI not found. Install it from ${SCE_INSTALL_URL}`,
369-
);
365+
console.warn(`sce CLI not found. Install it from ${SCE_INSTALL_URL}`);
370366
}
371367
resolve();
372368
});

config/.opencode/plugins/sce-bash-policy.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ function evaluateBashCommandPolicy(command: string): JsonPolicyResult | null {
3232

3333
if (result.error) {
3434
if ((result.error as NodeJS.ErrnoException).code === "ENOENT") {
35-
console.warn(
36-
`sce CLI not found. Install it from ${SCE_INSTALL_URL}`,
37-
);
35+
console.warn(`sce CLI not found. Install it from ${SCE_INSTALL_URL}`);
3836
}
3937
return null;
4038
}

config/automated/.opencode/plugins/sce-agent-trace.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ async function runDiffTraceHook(
337337

338338
child.on("error", (err: NodeJS.ErrnoException) => {
339339
if (err.code === "ENOENT") {
340-
console.warn(
341-
`sce CLI not found. Install it from ${SCE_INSTALL_URL}`,
342-
);
340+
console.warn(`sce CLI not found. Install it from ${SCE_INSTALL_URL}`);
343341
}
344342
resolve();
345343
});
@@ -364,9 +362,7 @@ async function runConversationTraceHook(
364362

365363
child.on("error", (err: NodeJS.ErrnoException) => {
366364
if (err.code === "ENOENT") {
367-
console.warn(
368-
`sce CLI not found. Install it from ${SCE_INSTALL_URL}`,
369-
);
365+
console.warn(`sce CLI not found. Install it from ${SCE_INSTALL_URL}`);
370366
}
371367
resolve();
372368
});

0 commit comments

Comments
 (0)