Skip to content

fix(environment): add libnode-dev for Ubuntu/Debian to fix Node loader build#742

Closed
0xShubhamSolanki wants to merge 1 commit into
metacall:developfrom
0xShubhamSolanki:fix-ubuntu-libnode-clean
Closed

fix(environment): add libnode-dev for Ubuntu/Debian to fix Node loader build#742
0xShubhamSolanki wants to merge 1 commit into
metacall:developfrom
0xShubhamSolanki:fix-ubuntu-libnode-clean

Conversation

@0xShubhamSolanki

Copy link
Copy Markdown

Summary

  • Add libnode-dev to package list in sub_nodejs() for Debian/Ubuntu
  • Add post-install verification check that fails fast if package missing
  • Add test script tools/test/check-node-headers.sh to verify Node build env
  • Prevents CMake from falling back to broken source build on Ubuntu 24+

Test Plan

Run ./tools/test/check-node-headers.sh on fresh Ubuntu 24 without libnode-dev:

Fixes #732

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation update

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests/screenshots (if any) that prove my fix is effective or that my feature works.
  • I have tested the tests implicated (if any) by my own code and they pass (make test or ctest -VV -R <test-name>).
  • If my change is significant or breaking, I have passed all tests with ./docker-compose.sh test &> output and attached the output.
  • I have tested my code with OPTION_BUILD_ADDRESS_SANITIZER or ./docker-compose.sh test-address-sanitizer &> output and OPTION_TEST_MEMORYCHECK.
  • I have tested my code with OPTION_BUILD_THREAD_SANITIZER or ./docker-compose.sh test-thread-sanitizer &> output.
  • I have tested with Helgrind in case my code works with threading.
  • I have run make clang-format in order to format my code and my code follows the style guidelines.

@0xShubhamSolanki

0xShubhamSolanki commented Mar 29, 2026

Copy link
Copy Markdown
Author

Hi @viferga,

I’ve opened a fresh PR (#742) to address the Node loader build issue on Ubuntu 24.04, with a cleaner commit history and a proper reproduction test.

In this PR:

  • Added libnode-dev to the Debian/Ubuntu environment setup
  • Added a check to ensure Node headers are available
  • Added a small repro script (tools/test/check-node-headers.sh) that fails on a clean Ubuntu 24 setup and passes after this fix

From what i found, the issue comes from missing system node headers. Without libnode-dev, MetaCall falls back to building Node from source.On ubuntu 24, that path currently breaks due to python 3.12 (distutils removal).

This change ensures metacall correctly detects and uses the system Node instead of hitting that failing fallback.

Regarding PR #622 ,it seems more focused on newer Debian versions and Node 22, while this specifically targets the current Ubuntu 24 (Noble) setup.

Happy to refine this further based on your feedback. Would appreciate your review whenever you have time.

@viferga

viferga commented Mar 29, 2026

Copy link
Copy Markdown
Member

The teats are completely wrong, add only the package and go the ci and add Ubuntu 24 for testing:

image: ["debian:trixie-slim", "debian:bookworm-slim", "ubuntu:noble", "ubuntu:jammy"] # TODO: "alpine:3.17"

Also there's a PR that already started working on this, but it is not ready, you can use it as reference.

@viferga

viferga commented Mar 29, 2026

Copy link
Copy Markdown
Member

#622

…r build

Without libnode-dev, CMake cannot find Node.js shared library and headers,
falling back to source build which fails on Ubuntu 24+ (Python 3.12 removed distutils).

Fixes metacall#732
@0xShubhamSolanki 0xShubhamSolanki force-pushed the fix-ubuntu-libnode-clean branch from 3bd24d1 to ff5dbb2 Compare March 29, 2026 23:52
@0xShubhamSolanki

0xShubhamSolanki commented Mar 30, 2026

Copy link
Copy Markdown
Author

Hi @viferga,

Thank you for the guidance. I think i understood your point now as the project prefers automated validation via CI rather than manual test scripts to keep the repository clean.I have pushed a clean update that aligns with your feedback:

  • Removed the manual test script and extra logs. The PR now only contains the libnode-dev package addition
  • Since ubuntu:noble is already part of the CI matrix, the GitHub Actions logs for Noble will now act as the reproduction test, confirming that the Node loader builds correctly on a clean Ubuntu 24 environment with these headers.

i have also looked at #622 for reference. Let me know if you would like me to align this fix further with any other specific environment changes you have in mind, or if this minimal approach is sufficient.

Could you please approve the workflows to run? Ready for your review whenever you have a moment

@viferga

viferga commented Mar 30, 2026

Copy link
Copy Markdown
Member

Hi @viferga,

Thank you for the guidance. I think i understood your point now as the project prefers automated validation via CI rather than manual test scripts to keep the repository clean.I have pushed a clean update that aligns with your feedback:

  • Removed the manual test script and extra logs. The PR now only contains the libnode-dev package addition
  • Since ubuntu:noble is already part of the CI matrix, the GitHub Actions logs for Noble will now act as the reproduction test, confirming that the Node loader builds correctly on a clean Ubuntu 24 environment with these headers.

i have also looked at #622 for reference. Let me know if you would like me to align this fix further with any other specific environment changes you have in mind, or if this minimal approach is sufficient.

Could you please approve the workflows to run? Ready for your review whenever you have a moment

Then it doesn't make sense because as it is right now the tests are passing, you're not reproducing the issue you're solving.. I thought you were referring to Ubuntu forky, not noble.

@viferga

viferga commented Mar 30, 2026

Copy link
Copy Markdown
Member

If the bug isn't reproduced in the CI, I cannot merge the patch. Create a new PR that reproduces the issue.

Right now node is not getting compiled in the ci.

@viferga viferga closed this Mar 30, 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