From 34e34f9bf71ce0c68ad3e5d9a72baa1f1fda756e Mon Sep 17 00:00:00 2001 From: JuliusFreudenberger Date: Sun, 7 Jun 2026 23:28:14 +0200 Subject: [PATCH] teleport_18: 18.7.6 -> 18.8.3 Upstream moved the declaration of default paths into a module, which breaks applying a patch. Adapting the patch and applying it conditionally based on the version mitigates this problem. Changelogs: https://github.com/gravitational/teleport/releases/tag/v18.8.0 https://github.com/gravitational/teleport/releases/tag/v18.8.1 https://github.com/gravitational/teleport/releases/tag/v18.8.2 https://github.com/gravitational/teleport/releases/tag/v18.8.3 Diff: https://github.com/gravitational/teleport/compare/v18.7.6...v18.8.3 --- ...-fix-add-nix-path-to-exec-env-reexec.patch | 28 +++++++++++++++++++ pkgs/build-support/teleport/default.nix | 15 +++++++--- pkgs/by-name/te/teleport_18/package.nix | 10 +++---- 3 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 pkgs/build-support/teleport/0001-fix-add-nix-path-to-exec-env-reexec.patch diff --git a/pkgs/build-support/teleport/0001-fix-add-nix-path-to-exec-env-reexec.patch b/pkgs/build-support/teleport/0001-fix-add-nix-path-to-exec-env-reexec.patch new file mode 100644 index 000000000000..2ab25db3784a --- /dev/null +++ b/pkgs/build-support/teleport/0001-fix-add-nix-path-to-exec-env-reexec.patch @@ -0,0 +1,28 @@ +From e3651ca79c0edb66c04e0d3381f3b0b6f76d37d2 Mon Sep 17 00:00:00 2001 +From: 5aaee9 +Date: Thu, 24 Mar 2022 17:34:38 +0800 +Subject: [PATCH] fix: add nix path to exec env +# Adapted to new path starting from 18.8 + +--- + session/reexec/exec.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/session/reexec/exec.go b/session/reexec/exec.go +index 253fbafef..815a2e1e0 100644 +--- a/session/reexec/exec.go ++++ b/session/reexec/exec.go +@@ -30,8 +30,8 @@ import ( + ) + + const ( +- defaultPath = "/bin:/usr/bin:/usr/local/bin:/sbin" ++ defaultPath = "/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/bin:/usr/bin:/usr/local/bin:/sbin" + defaultEnvPath = "PATH=" + defaultPath +- defaultRootPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ++ defaultRootPath = "/run/wrappers/bin:/etc/profiles/per-user/root/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + defaultEnvRootPath = "PATH=" + defaultRootPath + defaultLoginDefsPath = "/etc/login.defs" +-- +2.32.0 (Apple Git-132) + diff --git a/pkgs/build-support/teleport/default.nix b/pkgs/build-support/teleport/default.nix index 025c4a149bdd..d696a6243627 100644 --- a/pkgs/build-support/teleport/default.nix +++ b/pkgs/build-support/teleport/default.nix @@ -157,10 +157,17 @@ buildGoModule (finalAttrs: { pkg-config ]; - patches = extPatches ++ [ - ./0001-fix-add-nix-path-to-exec-env.patch - ./rdpclient.patch - ]; + patches = + extPatches + ++ [ + ./rdpclient.patch + ] + ++ lib.optional (lib.versionOlder version "18.8.0") [ + ./0001-fix-add-nix-path-to-exec-env.patch + ] + ++ lib.optional (lib.versionAtLeast version "18.8.0") [ + ./0001-fix-add-nix-path-to-exec-env-reexec.patch + ]; # Reduce closure size for client machines outputs = [ diff --git a/pkgs/by-name/te/teleport_18/package.nix b/pkgs/by-name/te/teleport_18/package.nix index d93d3874fe32..71fb509ee77e 100644 --- a/pkgs/by-name/te/teleport_18/package.nix +++ b/pkgs/by-name/te/teleport_18/package.nix @@ -7,11 +7,11 @@ }: buildTeleport { - version = "18.7.6"; - hash = "sha256-p7qwsUr6n6OAl/b20SgropAubfPfwBiVTvbReb2HpO8="; - vendorHash = "sha256-/ZY0J0yB/8qMG6vEIta7Nf2Uv3xTZ/WPoMz+Dj5hwZA="; - pnpmHash = "sha256-uRsS5m0Q4fAFvJ3Qp6xcEAB8QFriLXbeGtD0o0n46RE="; - cargoHash = "sha256-KkFwMSBXsRmDuaPU1n6FPq2P5UQiQnb7+HEDOhhmjd0="; + version = "18.8.3"; + hash = "sha256-DHPOWIvzBCOT3GU0YHBtG46ctB0Nh8XwSmpl9vgCET8="; + vendorHash = "sha256-0+fIoprAQyoom9xBpXGiEgmE4dWktcqlZQOzkRXYlKo="; + pnpmHash = "sha256-8FlC9Sm12A5kfS9X0qYDNJOePZjeJU7LDTRlWUIEneA="; + cargoHash = "sha256-IX0HCeCosXCe/oTYa8PImemf9op2AeagSnl44uBnSbM="; wasm-bindgen-cli = wasm-bindgen-cli_0_2_99; buildGoModule = buildGo125Module;