summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Moog <moogcharlie@gmail.com>2022-08-12 13:47:48 -0500
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-08-22 18:38:50 +0000
commit837ef2ec9afafe15420b23358f2aaf8eb67b4b93 (patch)
tree946490672ef3279dc743671fee43d21a898d225a
parentMerge pull request #187903 from NixOS/backport-187896-to-release-22.05 (diff)
downloadnixpkgs-origin/backport-186325-to-release-22.05.tar.gz
github-runner: fix package layout, script patches, default state dirorigin/backport-186325-to-release-22.05
(cherry picked from commit 9fd2b544ac7795464f5b1d9bacbe3cf12465dc16)
-rw-r--r--pkgs/development/tools/continuous-integration/github-runner/default.nix31
1 files changed, 20 insertions, 11 deletions
diff --git a/pkgs/development/tools/continuous-integration/github-runner/default.nix b/pkgs/development/tools/continuous-integration/github-runner/default.nix
index a7dca1959fda..f981517d05cf 100644
--- a/pkgs/development/tools/continuous-integration/github-runner/default.nix
+++ b/pkgs/development/tools/continuous-integration/github-runner/default.nix
@@ -232,15 +232,21 @@ stdenv.mkDerivation rec {
# Install the helper scripts to bin/ to resemble the upstream package
mkdir -p $out/bin
- install -m755 src/Misc/layoutbin/runsvc.sh $out/bin/
- install -m755 src/Misc/layoutbin/RunnerService.js $out/lib/
- install -m755 src/Misc/layoutroot/run.sh $out/lib/
- install -m755 src/Misc/layoutroot/config.sh $out/lib/
- install -m755 src/Misc/layoutroot/env.sh $out/lib/
+ install -m755 src/Misc/layoutbin/runsvc.sh $out/bin/
+ install -m755 src/Misc/layoutbin/RunnerService.js $out/lib/
+ install -m755 src/Misc/layoutroot/run.sh $out/lib/
+ install -m755 src/Misc/layoutroot/run-helper.sh.template $out/lib/run-helper.sh
+ install -m755 src/Misc/layoutroot/config.sh $out/lib/
+ install -m755 src/Misc/layoutroot/env.sh $out/lib/
# Rewrite reference in helper scripts from bin/ to lib/
- substituteInPlace $out/lib/run.sh --replace '"$DIR"/bin' "$out/lib"
- substituteInPlace $out/lib/config.sh --replace './bin' "$out/lib"
+ substituteInPlace $out/lib/run.sh --replace '"$DIR"/bin' '"$DIR"/lib'
+ substituteInPlace $out/lib/config.sh --replace './bin' $out'/lib' \
+ --replace 'source ./env.sh' $out/bin/env.sh
+
+ # Remove uneeded copy for run-helper template
+ substituteInPlace $out/lib/run.sh --replace 'cp -f "$DIR"/run-helper.sh.template "$DIR"/run-helper.sh' ' '
+ substituteInPlace $out/lib/run-helper.sh --replace '"$DIR"/bin/' '"$DIR"/'
# Make paths absolute
substituteInPlace $out/bin/runsvc.sh \
@@ -277,7 +283,7 @@ stdenv.mkDerivation rec {
wrap() {
makeWrapper $out/lib/$1 $out/bin/$1 \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (buildInputs ++ [ openssl ])} \
- ''${@:2}
+ "''${@:2}"
}
fix_rpath Runner.Listener
@@ -287,10 +293,13 @@ stdenv.mkDerivation rec {
wrap Runner.Listener
wrap Runner.PluginHost
wrap Runner.Worker
- wrap run.sh
- wrap env.sh
+ wrap run.sh --run 'export RUNNER_ROOT=''${RUNNER_ROOT:-$HOME/.github-runner}'
+ wrap env.sh --run 'cd $RUNNER_ROOT'
- wrap config.sh --prefix PATH : ${lib.makeBinPath [ glibc.bin ]}
+ wrap config.sh --run 'export RUNNER_ROOT=''${RUNNER_ROOT:-$HOME/.github-runner}' \
+ --run 'mkdir -p $RUNNER_ROOT' \
+ --prefix PATH : ${lib.makeBinPath [ glibc.bin ]} \
+ --chdir $out
'';
# Script to create deps.nix file for dotnet dependencies. Run it with