| # buildifier: disable=bzl-visibility | |
| load("//rust/private:rust.bzl", "rust_binary_without_process_wrapper", "rust_test_without_process_wrapper_test") | |
| load("//util/process_wrapper/private:bootstrap_process_wrapper.bzl", "bootstrap_process_wrapper") | |
| rust_binary_without_process_wrapper( | |
| name = "process_wrapper", | |
| srcs = glob(["*.rs"]), | |
| allocator_libraries = select({ | |
| "@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols_on": "@rules_rust//ffi/rs:allocator_libraries_with_mangling_support_without_process_wrapper", | |
| "//conditions:default": "@rules_rust//ffi/rs:empty_allocator_libraries", | |
| }), | |
| edition = "2018", | |
| # To ensure the process wrapper is produced deterministically | |
| # debug info, which is known to sometimes have host specific | |
| # paths embedded in this section, is stripped out. On macOS, | |
| # full symbol stripping is needed to also remove N_OSO stab | |
| # entries whose timestamps vary between builds. | |
| rustc_flags = select({ | |
| "@platforms//os:linux": ["-Cstrip=debuginfo"], | |
| "@platforms//os:macos": ["-Cstrip=symbols"], | |
| "@platforms//os:windows": ["-Cstrip=debuginfo"], | |
| "//conditions:default": [], | |
| }), | |
| visibility = ["//visibility:public"], | |
| deps = [ | |
| "@rules_rust_tinyjson//:tinyjson", | |
| ], | |
| ) | |
| rust_test_without_process_wrapper_test( | |
| name = "process_wrapper_test", | |
| crate = ":process_wrapper", | |
| edition = "2018", | |
| ) | |
| bootstrap_process_wrapper( | |
| name = "bootstrap_process_wrapper", | |
| is_windows = select({ | |
| "@platforms//os:windows": True, | |
| "//conditions:default": False, | |
| }), | |
| visibility = ["//visibility:public"], | |
| ) |