File tree Expand file tree Collapse file tree 2 files changed +22
-19
lines changed
Expand file tree Collapse file tree 2 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 11load ("@bazel_skylib//:bzl_library.bzl" , "bzl_library" )
2+ load ("@bazel_skylib//rules:copy_file.bzl" , "copy_file" )
23load ("//rust:defs.bzl" , "rust_binary" )
34
45rust_binary (
@@ -9,33 +10,31 @@ rust_binary(
910)
1011
1112rust_binary (
12- name = "no_ar " ,
13+ name = "no_binary " ,
1314 srcs = ["no_binary.rs" ],
1415 edition = "2021" ,
15- rustc_env = {
16- "BINARY_ENV" : "AR" ,
17- },
1816 visibility = ["//visibility:public" ],
1917)
2018
21- rust_binary (
19+ copy_file (
20+ name = "no_ar" ,
21+ src = ":no_binary" ,
22+ out = "no_ar.exe" ,
23+ is_executable = True ,
24+ )
25+
26+ copy_file (
2227 name = "no_cc" ,
23- srcs = ["no_binary.rs" ],
24- edition = "2021" ,
25- rustc_env = {
26- "BINARY_ENV" : "CC" ,
27- },
28- visibility = ["//visibility:public" ],
28+ src = ":no_binary" ,
29+ out = "no_cc.exe" ,
30+ is_executable = True ,
2931)
3032
31- rust_binary (
33+ copy_file (
3234 name = "no_cxx" ,
33- srcs = ["no_binary.rs" ],
34- edition = "2021" ,
35- rustc_env = {
36- "BINARY_ENV" : "CXX" ,
37- },
38- visibility = ["//visibility:public" ],
35+ src = ":no_binary" ,
36+ out = "no_cxx.exe" ,
37+ is_executable = True ,
3938)
4039
4140bzl_library (
Original file line number Diff line number Diff line change 11//! A cross platform implementation of `/bin/false`
22
33fn main ( ) {
4- eprintln ! ( concat!( "No binary provided for " , env!( "BINARY_ENV" ) ) ) ;
4+ let program_name = std:: env:: args ( )
5+ . next ( )
6+ . unwrap_or_else ( || "unknown" . to_string ( ) ) ;
7+
8+ eprintln ! ( "No binary provided for {}" , program_name) ;
59 std:: process:: exit ( 1 ) ;
610}
You can’t perform that action at this time.
0 commit comments