Repository navigation
fix(scripts): build libghostty-vt for the baseline CPU #55
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
8 commits
Select commit
Hold shift + click to select a range
8810234
fix(scripts): build libghostty-vt for the baseline CPU
ThomasK33 fc5c2a8
docs: link the changelog entry to #55
ThomasK33 b46c4b1
fix(scripts): tell a host that cannot emulate the CPU from a bad addon
ThomasK33 1abebc8
ci: run the baseline CPU check on an emulated Haswell
ThomasK33 0359703
ci: build and test on macos-15 runners
ThomasK33 f599131
docs: name the emulated CPU in the changelog entry
ThomasK33 6f2477f
ci: run the baseline CPU check on the prebuilds that publish.yml ships
ThomasK33 e99e5fd
docs: say LIBGHOSTTY_VT_CPU has no effect on macOS, list publish.yml
ThomasK33 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ vendor/ | |
| .zig-cache/ | ||
| zig-out/ | ||
| *.log | ||
| qemu_*.core | ||
| !dogfood/bootstrap/session.log | ||
| *.tsbuildinfo | ||
| coverage/ | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Runs examples/smoke.ts in one Node process under qemu-user with a generic | ||
| # x86-64 CPU, so an addon that executes instructions newer than the x86-64 | ||
| # baseline (such as AVX-512) fails here instead of on users' machines. | ||
| # Set PREBUILDS_ONLY=1 to check prebuilds/ instead of build/Release. | ||
|
|
||
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| QEMU_CPU="${QEMU_CPU:-qemu64}" | ||
|
|
||
| if [[ "$(uname -s)" != "Linux" || "$(uname -m)" != "x86_64" ]]; then | ||
| echo "error: check-baseline-cpu needs Linux on x86_64, found $(uname -s) $(uname -m)" >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| qemu="$(command -v qemu-x86_64-static || command -v qemu-x86_64 || true)" | ||
| if [[ -z "$qemu" ]]; then | ||
| echo "error: missing qemu-x86_64-static or qemu-x86_64" >&2 | ||
| echo "Install it first, for example: sudo apt-get install qemu-user" >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| # qemu-user emulates only the binary it starts. A version-manager shim (mise, | ||
| # nvm, volta) would exec the real node natively and the check would pass on | ||
| # any addon, so start the real binary. | ||
| node_bin="$(node -p process.execPath)" | ||
|
|
||
| # Control: if Node or the system libraries alone need a newer CPU (Ubuntu's | ||
| # amd64v3 variant builds them for x86-64-v3), the host cannot emulate | ||
| # QEMU_CPU and a failure says nothing about the addon. | ||
| if ! "$qemu" -cpu "$QEMU_CPU" "$node_bin" -e 0; then | ||
| echo "error: node without the addon fails on an emulated $QEMU_CPU CPU, so this host cannot run the check with that CPU" >&2 | ||
| echo "Pick an older-than-host CPU that node runs on, for example QEMU_CPU=Haswell" >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| cd "$ROOT" | ||
| echo "Running examples/smoke.ts with $node_bin under $qemu -cpu $QEMU_CPU" | ||
| if ! "$qemu" -cpu "$QEMU_CPU" "$node_bin" --import tsx examples/smoke.ts; then | ||
| echo "error: the addon failed on a $QEMU_CPU CPU; it likely uses instructions newer than the x86-64 baseline" >&2 | ||
| echo "Build libghostty-vt with LIBGHOSTTY_VT_CPU=baseline (the default) and rebuild the addon." >&2 | ||
| exit 1 | ||
| fi |
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.
Uh oh!
There was an error while loading. Please reload this page.