| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 |
|
| 27 | (define-module (gnu packages codex)
|
| 28 | #:use-module ((guix licenses) #:prefix license:)
|
| 29 | #:use-module (guix gexp)
|
| 30 | #:use-module (guix packages)
|
| 31 | #:use-module (guix download)
|
| 32 | #:use-module (guix git-download)
|
| 33 | #:use-module (guix search-paths)
|
| 34 | #:use-module (guix utils)
|
| 35 | #:use-module (guix build-system cargo)
|
| 36 | #:use-module (srfi srfi-1)
|
| 37 | #:use-module (gnu packages)
|
| 38 | #:use-module (gnu packages bash)
|
| 39 | #:use-module (gnu packages base)
|
| 40 | #:use-module (gnu packages cmake)
|
| 41 | #:use-module (gnu packages compression)
|
| 42 | #:use-module (gnu packages curl)
|
| 43 | #:use-module (gnu packages gdb)
|
| 44 | #:use-module (gnu packages linux)
|
| 45 | #:use-module (gnu packages libunwind)
|
| 46 | #:use-module (gnu packages llvm)
|
| 47 | #:use-module (gnu packages llvm-meta)
|
| 48 | #:use-module (gnu packages lsof)
|
| 49 | #:use-module (gnu packages perl)
|
| 50 | #:use-module (gnu packages pkg-config)
|
| 51 | #:use-module (gnu packages python)
|
| 52 | #:use-module (gnu packages regex)
|
| 53 | #:use-module (gnu packages rust)
|
| 54 | #:use-module (gnu packages rust-sources)
|
| 55 | #:use-module (gnu packages sqlite)
|
| 56 | #:use-module (gnu packages nss)
|
| 57 | #:use-module (gnu packages tls)
|
| 58 | #:use-module (gnu packages version-control)
|
| 59 | #:use-module (gnu packages virtualization))
|
| 60 |
|
| 61 | (define-public codex
|
| 62 | (package
|
| 63 | (name "codex")
|
| 64 | (version "0.144.1")
|
| 65 | (source
|
| 66 | (origin
|
| 67 | (method git-fetch)
|
| 68 | (uri (git-reference
|
| 69 | (url "https://github.com/openai/codex")
|
| 70 | (commit "44918ea10c0f99151c6710411b4322c2f5c96bea")))
|
| 71 | (file-name (git-file-name name version))
|
| 72 | (sha256
|
| 73 | (base32 "0icwnvss0zswsp0vz2cffzr4xq46zfv634cl9phn40kjhsl2ny18"))
|
| 74 | (modules '((guix build utils)))
|
| 75 | (snippet '(begin
|
| 76 | |
| 77 | |
| 78 | (delete-file-recursively "codex-rs/vendor/bubblewrap")))
|
| 79 | (patches (search-patches
|
| 80 | "codex-0.144.1-disable-code-mode.patch"
|
| 81 | "codex-0.144.1-remove-patch-sections.patch"
|
| 82 | "codex-0.144.1-remove-libwebrtc.patch"
|
| 83 | "codex-0.144.1-test-disable-network-model-refresh.patch"
|
| 84 | "codex-0.144.1-test-selected-capability-readiness.patch"
|
| 85 | "codex-0.144.1-test-shebangs.patch"
|
| 86 | "codex-0.144.1-test-timeout.patch"))))
|
| 87 | (build-system cargo-build-system)
|
| 88 | (arguments
|
| 89 | (list
|
| 90 | #:rust rust-1.94
|
| 91 | #:install-source? #f
|
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | #:cargo-install-paths '(list "cli" "exec"
|
| 98 | "linux-sandbox" "mcp-server"
|
| 99 | "app-server" "tui")
|
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | #:cargo-test-flags '(list "--workspace"
|
| 105 | "--exclude" "codex-app-server-protocol"
|
| 106 | "--exclude" "codex-code-mode"
|
| 107 | "--exclude" "codex-code-mode-host"
|
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | "--lib" "--bins" "--tests"
|
| 113 | |
| 114 | "--"
|
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | "--skip" "sandbox_denied_shell_returns_original_output"
|
| 121 | |
| 122 | "--skip" "shell_escalated_permissions_rejected_then_ok"
|
| 123 | |
| 124 | "--skip" "unified_exec_runs_under_sandbox"
|
| 125 | |
| 126 | |
| 127 | "--skip" "python_getpwuid_works_under_sandbox"
|
| 128 | |
| 129 | "--skip" "python_multiprocessing_lock_works_under_sandbox"
|
| 130 | |
| 131 | "--skip" "sandbox_distinguishes_command_and_policy_cwds"
|
| 132 | |
| 133 | |
| 134 | "--skip" "test_writable_root"
|
| 135 | |
| 136 | "--skip" "test_timeout"
|
| 137 | |
| 138 | "--skip" "test_root_read"
|
| 139 | |
| 140 | "--skip" "test_dev_null_write"
|
| 141 | |
| 142 | "--skip" "test_no_new_privs_is_enabled"
|
| 143 | |
| 144 | |
| 145 | |
| 146 | "--skip" "approval_matrix_covers_all_modes"
|
| 147 | |
| 148 | |
| 149 | "--skip" "approving_apply_patch_for_session_skips_future_prompts_for_same_file"
|
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | "--skip" "interrupt_persists_turn_aborted_marker_in_next_request"
|
| 177 | |
| 178 | "--skip" "interrupt_tool_records_history_entries"
|
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | "--skip" "request_permissions_grants_apply_to_later_exec_command_calls"
|
| 184 | |
| 185 | "--skip" "request_permissions_grants_apply_to_later_shell_command_calls"
|
| 186 | |
| 187 | "--skip" "partial_request_permissions_grants_do_not_preapprove_new_permissions"
|
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | "--skip" "test_codex_tool_passes_base_instructions"
|
| 193 | "--skip" "test_shell_command_approval_triggers_elicitation"
|
| 194 | "--skip" "test_patch_approval_triggers_elicitation"
|
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | "--skip" "init_removes_legacy_state_db_files"
|
| 206 | "--skip" "upsert_and_get_thread_memory"
|
| 207 | "--skip" "get_last_n_thread_memories_for_cwd_matches_exactly"
|
| 208 | "--skip" "upsert_thread_memory_errors_for_unknown_thread"
|
| 209 | "--skip" "get_last_n_thread_memories_for_cwd_zero_returns_empty"
|
| 210 | "--skip" "get_last_n_thread_memories_for_cwd_does_not_prefix_match"
|
| 211 | "--skip" "deleting_thread_cascades_thread_memory"
|
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | "--skip" "redetects_sessions_when_source_contents_change_after_import"
|
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | "--skip" "cancellation_expiration_keeps_process_alive_until_terminated"
|
| 230 | "--skip" "timeout_or_cancellation_reports_cancellation_without_timeout_exit_code"
|
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | "--skip" "exec_process_signal_interrupts_process"
|
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | "--skip" "managed_network_proxy_decider_survives_full_access_start"
|
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | "--skip" "bash_snapshot_filters_invalid_exports"
|
| 252 | |
| 253 | "--skip" "bash_snapshot_preserves_multiline_exports"
|
| 254 | |
| 255 | "--skip" "linux_bash_snapshot_includes_sections"
|
| 256 | |
| 257 | |
| 258 | |
| 259 | "--skip" "unified_exec_env_injects_defaults"
|
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | "--skip" "missing_process_host_falls_back_to_in_process_session"
|
| 265 | |
| 266 | |
| 267 | "--skip" "missing_code_mode_wait_traces_only_the_wait_tool_call"
|
| 268 | "--skip" "suite::code_mode::"
|
| 269 | "--skip" "suite::code_mode_elicitation::"
|
| 270 | "--skip" "suite::v2::imagegen_extension::standalone_image_generation_is_callable_from_code_mode_only"
|
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | "--skip" "linux_shell_command_uses_shell_snapshot"
|
| 283 | "--skip" "linux_unified_exec_uses_shell_snapshot"
|
| 284 | "--skip" "shell_command_snapshot_still_intercepts_apply_patch"
|
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | "--skip" "sandbox_reenables_writable_subpaths_under_unreadable_parents"
|
| 297 | "--skip" "managed_proxy_mode_routes_through_bridge_and_blocks_direct_egress"
|
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | "--skip" "unified_exec_terminal_interaction_captures_delayed_output"
|
| 303 | |
| 304 | |
| 305 | |
| 306 | "--skip" "read_file_tools_run_in_parallel"
|
| 307 | |
| 308 | "--skip" "shell_tools_run_in_parallel"
|
| 309 | |
| 310 | "--skip" "mixed_parallel_tools_run_in_parallel"
|
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | "--skip" "remote_models_request_times_out_after_5s"
|
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | "--skip" "builder_interposes_fixed_delay_for_auto_env"
|
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | "--skip" "queued_inter_agent_mail_triggers_follow_up_after_commentary_message_item"
|
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | "--skip" "queued_inter_agent_mail_triggers_follow_up_after_reasoning_item"
|
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | "--skip" "process_start_propagates_caller_trace_context_across_background_task"
|
| 347 | "--skip" "rpc_client_propagates_current_trace_context"
|
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | "--skip" "host_blocked_requires_allowlist_match"
|
| 358 | "--skip" "add_allowed_domain_removes_matching_deny_entry"
|
| 359 | "--skip" "host_blocked_subdomain_wildcards_exclude_apex"
|
| 360 | "--skip" "host_blocked_global_wildcard_allowlist_allows_public_hosts_except_denylist"
|
| 361 | "--skip" "evaluate_host_policy_emits_domain_event_for_decider_ask"
|
| 362 | "--skip" "evaluate_host_policy_emits_domain_event_for_decider_allow_override"
|
| 363 | "--skip" "http_connect_accept_blocks_in_limited_mode"
|
| 364 | "--skip" "http_connect_accept_allows_allowlisted_host_in_full_mode"
|
| 365 | "--skip" "mitm_policy_blocks_disallowed_method_and_records_telemetry"
|
| 366 | "--skip" "http_connect_accept_blocks_hooked_host_in_full_mode_without_mitm_state"
|
| 367 | "--skip" "http_connect_accept_defers_brokered_host_mitm_until_protocol_detection"
|
| 368 | "--skip" "http_connect_accept_passes_environment_id_to_decider"
|
| 369 | "--skip" "mitm_policy_allows_matching_hooked_write_in_full_mode"
|
| 370 | "--skip" "mitm_policy_blocks_hook_miss_for_hooked_host_and_records_telemetry_in_full_mode"
|
| 371 | "--skip" "mitm_policy_blocks_matching_hooked_write_in_limited_mode"
|
| 372 | "--skip" "evaluate_host_policy_emits_execution_id_for_baseline_allow"
|
| 373 | "--skip" "handle_socks5_tcp_blocks_hooked_non_https_host_in_full_mode"
|
| 374 | "--skip" "handle_socks5_tcp_blocks_limited_mode_without_mitm_state"
|
| 375 | "--skip" "handle_socks5_tcp_detects_tls_for_brokered_nonstandard_port_in_full_mode"
|
| 376 | "--skip" "handle_socks5_tcp_uses_mitm_for_hooked_host_in_full_mode"
|
| 377 | "--skip" "handle_socks5_tcp_uses_mitm_in_limited_mode"
|
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | "--skip" "public_connector_uses_factory_and_exposes_stream_and_sink"
|
| 386 | "--skip" "direct_route_connects_secure_websocket"
|
| 387 | "--skip" "http_proxy_tunnels_secure_websocket_before_handshake"
|
| 388 | "--skip" "https_proxy_tunnels_secure_websocket_before_handshake"
|
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | "--skip" "approve_mode_blocks_when_arc_returns_interrupt_for_model"
|
| 400 | "--skip" "approve_mode_blocks_when_arc_returns_interrupt_without_annotations"
|
| 401 | |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 | "--skip" "approve_mode_blocks_when_arc_returns_interrupt_for_model"
|
| 410 | "--skip" "approve_mode_blocks_when_arc_returns_interrupt_without_annotations"
|
| 411 | |
| 412 | |
| 413 | |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | "--skip" "remote_exec_process_reports_transport_disconnect"
|
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | "--skip" "mcp_server_status_list_tools_and_auth_only_skips_slow_inventory_calls"
|
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | "--skip" "turn_start_jsonrpc_span_parents_core_turn_spans"
|
| 447 | |
| 448 | |
| 449 | |
| 450 | |
| 451 | |
| 452 | |
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | |
| 463 | |
| 464 | "--skip" "test_precedence_fixture_with_gpt3_profile"
|
| 465 | "--skip" "test_precedence_fixture_with_gpt5_profile"
|
| 466 | "--skip" "test_precedence_fixture_with_o3_profile"
|
| 467 | "--skip" "test_precedence_fixture_with_zdr_profile"
|
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | "--skip" "user_shell_command_does_not_set_network_sandbox_env_var"
|
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | "--skip" "file_system_copy_preserves_symlink_source"
|
| 495 | "--skip" "file_system_copy_rejects_symlink_escape_destination"
|
| 496 | "--skip" "file_system_copy_rejects_symlink_escape_source"
|
| 497 | "--skip" "file_system_create_directory_rejects_symlink_escape"
|
| 498 | "--skip" "file_system_read_directory_rejects_symlink_escape"
|
| 499 | "--skip" "file_system_remove_rejects_symlink_escape"
|
| 500 | "--skip" "file_system_remove_removes_symlink_not_target"
|
| 501 | "--skip" "file_system_sandboxed_read_allows_readable_root"
|
| 502 | "--skip" "file_system_sandboxed_read_rejects_symlink_escape"
|
| 503 | "--skip" "file_system_sandboxed_read_rejects_symlink_parent_dotdot_escape"
|
| 504 | "--skip" "file_system_sandboxed_write_allows_additional_write_root"
|
| 505 | "--skip" "file_system_sandboxed_write_rejects_symlink_escape"
|
| 506 | "--skip" "file_system_sandboxed_write_rejects_unwritable_path"
|
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | "--skip" "sandbox_blocks_nc"
|
| 520 | "--skip" "sandbox_blocks_ping"
|
| 521 | "--skip" "sandbox_blocks_dev_tcp_redirection"
|
| 522 | "--skip" "sandbox_blocks_getent"
|
| 523 | "--skip" "sandbox_blocks_ssh"
|
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | "--skip" "import_plugins_infers_external_official_marketplace_when_missing_from_settings"
|
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | |
| 561 | |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | |
| 567 | |
| 568 | |
| 569 | |
| 570 | "--skip" "update_memory_settings_updates_current_thread_memory_mode"
|
| 571 | |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | |
| 577 | |
| 578 | |
| 579 | |
| 580 | |
| 581 | |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | "--skip" "cancellation_receiver_fires_after_limit"
|
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | |
| 604 | |
| 605 | |
| 606 | |
| 607 | |
| 608 | |
| 609 | "--skip" "remote_control_waits_for_account_id_before_enrolling"
|
| 610 | |
| 611 | |
| 612 | |
| 613 | |
| 614 | |
| 615 | |
| 616 | |
| 617 | |
| 618 | |
| 619 | |
| 620 | |
| 621 | |
| 622 | |
| 623 | |
| 624 | |
| 625 | |
| 626 | |
| 627 | |
| 628 | |
| 629 | |
| 630 | |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | |
| 636 | |
| 637 | |
| 638 | |
| 639 | |
| 640 | |
| 641 | |
| 642 | |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | "--skip" "request_timeout_before_response_headers_is_transient"
|
| 648 | "--skip" "response_body_timeout_is_transient"
|
| 649 | |
| 650 | |
| 651 | |
| 652 | |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | |
| 660 | |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | |
| 667 | |
| 668 | "--skip" "thread_name_updated_broadcasts_for_loaded_threads"
|
| 669 | |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | |
| 675 | |
| 676 | |
| 677 | |
| 678 | |
| 679 | |
| 680 | |
| 681 | |
| 682 | |
| 683 | |
| 684 | |
| 685 | |
| 686 | |
| 687 | |
| 688 | |
| 689 | |
| 690 | |
| 691 | "--skip" "list_apps_emits_updates_and_returns_after_both_lists_load"
|
| 692 | "--skip" "list_apps_force_refetch_patches_updates_from_cached_snapshots"
|
| 693 | |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | "--skip" "turn_interrupt_aborts_running_turn"
|
| 699 | "--skip" "sandbox_with_network_proxy_blocks_direct_loopback_access"
|
| 700 | "--skip" "zsh_fork_inner_allowed_script_inherits_active_permission_profile"
|
| 701 | "--skip" "permission_request_hook_allows_network_approval_without_prompt"
|
| 702 | "--skip" "guardian_receives_exact_triggers_for_concurrent_network_requests"
|
| 703 | "--skip" "guardian_receives_exact_trigger_for_single_network_request"
|
| 704 | "--skip" "approved_network_host_for_one_environment_still_prompts_in_another"
|
| 705 | "--skip" "unified_exec_network_denial_emits_failed_background_end_event"
|
| 706 | "--skip" "unified_exec_short_lived_network_denial_emits_failed_end_event"
|
| 707 | |
| 708 | )
|
| 709 | #:phases
|
| 710 | #~(modify-phases %standard-phases
|
| 711 | (add-after 'unpack 'chdir-to-workspace
|
| 712 | (lambda _
|
| 713 | (chdir "codex-rs")))
|
| 714 | (add-after 'chdir-to-workspace 'update-version-in-snapshots
|
| 715 | (lambda _
|
| 716 | |
| 717 | |
| 718 | (let ((snap-files (find-files "." "\\.snap$")))
|
| 719 | (substitute* snap-files
|
| 720 | (("\\(v0\\.0\\.0\\) ") "(v0.144.1) ")
|
| 721 | (("Update available! 0\\.0\\.0 -> 9\\.9\\.9 ")
|
| 722 | "Update available! 0.144.1 -> 9.9.9")
|
| 723 | (("Update available! 0\\.0\\.0 -> 9\\.9\\.9")
|
| 724 | "Update available! 0.144.1 -> 9.9.9")))))
|
| 725 | (add-after 'chdir-to-workspace 'patch-git-deps-to-vendor
|
| 726 | (lambda _
|
| 727 | |
| 728 | |
| 729 | (substitute* "Cargo.toml"
|
| 730 | (("crossterm = \\{ git = [^}]+\\}")
|
| 731 | "crossterm = { version = \"0.28.1\" }")
|
| 732 | (("ratatui = \\{ git = [^}]+\\}")
|
| 733 | "ratatui = { version = \"0.29.0\" }")
|
| 734 | (("tokio-tungstenite = \\{ git = [^}]+\\}")
|
| 735 | "tokio-tungstenite = { version = \"0.28.0\" }")
|
| 736 | (("tungstenite = \\{ git = [^}]+\\}")
|
| 737 | "tungstenite = { version = \"0.27.0\" }")
|
| 738 | (("nucleo = \\{ git = [^}]+\\}")
|
| 739 | "nucleo = { version = \"0.5.0\" }")
|
| 740 | (("runfiles = \\{ git = [^}]+\\}")
|
| 741 | "runfiles = { version = \"0.1.0\" }"))
|
| 742 | |
| 743 | |
| 744 | |
| 745 | |
| 746 | |
| 747 | (substitute* "Cargo.toml"
|
| 748 | (("\"v8-poc\",") ""))
|
| 749 | |
| 750 | |
| 751 | |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | (substitute* "Cargo.toml"
|
| 757 | (("codex-code-mode = \\{ path = \"code-mode\" \\}")
|
| 758 | "codex-code-mode = { path = \"code-mode\", default-features = false }"))))
|
| 759 | (add-after 'patch-git-deps-to-vendor 'add-version-to-workspace-deps
|
| 760 | (lambda _
|
| 761 | |
| 762 | |
| 763 | (let ((cargo-files (find-files "." "^Cargo\\.toml$")))
|
| 764 | (substitute* cargo-files
|
| 765 | |
| 766 | (("(codex[_-][a-z0-9_-]+|app_test_support|core_test_support|mcp_test_support) = \\{ path = " all name)
|
| 767 | (string-append name " = { version = \"0.144.1\", path = "))
|
| 768 | |
| 769 | (("(codex[_-][a-z0-9_-]+|app_test_support|core_test_support|mcp_test_support) = \\{ package = " all name)
|
| 770 | (string-append name " = { version = \"0.144.1\", package = "))
|
| 771 | |
| 772 | (("^(path = \"\\.\\./[^\"]*\")" all path-line)
|
| 773 | (string-append path-line "\nversion = \"0.144.1\""))))))
|
| 774 | (add-after 'chdir-to-workspace 'use-gnu-store-in-sandbox
|
| 775 | (lambda _
|
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | (substitute* "linux-sandbox/src/bwrap.rs"
|
| 785 | (("\"/nix/store\"") "\"/gnu/store\""))))
|
| 786 | (add-after 'chdir-to-workspace 'patch-hardcoded-paths
|
| 787 | (lambda* (#:key inputs #:allow-other-keys)
|
| 788 | (let ((bash-bin (string-append
|
| 789 | (assoc-ref inputs "bash-minimal") "/bin"))
|
| 790 | (coreutils-bin (string-append
|
| 791 | (assoc-ref inputs "coreutils") "/bin"))
|
| 792 | (git-bin (string-append
|
| 793 | (assoc-ref inputs "git-minimal") "/bin"))
|
| 794 | (sed-bin (string-append
|
| 795 | (assoc-ref inputs "sed") "/bin"))
|
| 796 | |
| 797 | |
| 798 | |
| 799 | |
| 800 | (rs-files (find-files "." "\\.(rs|policy)$")))
|
| 801 | (substitute* rs-files
|
| 802 | (("\"/bin/bash\"")
|
| 803 | (string-append "\"" bash-bin "/bash\""))
|
| 804 | (("\"/bin/sh\"")
|
| 805 | (string-append "\"" bash-bin "/sh\""))
|
| 806 | (("\"/usr/bin/bash\"")
|
| 807 | (string-append "\"" bash-bin "/bash\""))
|
| 808 | (("\"/usr/bin/sh\"")
|
| 809 | (string-append "\"" bash-bin "/sh\""))
|
| 810 | |
| 811 | (("\"/bin/bash ")
|
| 812 | (string-append "\"" bash-bin "/bash "))
|
| 813 | (("\"/bin/sh ")
|
| 814 | (string-append "\"" bash-bin "/sh "))
|
| 815 | |
| 816 | |
| 817 | |
| 818 | |
| 819 | (("'/bin/bash'")
|
| 820 | (string-append "'" bash-bin "/bash'"))
|
| 821 | (("'/bin/sh'")
|
| 822 | (string-append "'" bash-bin "/sh'"))
|
| 823 | |
| 824 | (("\"/bin/(cat|cp|date|echo|head|ls|rm|sleep|true|touch)\"" all cmd)
|
| 825 | (string-append "\"" coreutils-bin "/" cmd "\""))
|
| 826 | |
| 827 | (("\"/usr/bin/(cat|cp|head|ls|touch|true)\"" all cmd)
|
| 828 | (string-append "\"" coreutils-bin "/" cmd "\""))
|
| 829 | |
| 830 | |
| 831 | (("\"/bin/(cat|cp|date|echo|head|ls|rm|sleep|true|touch) " all cmd)
|
| 832 | (string-append "\"" coreutils-bin "/" cmd " "))
|
| 833 | (("\"/usr/bin/git\"")
|
| 834 | (string-append "\"" git-bin "/git\""))
|
| 835 | (("\"/usr/bin/sed\"")
|
| 836 | (string-append "\"" sed-bin "/sed\"")))
|
| 837 | |
| 838 | |
| 839 | (substitute* (find-files "git-utils" "\\.rs$")
|
| 840 | (("Command::new\\(\"git\"\\)")
|
| 841 | (string-append "Command::new(\"" git-bin "/git\")")))
|
| 842 | (substitute* "tui/src/get_git_diff.rs"
|
| 843 | (("Command::new\\(\"git\"\\)")
|
| 844 | (string-append "Command::new(\"" git-bin "/git\")")))
|
| 845 | (substitute* "core/src/turn_diff_tracker.rs"
|
| 846 | (("Command::new\\(\"git\"\\)")
|
| 847 | (string-append "Command::new(\"" git-bin "/git\")")))
|
| 848 | (substitute* "cloud-tasks/src/env_detect.rs"
|
| 849 | (("Command::new\\(\"git\"\\)")
|
| 850 | (string-append "Command::new(\"" git-bin "/git\")")))
|
| 851 | (substitute* "core-plugins/src/startup_sync.rs"
|
| 852 | (("\"git\",")
|
| 853 | (string-append "\"" git-bin "/git\",")))
|
| 854 | (substitute* "file-search/src/lib.rs"
|
| 855 | (("Command::new\\(\"ls\"\\)")
|
| 856 | (string-append "Command::new(\"" coreutils-bin "/ls\")")))
|
| 857 | |
| 858 | (substitute* "core/src/unified_exec/process_manager.rs"
|
| 859 | (("\"PAGER\", \"cat\"")
|
| 860 | (string-append "\"PAGER\", \"" coreutils-bin "/cat\""))
|
| 861 | (("\"GIT_PAGER\", \"cat\"")
|
| 862 | (string-append "\"GIT_PAGER\", \"" coreutils-bin "/cat\""))
|
| 863 | (("\"GH_PAGER\", \"cat\"")
|
| 864 | (string-append "\"GH_PAGER\", \"" coreutils-bin "/cat\"")))
|
| 865 | |
| 866 | |
| 867 | |
| 868 | (substitute*
|
| 869 | "exec-server/tests/exec_process.rs"
|
| 870 | (("/bin/sleep")
|
| 871 | (string-append coreutils-bin "/sleep")))
|
| 872 | |
| 873 | |
| 874 | |
| 875 | (substitute*
|
| 876 | "exec-server/tests/relay.rs"
|
| 877 | (("\"true\"")
|
| 878 | (string-append "\"" coreutils-bin "/true\"")))
|
| 879 | |
| 880 | |
| 881 | |
| 882 | (substitute*
|
| 883 | "shell-escalation/src/unix/escalate_server.rs"
|
| 884 | (("/bin/sleep")
|
| 885 | (string-append coreutils-bin "/sleep")))
|
| 886 | |
| 887 | (substitute*
|
| 888 | (list "rmcp-client/src/program_resolver.rs"
|
| 889 | "tui/src/external_editor.rs")
|
| 890 | (("@SHELL@")
|
| 891 | (string-append bash-bin "/sh")))
|
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | (substitute*
|
| 898 | (list "cli/src/doctor.rs"
|
| 899 | "core-plugins/src/npm_source_tests.rs"
|
| 900 | "core-plugins/src/remote_bundle.rs"
|
| 901 | "core-plugins/src/startup_sync_tests.rs"
|
| 902 | "core/src/git_info_tests.rs"
|
| 903 | "core/src/tools/runtimes/shell/unix_escalation_tests.rs"
|
| 904 | "core/tests/suite/client.rs"
|
| 905 | "core/tests/suite/guardian_review.rs"
|
| 906 | "core/tests/suite/skill_approval.rs"
|
| 907 | "core/tests/suite/user_notification.rs"
|
| 908 | "exec-server/tests/file_system_unix.rs"
|
| 909 | "git-utils/src/baseline.rs"
|
| 910 | "git-utils/src/info.rs"
|
| 911 | "login/src/auth/auth_tests.rs"
|
| 912 | "models-manager/src/manager_tests.rs"
|
| 913 | "sandboxing/src/bwrap_tests.rs"
|
| 914 | "shell-command/src/command_safety/is_safe_command.rs"
|
| 915 | "tui/src/get_git_diff.rs")
|
| 916 | (("#!/bin/bash")
|
| 917 | (string-append "#!" bash-bin "/bash"))
|
| 918 | (("#!/bin/sh")
|
| 919 | (string-append "#!" bash-bin "/sh")))
|
| 920 | |
| 921 | |
| 922 | |
| 923 | |
| 924 | (substitute* (find-files "." "\\.rs$")
|
| 925 | (("env: Default::default\\(\\)")
|
| 926 | (string-append
|
| 927 | "env: std::env::var(\"PATH\")"
|
| 928 | ".into_iter()"
|
| 929 | ".map(|p| (\"PATH\".to_string(), p))"
|
| 930 | ".collect()")))
|
| 931 | |
| 932 | (substitute* "exec-server/tests/exec_process.rs"
|
| 933 | (("\"/usr/bin/python3\"")
|
| 934 | "\"python3\""))
|
| 935 | |
| 936 | |
| 937 | (substitute* "exec-server/tests/process.rs"
|
| 938 | (("\"env\": \\{\\}")
|
| 939 | (string-append
|
| 940 | "\"env\": {\"PATH\": \""
|
| 941 | (getenv "PATH")
|
| 942 | "\"}"))))))
|
| 943 | (add-before 'build 'set-bubblewrap-source
|
| 944 | (lambda* (#:key inputs #:allow-other-keys)
|
| 945 | (setenv "CODEX_BWRAP_SOURCE_DIR"
|
| 946 | (string-append
|
| 947 | (assoc-ref inputs "bubblewrap-source")
|
| 948 | "/"))))
|
| 949 | (add-before 'build 'create-node-version-file
|
| 950 | (lambda _
|
| 951 | (call-with-output-file "guix-vendor/node-version.txt"
|
| 952 | (lambda (port)
|
| 953 | (display "22.22.0" port)))))
|
| 954 | (add-before 'check 'increase-open-file-limit
|
| 955 | (lambda _
|
| 956 | |
| 957 | |
| 958 | |
| 959 | |
| 960 | (call-with-values (lambda () (getrlimit 'nofile))
|
| 961 | (lambda (soft hard)
|
| 962 | (let ((target (if hard (min hard 65536) 65536)))
|
| 963 | (when (and soft (< soft target))
|
| 964 | (setrlimit 'nofile target hard)
|
| 965 | (format #t
|
| 966 | "increased maximum number of open files from ~d to ~d~%"
|
| 967 | soft target)))))))
|
| 968 | (add-before 'check 'set-home
|
| 969 | (lambda _
|
| 970 | |
| 971 | |
| 972 | |
| 973 | (setenv "HOME" "/tmp/guix-home")
|
| 974 | (mkdir-p "/tmp/guix-home")
|
| 975 | (setenv "USER" "nixbld")
|
| 976 | |
| 977 | |
| 978 | |
| 979 | (umask #o077)
|
| 980 | |
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | |
| 986 | |
| 987 | (setenv "RUST_MIN_STACK" "8388608")
|
| 988 | |
| 989 | (setenv "TOKIO_WORKER_THREADS" "3")
|
| 990 | |
| 991 | |
| 992 | (setenv "CODEX_SANDBOX_NETWORK_DISABLED" "1")))
|
| 993 | (replace 'check
|
| 994 | (lambda* (#:key tests? parallel-build? cargo-test-flags
|
| 995 | #:allow-other-keys)
|
| 996 | (when tests?
|
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | |
| 1005 | (let ((test-threads (min 64 (parallel-job-count))))
|
| 1006 | (apply invoke
|
| 1007 | `("cargo" "test" "--offline"
|
| 1008 | ,@(if parallel-build?
|
| 1009 | (list "-j"
|
| 1010 | (number->string
|
| 1011 | (parallel-job-count)))
|
| 1012 | (list "-j" "1"))
|
| 1013 | ,@cargo-test-flags
|
| 1014 | ,@(if (member "--" cargo-test-flags)
|
| 1015 | '()
|
| 1016 | '("--"))
|
| 1017 | "--test-threads"
|
| 1018 | ,(number->string test-threads))))))))))
|
| 1019 | (native-inputs `(("bubblewrap" ,bubblewrap) |
| 1020 | ("clang" ,clang)
|
| 1021 | ("cmake-minimal" ,cmake-minimal)
|
| 1022 | ("curl" ,curl) |
| 1023 | ("libunwind" ,libunwind)
|
| 1024 | ("lsof" ,lsof) |
| 1025 | ("nss-certs-for-test" ,nss-certs-for-test) |
| 1026 | ("perl" ,perl)
|
| 1027 | ("procps" ,procps) |
| 1028 | ("python-minimal" ,python-minimal)
|
| 1029 | ("pkg-config" ,pkg-config)
|
| 1030 | ("bubblewrap-source" ,(package-source bubblewrap))))
|
| 1031 | (inputs (cons* bash-minimal coreutils git-minimal sed
|
| 1032 | libcap oniguruma openssl sqlite zlib `(,zstd "lib")
|
| 1033 | (cargo-inputs 'codex)))
|
| 1034 | (properties '((timeout . 108000) |
| 1035 | (max-silent-time . 54000))) |
| 1036 | (home-page "https://github.com/openai/codex")
|
| 1037 | (synopsis "AI-assisted coding CLI and TUI")
|
| 1038 | (description
|
| 1039 | "Codex is an AI-powered coding assistant that runs in the terminal.
|
| 1040 | It provides an interactive TUI for conversations with AI models, with
|
| 1041 | support for shell command execution, file editing, and code generation.
|
| 1042 | Configure providers via @file{~/.codex/config.toml}.
|
| 1043 |
|
| 1044 | codex-code-mode's V8 Javascript executor is disabled. That means if
|
| 1045 | you want to use the GPT 5.6 models you need to add a custom
|
| 1046 | @code{model_catalog_json} into @code{~/.codex/config.toml} that
|
| 1047 | makes them NOT force code (i.e. V8) mode.")
|
| 1048 | (license license:asl2.0)))
|
| 1049 |
|
| 1050 | (define-public codex-acp
|
| 1051 | (package
|
| 1052 | (name "codex-acp")
|
| 1053 | (version "0.11.1")
|
| 1054 | (source
|
| 1055 | (origin
|
| 1056 | (method git-fetch)
|
| 1057 | (uri (git-reference
|
| 1058 | (url "https://github.com/zed-industries/codex-acp")
|
| 1059 | (commit (string-append "v" version))))
|
| 1060 | (file-name (git-file-name name version))
|
| 1061 | (sha256
|
| 1062 | (base32 "1rlgkbvrbdl5jhf49sjn2mifn2rq6z0vwf0gard23y1bz6sr3wmr"))
|
| 1063 | (patches (search-patches "codex-acp-0.11.1-remove-patch-sections.patch"))))
|
| 1064 | (build-system cargo-build-system)
|
| 1065 | (arguments
|
| 1066 | (list
|
| 1067 | #:install-source? #f
|
| 1068 | #:phases
|
| 1069 | #~(modify-phases %standard-phases
|
| 1070 | (add-after 'unpack 'patch-codex-deps
|
| 1071 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1072 | |
| 1073 | (substitute* "Cargo.toml"
|
| 1074 | (("git = \"https://github.com/openai/codex\", tag = \"rust-v0.117.0\"")
|
| 1075 | "version = \"0.117.0\""))
|
| 1076 | |
| 1077 | (let ((port (open-file "Cargo.toml" "a")))
|
| 1078 | (display "
|
| 1079 | [dependencies.codex-code-mode]
|
| 1080 | version = \"0.117.0\"
|
| 1081 | default-features = false
|
| 1082 | " port)
|
| 1083 | (close-port port))
|
| 1084 | |
| 1085 | (setenv "CODEX_BWRAP_SOURCE_DIR"
|
| 1086 | (string-append
|
| 1087 | (assoc-ref inputs "bubblewrap-source")
|
| 1088 | "/"))))
|
| 1089 | (add-before 'check 'set-home
|
| 1090 | (lambda _
|
| 1091 | (setenv "HOME" "/tmp")
|
| 1092 | (setenv "USER" "nixbld")))
|
| 1093 | (add-before 'build 'create-node-version-file
|
| 1094 | (lambda _
|
| 1095 | |
| 1096 | |
| 1097 | |
| 1098 | (call-with-output-file "guix-vendor/node-version.txt"
|
| 1099 | (lambda (port)
|
| 1100 | (display "22.22.0" port))))))))
|
| 1101 | (native-inputs
|
| 1102 | `(("cmake-minimal" ,cmake-minimal)
|
| 1103 | ("clang" ,clang)
|
| 1104 | ("pkg-config" ,pkg-config)
|
| 1105 | ("bubblewrap-source" ,(package-source bubblewrap))))
|
| 1106 | (inputs (cons* libcap openssl sqlite zlib `(,zstd "lib")
|
| 1107 | (cargo-inputs 'codex-acp)))
|
| 1108 | (home-page "https://github.com/zed-industries/codex-acp")
|
| 1109 | (synopsis "ACP-compatible agent bridging Zed Codex with ACP clients")
|
| 1110 | (description
|
| 1111 | "This package provides an Agent Client Protocol (ACP) compatible agent
|
| 1112 | that bridges the Zed Codex runtime with ACP clients over stdio. It
|
| 1113 | supports multiple LLM providers through configuration in
|
| 1114 | @file{~/.codex/config.toml} and integrates with MCP servers for filesystem
|
| 1115 | operations.")
|
| 1116 | (license license:asl2.0)))
|