Skip to content

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

Closed
0xShubhamSolanki wants to merge 0 commit into
metacall:developfrom
0xShubhamSolanki:fix/ubuntu-libnode-dev
Closed

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

Conversation

@0xShubhamSolanki

Copy link
Copy Markdown

Problem

On Ubuntu 24.04, the build fails because libnode-dev is not installed by the environment script. This causes CMake to fall back to building Node from source, which fails due to Python 3.12 incompatibility (distutils removal).

Without the development headers, FindNodeJS.cmake cannot detect the system Node, triggering a broken source build fallback.

Solution

Add libnode-dev to the package list in sub_nodejs() for Debian/Ubuntu. This ensures Node development headers are available, allowing MetaCall to properly detect and link against the system Node.

Manual Testing Performed

  • Fresh Ubuntu 24.04 environment
  • Ran ./tools/metacall-environment.sh base python nodejs rpc
  • Build completed successfully with all loaders
  • Verified CLI with Python and Node loaders working correctly
  • Verified with dpkg -l | grep libnode-dev

Context

Discussed in Discord #general channel with community members facing the same issue on Ubuntu 24.


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.

@viferga viferga marked this pull request as draft March 26, 2026 23:47
@viferga

viferga commented Mar 26, 2026

Copy link
Copy Markdown
Member

Provide a test for reproducing the issue before sending the patch.

@viferga

viferga commented Mar 26, 2026

Copy link
Copy Markdown
Member

Also, is it related to this?
#622

0xShubhamSolanki added a commit to 0xShubhamSolanki/core that referenced this pull request Mar 28, 2026
Add post-install check in sub_nodejs() to ensure libnode-dev
package is correctly installed on Ubuntu/Debian systems.
Prevents silent failures where CMake falls back to broken
source build on Ubuntu 24+.

Fixes metacall#732
0xShubhamSolanki added a commit to 0xShubhamSolanki/core that referenced this pull request Mar 28, 2026
- 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 reproduces the issue: run ./tools/test/check-node-headers.sh on fresh
Ubuntu 24 without libnode-dev - it will fail. After running environment
script with this patch, it will pass.

Fixes metacall#732
0xShubhamSolanki added a commit to 0xShubhamSolanki/core that referenced this pull request Mar 28, 2026
- Add libnode-dev to package list in sub_nodejs()
- Add post-install verification check
- Add test script tools/test/check-node-headers.sh

Fixes metacall#732
0xShubhamSolanki added a commit to 0xShubhamSolanki/core that referenced this pull request Mar 29, 2026
…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 added a commit to 0xShubhamSolanki/core that referenced this pull request Mar 29, 2026
…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
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