Skip to content

Commit 2d61d74

Browse files
chbaker0copybara-github
authored andcommitted
Include rust-analyzer-proc-macro-srv
Rust-analyzer needs this binary to expand proc macros. This is especially important with the chromium::import! macro, since without expanding the macro rust-analyzer cannot know about any dependencies. The only way to include this binary is to set `extended = true` and pass it in the `tools` list in config.toml, so do that. Bug: None Change-Id: I51f639b7a173a0f3a44b2dc3b57d5190a2eb9d80 Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel Change-Id: I51f639b7a173a0f3a44b2dc3b57d5190a2eb9d80 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5640314 Auto-Submit: Collin Baker <collinbaker@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/main@{#1319723} NOKEYCHECK=True GitOrigin-RevId: 40573212d3c8beb5bf8bcc506340eab369a10356
1 parent dac6798 commit 2d61d74

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

build_rust.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@
163163
'src/tools/rustfmt'
164164
]
165165

166-
# Desired tools and libraries in our Rust toolchain.
167-
DISTRIBUTION_ARTIFACTS = [
168-
'cargo', 'clippy', 'compiler/rustc', 'library/std', 'rust-analyzer',
169-
'rustfmt', 'src'
170-
]
171-
172166
# Which test suites to run. Any failure will fail the build.
173167
TEST_SUITES = [
174168
'library/std',
@@ -827,8 +821,7 @@ def main():
827821
if os.path.exists(RUST_TOOLCHAIN_OUT_DIR):
828822
RmTree(RUST_TOOLCHAIN_OUT_DIR)
829823

830-
artifacts = DISTRIBUTION_ARTIFACTS
831-
xpy.run('install', xpy_args + artifacts)
824+
xpy.run('install', [])
832825

833826
# Copy additional vendored crates required for building stdlib.
834827
print(f'Copying vendored dependencies to {RUST_TOOLCHAIN_OUT_DIR} ...')

config.toml.template

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ docs = false
3434
# with the rust compiler we build.
3535
profiler = true
3636

37+
# With `extended = true`, `x.py install` will install rustc and the listed
38+
# tools. This is the *only* way to install rust-analyzer-proc-macro-srv, which
39+
# is necessary to use rust-analyzer.
40+
extended = true
41+
tools = [
42+
"cargo",
43+
"clippy",
44+
"rustfmt",
45+
"rust-analyzer",
46+
"rust-analyzer-proc-macro-srv",
47+
"src",
48+
]
49+
3750
[install]
3851
prefix = "$INSTALL_DIR"
3952
sysconfdir = "etc"

update_rust.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# this back to its previous value _AND_ set `OVERRIDE_CLANG_REVISION` below
3737
# to the `CLANG_REVISION` that was in place before the roll.
3838
RUST_REVISION = '3cf924b934322fd7b514600a7dc84fc517515346'
39-
RUST_SUB_REVISION = 1
39+
RUST_SUB_REVISION = 2
4040

4141
# If not None, this overrides the `CLANG_REVISION` in
4242
# //tools/clang/scripts/update.py in order to download a Rust toolchain that

0 commit comments

Comments
 (0)