diff --git a/pkgs/by-name/co/codex/package.nix b/pkgs/by-name/co/codex/package.nix index 56ebb1faba9f..13a1a98bf7a9 100644 --- a/pkgs/by-name/co/codex/package.nix +++ b/pkgs/by-name/co/codex/package.nix @@ -15,6 +15,7 @@ inherit (callPackage ./fetchers.nix { }) fetchLibrustyV8; }, livekit-libwebrtc, + lld, makeBinaryWrapper, nix-update-script, pkg-config, @@ -25,18 +26,18 @@ }: rustPlatform.buildRustPackage (finalAttrs: { pname = "codex"; - version = "0.137.0"; + version = "0.139.0"; src = fetchFromGitHub { owner = "openai"; repo = "codex"; tag = "rust-v${finalAttrs.version}"; - hash = "sha256-puszZqi1lZeq8iXWAD9U9+WMnNvzMYKf6wVT9mtjSUU="; + hash = "sha256-XjzlkBUkBey+P3tFLDYB3ae5oseUfW5tmzhLzqlqj2E="; }; sourceRoot = "${finalAttrs.src.name}/codex-rs"; - cargoHash = "sha256-SX5LMO+IWismbH61Jd0g1mgykfav8DrqG+wjyNCWyCo="; + cargoHash = "sha256-8mN4OTRJvt2mBYHQXZS55PSOChLqEIiXwPu2y+2MZ9o="; __structuredAttrs = true; @@ -58,7 +59,7 @@ rustPlatform.buildRustPackage (finalAttrs: { substituteInPlace $cargoDepsCopy/*/webrtc-sys-*/build.rs \ --replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=dylib=webrtc" substituteInPlace Cargo.toml \ - --replace-fail 'lto = "fat"' "" \ + --replace-fail 'lto = "thin"' "" \ --replace-fail 'codegen-units = 1' "" ''; @@ -95,6 +96,11 @@ rustPlatform.buildRustPackage (finalAttrs: { ] ); RUSTY_V8_ARCHIVE = librusty_v8; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # Link with lld on Darwin. nixpkgs' classic open-source ld64 fails to insert + # ARM64 branch thunks for this binary, producing `b(l) ARM64 branch out of range`. + NIX_CFLAGS_LINK = "-fuse-ld=${lib.getExe' lld "ld64.lld"}"; }; # NOTE: part of the test suite requires access to networking, local shells,