-
Notifications
You must be signed in to change notification settings - Fork 76
Fix Dax typecheck on providers that ship Node 20 #430
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,10 +157,22 @@ prepare() { | |
| # setuptools is optional - only needed for node-gyp native module compilation, | ||
| # not for the clone/install/typecheck benchmark. Skip the check entirely. | ||
|
|
||
| # Install Node.js only if it's not already available. Some sandboxes (e.g. | ||
| # Vercel) ship Node.js pre-installed; respect that rather than trying to | ||
| # override it (the symlink may not take precedence in PATH). | ||
| if ! command -v node >/dev/null 2>&1; then | ||
| # Install the pinned Node.js if it is missing or older than 22. Some | ||
| # sandboxes (e.g. Vercel) ship a current Node.js; keep that rather than | ||
| # fighting PATH precedence. OpenCode's native-module install scripts | ||
| # require Node 22+ (recent node-gyp pulls an undici that needs | ||
| # util.markAsUncloneable). | ||
| local need_node=1 | ||
| if command -v node >/dev/null 2>&1; then | ||
| local current_major | ||
| current_major="$(node -v 2>/dev/null || true)" | ||
| current_major="${current_major#v}" | ||
| current_major="${current_major%%.*}" | ||
| if [[ "$current_major" =~ ^[0-9]+$ ]] && (( current_major >= 22 )); then | ||
| need_node=0 | ||
| fi | ||
| fi | ||
| if [[ "$need_node" -eq 1 ]]; then | ||
| local archive="node-v${NODE_VERSION}-${NODE_ARCH}.tar.gz" | ||
| local prefix="/opt/node-v${NODE_VERSION}-${NODE_ARCH}" | ||
| if ! curl -fsSL "https://nodejs.org/download/release/v${NODE_VERSION}/${archive}" -o "/tmp/${archive}"; then | ||
|
Comment on lines
+175
to
178
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Node override bypasses required minimum With Learn more
Example: With Recommended fix: Parse and reject Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
@@ -176,6 +188,7 @@ prepare() { | |
| for executable in node npm npx corepack; do | ||
| "${SUDO[@]}" ln -sfn "$prefix/bin/$executable" "/usr/local/bin/$executable" | ||
| done | ||
| hash -r 2>/dev/null || true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 PATH precedence defeats Node upgrade When old Node precedes Learn moreBash's Example: A sandbox has Recommended fix: Prepend the installed prefix's Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| fi | ||
| if ! command -v node >/dev/null 2>&1; then | ||
| printf 'BENCH_ERROR\tprepare\tnode_not_found\n' >&2 | ||
|
|
||
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.
🟡 Alpine upgrades install unusable Node
On musl with Node below 22,
need_nodedownloads the glibc Node archive. The installed binary cannot start, so Alpine benchmarks fail.Learn more
The script explicitly detects musl because standard Linux binaries can depend on glibc, which Alpine does not provide. The new version gate sends every pre-22 Node installation through the official Node archive. That archive uses glibc, unlike the musl-specific Bun archive selected by BUN_MUSL_SUFFIX. Extraction succeeds, but invoking the installed
nodefails because its dynamic loader is unavailable.Example: An x86_64
node:20-alpinesandbox reports Node 20.need_nodedownloadsnode-v24.14.1-linux-x64.tar.gz, links it into/usr/local/bin, and preparation appears successful. The laternode --versioninvocation cannot execute the binary, instead of reporting Node 24.Recommended fix: On musl, install a Node 22+ musl build through Alpine's package repositories or another verified source. If no compatible release exists, emit a specific preparation error rather than installing the glibc archive. Validate the resulting
node --versionbefore completingprepare.Was this helpful? React with 👍 or 👎 to provide feedback.