From 9298ef8ab8d34ee97c4fedc380e15248b54cd118 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 23 Mar 2021 23:22:55 -0400 Subject: [PATCH] fuck --- ci/rustc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 ci/rustc diff --git a/ci/rustc b/ci/rustc new file mode 100755 index 00000000..10f08adb --- /dev/null +++ b/ci/rustc @@ -0,0 +1,24 @@ +#!/bin/bash +# rustc calculates a unique metadata tag to mangle symbols which includes the +# actual path to the crate. This breaks our deterministic builds as we depend +# on a copy of rust-lightning via a path. We insert this shim between cargo and +# rustc and edit the metadata tag for rust-lightning. +# While we could just set RUSTFLAGS="-C metadata=42", this would break if we +# ever (indirectly) depend on multiple versions of the same crate. +args=("$@") +IS_LIGHTNING=false +for ((i=0; i<"${#args[@]}"; ++i)); do + case ${args[i]} in + --crate-name) + if [ "${args[i+1]}" = "lightning" ]; then + IS_LIGHTNING=true + fi + ;; + metadata*) + if [ "$IS_LIGHTNING" = "true" ]; then + args[i]="metadata=42" + fi + ;; + esac +done +/usr/bin/rustc "${args[@]}" -- 2.30.2