]> git.bitcoin.ninja Git - ldk-java/commitdiff
[C#] Use faketime explicitly when compiling
authorMatt Corallo <git@bluematt.me>
Thu, 16 Nov 2023 21:36:10 +0000 (21:36 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 16 Nov 2023 21:36:53 +0000 (21:36 +0000)
As targeting windows has a timestamp in the resulting dll, which we
need to be deterministic.

genbindings.sh

index c4a1b270edd68be57433106cb9054bf3a8a64b66..2e8204cc35c206cbe57dac615ee5c720ef3101e6 100755 (executable)
@@ -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