-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: make use of Nix files to set up dev env #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
base: main
Are you sure you want to change the base?
Conversation
| set -xe | ||
|
|
||
| /home/developer/nodejs/node/configure --ninja && make -C /home/developer/nodejs/node | ||
| make -C /home/developer/nodejs/node build-ci |
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.
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.
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.
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" | \ |
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.
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.
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.
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
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
nodebuilt with all shared libs, similar to what buildstest-sharedGHA 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