Skip to content
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

fix: Ensure that Node.js native addon targets GLIBC 2.28 on x86_64-unknown-linux-gnu #909

Merged
merged 11 commits into from
Apr 8, 2024

Conversation

Xanewok
Copy link
Contributor

@Xanewok Xanewok commented Mar 28, 2024

Required for NomicFoundation/hardhat-vscode#546 #639

Without this, we host-compiled our native addon with the GLIBC of the runner (ubuntu-22.04), which is 2.33. That's too high and will cause linking issues on older, stable distributions such as Debian 11 (2.31), Debian 10 (2.28), Ubuntu 20.04 (2.31) etc.

The Linux requirement for VS Code atm is 2.28 (https://code.visualstudio.com/docs/supporting/requirements#_additional-linux-requirements) and was bumped in 1.86. Prior to that, the required version was 2.17 and we might consider targeting it instead, until we bump the required VS Code engine for the shipped extension (cc @kanej).

Here is the latest runs that check that the infra publish npm --dry-run executes as expected and passes the relevant checks on our CI: https://github.com/Xanewok/slang/actions/runs/8472800732/job/23215682564. The built artifacts are uploaded as part of the pipeline so they can be additionally downloaded and inspected manually for the GLIBC symbols.

@Xanewok Xanewok requested a review from a team as a code owner March 28, 2024 19:59
Copy link

changeset-bot bot commented Mar 28, 2024

⚠️ No Changeset found

Latest commit: d198f3f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Xanewok Xanewok enabled auto-merge April 2, 2024 02:40
Copy link
Contributor

@OmarTawfik OmarTawfik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few suggestions/concerns

@Xanewok
Copy link
Contributor Author

Xanewok commented Apr 4, 2024

@OmarTawfik I've applied the feedback and separated the GLIBC-related code into a dedicated module because it deals with a single platform, so it doesn't pollute remaining modules and it got a bit bigger (added a new data type, added tests).

Cargo.toml Show resolved Hide resolved
Copy link
Contributor

@OmarTawfik OmarTawfik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved most comments, and left a couple of questions. LGTM otherwise!
Up to you if you would like to merge this now.
Thank you!

@Xanewok Xanewok added this pull request to the merge queue Apr 5, 2024
@OmarTawfik OmarTawfik removed this pull request from the merge queue due to a manual request Apr 5, 2024
@Xanewok Xanewok added this pull request to the merge queue Apr 8, 2024
Merged via the queue into NomicFoundation:main with commit cdcdf8c Apr 8, 2024
1 check passed
@Xanewok Xanewok deleted the napi-glibc branch April 8, 2024 09:24
github-merge-queue bot pushed a commit that referenced this pull request Apr 11, 2024
Fixes warnings on non-GNU systems introduced with #909 

Instead of doing the conditional compilation for the remaining items
that are only used for this check, the routines will be compiled in on
the other systems for simplicity but only used inside a host GNU system.

The alternative is to pepper `#[cfg(target_env = "gnu")]` everywhere but
IMO it'd hurt readability and we're talking about the `infra` CLI,
should is only executed as part of the local development, so this should
be an acceptable trade-off.

This was not caught in the CI as we only use a GNU host there, so
naturally all of the code was compiled in.

Tested with `infra ci` and `infra publish npm --dry-run` on macOS and a
Linux GNU.
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