You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't pass 'embed-bitcode'/'lto' while building proc-macros
cargo is usually good about not passing `RUSTFLAGS` to build-time
dependencies which need to be built for the host platform rather
than the target platform, but for some reason it does not do so
for `proc-macro` crates.
Thus, we have to manually drop the `embed-bitcode` and `lto`
arguments when calling rustc in our existing rustc wrapper.
Copy file name to clipboardExpand all lines: deterministic-build-wrappers/rustc
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,21 @@
7
7
# ever (indirectly) depend on multiple versions of the same crate.
8
8
args=("$@")
9
9
IS_LIGHTNING=false
10
+
SKIP_EMBED_BITCODE=false
10
11
for((i=0; i<"${#args[@]}"; ++i));do
11
12
case${args[i]}in
12
13
--crate-name)
13
-
if [ "${args[i+1]}"="lightning"-o"${args[i+1]}"="lightning_background_processor"-o"${args[i+1]}"="lightning_invoice"-o"${args[i+1]}"="lightning_persister"-o"${args[i+1]}"="lightning_rapid_gossip_sync"-o"${args[i+1]}"="ldk" ];then
14
+
if [ "${args[i+1]}"="lightning"-o"${args[i+1]}"="lightning_background_processor"-o"${args[i+1]}"="lightning_invoice"-o"${args[i+1]}"="lightning_persister"-o"${args[i+1]}"="lightning_rapid_gossip_sync"-o"${args[i+1]}"="lightning_transaction_sync"-o"${args[i+1]}"="ldk" ];then
14
15
IS_LIGHTNING=true
15
16
fi
16
17
;;
18
+
--crate-type)
19
+
if [ "${args[i+1]}"="proc-macro" ];then
20
+
# If we're building a proc-macro, rustc incorrectly passes our RUSTFLAGS containing
21
+
# embed-bitcode=yes, which we don't want.
22
+
SKIP_EMBED_BITCODE=true
23
+
fi
24
+
;;
17
25
esac
18
26
done
19
27
for((i=0; i<"${#args[@]}"; ++i));do
@@ -24,7 +32,16 @@ for ((i=0; i<"${#args[@]}"; ++i)); do
0 commit comments