Skip to content

Commit f0ef6ed

Browse files
authored
Release 0.57.0 (#3165)
1 parent ff2dddb commit f0ef6ed

File tree

22 files changed

+46
-49
lines changed

22 files changed

+46
-49
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module(
44
name = "rules_rust",
5-
version = "0.56.0",
5+
version = "0.57.0",
66
)
77

88
###############################################################################

crate_universe/extensions.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ There are some examples of using crate_universe with bzlmod in the [example fold
2626
To use rules_rust in a project using bzlmod, add the following to your MODULE.bazel file:
2727
2828
```python
29-
bazel_dep(name = "rules_rust", version = "0.49.3")
29+
bazel_dep(name = "rules_rust", version = "0.57.0")
3030
```
3131
3232
You find the latest version on the [release page](https://github.com/bazelbuild/rules_rust/releases).
@@ -237,7 +237,7 @@ module(
237237
bazel_dep(name = "bazel_skylib", version = "1.7.1")
238238
239239
# https://github.com/bazelbuild/rules_rust/releases
240-
bazel_dep(name = "rules_rust", version = "0.49.3")
240+
bazel_dep(name = "rules_rust", version = "0.57.0")
241241
242242
###############################################################################
243243
# T O O L C H A I N S

docs/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module(
55
version = "0.0.0",
66
)
77

8-
bazel_dep(name = "rules_rust", version = "0.55.6")
8+
bazel_dep(name = "rules_rust", version = "0.0.0")
99
local_path_override(
1010
module_name = "rules_rust",
1111
path = "..",

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that rules_rust bzlmod support is still a work in progress. Most features s
2020
To use `rules_rust` in a project using bzlmod, add the following to your `MODULE.bazel` file:
2121

2222
```python
23-
bazel_dep(name = "rules_rust", version = "0.48.0")
23+
bazel_dep(name = "rules_rust", version = "0.57.0")
2424
```
2525

2626
Don't forget to substitute in your desired release's version number.

examples/all_deps_vendor/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module(
1010
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1111

1212
# https://github.com/bazelbuild/rules_rust/releases
13-
bazel_dep(name = "rules_rust", version = "0.46.0")
13+
bazel_dep(name = "rules_rust", version = "0.0.0")
1414
local_path_override(
1515
module_name = "rules_rust",
1616
path = "../..",

examples/all_deps_vendor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module(
2626
bazel_dep(name = "bazel_skylib", version = "1.7.1")
2727

2828
# https://github.com/bazelbuild/rules_rust/releases
29-
bazel_dep(name = "rules_rust", version = "0.46.0")
29+
bazel_dep(name = "rules_rust", version = "0.57.0")
3030

3131
###############################################################################
3232
# T O O L C H A I N S

examples/compile_opt/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module(
77
# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/
88
###############################################################################
99
# https://github.com/bazelbuild/rules_rust/releases
10-
bazel_dep(name = "rules_rust", version = "0.56.0")
10+
bazel_dep(name = "rules_rust", version = "0.0.0")
1111
local_path_override(
1212
module_name = "rules_rust",
1313
path = "../..",

examples/crate_universe_local_path/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bazel_dep(name = "rules_rust", version = "0.54.1")
1+
bazel_dep(name = "rules_rust", version = "0.0.0")
22
local_path_override(
33
module_name = "rules_rust",
44
path = "../..",

examples/cross_compile/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module(
88
###############################################################################
99
# Get latest rules_rust release from:
1010
# https://github.com/bazelbuild/rules_rust/releases
11-
bazel_dep(name = "rules_rust", version = "0.52.0")
11+
bazel_dep(name = "rules_rust", version = "0.0.0")
1212
local_path_override(
1313
module_name = "rules_rust",
1414
path = "../..",

examples/cross_compile/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The example code is setup to cross compile from the following hosts to the the f
1111
* {darwin, aarch64 (Apple Silicon)} -> {linux, x86_64}
1212
* {darwin, aarch64 (Apple Silicon)} -> {linux, aarch64}
1313

14-
Cross compilation from Linux to Apple may work, but has not been tested.
14+
Cross compilation from Linux to Apple may work, but has not been tested.
1515

1616
You cross-compile by calling the target.
1717

@@ -23,7 +23,7 @@ or
2323

2424

2525
You can also build all targets at once:
26-
26+
2727

2828
`bazel build //...`
2929

@@ -43,7 +43,7 @@ You add the required rules for cross compilation to your MODULE.bazel as shown b
4343
```Starlark
4444
# Get latest release from:
4545
# https://github.com/bazelbuild/rules_rust/releases
46-
bazel_dep(name = "rules_rust", version = "0.52.0")
46+
bazel_dep(name = "rules_rust", version = "0.57.0")
4747

4848
# https://github.com/bazelbuild/platforms/releases
4949
bazel_dep(name = "platforms", version = "0.0.10")
@@ -57,8 +57,8 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht
5757

5858
## LLVM Configuration
5959

60-
Next, you have to configure the LLVM toolchain because rules_rust still needs a cpp toolchain for cross compilation and you have to add the specific platform triplets to the Rust toolchain.
61-
Suppose you want to compile a Rust binary that supports linux on both, X86 and ARM.
60+
Next, you have to configure the LLVM toolchain because rules_rust still needs a cpp toolchain for cross compilation and you have to add the specific platform triplets to the Rust toolchain.
61+
Suppose you want to compile a Rust binary that supports linux on both, X86 and ARM.
6262
In that case, you have to configure three LLVM targets:
6363

6464
1) LLVM for the host
@@ -88,14 +88,14 @@ http_archive(
8888
```
8989

9090
Here, we declare to new http downloads that retrieve the sysroot for linux_x64 (Intel/AMD) and linux_aarch64 (ARM/Apple Silicon). The buildfile is a simple filegroup and located in the /build/sysroot directory. You have to copy it in your project directory to make the sysroots work. Note, these are only
91-
sysroots, that means you have to configure LLVM next to use these files.
91+
sysroots, that means you have to configure LLVM next to use these files.
9292

93-
If you need a custom sysroot, for example to cross compile system dependencies such as openssl,
93+
If you need a custom sysroot, for example to cross compile system dependencies such as openssl,
9494
libpq (postgres client library) or similar, read through the excellent tutorial by Steven Casagrande:
9595

9696
https://steven.casagrande.io/posts/2024/sysroot-generation-toolchains-llvm/
9797

98-
As mentioned earlier, three LLVM targets need to be configured and to do just that,
98+
As mentioned earlier, three LLVM targets need to be configured and to do just that,
9999
please add the following to your MODULE.bazel
100100

101101
```Starlark
@@ -128,7 +128,7 @@ register_toolchains(
128128

129129
For simplicity, all toolchains are pinned to LLVM version 16 because it is one of the few releases that supports many targets and runs on older linux distributions i.e. Ubuntu 18.04. If you target modern CPU's i.e. ARMv9 that require a more recent LLVM version, see the complete [list off all LLVM releases and supported platforms.](https://github.com/bazel-contrib/toolchains_llvm/blob/master/toolchain/internal/llvm_distributions.bzl) Also, it is possible to pin different targets to different LLVM versions; [see the documentation for details](https://github.com/bazel-contrib/toolchains_llvm/tree/master?tab=readme-ov-file#per-host-architecture-llvm-version).
130130

131-
If you face difficulties with building LLVM on older linux distros or your CI,
131+
If you face difficulties with building LLVM on older linux distros or your CI,
132132
please take a look at the [LLVM Troubleshooting guide](README_LLVM_Troubleshooting) for known issues.
133133

134134

@@ -138,7 +138,7 @@ The Rust toolchain only need to know the additional platform triplets to downloa
138138
or or modify your MODULE.bazel with the following entry:
139139

140140
```Starlark
141-
RUST_EDITION = "2021"
141+
RUST_EDITION = "2021"
142142
RUST_VERSION = "1.81.0"
143143

144144
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")

examples/ffi/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module(
77
# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/
88
###############################################################################
99
# https://github.com/bazelbuild/rules_rust/releases
10-
bazel_dep(name = "rules_rust", version = "0.46.0")
10+
bazel_dep(name = "rules_rust", version = "0.0.0")
1111
local_path_override(
1212
module_name = "rules_rust",
1313
path = "../..",

examples/ffi/README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Rust FFI
22

33
In case of an existing C++, Rust can call into the C++ function via FFI.
4-
With Bazel, this is straightforward. However, your C++ API needs an extern "C"
4+
With Bazel, this is straightforward. However, your C++ API needs an extern "C"
55
declaration to generate the C compatibility required for FFI.
66

77
## Setup
88

9-
The setup is twofold, the Rust rules are declared in the MODULE file,
10-
but the rules_cc are not yet available in the Bazelmod format and thus are declared in
9+
The setup is twofold, the Rust rules are declared in the MODULE file,
10+
but the rules_cc are not yet available in the Bazelmod format and thus are declared in
1111
the WORKSPACE.bzlmod file.
1212

1313
In your MODULE.bazel file, ensure to have the following entry:
@@ -21,7 +21,7 @@ module(
2121
# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/
2222
###############################################################################
2323
# https://github.com/bazelbuild/rules_rust/releases
24-
bazel_dep(name = "rules_rust", version = "0.46.0")
24+
bazel_dep(name = "rules_rust", version = "0.57.0")
2525

2626
###############################################################################
2727
# T O O L C H A I N S
@@ -73,8 +73,8 @@ cc_library(
7373
)
7474
```
7575

76-
In some cases, you have to deal with non standard naming. In that case you define a
77-
custom gen_rule to take of that and then define a cc_import.
76+
In some cases, you have to deal with non standard naming. In that case you define a
77+
custom gen_rule to take of that and then define a cc_import.
7878

7979
```starlark
8080
load("@rules_cc//cc:defs.bzl", "cc_import", "cc_library")
@@ -94,10 +94,10 @@ cc_import(
9494
)
9595
```
9696

97-
## Rust Callsite
97+
## Rust Callsite
9898

9999
On the Rust side, interestingly, you just declare the cc_import as a dependency of
100-
your Rust target.
100+
your Rust target.
101101

102102
```starlark
103103
load("@rules_rust//rust:defs.bzl", "rust_shared_library")
@@ -111,7 +111,7 @@ rust_shared_library(
111111
)
112112
```
113113

114-
Then in your Rust source file, your create a FFI binding and wrap the call to it into unsafe. You can do that because the Rust standard library provides all the c raw types for FFI so you just import them and unsafe informs the Rust borrow checker to hold off certain checks. The public Rust function f() can then be used in regular Rust code.
114+
Then in your Rust source file, your create a FFI binding and wrap the call to it into unsafe. You can do that because the Rust standard library provides all the c raw types for FFI so you just import them and unsafe informs the Rust borrow checker to hold off certain checks. The public Rust function f() can then be used in regular Rust code.
115115

116116
```rust
117117
use std::os::raw::c_int;
@@ -132,6 +132,3 @@ pub fn f() {
132132
And with that, you build your FFI target as usual:
133133

134134
`bazel build //...`
135-
136-
137-

examples/proto/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module(
77
# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/
88
###############################################################################
99
# https://github.com/bazelbuild/rules_rust/releases
10-
bazel_dep(name = "rules_rust", version = "0.54.1")
10+
bazel_dep(name = "rules_rust", version = "0.0.0")
1111
local_path_override(
1212
module_name = "rules_rust",
1313
path = "../..",

examples/proto_with_toolchain/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ module(
77
# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/
88
###############################################################################
99
# https://github.com/bazelbuild/rules_rust/releases
10-
bazel_dep(name = "rules_rust", version = "0.54.1")
10+
bazel_dep(name = "rules_rust", version = "0.0.0")
1111
local_path_override(
1212
module_name = "rules_rust",
1313
path = "../..",
1414
)
1515

16-
bazel_dep(name = "rules_rust_prost", version = "0.54.1")
16+
bazel_dep(name = "rules_rust_prost", version = "0.0.0")
1717
local_path_override(
1818
module_name = "rules_rust_prost",
1919
path = "../../extensions/prost",

examples/sys/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module(
77
# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/
88
###############################################################################
99
# https://github.com/bazelbuild/rules_rust/releases
10-
bazel_dep(name = "rules_rust", version = "0.46.0")
10+
bazel_dep(name = "rules_rust", version = "0.0.0")
1111
local_path_override(
1212
module_name = "rules_rust",
1313
path = "../..",

extensions/bindgen/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
module(
44
name = "rules_rust_bindgen",
5-
version = "0.56.0",
5+
version = "0.57.0",
66
)
77

88
bazel_dep(
99
name = "rules_rust",
10-
version = "0.56.0",
10+
version = "0.57.0",
1111
)
1212
bazel_dep(
1313
name = "bazel_features",

extensions/mdbook/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
module(
44
name = "rules_rust_mdbook",
5-
version = "0.56.0",
5+
version = "0.57.0",
66
)
77

88
bazel_dep(
99
name = "rules_rust",
10-
version = "0.56.0",
10+
version = "0.57.0",
1111
)
1212
bazel_dep(
1313
name = "rules_cc",

extensions/prost/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
module(
44
name = "rules_rust_prost",
5-
version = "0.56.0",
5+
version = "0.57.0",
66
)
77

88
bazel_dep(
99
name = "rules_rust",
10-
version = "0.56.0",
10+
version = "0.57.0",
1111
)
1212
bazel_dep(
1313
name = "platforms",

extensions/protobuf/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
module(
44
name = "rules_rust_protobuf",
5-
version = "0.56.0",
5+
version = "0.57.0",
66
)
77

88
bazel_dep(
99
name = "rules_rust",
10-
version = "0.56.0",
10+
version = "0.57.0",
1111
)
1212
bazel_dep(
1313
name = "bazel_features",

extensions/wasm_bindgen/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
module(
44
name = "rules_rust_wasm_bindgen",
5-
version = "0.56.0",
5+
version = "0.57.0",
66
)
77

88
bazel_dep(
99
name = "rules_rust",
10-
version = "0.56.0",
10+
version = "0.57.0",
1111
)
1212
bazel_dep(
1313
name = "bazel_features",

test/no_std/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module(
33
version = "0.0.0",
44
)
55

6-
bazel_dep(name = "rules_rust", version = "0.55.6")
6+
bazel_dep(name = "rules_rust", version = "0.0.0")
77
local_path_override(
88
module_name = "rules_rust",
99
path = "../..",

version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""The version of rules_rust."""
22

3-
VERSION = "0.56.0"
3+
VERSION = "0.57.0"

0 commit comments

Comments
 (0)