File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -929,14 +929,27 @@ rust_binary = rule(
929
929
""" ),
930
930
)
931
931
932
- def _fake_out_process_wrapper (attrs ):
932
+ def _common_attrs_for_binary_without_process_wrapper (attrs ):
933
933
new_attr = dict (attrs .items ())
934
+
935
+ # use a fake process wrapper
934
936
new_attr ["_process_wrapper" ] = attr .label (
935
937
default = None ,
936
938
executable = True ,
937
939
allow_single_file = True ,
938
940
cfg = "exec" ,
939
941
)
942
+
943
+ # fix stamp = 0
944
+ new_attr ["stamp" ] = attr .int (
945
+ doc = dedent ("""\
946
+ Fix `stamp = 0` as stamping is not supported when building without process_wrapper:
947
+ https://github.com/bazelbuild/rules_rust/blob/8df4517d370b0c543a01ba38b63e1d5a4104b035/rust/private/rustc.bzl#L955
948
+ """ ),
949
+ default = 0 ,
950
+ values = [0 ],
951
+ )
952
+
940
953
return new_attr
941
954
942
955
# Provides an internal rust_binary to use that we can use to build the process
@@ -945,7 +958,7 @@ def _fake_out_process_wrapper(attrs):
945
958
rust_binary_without_process_wrapper = rule (
946
959
implementation = _rust_binary_impl ,
947
960
provides = _common_providers ,
948
- attrs = dict (_fake_out_process_wrapper (_common_attrs ).items () + _rust_binary_attrs .items ()),
961
+ attrs = dict (_common_attrs_for_binary_without_process_wrapper (_common_attrs ).items () + _rust_binary_attrs .items ()),
949
962
executable = True ,
950
963
fragments = ["cpp" ],
951
964
host_fragments = ["cpp" ],
You can’t perform that action at this time.
0 commit comments