From d5765a687263a85878ff3c90645ba11290ece686 Mon Sep 17 00:00:00 2001 From: contagnas Date: Thu, 8 Jun 2023 22:09:48 -0400 Subject: [PATCH 1/6] Update rust toolchain to use rules_rust 0.22.0 --- examples/toolchains/rust/WORKSPACE | 6 +++--- toolchains/rust/rust.bzl | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/toolchains/rust/WORKSPACE b/examples/toolchains/rust/WORKSPACE index 6c27780f2..e274d546b 100644 --- a/examples/toolchains/rust/WORKSPACE +++ b/examples/toolchains/rust/WORKSPACE @@ -9,10 +9,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # https://bazelbuild.github.io/rules_rust/#setup http_archive( name = "rules_rust", - sha256 = "d125fb75432dc3b20e9b5a19347b45ec607fabe75f98c6c4ba9badaab9c193ce", + sha256 = "50272c39f20a3a3507cb56dcb5c3b348bda697a7d868708449e2fa6fb893444c", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/0.17.0/rules_rust-v0.17.0.tar.gz", - "https://github.com/bazelbuild/rules_rust/releases/download/0.17.0/rules_rust-v0.17.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", + "https://github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", ], # rules_rust 0.17.0 does not yet support direct # overriding toolchain used for build of cargo-bazel diff --git a/toolchains/rust/rust.bzl b/toolchains/rust/rust.bzl index 67e324930..cff5db0d1 100644 --- a/toolchains/rust/rust.bzl +++ b/toolchains/rust/rust.bzl @@ -107,7 +107,6 @@ pkgs.buildEnv {{ binary_ext = "${{binary-ext}}", staticlib_ext = "${{staticlib-ext}}", dylib_ext = "${{dylib-ext}}", - os = "${{os}}", exec_triple = "${{build-triple}}", target_triple = "${{target-triple}}", default_edition = "{default_edition}", From 6a9add6f48186c068b0110ccee98d0b7f2b59d2f Mon Sep 17 00:00:00 2001 From: contagnas Date: Thu, 8 Jun 2023 22:33:32 -0400 Subject: [PATCH 2/6] bump versions in rust/MODULE.bazel --- toolchains/rust/MODULE.bazel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchains/rust/MODULE.bazel b/toolchains/rust/MODULE.bazel index 760d9c3d7..b35f676b5 100644 --- a/toolchains/rust/MODULE.bazel +++ b/toolchains/rust/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "rules_nixpkgs_rust", - version = "0.9.0", + version = "0.10.0", ) bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") @@ -9,4 +9,4 @@ bazel_dep(name = "bazel_skylib", version = "1.0.3") # local registry entry to map a commit to a module "version". the caller will # also have to know this and point `--registry` at the file from right revision # on GitHub! -bazel_dep(name = "rules_rust", version = "0.17.0") +bazel_dep(name = "rules_rust", version = "0.22.0") From 97c7a956e33298be4ac7413ad39988341768bd5b Mon Sep 17 00:00:00 2001 From: contagnas Date: Sat, 10 Jun 2023 00:36:47 -0400 Subject: [PATCH 3/6] don't bump rules_nixpkgs version --- toolchains/rust/MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/rust/MODULE.bazel b/toolchains/rust/MODULE.bazel index b35f676b5..7546c3633 100644 --- a/toolchains/rust/MODULE.bazel +++ b/toolchains/rust/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "rules_nixpkgs_rust", - version = "0.10.0", + version = "0.9.0", ) bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") From ad104f7f64ca95c2ed7e3e7759ef1c3d6f3dd93e Mon Sep 17 00:00:00 2001 From: contagnas Date: Sat, 10 Jun 2023 00:49:17 -0400 Subject: [PATCH 4/6] Update all references to rules_rust 0.17.0 to 0.22.0 --- examples/toolchains/rust/WORKSPACE | 2 +- registry/modules/rules_rust/{0.17.0 => 0.22.0}/MODULE.bazel | 2 +- .../patches/001-rules-rust-crate-universe.patch | 0 .../{0.17.0 => 0.22.0}/patches/bzlmod-compat.patch | 0 registry/modules/rules_rust/{0.17.0 => 0.22.0}/source.json | 2 +- registry/modules/rules_rust/metadata.json | 2 +- testing/rust/MODULE.bazel | 2 +- testing/rust/WORKSPACE | 6 +++--- 8 files changed, 8 insertions(+), 8 deletions(-) rename registry/modules/rules_rust/{0.17.0 => 0.22.0}/MODULE.bazel (91%) rename registry/modules/rules_rust/{0.17.0 => 0.22.0}/patches/001-rules-rust-crate-universe.patch (100%) rename registry/modules/rules_rust/{0.17.0 => 0.22.0}/patches/bzlmod-compat.patch (100%) rename registry/modules/rules_rust/{0.17.0 => 0.22.0}/source.json (91%) diff --git a/examples/toolchains/rust/WORKSPACE b/examples/toolchains/rust/WORKSPACE index e274d546b..07ce2de5d 100644 --- a/examples/toolchains/rust/WORKSPACE +++ b/examples/toolchains/rust/WORKSPACE @@ -14,7 +14,7 @@ http_archive( "https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", "https://github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", ], - # rules_rust 0.17.0 does not yet support direct + # rules_rust 0.22.0 does not yet support direct # overriding toolchain used for build of cargo-bazel # binary. # On non-standard systems (viz. NixOS), that approach diff --git a/registry/modules/rules_rust/0.17.0/MODULE.bazel b/registry/modules/rules_rust/0.22.0/MODULE.bazel similarity index 91% rename from registry/modules/rules_rust/0.17.0/MODULE.bazel rename to registry/modules/rules_rust/0.22.0/MODULE.bazel index 45bf5b131..93ea86a3f 100644 --- a/registry/modules/rules_rust/0.17.0/MODULE.bazel +++ b/registry/modules/rules_rust/0.22.0/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "rules_rust", - version = "0.17.0", + version = "0.22.0", ) bazel_dep(name = "bazel_skylib", version = "1.0.3") diff --git a/registry/modules/rules_rust/0.17.0/patches/001-rules-rust-crate-universe.patch b/registry/modules/rules_rust/0.22.0/patches/001-rules-rust-crate-universe.patch similarity index 100% rename from registry/modules/rules_rust/0.17.0/patches/001-rules-rust-crate-universe.patch rename to registry/modules/rules_rust/0.22.0/patches/001-rules-rust-crate-universe.patch diff --git a/registry/modules/rules_rust/0.17.0/patches/bzlmod-compat.patch b/registry/modules/rules_rust/0.22.0/patches/bzlmod-compat.patch similarity index 100% rename from registry/modules/rules_rust/0.17.0/patches/bzlmod-compat.patch rename to registry/modules/rules_rust/0.22.0/patches/bzlmod-compat.patch diff --git a/registry/modules/rules_rust/0.17.0/source.json b/registry/modules/rules_rust/0.22.0/source.json similarity index 91% rename from registry/modules/rules_rust/0.17.0/source.json rename to registry/modules/rules_rust/0.22.0/source.json index 22f1ef7bf..a5e2461b7 100644 --- a/registry/modules/rules_rust/0.17.0/source.json +++ b/registry/modules/rules_rust/0.22.0/source.json @@ -1,5 +1,5 @@ { - "url": "https://github.com/bazelbuild/rules_rust/releases/download/0.17.0/rules_rust-v0.17.0.tar.gz", + "url": "https://github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", "integrity": "sha384-v3eVoRi4rdkELxzV3egjTJkc8M3UH1YmbdZ2m6Y45gpjBew4a/JU5A4TFNO8Bq3z", "patches": { "001-rules-rust-crate-universe.patch": "sha384-3jCxEdq9CtWHQZWbIj3vvI1MDxc735phBmjj49QbnRCuIVFjMfMQRH7x6px4iKT4", diff --git a/registry/modules/rules_rust/metadata.json b/registry/modules/rules_rust/metadata.json index fe73ec584..fac58e70e 100644 --- a/registry/modules/rules_rust/metadata.json +++ b/registry/modules/rules_rust/metadata.json @@ -1,6 +1,6 @@ { "homepage": "https://bazelbuild.github.io/rules_rust/", "maintainers": [], - "versions": ["0.17.0"], + "versions": ["0.22.0"], "yanked_versions": [] } diff --git a/testing/rust/MODULE.bazel b/testing/rust/MODULE.bazel index 8a9be67cd..feba4746e 100644 --- a/testing/rust/MODULE.bazel +++ b/testing/rust/MODULE.bazel @@ -26,7 +26,7 @@ local_path_override( bazel_dep(name = "bazel_skylib", version = "1.0.3") bazel_dep(name = "rules_cc", version = "0.0.4") -bazel_dep(name = "rules_rust", version = "0.17.0") +bazel_dep(name = "rules_rust", version = "0.22.0") # TODO[AH] Remove these transitive dependencies once nixpkgs_java_configure has # become a module extension in rules_nixpkgs_java. diff --git a/testing/rust/WORKSPACE b/testing/rust/WORKSPACE index 1284b2a9d..204cae29a 100644 --- a/testing/rust/WORKSPACE +++ b/testing/rust/WORKSPACE @@ -37,10 +37,10 @@ bazel_skylib_workspace() http_archive( name = "rules_rust", - sha256 = "d125fb75432dc3b20e9b5a19347b45ec607fabe75f98c6c4ba9badaab9c193ce", + sha256 = "50272c39f20a3a3507cb56dcb5c3b348bda697a7d868708449e2fa6fb893444c", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/0.17.0/rules_rust-v0.17.0.tar.gz", - "https://github.com/bazelbuild/rules_rust/releases/download/0.17.0/rules_rust-v0.17.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", + "https://github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", ], # See note on examples/toolchains/rust/WORKSPACE. patches = ["//:patches/001-rules-rust-crate-universe.patch"], From b550efd47eb9530a10189050ca5c7dbab384bfd7 Mon Sep 17 00:00:00 2001 From: Ben Radford <104896700+benradf@users.noreply.github.com> Date: Fri, 4 Aug 2023 10:23:14 +0100 Subject: [PATCH 5/6] Fix integrity hash for rules_rust tarball. --- registry/modules/rules_rust/0.22.0/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/modules/rules_rust/0.22.0/source.json b/registry/modules/rules_rust/0.22.0/source.json index a5e2461b7..8b7fc6927 100644 --- a/registry/modules/rules_rust/0.22.0/source.json +++ b/registry/modules/rules_rust/0.22.0/source.json @@ -1,6 +1,6 @@ { "url": "https://github.com/bazelbuild/rules_rust/releases/download/0.22.0/rules_rust-v0.22.0.tar.gz", - "integrity": "sha384-v3eVoRi4rdkELxzV3egjTJkc8M3UH1YmbdZ2m6Y45gpjBew4a/JU5A4TFNO8Bq3z", + "integrity": "sha384-9HMDzRK4uOv9zg4qyT8rctHUhNfvm9bztPMH9SPjMeu/NJbK7SaI9NU0WRg0S+ny", "patches": { "001-rules-rust-crate-universe.patch": "sha384-3jCxEdq9CtWHQZWbIj3vvI1MDxc735phBmjj49QbnRCuIVFjMfMQRH7x6px4iKT4", "bzlmod-compat.patch": "sha384-N2llBj7w8Y9bTSuXEhuFYxt3eJ6IZpFKP+fOG2t37WilVocXjBVvarolapFJhzU5" From 5fb419ef49709e43cdb32153a705768edcf5518a Mon Sep 17 00:00:00 2001 From: Ben Radford Date: Fri, 4 Aug 2023 10:57:23 +0100 Subject: [PATCH 6/6] Update cargo bazel lockfile. --- .../toolchains/rust/cargo-bazel-lock.json | 91 ++++++++++++------- 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/examples/toolchains/rust/cargo-bazel-lock.json b/examples/toolchains/rust/cargo-bazel-lock.json index e316aa32a..d1359ae55 100644 --- a/examples/toolchains/rust/cargo-bazel-lock.json +++ b/examples/toolchains/rust/cargo-bazel-lock.json @@ -1,5 +1,5 @@ { - "checksum": "59ace66e05f26b5ab71bdc99a930d8b1bafdb232f70f60ad13c15599bc4a49a4", + "checksum": "7b9ecdeb4604da8a08e5bb7a2db2abcb1193b450993102bce9e408287cbb0a89", "crates": { "autocfg 1.1.0": { "name": "autocfg", @@ -56,9 +56,12 @@ "compile_data_glob": [ "**" ], - "crate_features": [ - "default" - ], + "crate_features": { + "common": [ + "default" + ], + "selects": {} + }, "edition": "2018", "version": "1.3.2" }, @@ -261,10 +264,13 @@ "compile_data_glob": [ "**" ], - "crate_features": [ - "default", - "std" - ], + "crate_features": { + "common": [ + "default", + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -309,12 +315,15 @@ "compile_data_glob": [ "**" ], - "crate_features": [ - "alloc", - "default", - "race", - "std" - ], + "crate_features": { + "common": [ + "alloc", + "default", + "race", + "std" + ], + "selects": {} + }, "edition": "2021", "version": "1.17.0" }, @@ -354,9 +363,12 @@ "compile_data_glob": [ "**" ], - "crate_features": [ - "default" - ], + "crate_features": { + "common": [ + "default" + ], + "selects": {} + }, "deps": { "common": [ { @@ -637,10 +649,13 @@ "compile_data_glob": [ "**" ], - "crate_features": [ - "default", - "proc-macro" - ], + "crate_features": { + "common": [ + "default", + "proc-macro" + ], + "selects": {} + }, "deps": { "common": [ { @@ -698,10 +713,13 @@ "compile_data_glob": [ "**" ], - "crate_features": [ - "default", - "proc-macro" - ], + "crate_features": { + "common": [ + "default", + "proc-macro" + ], + "selects": {} + }, "deps": { "common": [ { @@ -759,16 +777,19 @@ "compile_data_glob": [ "**" ], - "crate_features": [ - "clone-impls", - "default", - "derive", - "full", - "parsing", - "printing", - "proc-macro", - "quote" - ], + "crate_features": { + "common": [ + "clone-impls", + "default", + "derive", + "full", + "parsing", + "printing", + "proc-macro", + "quote" + ], + "selects": {} + }, "deps": { "common": [ {