Skip to content

Conversation

@aduh95
Copy link

@aduh95 aduh95 commented Dec 8, 2025

I first attempted to create the Docker image using Nix tools, but that ended up being too complicated, in the end it was easier to install Nix from the Dockerfile, and update the existing scripts to use Nix provided tools.

Worth noting the image contains a node built with all shared libs, similar to what builds test-shared GHA workflow on nodejs/node; we could certainly disable that to use the vendored static deps instead, the tradeoff being the build would take longer.

Fixes: #18

set -xe

/home/developer/nodejs/node/configure --ninja && make -C /home/developer/nodejs/node
make -C /home/developer/nodejs/node build-ci
Copy link
Member

@joyeecheung joyeecheung Dec 9, 2025

Choose a reason for hiding this comment

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

Does it have to use make? I think maybe it's about time that we can just use ninja in the GHA...it would be rather unfortunate to revert to make for development when the devcontainer is used, as it's not really pleasant to use for local development, and if the image is not built with ninja, then switching to ninja for development no longer hits the cache and everything has to be recompiled.

Copy link
Author

@aduh95 aduh95 Dec 9, 2025

Choose a reason for hiding this comment

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

The image is still using Ninja, it's defined in https://github.com/nodejs/node/blob/83ba6b107a067f5831b03ab69c787fcb35bdcb05/shell.nix#L87. The fact that the build is started with make predates this PR, the actual change in this PR is to use build-ci which calls ./configure then make all (defined in https://github.com/nodejs/node/blob/83ba6b107a067f5831b03ab69c787fcb35bdcb05/Makefile#L627-L629).

FWIW that's also what test-shared is doing on nodejs/node, and as you can see in e.g. https://github.com/nodejs/node/actions/runs/20067281194/job/57559349798, we're using Ninja there.

RUN /home/developer/scripts/clone.sh

# Installing Nix and Cachix
RUN curl -L "https://github.com/$(sed -nE 's#.*(cachix/install-nix-action)@([a-f0-9]+).*#\1/raw/\2#p' /home/developer/nodejs/node/.github/workflows/test-shared.yml)/install-nix.sh" | \
Copy link
Member

@joyeecheung joyeecheung Dec 9, 2025

Choose a reason for hiding this comment

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

Can we make this a variable, so that we can have two nightly build workflows, one for shared builds and one for static ones, then users can easily choose different images when spinning a container? That'll be handy if say one day I need to reproduce a bug that only reproduces with shared builds, then I can just spin a container with the shared builds and build it quickly without compiling the entire V8 and whatnot when I am working on non-Linux.

Copy link
Author

Choose a reason for hiding this comment

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

Done in 885db6b...a8c190f. I've set the default value to false, to be consistent with the current images, though that's taking much longer to build

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.

Re-use the Nix env that's being tested on nodejs/node

3 participants