From 3093b3da6bff1fb69a7d83f51c0113c275c688a1 Mon Sep 17 00:00:00 2001 From: Jakob Degen Date: Sun, 17 Dec 2023 00:38:42 -0800 Subject: [PATCH] prelude: `panic_abort` and `panic_unwind` in explicit sysroot deps Summary: Will need access to these in a future diff, more details to come Reviewed By: dtolnay Differential Revision: D52234629 fbshipit-source-id: 761dbc6cced094649c72eceea936e9a930e392df --- prelude/rust/link_info.bzl | 12 ++++++++++++ prelude/rust/rust_toolchain.bzl | 2 ++ 2 files changed, 14 insertions(+) diff --git a/prelude/rust/link_info.bzl b/prelude/rust/link_info.bzl index aa875ba5..49f9c4b4 100644 --- a/prelude/rust/link_info.bzl +++ b/prelude/rust/link_info.bzl @@ -228,6 +228,18 @@ def gather_explicit_sysroot_deps(dep_ctx: DepCollectionContext) -> list[RustOrNa name = None, flags = ["nounused"] + flags, )) + if explicit_sysroot_deps.panic_unwind: + out.append(RustOrNativeDependency( + dep = explicit_sysroot_deps.panic_unwind, + name = None, + flags = ["nounused"], + )) + if explicit_sysroot_deps.panic_abort: + out.append(RustOrNativeDependency( + dep = explicit_sysroot_deps.panic_abort, + name = None, + flags = ["nounused"], + )) for d in explicit_sysroot_deps.others: # FIXME(JakobDegen): Ideally we would not be using `noprelude` here but # instead report these as regular transitive dependencies. However, diff --git a/prelude/rust/rust_toolchain.bzl b/prelude/rust/rust_toolchain.bzl index 0189ff82..caacdbc6 100644 --- a/prelude/rust/rust_toolchain.bzl +++ b/prelude/rust/rust_toolchain.bzl @@ -22,6 +22,8 @@ RustExplicitSysrootDeps = record( core = Dependency | None, proc_macro = Dependency | None, std = Dependency | None, + panic_unwind = Dependency | None, + panic_abort = Dependency | None, others = list[Dependency], )