Skip to content

Commit f31aed4

Browse files
authored
Merge branch 'main' into rust-analyzer-discover-config
2 parents 4568240 + 4a2cdb9 commit f31aed4

557 files changed

Lines changed: 44420 additions & 8488 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelci/presubmit.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ default_windows_no_runfiles_targets: &default_windows_no_runfiles_targets
7272
- "-//test/test_env:test_run"
7373
- "-//test/unit/pipelined_compilation/..."
7474
- "-//test/unit/rustdoc/..."
75-
- "-//tools/runfiles/..."
75+
- "-//rust/runfiles/..."
7676
# Runfiles used by the test only.
7777
- "-//test/empty_suite:deps_test"
7878
crate_universe_vendor_example_targets: &crate_universe_vendor_example_targets
@@ -293,7 +293,7 @@ tasks:
293293
- "--enable_bzlmod"
294294
build_targets:
295295
- "//crate_universe:cargo_bazel_bin"
296-
- "//tools/runfiles"
296+
- "//rust/runfiles"
297297
- "//util/import"
298298
ubuntu2004_clang:
299299
name: With Clang
@@ -498,6 +498,14 @@ tasks:
498498
working_directory: examples/crate_universe_local_path
499499
run_targets:
500500
- "//:vendor_edit_test_in_tree"
501+
example_bindgen_toolchain:
502+
name: Example custom bindgen toolchain registration
503+
platform: ubuntu2204
504+
working_directory: examples/bindgen_toolchain
505+
build_targets:
506+
- "//..."
507+
test_targets:
508+
- "//..."
501509
# See https://github.com/bazelbuild/rules_rust/issues/2186 about re-enabling these.
502510
# crate_universe_examples_windows:
503511
# name: Crate Universe Examples

.github/release_notes.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ http_archive(
2121

2222
## Extensions
2323

24+
<details>
25+
2426
### Bindgen
2527

2628
<details>
@@ -140,3 +142,5 @@ http_archive(
140142
```
141143

142144
</details>
145+
146+
</details>

.github/workflows/formatting.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
clangFormatVersion: 14
3030
- uses: actionsx/prettier@v2
3131
with:
32-
args: --config "${{ github.workspace }}/.prettierrc.toml" --write "**/*.{js,ts}"
32+
args: --config "${{ github.workspace }}/.prettierrc.toml" --write "**/*.{js,mjs,cjs,jsx,ts,tsx}"
3333
# Prettier has no diff view so we must make one ourselves
3434
# https://github.com/prettier/prettier/issues/6885
3535
- run: |

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
bazel ${BAZEL_STARTUP_FLAGS[@]} run //crate_universe/tools/cross_installer -- --target=${TARGET} --output="${OUTPUT_PATH}"
112112
env:
113113
TARGET: "${{ matrix.env.TARGET }}"
114-
- uses: actions/upload-artifact@v3
114+
- uses: actions/upload-artifact@v4
115115
with:
116116
name: "${{ matrix.env.TARGET }}"
117117
path: ${{ github.workspace }}/crate_universe/target/artifacts/${{ matrix.env.TARGET }}
@@ -121,7 +121,7 @@ jobs:
121121
runs-on: ubuntu-20.04
122122
steps:
123123
- uses: actions/checkout@v3
124-
- uses: actions/download-artifact@v3
124+
- uses: actions/download-artifact@v4
125125
with:
126126
path: ${{ github.workspace }}/crate_universe/target/artifacts
127127
- name: Detect the current version
@@ -156,7 +156,7 @@ jobs:
156156
URL_PREFIX: https://github.com/${{ github.repository_owner }}/rules_rust/releases/download/${{ env.RELEASE_VERSION }}
157157

158158
# Upload the artifact in case creating a release fails so all artifacts can then be manually recovered.
159-
- uses: actions/upload-artifact@v3
159+
- uses: actions/upload-artifact@v4
160160
with:
161161
name: "rules_rust.tar.gz"
162162
path: ${{ github.workspace }}/.github/rules_rust.tar.gz

MODULE.bazel

Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,20 @@
22

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

88
###############################################################################
99
## Core
1010
###############################################################################
1111

12-
bazel_dep(
13-
name = "bazel_features",
14-
version = "1.21.0",
15-
)
16-
bazel_dep(
17-
name = "bazel_skylib",
18-
version = "1.7.1",
19-
)
20-
bazel_dep(
21-
name = "platforms",
22-
version = "0.0.11",
23-
)
24-
bazel_dep(
25-
name = "rules_cc",
26-
version = "0.0.17",
27-
)
28-
bazel_dep(
29-
name = "rules_license",
30-
version = "1.0.0",
31-
)
32-
bazel_dep(
33-
name = "rules_shell",
34-
version = "0.3.0",
35-
)
36-
bazel_dep(
37-
name = "apple_support",
38-
version = "1.17.1",
39-
repo_name = "build_bazel_apple_support",
40-
)
12+
bazel_dep(name = "bazel_features", version = "1.21.0")
13+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
14+
bazel_dep(name = "platforms", version = "0.0.11")
15+
bazel_dep(name = "rules_cc", version = "0.1.1")
16+
bazel_dep(name = "rules_license", version = "1.0.0")
17+
bazel_dep(name = "rules_shell", version = "0.3.0")
18+
bazel_dep(name = "apple_support", version = "1.17.1", repo_name = "build_bazel_apple_support")
4119

4220
internal_deps = use_extension("//rust/private:internal_extensions.bzl", "i")
4321
use_repo(
@@ -90,27 +68,15 @@ use_repo(
9068
"generated_inputs_in_external_repo",
9169
"libc",
9270
"rtra",
93-
"rtra__serde-1.0.217",
94-
"rtra__serde_json-1.0.138",
71+
"rtra__serde-1.0.218",
72+
"rtra__serde_json-1.0.139",
9573
"rules_rust_test_load_arbitrary_tool",
9674
"rules_rust_toolchain_test_target_json",
9775
)
9876

99-
bazel_dep(
100-
name = "rules_python",
101-
version = "0.40.0",
102-
dev_dependency = True,
103-
)
104-
bazel_dep(
105-
name = "rules_testing",
106-
version = "0.7.0",
107-
dev_dependency = True,
108-
)
109-
bazel_dep(
110-
name = "bazel_ci_rules",
111-
version = "1.0.0",
112-
dev_dependency = True,
113-
)
77+
bazel_dep(name = "rules_python", version = "0.40.0", dev_dependency = True)
78+
bazel_dep(name = "rules_testing", version = "0.7.0", dev_dependency = True)
79+
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
11480

11581
###############################################################################
11682
## Crate Universe
@@ -131,13 +97,13 @@ use_repo(
13197
"cui",
13298
"cui__anyhow-1.0.95",
13399
"cui__camino-1.1.9",
134-
"cui__cargo-lock-10.0.1",
100+
"cui__cargo-lock-10.1.0",
135101
"cui__cargo-platform-0.1.9",
136102
"cui__cargo_metadata-0.19.1",
137103
"cui__cargo_toml-0.21.0",
138104
"cui__cfg-expr-0.17.2",
139105
"cui__clap-4.5.26",
140-
"cui__crates-index-3.5.0",
106+
"cui__crates-index-3.6.0",
141107
"cui__glob-0.3.2",
142108
"cui__hex-0.4.3",
143109
"cui__indoc-2.0.5",

cargo/private/cargo_bootstrap.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ def _detect_changes(repository_ctx):
173173
# 'consumed' which means changes to it will trigger rebuilds
174174

175175
for src in repository_ctx.attr.srcs:
176-
repository_ctx.path(src)
176+
repository_ctx.watch(src)
177177

178-
repository_ctx.path(repository_ctx.attr.cargo_lockfile)
179-
repository_ctx.path(repository_ctx.attr.cargo_toml)
178+
repository_ctx.watch(repository_ctx.attr.cargo_lockfile)
179+
repository_ctx.watch(repository_ctx.attr.cargo_toml)
180180

181181
if repository_ctx.attr.cargo_config:
182-
repository_ctx.path(repository_ctx.attr.cargo_config)
182+
repository_ctx.watch(repository_ctx.attr.cargo_config)
183183

184184
def _cargo_bootstrap_repository_impl(repository_ctx):
185185
# Pretend to Bazel that this rule's input files have been used, so that it will re-run the rule if they change.

cargo/private/cargo_build_script.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,12 @@ def _cargo_build_script_impl(ctx):
361361
if use_default_shell_env:
362362
env.update(ctx.configuration.default_shell_env)
363363

364+
if toolchain.cargo:
365+
env.update({
366+
"CARGO": "${{pwd}}/{}".format(toolchain.cargo.path),
367+
})
368+
364369
env.update({
365-
"CARGO": "${{pwd}}/{}".format(toolchain.cargo.path),
366370
"CARGO_CRATE_NAME": name_to_crate_name(pkg_name),
367371
"CARGO_MANIFEST_DIR": manifest_dir,
368372
"CARGO_PKG_NAME": pkg_name,

crate_universe/3rdparty/crates/BUILD.bazel

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate_universe/3rdparty/crates/BUILD.cargo-lock-10.0.1.bazel renamed to crate_universe/3rdparty/crates/BUILD.cargo-lock-10.1.0.bazel

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate_universe/3rdparty/crates/BUILD.crates-index-3.5.0.bazel renamed to crate_universe/3rdparty/crates/BUILD.crates-index-3.6.0.bazel

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)