Skip to content
Prev Previous commit
Next Next commit
fixup! Add comments
  • Loading branch information
aduh95 committed Dec 20, 2025
commit 5686fcf09a3642cd645d5072755d4ac942ab783f
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ COPY --chown=root:developer --chmod=0755 ./scripts/ /home/developer/scripts/
USER developer
RUN /home/developer/scripts/clone.sh

# Installing Nix and Cachix
# using the same script test-shared workflow uses upstream
# Installing Nix using the same script test-shared workflow uses upstream.
# See https://github.com/nodejs/node/blob/HEAD/.github/workflows/test-shared.yml
# See https://github.com/cachix/install-nix-action/blob/HEAD/install-nix.sh
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" | \
Comment thread
joyeecheung marked this conversation as resolved.
Comment thread
aduh95 marked this conversation as resolved.
USER=developer \
Expand All @@ -36,6 +36,7 @@ RUN curl -L "https://github.com/$(sed -nE 's#.*(cachix/install-nix-action)@([a-f
ENV NIX_PROFILES="/nix/var/nix/profiles/default /home/developer/.nix-profile"
ENV NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
ENV PATH="/home/developer/.local/bin:/home/developer/.nix-profile/bin:${PATH}"
# Installing Cachix, and set it up to reuse binaries build by the CI.
RUN nix-env -iA cachix -f https://cachix.org/api/v1/install
RUN USER=developer cachix use nodejs

Expand All @@ -47,7 +48,7 @@ RUN echo 'eval "$(direnv hook bash)"' >> /home/developer/.bashrc

# Setting up direnv for the local clone
ARG USE_SHARED_LIBS=false
# Modifications to the env (such as adding flags, or env variables) should be done upstream unless it's only applicable to this repo.
# As much as possible, we want to use the defaults set in shell.nix so the DX is consistent for users of devcontainers and users of Nix.
Comment thread
joyeecheung marked this conversation as resolved.
Outdated
RUN echo "use nix --impure -I nixpkgs=/home/developer/nodejs/node/tools/nix/pkgs.nix$([ "${USE_SHARED_LIBS}" = "true" ] || echo " --arg sharedLibDeps '{}' --argstr icu full")" > /home/developer/nodejs/node/.envrc
Comment thread
aduh95 marked this conversation as resolved.
Outdated
Comment thread
joyeecheung marked this conversation as resolved.
Outdated
RUN direnv allow /home/developer/nodejs/node

Expand Down
3 changes: 2 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ set -xe
cd /home/developer/nodejs/node
eval "$(direnv export bash)"

# BUILD_WTIH=ninja is set in https://github.com/nodejs/node/blob/HEAD/shell.nix
# Build tools and env variables (including e.g. BUILD_WITH=ninja) are
# defined in https://github.com/nodejs/node/blob/HEAD/shell.nix
make -C /home/developer/nodejs/node build-ci
Comment thread
aduh95 marked this conversation as resolved.