nix/pkgs/heptapod-runner: fix

This commit is contained in:
Luke Granger-Brown 2021-12-25 20:31:34 +00:00
parent 0f550e736e
commit 47d3c07b8f
3 changed files with 26 additions and 2 deletions

View file

@ -64,5 +64,5 @@
common-updater-scripts = pkgs.common-updater-scripts.override {
nix = pkgs.nix_2_3;
};
} // (import ./heptapod-runner.nix args)
} // (import ./heptapod-runner args)
// (import ./lightspeed args)

View file

@ -16,7 +16,7 @@ in
inherit version;
buildInputs = oldAttrs.buildInputs ++ [ pkgs.makeWrapper ];
src = newSrc;
patches = [ "${depot.third_party.nixpkgs.path}/pkgs/development/tools/continuous-integration/gitlab-runner/fix-shell-path.patch" ];
patches = [ ./fix-shell-path.patch ];
});
heptapod-runner-mercurial = pkgs.symlinkJoin {
name = pkgs.mercurial.name;

View file

@ -0,0 +1,24 @@
diff --git a/shells/bash.go b/shells/bash.go
--- a/shells/bash.go
+++ b/shells/bash.go
@@ -5,6 +5,7 @@ import (
"bytes"
"fmt"
"io"
+ "os/exec"
"path"
"runtime"
"strconv"
@@ -249,7 +250,11 @@ func (b *BashShell) GetConfiguration(inf
if info.User != "" {
script.Command = "su"
if runtime.GOOS == "linux" {
- script.Arguments = append(script.Arguments, "-s", "/bin/"+b.Shell)
+ shellPath, err := exec.LookPath(b.Shell)
+ if err != nil {
+ shellPath = "/bin/" + b.Shell
+ }
+ script.Arguments = append(script.Arguments, "-s", shellPath)
}
script.Arguments = append(
script.Arguments,