| From 1c4c7f99242202988abbfb3725b17d29486b7c80 Mon Sep 17 00:00:00 2001 |
| From: Erik Gilling <konkers@google.com> |
| Date: Thu, 9 Jan 2025 12:52:39 -0800 |
| Subject: [PATCH] WIP: Specify rustc_srcs_subdir for rust_analyzer_toolchains |
| |
| Change-Id: I531944659e240eacedfc1ed9ef8caf5ee19bf5bf |
| --- |
| pw_toolchain/rust/rust_toolchain.BUILD | 2 +- |
| pw_toolchain/rust/templates.bzl | 6 ++++++ |
| 2 files changed, 7 insertions(+), 1 deletion(-) |
| |
| diff --git a/pw_toolchain/rust/rust_toolchain.BUILD b/pw_toolchain/rust/rust_toolchain.BUILD |
| index f8f3bf0de..4f1823fca 100644 |
| --- a/pw_toolchain/rust/rust_toolchain.BUILD |
| +++ b/pw_toolchain/rust/rust_toolchain.BUILD |
| @@ -28,6 +28,6 @@ filegroup( |
| |
| filegroup( |
| name = "rustc_srcs", |
| - srcs = glob(["lib/rustlib/src/rust/src/**"]), |
| + srcs = glob(["lib/rustlib/src/rust/**/*"]), |
| visibility = ["//visibility:public"], |
| ) |
| diff --git a/pw_toolchain/rust/templates.bzl b/pw_toolchain/rust/templates.bzl |
| index 1f0ed66a2..0b8b0164b 100644 |
| --- a/pw_toolchain/rust/templates.bzl |
| +++ b/pw_toolchain/rust/templates.bzl |
| @@ -23,6 +23,11 @@ rust_toolchain( |
| dylib_ext = "{dylib_ext}", |
| exec_compatible_with = {exec_compatible_with}, |
| exec_triple = "{exec_triple}", |
| + opt_level = {{ |
| + "dbg": "0", |
| + "fastbuild": "0", |
| + "opt": "z", |
| + }}, |
| rust_doc = "{toolchain_repo}//:bin/rustdoc", |
| rust_std = "{target_repo}//:rust_std", |
| rustc = "{toolchain_repo}//:bin/rustc", |
| @@ -92,6 +97,7 @@ rust_analyzer_toolchain( |
| proc_macro_srv = "{toolchain_repo}//:libexec/rust-analyzer-proc-macro-srv", |
| rustc = "{toolchain_repo}//:bin/rustc", |
| rustc_srcs = "{toolchain_repo}//:rustc_srcs", |
| + rustc_srcs_subdir = "lib/rustlib/src/rust", |
| target_compatible_with = {target_compatible_with}, |
| visibility = ["//visibility:public"], |
| ) |
| -- |
| 2.47.1.613.gc27f4b7a9f-goog |
| |