From 3707ee77bca5f0abd78d7a90db485059c2b06e9c Mon Sep 17 00:00:00 2001 From: Jhony Elmer Angulo Fabian Date: Tue, 3 Feb 2026 17:26:15 -0500 Subject: [PATCH] codex: 0.92.0 -> 0.111.0 Add a vendoring workaround that deletes manifest files that would trip up fetchCargoVendor's logic --- pkgs/by-name/co/codex/package.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/co/codex/package.nix b/pkgs/by-name/co/codex/package.nix index 664191c0c1a7..9221d75f6a14 100644 --- a/pkgs/by-name/co/codex/package.nix +++ b/pkgs/by-name/co/codex/package.nix @@ -4,9 +4,11 @@ rustPlatform, fetchFromGitHub, installShellFiles, + cargo, clang, cmake, gitMinimal, + libcap, libclang, makeBinaryWrapper, nix-update-script, @@ -18,18 +20,30 @@ }: rustPlatform.buildRustPackage (finalAttrs: { pname = "codex"; - version = "0.92.0"; + version = "0.111.0"; src = fetchFromGitHub { owner = "openai"; repo = "codex"; tag = "rust-v${finalAttrs.version}"; - hash = "sha256-m/g+5wdehyaHDw6i5vik4HXiisY/iWFtPX0gKjCFPNY="; + hash = "sha256-hdR70BhiMg9G/ibLCeHnRSY3PcGZDv0vnqBCbzSRD6I="; }; sourceRoot = "${finalAttrs.src.name}/codex-rs"; - cargoHash = "sha256-fuT8vPb9/7fZam129nR6y+r+3j46WBhlf73Htkcjpzc="; + # TODO: Drop workaround once PR #486983 reaches master. + depsExtraArgs = { + nativeBuildInputs = [ cargo ]; + postBuild = '' + # delete all Cargo.toml files for which `cargo metadata` fails + shopt -s globstar + for manifest_path in "$out"/**/Cargo.toml; do + cargo metadata --format-version 1 --no-deps --manifest-path "$manifest_path" >/dev/null || rm -v "$manifest_path" + done + ''; + }; + + cargoHash = "sha256-Ym2fB9IWQzYdgOX3hiBd9XUI00xF4cIoKO2jpal4eUA="; nativeBuildInputs = [ clang @@ -43,6 +57,9 @@ rustPlatform.buildRustPackage (finalAttrs: { buildInputs = [ libclang openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap ]; # NOTE: set LIBCLANG_PATH so bindgen can locate libclang, and adjust