Skip to content

Commit bac1320

Browse files
committed
fmt
1 parent 0a3b9ce commit bac1320

File tree

3 files changed

+55
-16
lines changed

3 files changed

+55
-16
lines changed

.github/workflows/labeled.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ jobs:
123123
echo "outdated=$(cat outdated.txt)" >> $GITHUB_OUTPUT
124124
fi
125125
126+
if [[ -f "is-standalone.txt" ]]; then
127+
echo "is-standalone=true" >> $GITHUB_OUTPUT
128+
fi
129+
126130
if [[ -f "is-very-outdated.txt" ]]; then
127131
echo "is-very-outdated=true" >> $GITHUB_OUTPUT
128132
LABELS="$LABELS,old-version"
@@ -132,7 +136,7 @@ jobs:
132136
133137
echo "latest=$(cat LATEST)" >> $GITHUB_OUTPUT
134138
echo "labels=$LABELS" >> $GITHUB_OUTPUT
135-
rm -rf is-outdated.txt outdated.txt latest.txt is-very-outdated.txt
139+
rm -rf is-outdated.txt outdated.txt latest.txt is-very-outdated.txt is-standalone.txt
136140
- name: Close issue if pattern detected
137141
if: github.event.label.name == 'crash' && fromJson(steps.add-labels.outputs.close-action).close == true
138142
uses: actions/github-script@v7
@@ -191,8 +195,17 @@ jobs:
191195
token: ${{ secrets.GITHUB_TOKEN }}
192196
issue-number: ${{ github.event.issue.number }}
193197
labels: ${{ steps.add-labels.outputs.labels }}
198+
- name: Comment outdated (standalone executable)
199+
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 == ''
200+
uses: actions-cool/issues-helper@v3
201+
with:
202+
actions: "create-comment"
203+
token: ${{ secrets.GITHUB_TOKEN }}
204+
issue-number: ${{ github.event.issue.number }}
205+
body: |
206+
@${{ 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.
194207
- name: Comment outdated
195-
if: steps.add-labels.outputs.is-outdated == 'true' && github.event.label.name == 'crash' && steps.generate-comment-text.outputs.sentry-link == ''
208+
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 == ''
196209
uses: actions-cool/issues-helper@v3
197210
with:
198211
actions: "create-comment"
@@ -206,8 +219,22 @@ jobs:
206219
```sh
207220
bun upgrade
208221
```
222+
- name: Comment with Sentry Link and outdated version (standalone executable)
223+
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'
224+
uses: actions-cool/issues-helper@v3
225+
with:
226+
actions: "create-comment"
227+
token: ${{ secrets.GITHUB_TOKEN }}
228+
issue-number: ${{ github.event.issue.number }}
229+
body: |
230+
@${{ 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.
231+
232+
For Bun's internal tracking, this issue is [${{ steps.generate-comment-text.outputs.sentry-id }}](${{ steps.generate-comment-text.outputs.sentry-link }}).
233+
234+
<!-- sentry-id: ${{ steps.generate-comment-text.outputs.sentry-id }} -->
235+
<!-- sentry-link: ${{ steps.generate-comment-text.outputs.sentry-link }} -->
209236
- name: Comment with Sentry Link and outdated version
210-
if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated == 'true'
237+
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'
211238
uses: actions-cool/issues-helper@v3
212239
with:
213240
actions: "create-comment"

scripts/handle-crash-patterns.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,23 @@ better-sqlite3 is not supported yet in Bun due to missing V8 C++ APIs. For now,
3535

3636
// Check for CPU architecture issues (Segmentation Fault/Illegal Instruction with no_avx)
3737
else if (
38-
(body.includes("Segmentation Fault") ||
39-
body.includes("Illegal Instruction") ||
40-
body.includes("IllegalInstruction")) &&
38+
(body.includes("Segmentation Fault") ||
39+
body.includes("Illegal Instruction") ||
40+
body.includes("IllegalInstruction")) &&
4141
body.includes("no_avx")
4242
) {
4343
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.`;
44-
44+
4545
// Check if it's macOS
4646
const platformMatch = body.match(/Platform:\s*([^\n]+)/i) || body.match(/on\s+(macos|darwin)/i);
47-
const isMacOS = platformMatch && (platformMatch[1]?.toLowerCase().includes("darwin") || platformMatch[1]?.toLowerCase().includes("macos"));
48-
47+
const isMacOS =
48+
platformMatch &&
49+
(platformMatch[1]?.toLowerCase().includes("darwin") || platformMatch[1]?.toLowerCase().includes("macos"));
50+
4951
if (isMacOS) {
5052
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.`;
5153
}
52-
54+
5355
closeAction = {
5456
reason: "not_planned",
5557
comment,
@@ -58,11 +60,13 @@ else if (
5860

5961
if (closeAction) {
6062
// Output the action to take
61-
console.write(JSON.stringify({
62-
close: true,
63-
reason: closeAction.reason,
64-
comment: closeAction.comment,
65-
}));
63+
console.write(
64+
JSON.stringify({
65+
close: true,
66+
reason: closeAction.reason,
67+
comment: closeAction.comment,
68+
}),
69+
);
6670
} else {
6771
console.write(JSON.stringify({ close: false }));
68-
}
72+
}

scripts/is-outdated.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ if (!body) {
66

77
const latest = (await Bun.file(join(import.meta.dir, "..", "LATEST")).text()).trim();
88

9+
// Check if this is a standalone executable
10+
const isStandalone = body.includes("standalone_executable");
11+
912
const lines = body.split("\n").reverse();
1013

1114
for (let line of lines) {
@@ -39,6 +42,11 @@ for (let line of lines) {
3942
await Bun.write("is-outdated.txt", "true");
4043
await Bun.write("outdated.txt", version);
4144

45+
// Write flag for standalone executables
46+
if (isStandalone) {
47+
await Bun.write("is-standalone.txt", "true");
48+
}
49+
4250
const isVeryOutdated =
4351
major !== latestMajor || minor !== latestMinor || (latestPatch > patch && latestPatch - patch > 3);
4452

0 commit comments

Comments
 (0)