diff --git a/MODULE.bazel b/MODULE.bazel index b277208c95..6569b8ea39 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -2,7 +2,7 @@ module(name = "codex") bazel_dep(name = "bazel_lib", version = "3.2.2") bazel_dep(name = "bazel_skylib", version = "1.9.0") -bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "platforms", version = "1.1.0") bazel_lib_toolchains = use_extension("@bazel_lib//lib:extensions.bzl", "toolchains") use_repo(bazel_lib_toolchains, "coreutils_toolchains") @@ -165,7 +165,7 @@ bazel_dep(name = "rules_cc", version = "0.2.25") bazel_dep(name = "rules_platform", version = "0.1.0") bazel_dep(name = "rules_pkg", version = "1.0.1") bazel_dep(name = "aws-lc", version = "5.1.0.bcr.3") -bazel_dep(name = "rules_rs", version = "0.0.96") +bazel_dep(name = "rules_rs", version = "0.2.3") bazel_dep(name = "rules_foreign_cc", version = "0.15.1") single_version_override( module_name = "rules_foreign_cc", @@ -211,19 +211,15 @@ use_repo(foreign_cc_tools, "cmake-3.31.8-windows-x86_64", "ninja_1.13.0_win", "p register_toolchains("//third_party/voice:windows_ninja_toolchain") -archive_override( +single_version_override( module_name = "rules_rs", - integrity = "sha256-b8sUj9EvM72+so/q4uRH91ed7QwOO8EoGbdL8NyBjE4=", patch_strip = 1, patches = [ "//patches:rules_rs_bindgen_v0_0_4.patch", "//patches:rules_rs_build_script_deps_annotation.patch", "//patches:rules_rs_rust_debug_modes.patch", "//patches:rules_rs_workspace_package_version.patch", - "//patches:rules_rs_zlib_snapshot_urls.patch", ], - strip_prefix = "rules_rs-7a05511772a8a85db5382ff7536bf2f1e6a8dde3", - urls = ["https://github.com/hermeticbuild/rules_rs/archive/7a05511772a8a85db5382ff7536bf2f1e6a8dde3.tar.gz"], ) rules_rust = use_extension("@rules_rs//rs:rules_rust.bzl", "rules_rust") @@ -349,6 +345,7 @@ crate = use_extension("@rules_rs//rs:extensions.bzl", "crate") crate.from_cargo( cargo_lock = "//codex-rs:Cargo.lock", cargo_toml = "//codex-rs:Cargo.toml", + incompatible_no_root_alias_targets = True, platform_triples = [ "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", @@ -369,6 +366,8 @@ crate.from_cargo( name = "argument_comment_lint_crates", cargo_lock = "//tools/argument-comment-lint:Cargo.lock", cargo_toml = "//tools/argument-comment-lint:Cargo.toml", + incompatible_no_root_alias_targets = True, + incompatible_no_root_crate_data = True, platform_triples = [ "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", @@ -446,7 +445,7 @@ crate.annotation( gen_build_script = "off", repositories = ["crates"], rustc_flags = ["--cfg=use_bindgen_pregenerated"], - deps = ["@crates//:aws_lc_sys_build_info"], + deps = ["@crates//aws_lc_sys_build_info"], ) crate.annotation( crate = "aws-lc-rs", @@ -520,8 +519,8 @@ crate.annotation( # MXC's resource compiler lookup needs an explicit path for Windows GNU targets. crate.annotation( build_script_deps = [ - "@crates//:cc-1.2.55", - "@crates//:winresource-0.1.34", + "@crates//cc-1.2.55", + "@crates//winresource-0.1.34", ], build_script_env = { "RC_PATH": "$(execpath @llvm//tools:llvm-rc)", diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 56a81e88ec..7f9e0b739b 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -233,6 +233,8 @@ "https://bcr.bazel.build/modules/rules_python/1.8.0/MODULE.bazel": "c151c025dbcc93d8f62ab68ecc313c9176a868a0e6386981bf2a12aec77cbe7b", "https://bcr.bazel.build/modules/rules_python/2.4.2/MODULE.bazel": "fde4307b6765b6f261c40a2c08140a5d10e3aa9b6c12e23bb57d31b7ce124c29", "https://bcr.bazel.build/modules/rules_python/2.4.2/source.json": "225828a44c27fa97ba8a594e6fd3b752061779f052d40c4bb5d6b45f2ded567b", + "https://bcr.bazel.build/modules/rules_rs/0.2.3/MODULE.bazel": "0f5051c62a5cd780e78169bc9154b9f9e15774486faa9d1c98c34bf8380dd48f", + "https://bcr.bazel.build/modules/rules_rs/0.2.3/source.json": "349ce52664a611a9a4a83f7533fe85ceb07d1e603493ccf472249a54a4a76fa7", "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", "https://bcr.bazel.build/modules/rules_shell/0.4.1/MODULE.bazel": "00e501db01bbf4e3e1dd1595959092c2fadf2087b2852d3f553b5370f5633592", diff --git a/bazel/rules/e2e_benchmark.bzl b/bazel/rules/e2e_benchmark.bzl index 035419adad..fe60972c2a 100644 --- a/bazel/rules/e2e_benchmark.bzl +++ b/bazel/rules/e2e_benchmark.bzl @@ -35,7 +35,7 @@ def codex_e2e_benchmark(name, binaries = [], data = [], deps = []): normal = True, normal_dev = True, ) + [ - "@crates//:divan", + "@crates//divan", ] + deps, ) diff --git a/bazel/rules/testing/compat/BUILD.bazel b/bazel/rules/testing/compat/BUILD.bazel index 9f4bf9b0ba..c3b11d5a2b 100644 --- a/bazel/rules/testing/compat/BUILD.bazel +++ b/bazel/rules/testing/compat/BUILD.bazel @@ -21,11 +21,11 @@ rust_test( deps = [ "//codex-rs/exec-server", "//codex-rs/exec-server/tests/support", - "@crates//:anyhow", - "@crates//:pretty_assertions", - "@crates//:serde_json", - "@crates//:tempfile", - "@crates//:tokio", - "@crates//:wiremock", + "@crates//anyhow", + "@crates//pretty_assertions", + "@crates//serde_json", + "@crates//tempfile", + "@crates//tokio", + "@crates//wiremock", ], ) diff --git a/bazel/rules/testing/wine/BUILD.bazel b/bazel/rules/testing/wine/BUILD.bazel index 9854d56fbc..640c43378b 100644 --- a/bazel/rules/testing/wine/BUILD.bazel +++ b/bazel/rules/testing/wine/BUILD.bazel @@ -22,9 +22,9 @@ rust_library( deps = [ "//codex-rs/utils/cargo-bin", "//codex-rs/utils/pty", - "@crates//:anyhow", - "@crates//:tempfile", - "@crates//:tokio", + "@crates//anyhow", + "@crates//tempfile", + "@crates//tokio", ], ) @@ -48,7 +48,7 @@ wine_rust_test( "wine-smoke": ":windows-smoke", }, deps = [ - "@crates//:futures", - "@crates//:pretty_assertions", + "@crates//futures", + "@crates//pretty_assertions", ], ) diff --git a/bazel/toolchains/prost/BUILD.bazel b/bazel/toolchains/prost/BUILD.bazel index 2b87000bb2..b850f40b4e 100644 --- a/bazel/toolchains/prost/BUILD.bazel +++ b/bazel/toolchains/prost/BUILD.bazel @@ -5,15 +5,15 @@ package(default_visibility = ["//visibility:public"]) rust_library_group( name = "prost_runtime", - deps = ["@crates//:prost"], + deps = ["@crates//prost"], ) rust_library_group( name = "tonic_runtime", deps = [ ":prost_runtime", - "@crates//:tonic", - "@crates//:tonic-prost", + "@crates//tonic", + "@crates//tonic-prost", ], ) @@ -22,7 +22,7 @@ rust_prost_toolchain( compile_well_known_types = False, prost_plugin = "@rules_rs//rs/private/prost:protoc-gen-prost__protoc-gen-prost", prost_runtime = ":prost_runtime", - prost_types = "@crates//:prost-types-0.14.3", + prost_types = "@crates//prost-types-0.14.3", tonic_plugin = "@rules_rs//rs/private/prost:protoc-gen-tonic__protoc-gen-tonic", tonic_plugin_flag = "--plugin=protoc-gen-tonic=%s", tonic_runtime = ":tonic_runtime", diff --git a/codex-rs/core/tests/remote_env_windows/BUILD.bazel b/codex-rs/core/tests/remote_env_windows/BUILD.bazel index 6ad412da2b..40a2ac6929 100644 --- a/codex-rs/core/tests/remote_env_windows/BUILD.bazel +++ b/codex-rs/core/tests/remote_env_windows/BUILD.bazel @@ -16,9 +16,9 @@ wine_rust_test( "//codex-rs/features", "//codex-rs/protocol", "//codex-rs/utils/path-uri", - "@crates//:anyhow", - "@crates//:pretty_assertions", - "@crates//:serde_json", - "@crates//:tokio", + "@crates//anyhow", + "@crates//pretty_assertions", + "@crates//serde_json", + "@crates//tokio", ], ) diff --git a/codex-rs/exec-server/BUILD.bazel b/codex-rs/exec-server/BUILD.bazel index 355e17e9ee..daa040c579 100644 --- a/codex-rs/exec-server/BUILD.bazel +++ b/codex-rs/exec-server/BUILD.bazel @@ -13,11 +13,6 @@ codex_rust_crate( "src/**/*.rs", "tests/unit/**/*.rs", ]), - deps_extra = [ - "@crates//:opentelemetry", - "@crates//:opentelemetry_sdk", - "@crates//:toml", - ], extra_binaries = [ "//codex-rs/bwrap:bwrap", "//codex-rs/windows-sandbox-rs:codex-command-runner", diff --git a/codex-rs/exec-server/testing/BUILD.bazel b/codex-rs/exec-server/testing/BUILD.bazel index 34b5978a51..2ee7128e1e 100644 --- a/codex-rs/exec-server/testing/BUILD.bazel +++ b/codex-rs/exec-server/testing/BUILD.bazel @@ -11,8 +11,8 @@ rust_library( deps = [ "//bazel/rules/testing/wine:wine_test_support", "//codex-rs/utils/cargo-bin", - "@crates//:anyhow", - "@crates//:tokio", + "@crates//anyhow", + "@crates//tokio", ], ) @@ -26,8 +26,8 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":wine-exec-server-test-support", - "@crates//:anyhow", - "@crates//:tokio", + "@crates//anyhow", + "@crates//tokio", ], ) @@ -42,6 +42,6 @@ rust_binary( "//codex-rs/exec-server", "//codex-rs/http-client", "//codex-rs/utils/pty", - "@crates//:tokio", + "@crates//tokio", ], ) diff --git a/codex-rs/v8-poc/BUILD.bazel b/codex-rs/v8-poc/BUILD.bazel index 29cd311e79..745c8e3785 100644 --- a/codex-rs/v8-poc/BUILD.bazel +++ b/codex-rs/v8-poc/BUILD.bazel @@ -4,7 +4,6 @@ codex_rust_crate( name = "v8-poc", crate_features = ["sandbox"], crate_name = "codex_v8_poc", - deps_extra = ["@crates//:v8"], # Bazel always builds the native pair required by the CppGC ABI checks. unit_test_args = ["--include-ignored"], ) diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel index bbd272c4b2..6fad1f052b 100644 --- a/patches/BUILD.bazel +++ b/patches/BUILD.bazel @@ -18,7 +18,6 @@ exports_files([ "rules_rs_build_script_deps_annotation.patch", "rules_rs_rust_debug_modes.patch", "rules_rs_workspace_package_version.patch", - "rules_rs_zlib_snapshot_urls.patch", "rusty_v8_prebuilt_out_dir.patch", "ring_windows_msvc_include_dirs.patch", "tikv-jemalloc-sys_make_env.patch", diff --git a/patches/rules_rs_build_script_deps_annotation.patch b/patches/rules_rs_build_script_deps_annotation.patch index 5d4aa14f83..40149b8c05 100644 --- a/patches/rules_rs_build_script_deps_annotation.patch +++ b/patches/rules_rs_build_script_deps_annotation.patch @@ -4,17 +4,16 @@ diff --git a/rs/extensions.bzl b/rs/extensions.bzl --- a/rs/extensions.bzl +++ b/rs/extensions.bzl -@@ -359,8 +359,8 @@ def _generate_hub_and_spokes( - kwargs = dict( +@@ -324,7 +324,7 @@ crate.annotation( hub_name = hub_name, - crate_visibility = visibility_with_internal_access(annotation.visibility, internal_packages), + crate_visibility = package["visibility"], gen_build_script = annotation.gen_build_script, - build_script_deps = [], + build_script_deps = annotation.build_script_deps, - build_script_deps_select = _select(feature_resolutions.build_deps), + build_script_deps_select = feature_resolutions.build_deps, build_script_data = annotation.build_script_data, build_script_data_select = annotation.build_script_data_select, -@@ -1094,9 +1094,9 @@ _annotation = tag_class( +@@ -996,9 +996,9 @@ _annotation = tag_class( # "build_script_data_glob": attr.string_list( # doc = "A list of glob patterns to add to a crate's `cargo_build_script::data` attribute", # ), @@ -30,7 +29,7 @@ diff --git a/rs/extensions.bzl b/rs/extensions.bzl diff --git a/rs/private/annotations.bzl b/rs/private/annotations.bzl --- a/rs/private/annotations.bzl +++ b/rs/private/annotations.bzl -@@ -2,6 +2,7 @@ def _crate_annotation( +@@ -4,6 +4,7 @@ def _crate_annotation( additive_build_file = None, additive_build_file_content = "", gen_build_script = "auto", @@ -38,7 +37,7 @@ diff --git a/rs/private/annotations.bzl b/rs/private/annotations.bzl build_script_data = [], build_script_data_select = {}, build_script_env = {}, -@@ -30,6 +31,7 @@ def _crate_annotation( +@@ -40,6 +41,7 @@ def _crate_annotation( additive_build_file = additive_build_file, additive_build_file_content = additive_build_file_content, gen_build_script = gen_build_script, @@ -49,7 +48,8 @@ diff --git a/rs/private/annotations.bzl b/rs/private/annotations.bzl diff --git a/rs/private/repository_utils.bzl b/rs/private/repository_utils.bzl --- a/rs/private/repository_utils.bzl +++ b/rs/private/repository_utils.bzl -@@ -298,6 +298,6 @@ rust_crate_attrs = { +@@ -330,7 +330,7 @@ rust_crate_attrs = { + "crate_visibility": attr.label_list(default = ["//visibility:public"]), "hub_name": attr.string(), "gen_build_script": attr.string(), - "build_script_deps": attr.label_list(), diff --git a/patches/rules_rs_workspace_package_version.patch b/patches/rules_rs_workspace_package_version.patch index 5c29459359..9168abbe24 100644 --- a/patches/rules_rs_workspace_package_version.patch +++ b/patches/rules_rs_workspace_package_version.patch @@ -1,16 +1,13 @@ -# What: expose resolved Cargo workspace package names and versions in DEP_DATA. -# Scope: rules_rs workspace metadata only. +# Expose the resolved Cargo workspace package version in the generated metadata. diff --git a/rs/private/cargo_workspace_graph.bzl b/rs/private/cargo_workspace_graph.bzl --- a/rs/private/cargo_workspace_graph.bzl +++ b/rs/private/cargo_workspace_graph.bzl -@@ -762,7 +762,9 @@ def workspace_dep_data( - "deps": deps, - "deps_by_platform": deps_by_platform, - "dev_deps": dev_deps, - "dev_deps_by_platform": dev_deps_by_platform, +@@ -654,6 +654,7 @@ def workspace_dep_data( "edition": package.get("edition", "2015"), -+ "package_name": package["name"], + "package_name": package["name"], "shared_libraries": shared_libraries, + "version": package["version"], } + lint_config = lint_configs.get(bazel_package) + if lint_config: diff --git a/patches/rules_rs_zlib_snapshot_urls.patch b/patches/rules_rs_zlib_snapshot_urls.patch deleted file mode 100644 index a7f0a2d609..0000000000 --- a/patches/rules_rs_zlib_snapshot_urls.patch +++ /dev/null @@ -1,33 +0,0 @@ -# Backport the Linux zlib package pins and mirrors from rules_rs v0.2.2. -# https://github.com/hermeticbuild/rules_rs/commit/4c3d6ecc8fe94d373b818366ac3c52a31fffa277 - -diff --git a/rs/private/rustc_repository.bzl b/rs/private/rustc_repository.bzl ---- a/rs/private/rustc_repository.bzl -+++ b/rs/private/rustc_repository.bzl -@@ -56,18 +56,20 @@ filegroup( - _LINUX_ZLIB = { - "aarch64": struct( - libdir = "usr/lib/aarch64-linux-gnu", -- sha256 = "e55ab3b4fb7b6edc4a628e28ec13f8780b08abe427d33ae148f030d8586d0e9a", -+ sha256 = "84536bcf440cf0f988899b24b6c7df32cb9ff9f0dfa97d5e7efcc2dc088d15dc", - urls = [ -- "https://launchpad.net/ubuntu/+archive/primary/+files/zlib1g_1.3.dfsg-3.1ubuntu2.2_arm64.deb", -- "https://snapshot.ubuntu.com/ubuntu/20260901T000000Z/pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.2_arm64.deb", -+ "https://ports.ubuntu.com/ubuntu-ports/pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.3_arm64.deb", -+ "https://launchpad.net/ubuntu/+archive/primary/+files/zlib1g_1.3.dfsg-3.1ubuntu2.3_arm64.deb", -+ "https://snapshot.ubuntu.com/ubuntu/20261110T000000Z/pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.3_arm64.deb", - ], - ), - "x86_64": struct( - libdir = "usr/lib/x86_64-linux-gnu", -- sha256 = "84b9cf5752b29c9f92c27cd4c4ba9bbcc70b5ccf9b1b515421a28ae23212e273", -+ sha256 = "376249c8de139568221dbb242318cc8cb8f02299e3a62b7432948e1754fbddf9", - urls = [ -- "https://launchpad.net/ubuntu/+archive/primary/+files/zlib1g_1.3.dfsg-3.1ubuntu2.2_amd64.deb", -- "https://snapshot.ubuntu.com/ubuntu/20260901T000000Z/pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.2_amd64.deb", -+ "https://archive.ubuntu.com/ubuntu/pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.3_amd64.deb", -+ "https://launchpad.net/ubuntu/+archive/primary/+files/zlib1g_1.3.dfsg-3.1ubuntu2.3_amd64.deb", -+ "https://snapshot.ubuntu.com/ubuntu/20261110T000000Z/pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.3_amd64.deb", - ], - ), - } diff --git a/third_party/openssl/openssl_sys.BUILD.bazel b/third_party/openssl/openssl_sys.BUILD.bazel index 7fe8071cfc..723428fc7c 100644 --- a/third_party/openssl/openssl_sys.BUILD.bazel +++ b/third_party/openssl/openssl_sys.BUILD.bazel @@ -28,9 +28,9 @@ cargo_build_script( rustc_env = {"CARGO_PKG_VERSION": "0.9.118"}, version = "0.9.118", deps = [ - "@crates//:cc-1.2.55", - "@crates//:pkg-config-0.3.32", - "@crates//:vcpkg-0.2.15", + "@crates//cc-1.2.55", + "@crates//pkg-config-0.3.32", + "@crates//vcpkg-0.2.15", ], ) @@ -45,6 +45,6 @@ rust_library( version = "0.9.118", deps = [ "build_script", - "@crates//:libc-0.2.186", + "@crates//libc-0.2.186", ], ) diff --git a/third_party/sqlite/BUILD.bazel b/third_party/sqlite/BUILD.bazel index 10687f7e1d..e49902a5ba 100644 --- a/third_party/sqlite/BUILD.bazel +++ b/third_party/sqlite/BUILD.bazel @@ -11,7 +11,7 @@ exports_files([ # Use bindings and native code from the same libsqlite3-sys release. copy_to_directory( name = "sqlite_bindings", - srcs = ["@crates//:libsqlite3_sys_bindings"], + srcs = ["@crates//libsqlite3_sys_bindings"], include_external_repositories = ["*"], replace_prefixes = {"sqlite3/bindgen_bundled_version.rs": "bindgen.rs"}, ) @@ -26,7 +26,7 @@ sqlite_build_info( # Internal compilation options must not leak into dependent C/C++ targets. cc_library( name = "sqlite3", - srcs = ["@crates//:libsqlite3_sys_source"], + srcs = ["@crates//libsqlite3_sys_source"], linkopts = select({ "@platforms//os:freebsd": ["-lpthread"], "@platforms//os:linux": [ @@ -65,5 +65,5 @@ cc_library( "@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ["SQLITE_DISABLE_INTRINSIC"], "//conditions:default": [], }), - deps = ["@crates//:libsqlite3_sys_headers"], + deps = ["@crates//libsqlite3_sys_headers"], ) diff --git a/tools/argument-comment-lint/BUILD.bazel b/tools/argument-comment-lint/BUILD.bazel index 5d2695a80d..83d12633b0 100644 --- a/tools/argument-comment-lint/BUILD.bazel +++ b/tools/argument-comment-lint/BUILD.bazel @@ -14,7 +14,7 @@ rust_library( edition = "2024", tags = ["manual"], visibility = ["//visibility:public"], - deps = ["@argument_comment_lint_crates//:clippy_utils"], + deps = ["@argument_comment_lint_crates//clippy_utils"], ) rust_binary(