From 0ae1b807d30d36862617580b5886f178000a52a9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 16 Nov 2023 21:36:10 +0000 Subject: [PATCH] [C#] Use faketime explicitly when compiling As targeting windows has a timestamp in the resulting dll, which we need to be deterministic. --- genbindings.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/genbindings.sh b/genbindings.sh index c4a1b270..2e8204cc 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -160,8 +160,10 @@ if [ "$2" = "c_sharp" ]; then LINK="$LINK -Wl,--version-script=c_sharp/libcode.version" fi - $COMPILE -o bindings.o -c -O3 -I"$1"/lightning-c-bindings/include/ c_sharp/bindings.c - $COMPILE $LINK -o libldkcsharp_release$LDK_TARGET_SUFFIX.so -O3 bindings.o $LDK_LIB -lm + # When building for Windows, a timestamp is included in the resulting dll, + # so we have to build with faketime. + faketime -f "2021-01-01 00:00:00" $COMPILE -o bindings.o -c -O3 -I"$1"/lightning-c-bindings/include/ c_sharp/bindings.c + faketime -f "2021-01-01 00:00:00" $COMPILE $LINK -o libldkcsharp_release$LDK_TARGET_SUFFIX.so -O3 bindings.o $LDK_LIB -lm [ "$IS_APPLE_CLANG" != "true" ] && llvm-strip libldkcsharp_release$LDK_TARGET_SUFFIX.so if [ "$LDK_JAR_TARGET" = "true" ]; then -- 2.39.5