-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
|
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.
Left a few suggestions/concerns
@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). |
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.
Resolved most comments, and left a couple of questions. LGTM otherwise!
Up to you if you would like to merge this now.
Thank you!
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.
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.