Skip to content

Fix RUST builds copying non-.node binaries with wrong name#106

Merged
szegedi merged 1 commit intomainfrom
fix/rust-binary-copy
Mar 23, 2026
Merged

Fix RUST builds copying non-.node binaries with wrong name#106
szegedi merged 1 commit intomainfrom
fix/rust-binary-copy

Conversation

@szegedi
Copy link
Copy Markdown
Contributor

@szegedi szegedi commented Mar 23, 2026

Summary

  • The RUST=true code path scans all files from build/Release/ and applies prebuildFilename() to generate output names
  • This works for .node libraries but incorrectly renames plain binaries (e.g. crashtracker-receiver becomes crashtracker-receiver-napi.node)
  • The old pre-Add node-gyp-build-major parameter to support v4 naming convention #90 code used .replace('.node', '-napi.node') which was a no-op for files without .node, preserving binaries as-is
  • Fix: only apply prebuildFilename() to .node files; copy other files with their original name

Context

Discovered via DataDog/libdatadog-nodejs#106 — the crashtracker tests fail because crashtracker-receiver binary gets renamed and can't be found at runtime by load.js.

Test plan

  • Verify libdatadog-nodejs#106 tests pass after this fix
  • Verify existing action-prebuildify CI still passes

🤖 Generated with Claude Code

Jira: PROF-14113

The RUST=true code path scans all files from build/Release/ and
applies prebuildFilename() to generate output names. This works for
.node libraries but incorrectly renames plain binaries (e.g.
crashtracker-receiver) by adding a -napi.node suffix.

The old pre-PR#90 code used .replace('.node', '-napi.node') which was
a no-op for files without .node in their name, preserving binaries
as-is. The refactored code unconditionally applied the naming
convention.

Fix: only apply prebuildFilename() to .node files; copy other files
with their original name.

Fixes crashtracker test failures in DataDog/libdatadog-nodejs#106.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@szegedi szegedi requested a review from a team as a code owner March 23, 2026 18:53
@szegedi szegedi force-pushed the fix/rust-binary-copy branch from 1e603b3 to 3d96784 Compare March 23, 2026 19:23
@szegedi szegedi merged commit 257be4e into main Mar 23, 2026
224 of 228 checks passed
@szegedi szegedi deleted the fix/rust-binary-copy branch March 23, 2026 19:24
@szegedi szegedi mentioned this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants