From 05d752888ee2c2351ba104df893b8bc8abcafb1e Mon Sep 17 00:00:00 2001 From: Vincent Haupert Date: Mon, 4 Apr 2022 12:11:34 +0200 Subject: [PATCH] github-runner: guard support for Node.js 12 Adds an argument `withNode12` to the derivation which defaults to `false`. Node.js 12 reaches end-of-life on April 30, 2022. Yet, upstream still supports Node.js 12 (with an explicit opt-in through the environment variable `ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION`). --- .../github-runner/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/continuous-integration/github-runner/default.nix b/pkgs/development/tools/continuous-integration/github-runner/default.nix index f53ebd645d05..fcc6906de507 100644 --- a/pkgs/development/tools/continuous-integration/github-runner/default.nix +++ b/pkgs/development/tools/continuous-integration/github-runner/default.nix @@ -13,13 +13,16 @@ , linkFarmFromDrvs , lttng-ust , makeWrapper -, nodejs-12_x , nodejs-16_x , openssl , stdenv , zlib , writeShellApplication , nuget-to-nix +# Keeping this option until upstream removes support for EoL Node.js 12 entirely +# Also refer to: https://github.com/actions/runner/pull/1716 +, withNode12 ? false +, nodejs-12_x }: let nugetSource = linkFarmFromDrvs "nuget-packages" ( @@ -187,15 +190,17 @@ stdenv.mkDerivation rec { ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ # "JavaScript Actions in Alpine containers are only supported on x64 Linux runners. Detected Linux Arm64" "GitHub.Runner.Common.Tests.Worker.StepHostL0.DetermineNodeRuntimeVersionInAlpineContainerAsync" + ] + ++ lib.optionals (!withNode12) [ + "GitHub.Runner.Common.Tests.ProcessExtensionL0.SuccessReadProcessEnv" ]; - checkInputs = [ git ]; checkPhase = '' runHook preCheck mkdir -p _layout/externals - ln -s ${nodejs-12_x} _layout/externals/node12 + ${lib.optionalString withNode12 "ln -s ${nodejs-12_x} _layout/externals/node12"} ln -s ${nodejs-16_x} _layout/externals/node16 printf 'Disabled tests:\n%s\n' '${lib.concatMapStringsSep "\n" (x: " - ${x}") disabledTests}' @@ -244,7 +249,7 @@ stdenv.mkDerivation rec { # externals/node{12,16}. As opposed to the official releases, we don't # link the Alpine Node flavors. mkdir -p $out/externals - ln -s ${nodejs-12_x} $out/externals/node12 + ${lib.optionalString withNode12 "ln -s ${nodejs-12_x} $out/externals/node12"} ln -s ${nodejs-16_x} $out/externals/node16 # Install Nodejs scripts called from workflows