This commit is contained in:
Jarred Sumner
2025-09-12 17:24:47 -07:00
parent 0a3b9ce701
commit bac13201ae
3 changed files with 55 additions and 16 deletions

View File

@@ -123,6 +123,10 @@ jobs:
echo "outdated=$(cat outdated.txt)" >> $GITHUB_OUTPUT echo "outdated=$(cat outdated.txt)" >> $GITHUB_OUTPUT
fi fi
if [[ -f "is-standalone.txt" ]]; then
echo "is-standalone=true" >> $GITHUB_OUTPUT
fi
if [[ -f "is-very-outdated.txt" ]]; then if [[ -f "is-very-outdated.txt" ]]; then
echo "is-very-outdated=true" >> $GITHUB_OUTPUT echo "is-very-outdated=true" >> $GITHUB_OUTPUT
LABELS="$LABELS,old-version" LABELS="$LABELS,old-version"
@@ -132,7 +136,7 @@ jobs:
echo "latest=$(cat LATEST)" >> $GITHUB_OUTPUT echo "latest=$(cat LATEST)" >> $GITHUB_OUTPUT
echo "labels=$LABELS" >> $GITHUB_OUTPUT echo "labels=$LABELS" >> $GITHUB_OUTPUT
rm -rf is-outdated.txt outdated.txt latest.txt is-very-outdated.txt rm -rf is-outdated.txt outdated.txt latest.txt is-very-outdated.txt is-standalone.txt
- name: Close issue if pattern detected - name: Close issue if pattern detected
if: github.event.label.name == 'crash' && fromJson(steps.add-labels.outputs.close-action).close == true if: github.event.label.name == 'crash' && fromJson(steps.add-labels.outputs.close-action).close == true
uses: actions/github-script@v7 uses: actions/github-script@v7
@@ -191,8 +195,17 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
labels: ${{ steps.add-labels.outputs.labels }} labels: ${{ steps.add-labels.outputs.labels }}
- name: Comment outdated (standalone executable)
if: steps.add-labels.outputs.is-outdated == 'true' && steps.add-labels.outputs.is-standalone == 'true' && github.event.label.name == 'crash' && steps.generate-comment-text.outputs.sentry-link == ''
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }}, the latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but the standalone executable is running Bun v${{ steps.add-labels.outputs.outdated }}. When the CLI using Bun's single-file executable next updates it might be fixed.
- name: Comment outdated - name: Comment outdated
if: steps.add-labels.outputs.is-outdated == 'true' && github.event.label.name == 'crash' && steps.generate-comment-text.outputs.sentry-link == '' if: steps.add-labels.outputs.is-outdated == 'true' && steps.add-labels.outputs.is-standalone != 'true' && github.event.label.name == 'crash' && steps.generate-comment-text.outputs.sentry-link == ''
uses: actions-cool/issues-helper@v3 uses: actions-cool/issues-helper@v3
with: with:
actions: "create-comment" actions: "create-comment"
@@ -206,8 +219,22 @@ jobs:
```sh ```sh
bun upgrade bun upgrade
``` ```
- name: Comment with Sentry Link and outdated version (standalone executable)
if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated == 'true' && steps.add-labels.outputs.is-standalone == 'true'
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }}, thank you for reporting this crash. The latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but the standalone executable is running Bun v${{ steps.add-labels.outputs.outdated }}. When the CLI using Bun's single-file executable next updates it might be fixed.
For Bun's internal tracking, this issue is [${{ steps.generate-comment-text.outputs.sentry-id }}](${{ steps.generate-comment-text.outputs.sentry-link }}).
<!-- sentry-id: ${{ steps.generate-comment-text.outputs.sentry-id }} -->
<!-- sentry-link: ${{ steps.generate-comment-text.outputs.sentry-link }} -->
- name: Comment with Sentry Link and outdated version - name: Comment with Sentry Link and outdated version
if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated == 'true' if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated == 'true' && steps.add-labels.outputs.is-standalone != 'true'
uses: actions-cool/issues-helper@v3 uses: actions-cool/issues-helper@v3
with: with:
actions: "create-comment" actions: "create-comment"

View File

@@ -35,21 +35,23 @@ better-sqlite3 is not supported yet in Bun due to missing V8 C++ APIs. For now,
// Check for CPU architecture issues (Segmentation Fault/Illegal Instruction with no_avx) // Check for CPU architecture issues (Segmentation Fault/Illegal Instruction with no_avx)
else if ( else if (
(body.includes("Segmentation Fault") || (body.includes("Segmentation Fault") ||
body.includes("Illegal Instruction") || body.includes("Illegal Instruction") ||
body.includes("IllegalInstruction")) && body.includes("IllegalInstruction")) &&
body.includes("no_avx") body.includes("no_avx")
) { ) {
let comment = `Bun requires a CPU with the micro-architecture [\`nehalem\`](https://en.wikipedia.org/wiki/Nehalem_(microarchitecture)) or later (released in 2008). If you're using a CPU emulator like qemu, then try enabling x86-64-v2.`; let comment = `Bun requires a CPU with the micro-architecture [\`nehalem\`](https://en.wikipedia.org/wiki/Nehalem_(microarchitecture)) or later (released in 2008). If you're using a CPU emulator like qemu, then try enabling x86-64-v2.`;
// Check if it's macOS // Check if it's macOS
const platformMatch = body.match(/Platform:\s*([^\n]+)/i) || body.match(/on\s+(macos|darwin)/i); const platformMatch = body.match(/Platform:\s*([^\n]+)/i) || body.match(/on\s+(macos|darwin)/i);
const isMacOS = platformMatch && (platformMatch[1]?.toLowerCase().includes("darwin") || platformMatch[1]?.toLowerCase().includes("macos")); const isMacOS =
platformMatch &&
(platformMatch[1]?.toLowerCase().includes("darwin") || platformMatch[1]?.toLowerCase().includes("macos"));
if (isMacOS) { if (isMacOS) {
comment += `\n\nIf you're on a macOS silicon device, you're running Bun via the Rosetta CPU emulator and your best option is to run Bun natively instead.`; comment += `\n\nIf you're on a macOS silicon device, you're running Bun via the Rosetta CPU emulator and your best option is to run Bun natively instead.`;
} }
closeAction = { closeAction = {
reason: "not_planned", reason: "not_planned",
comment, comment,
@@ -58,11 +60,13 @@ else if (
if (closeAction) { if (closeAction) {
// Output the action to take // Output the action to take
console.write(JSON.stringify({ console.write(
close: true, JSON.stringify({
reason: closeAction.reason, close: true,
comment: closeAction.comment, reason: closeAction.reason,
})); comment: closeAction.comment,
}),
);
} else { } else {
console.write(JSON.stringify({ close: false })); console.write(JSON.stringify({ close: false }));
} }

View File

@@ -6,6 +6,9 @@ if (!body) {
const latest = (await Bun.file(join(import.meta.dir, "..", "LATEST")).text()).trim(); const latest = (await Bun.file(join(import.meta.dir, "..", "LATEST")).text()).trim();
// Check if this is a standalone executable
const isStandalone = body.includes("standalone_executable");
const lines = body.split("\n").reverse(); const lines = body.split("\n").reverse();
for (let line of lines) { for (let line of lines) {
@@ -39,6 +42,11 @@ for (let line of lines) {
await Bun.write("is-outdated.txt", "true"); await Bun.write("is-outdated.txt", "true");
await Bun.write("outdated.txt", version); await Bun.write("outdated.txt", version);
// Write flag for standalone executables
if (isStandalone) {
await Bun.write("is-standalone.txt", "true");
}
const isVeryOutdated = const isVeryOutdated =
major !== latestMajor || minor !== latestMinor || (latestPatch > patch && latestPatch - patch > 3); major !== latestMajor || minor !== latestMinor || (latestPatch > patch && latestPatch - patch > 3);