summaryrefslogtreecommitdiff
path: root/gnu/packages/rust-apps.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/rust-apps.scm')
-rw-r--r--gnu/packages/rust-apps.scm365
1 files changed, 0 insertions, 365 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 8c05d01ffab..b165539848c 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -125,7 +125,6 @@
125 #:use-module (gnu packages python-xyz) 125 #:use-module (gnu packages python-xyz)
126 #:use-module (gnu packages ruby-xyz) 126 #:use-module (gnu packages ruby-xyz)
127 #:use-module (gnu packages rust) 127 #:use-module (gnu packages rust)
128 #:use-module (gnu packages rust-sources)
129 #:use-module (gnu packages security-token) 128 #:use-module (gnu packages security-token)
130 #:use-module (gnu packages sqlite) 129 #:use-module (gnu packages sqlite)
131 #:use-module (gnu packages terminals) 130 #:use-module (gnu packages terminals)
@@ -837,370 +836,6 @@ Commit and SemVer specifications.")
837 "This package provides CLI Tool for codeberg similar to gh and glab.") 836 "This package provides CLI Tool for codeberg similar to gh and glab.")
838 (license license:agpl3+))) 837 (license license:agpl3+)))
839 838
840(define-public codex
841 (package
842 (name "codex")
843 (version (package-version rust-codex-0.98.0))
844 (source
845 (origin
846 (inherit (package-source rust-codex-0.98.0))
847 (patches (search-patches
848 "codex-0.98.0-remove-patch-sections.patch"
849 "rust-codex-0.98.0-test-shebangs.patch"
850 "rust-codex-0.98.0-test-timeout.patch"))))
851 (build-system cargo-build-system)
852 (arguments
853 (list
854 #:install-source? #f
855 #:cargo-install-paths '(list "cli" "exec" "exec-server"
856 "linux-sandbox" "mcp-server" "network-proxy"
857 "app-server" "tui")
858 ;; schema_fixtures_match_generated (upstream fixture is stale:
859 ;; FileChange::Update in codex-protocol gained old_content,
860 ;; new_content, move_path fields but the committed JSON schema
861 ;; fixture was not regenerated).
862 #:cargo-test-flags '(list "--workspace"
863 "--exclude" "codex-app-server-protocol"
864 "--"
865 ;; These tests exercise sandbox denial and
866 ;; escalation, which requires Landlock to
867 ;; cleanly deny filesystem access. Inside the
868 ;; build container Landlock returns NotEnforced
869 ;; and the sandbox binary panics instead.
870 ;; Disabling Landlock would not help either,
871 ;; since these tests need a working sandbox to
872 ;; have anything to deny and escalate.
873 "--skip" "sandbox_denied_shell_returns_original_output"
874 "--skip" "shell_escalated_permissions_rejected_then_ok"
875 "--skip" "unified_exec_runs_under_sandbox"
876 ;; These tests (in codex-exec) directly call
877 ;; spawn_command_under_linux_sandbox to verify
878 ;; that python and bash work correctly inside
879 ;; the Landlock sandbox. The sandbox binary
880 ;; (codex-exec) panics with LandlockRestrict
881 ;; (exit code 101) before the inner command
882 ;; even starts.
883 "--skip" "python_getpwuid_works_under_sandbox"
884 "--skip" "python_multiprocessing_lock_works_under_sandbox"
885 "--skip" "sandbox_distinguishes_command_and_policy_cwds"
886 ;; These linux-sandbox tests directly invoke
887 ;; the Landlock sandbox via
888 ;; process_exec_tool_call; same root cause.
889 "--skip" "test_writable_root"
890 "--skip" "test_timeout"
891 "--skip" "test_root_read"
892 "--skip" "test_dev_null_write"
893 "--skip" "test_no_new_privs_is_enabled"
894 ;; This test iterates many approval scenarios;
895 ;; one of them
896 ;; (danger_full_access_on_request_allows_network)
897 ;; runs a command through the Landlock sandbox
898 ;; binary, which panics with LandlockRestrict
899 ;; inside the build container. Cargo --skip
900 ;; cannot target individual scenarios, so we
901 ;; skip the entire matrix.
902 "--skip" "approval_matrix_covers_all_modes"
903 ;; This test verifies session-level patch
904 ;; approval caching: approve once, skip
905 ;; future prompts for the same file. When
906 ;; Landlock is unavailable (as in the Guix
907 ;; build container) the sandbox binary panics,
908 ;; triggering the escalation-retry path, which
909 ;; interferes with the approval cache and
910 ;; causes a spurious re-prompt on the second
911 ;; patch.
912 "--skip" "approving_apply_patch_for_session_skips_future_prompts_for_same_file"
913 ;; These tests expect to interrupt a
914 ;; long-running 'sleep 60' and receive
915 ;; TurnAborted. Default test config is
916 ;; OnRequest + ReadOnly. What happens:
917 ;;
918 ;; 1. ReadOnly wraps the command with
919 ;; codex-linux-sandbox (Landlock-based).
920 ;; 2. Landlock is unavailable in the Guix
921 ;; build container, so the sandbox
922 ;; binary exits instantly (~1 ms).
923 ;; 3. Orchestrator gets SandboxErr::Denied.
924 ;; wants_no_sandbox_approval(OnRequest)
925 ;; returns false (sandboxing.rs:222),
926 ;; so no escalation -- denial returned
927 ;; directly.
928 ;; 4. ToolEmitter::finish sends the error
929 ;; to the mock model as
930 ;; function_call_output.
931 ;; 5. Second mock SSE response fires,
932 ;; turn finishes with TurnComplete.
933 ;; 6. Op::Interrupt arrives 100 ms later,
934 ;; but the turn is already done --
935 ;; TurnAborted is never emitted,
936 ;; test times out.
937 ;;
938 ;; The similar interrupt_long_running_tool_
939 ;; emits_turn_aborted passes because it
940 ;; sends the interrupt with no delay and
941 ;; has only one mock response (so the turn
942 ;; cannot complete first).
943 "--skip" "interrupt_persists_turn_aborted_marker_in_next_request"
944 "--skip" "interrupt_tool_records_history_entries"
945 ;; Upstream bug: test hardcodes "0.0.0" in the
946 ;; expected user-agent string but the workspace
947 ;; version is "0.98.0".
948 "--skip" "get_user_agent_returns_current_codex_user_agent"
949 ;; Same upstream bug: mcp-server tests
950 ;; check the initialize response which
951 ;; includes "version": "0.0.0" but the
952 ;; server returns "0.98.0".
953 "--skip" "test_codex_tool_passes_base_instructions"
954 "--skip" "test_shell_command_approval_triggers_elicitation"
955 "--skip" "test_patch_approval_triggers_elicitation"
956 ;; These codex-exec-server tests need
957 ;; "dotslash", a Meta tool that lazily
958 ;; downloads pre-built binaries from a
959 ;; JSON manifest. The test helper
960 ;; create_transport runs
961 ;; `dotslash -- fetch <path>` to obtain a
962 ;; custom bash binary described in
963 ;; exec-server/tests/suite/bash.
964 ;; dotslash is not available in the build
965 ;; container.
966 "--skip" "list_tools"
967 "--skip" "accept_elicitation_for_prompt_rule"
968 ;;; Test isolation bug: each test in
969 ;;; state/src/runtime.rs calls
970 ;;; unique_temp_dir() to get its own
971 ;;; temporary directory (and thus its
972 ;;; own SQLite database). That function
973 ;;; names directories using the current
974 ;;; nanosecond timestamp, so when tests
975 ;;; run in parallel several can receive
976 ;;; the same name and open the same
977 ;;; database. The initial SQLite
978 ;;; migration runs CREATE TABLE threads
979 ;;; (without IF NOT EXISTS), so any init
980 ;;; after the first panics with "table
981 ;;; threads already exists". Any of
982 ;;; these tests
983 ;;; can be the victim.
984 "--skip" "init_removes_legacy_state_db_files"
985 "--skip" "upsert_and_get_thread_memory"
986 "--skip" "get_last_n_thread_memories_for_cwd_matches_exactly"
987 "--skip" "upsert_thread_memory_errors_for_unknown_thread"
988 "--skip" "get_last_n_thread_memories_for_cwd_zero_returns_empty"
989 "--skip" "get_last_n_thread_memories_for_cwd_does_not_prefix_match"
990 "--skip" "deleting_thread_cascades_thread_memory")
991 #:cargo-package-crates
992 ''(;;; Tier 0: No internal deps.
993 "codex-async-utils"
994 "codex-client"
995 "codex-execpolicy"
996 "codex-file-search"
997 "codex-git"
998 "codex-keyring-store"
999 "codex-utils-absolute-path"
1000 "codex-utils-cache"
1001 "codex-utils-cargo-bin"
1002 "codex-utils-home-dir"
1003 "codex-utils-json-to-toml"
1004 "codex-utils-pty"
1005 "codex-utils-readiness"
1006 "codex-utils-string"
1007 "codex-backend-openapi-models"
1008 "codex-process-hardening"
1009 "codex-ansi-escape"
1010 ;;; Tier 1: Depends on tier 0.
1011 "codex-utils-image"
1012 "codex-apply-patch"
1013 "codex-protocol"
1014 "codex-windows-sandbox"
1015 "codex-api"
1016 "codex-experimental-api-macros"
1017 "codex-secrets"
1018 "codex-execpolicy-legacy"
1019 "codex-debug-client"
1020 ;;; Tier 2.
1021 "codex-app-server-protocol"
1022 "codex-rmcp-client"
1023 "codex-otel"
1024 "codex-state"
1025 "codex-core"
1026 "codex-linux-sandbox"
1027 "codex-feedback"
1028 ;;; Tier 3.
1029 "codex-arg0"
1030 "codex-lmstudio"
1031 "codex-login"
1032 "codex-ollama"
1033 "codex-common"
1034 "codex-mcp-server"
1035 "codex-backend-client"
1036 "codex-responses-api-proxy"
1037 ;;; Tier 4.
1038 "codex-cloud-requirements"
1039 "codex-exec"
1040 "codex-exec-server"
1041 "codex-stdio-to-uds"
1042 "codex-network-proxy"
1043 "codex-chatgpt"
1044 "codex-cloud-tasks-client"
1045 ;;; Tier 5.
1046 "codex-app-server"
1047 "codex-app-server-test-client"
1048 "codex-tui"
1049 ;;; Tier 6.
1050 "codex-cloud-tasks"
1051 ;; The main executable.
1052 "codex-cli")
1053 #:phases
1054 #~(modify-phases %standard-phases
1055 (add-after 'unpack 'chdir-to-workspace
1056 (lambda _
1057 (chdir "codex-rs")))
1058 (add-after 'chdir-to-workspace 'update-version-in-snapshots
1059 (lambda _
1060 ;; Snapshot test files contain hardcoded v0.0.0 version strings.
1061 ;; Update them to match the actual package version.
1062 (let ((snap-files (find-files "." "\\.snap$")))
1063 (substitute* snap-files
1064 (("\\(v0\\.0\\.0\\) ") "(v0.98.0)")))))
1065 (add-after 'chdir-to-workspace 'patch-git-deps-to-vendor
1066 (lambda _
1067 ;; Replace git dependencies with version references so cargo
1068 ;; resolves them from the vendored sources.
1069 (substitute* "Cargo.toml"
1070 (("nucleo = \\{ git = [^}]+\\}")
1071 "nucleo = \"0.5.0\"")
1072 (("runfiles = \\{ git = [^}]+\\}")
1073 "runfiles = \"0.1.0\""))))
1074 (add-after 'chdir-to-workspace 'add-version-to-workspace-deps
1075 (lambda _
1076 ;; cargo package requires all dependencies to have versions.
1077 ;; cargo package requires all dependencies to have versions.
1078 ;; Add version = "0.98.0" to internal path dependencies.
1079 (let ((cargo-files (find-files "." "^Cargo\\.toml$")))
1080 (substitute* cargo-files
1081 ;; Handle inline deps: name = { path = "..." }
1082 (("(codex-[a-z0-9-]+) = \\{ path = " all name)
1083 (string-append name " = { version = \"0.98.0\", path = "))
1084 ;; Handle inline deps with package: name = { package = "...", path = "..." }
1085 (("(codex-[a-z0-9-]+) = \\{ package = " all name)
1086 (string-append name " = { version = \"0.98.0\", package = "))
1087 ;; Handle section deps: [dependencies.X] with path = "..."
1088 (("^(path = \"\\.\\./[^\"]*\")" all path-line)
1089 (string-append path-line "\nversion = \"0.98.0\""))))))
1090 (add-after 'chdir-to-workspace 'patch-hardcoded-paths
1091 (lambda* (#:key inputs #:allow-other-keys)
1092 (let ((bash-bin (string-append
1093 (assoc-ref inputs "bash-minimal") "/bin"))
1094 (coreutils-bin (string-append
1095 (assoc-ref inputs "coreutils") "/bin"))
1096 (git-bin (string-append
1097 (assoc-ref inputs "git-minimal") "/bin"))
1098 (sed-bin (string-append
1099 (assoc-ref inputs "sed") "/bin"))
1100 ;; Include .policy files: the execpolicy-legacy
1101 ;; crate embeds default.policy via include_str!
1102 ;; at compile time, so its paths must also be
1103 ;; patched.
1104 (rs-files (find-files "." "\\.(rs|policy)$")))
1105 (substitute* rs-files
1106 (("\"/bin/bash\"")
1107 (string-append "\"" bash-bin "/bash\""))
1108 (("\"/bin/sh\"")
1109 (string-append "\"" bash-bin "/sh\""))
1110 (("\"/usr/bin/bash\"")
1111 (string-append "\"" bash-bin "/bash\""))
1112 (("\"/usr/bin/sh\"")
1113 (string-append "\"" bash-bin "/sh\""))
1114 ;;; bash/sh with inline arguments, e.g. "/bin/bash -i".
1115 (("\"/bin/bash ")
1116 (string-append "\"" bash-bin "/bash "))
1117 (("\"/bin/sh ")
1118 (string-append "\"" bash-bin "/sh "))
1119 ;; coreutils.
1120 (("\"/bin/(cat|cp|date|echo|head|ls|rm|sleep|true|touch)\"" all cmd)
1121 (string-append "\"" coreutils-bin "/" cmd "\""))
1122 ;; coreutils.
1123 (("\"/usr/bin/(cat|cp|head|ls|touch|true)\"" all cmd)
1124 (string-append "\"" coreutils-bin "/" cmd "\""))
1125 ;; coreutils with inline arguments
1126 ;; like "/bin/echo END-EVENT".
1127 (("\"/bin/(cat|cp|date|echo|head|ls|rm|sleep|true|touch) " all cmd)
1128 (string-append "\"" coreutils-bin "/" cmd " "))
1129 (("\"/usr/bin/git\"")
1130 (string-append "\"" git-bin "/git\""))
1131 (("\"/usr/bin/sed\"")
1132 (string-append "\"" sed-bin "/sed\"")))
1133 ;; @SHELL@ placeholder from test-shebangs patch
1134 (substitute*
1135 (list "rmcp-client/src/program_resolver.rs"
1136 "tui/src/external_editor.rs")
1137 (("@SHELL@")
1138 (string-append bash-bin "/sh")))
1139 ;; shebang in test-only file
1140 (substitute*
1141 "core/tests/suite/user_notification.rs"
1142 (("#!/bin/bash")
1143 (string-append "#!" bash-bin "/bash"))))))
1144 (add-before 'check 'set-home
1145 (lambda _
1146 (setenv "HOME" "/tmp")
1147 (setenv "USER" "nixbld"))))))
1148 (native-inputs (list clang ;bindgen uses libclang to parse BoringSSL's C headers
1149 cmake-minimal ;BoringSSL is compiled from C source
1150 libunwind ;BoringSSL tests verify stack unwinding in assembly
1151 perl python-minimal ;for tests
1152 pkg-config))
1153 (inputs (cons* bash-minimal coreutils git-minimal sed
1154 openssl sqlite `(,zstd "lib")
1155 (cargo-inputs 'codex)))
1156 (home-page "https://github.com/openai/codex")
1157 (synopsis "AI-assisted coding CLI and TUI")
1158 (description
1159 "Codex is an AI-powered coding assistant that runs in the terminal.
1160It provides an interactive TUI for conversations with AI models, with
1161support for shell command execution, file editing, and code generation.
1162Configure providers via @file{~/.codex/config.toml}.")
1163 (license license:asl2.0)))
1164
1165(define-public codex-acp
1166 (package
1167 (name "codex-acp")
1168 (version "0.9.2")
1169 (source
1170 (origin
1171 (method git-fetch)
1172 (uri (git-reference
1173 (url "https://github.com/zed-industries/codex-acp")
1174 (commit (string-append "v" version))))
1175 (file-name (git-file-name name version))
1176 (sha256
1177 (base32 "190sq6s6jfz8dkj1y8305r7x6ln86qqr2j1bnfjci7f1x2wyzmsj"))
1178 (patches (search-patches "codex-acp-0.9.2-remove-patch-sections.patch"
1179 "codex-acp-0.9.2-replace-result-flatten.patch"))))
1180 (build-system cargo-build-system)
1181 (arguments
1182 (list
1183 #:install-source? #f
1184 #:phases
1185 #~(modify-phases %standard-phases
1186 (add-after 'unpack 'patch-codex-deps
1187 (lambda _
1188 ;; Rewrite git dependencies to use vendored sources from rust-codex
1189 (substitute* "Cargo.toml"
1190 (("git = \"https://github.com/zed-industries/codex\", branch = \"acp\"")
1191 "version = \"0.0.0\"")))))))
1192 (native-inputs (list pkg-config))
1193 (inputs (cons* openssl sqlite `(,zstd "lib") (cargo-inputs 'codex-acp)))
1194 (home-page "https://github.com/zed-industries/codex-acp")
1195 (synopsis "ACP-compatible agent bridging Zed Codex with ACP clients")
1196 (description
1197 "This package provides an Agent Client Protocol (ACP) compatible agent
1198that bridges the Zed Codex runtime with ACP clients over stdio. It
1199supports multiple LLM providers through configuration in
1200@file{~/.codex/config.toml} and integrates with MCP servers for filesystem
1201operations.")
1202 (license license:asl2.0)))
1203
1204(define-public complgen 839(define-public complgen
1205 (package 840 (package
1206 (name "complgen") 841 (name "complgen")