Subject: bug#71548: NSIS compile using --system=riscv64-linux fails

From: Michael Ford <[email-masked]>
Date: Fri, 14 Jun 2024 11:10:01 +0100

Building with master @ 0beb0dbfe036763e7b5d6c999fe2b3fc89faa6cb using
./pre-inst-env guix build nsis-x86_64 --system=riscv64-linux. I see
the following:

x86_64-w64-mingw32-gcc -o
build/urelease/stub_bzip2-amd64-unicode/bzlib.o -c -Os -Wall -xc
-fno-strict-aliasing -fno-tree-loop-distribute-patterns
-DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE
-DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500
-DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config Source/bzip2/bzlib.c
x86_64-w64-mingw32-gcc -o
build/urelease/stub_bzip2-amd64-unicode/decompress.o -c -Os -Wall -xc
-fno-strict-aliasing -fno-tree-loop-distribute-patterns
-DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE
-DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500
-DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config
Source/bzip2/decompress.c
x86_64-w64-mingw32-gcc -o
build/urelease/stub_bzip2-amd64-unicode/huffman.o -c -Os -Wall -xc
-fno-strict-aliasing -fno-tree-loop-distribute-patterns
-DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE
-DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500
-DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config
Source/bzip2/huffman.c
x86_64-w64-mingw32-windres -DNSISCALL="__attribute__((__stdcall__))"
-D_UNICODE -DUNICODE -DEXEHEAD -DWIN32_LEAN_AND_MEAN
-D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config
-ISource/exehead -i Source/exehead/resource.rc -o
build/urelease/stub_bzip2-amd64-unicode/resource.o
/gnu/store/l5pggw8xsialdi0zngy2rw0hh768cgpm-binutils-cross-x86_64-w64-mingw32-2.38/bin/x86_64-w64-mingw32-windres:
Source/exehead/resource.rc:41: syntax error
scons: *** [build/urelease/stub_bzip2-amd64-unicode/resource.o] Error 1
scons: building terminated because of errors.
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "scons" arguments: ("-j" "16"
"UNICODE=yes" "SKIPUTILS=MakeLangId,Makensisw,NSIS
Menu,SubStart,zip2exe" "SKIPDOC=COPYING" "STRIP_CP=no"
"PREFIX=/gnu/store/kmnb75j8crsc218yzm0a8yaywh0icskw-nsis-x86_64-3.09"
"TARGET_ARCH=amd64" "XGCC_W32_PREFIX=x86_64-w64-mingw32-"
"PREFIX_PLUGINAPI_INC=/gnu/store/fnqpagmnahkkjpa1zhvnhs3kcw5ix92s-mingw-w64-x86_64-11.0.1/include/"
"PREFIX_PLUGINAPI_LIB=/gnu/store/fnqpagmnahkkjpa1zhvnhs3kcw5ix92s-mingw-w64-x86_64-11.0.1/lib/"
"makensis" "stubs" "plugins" "utils") exit-status: 2 term-signal: #f
stop-signal: #f>
phase `build' failed after 124.7 seconds
command "scons" "-j" "16" "UNICODE=yes"
"SKIPUTILS=MakeLangId,Makensisw,NSIS Menu,SubStart,zip2exe"
"SKIPDOC=COPYING" "STRIP_CP=no"
"PREFIX=/gnu/store/kmnb75j8crsc218yzm0a8yaywh0icskw-nsis-x86_64-3.09"
"TARGET_ARCH=amd64" "XGCC_W32_PREFIX=x86_64-w64-mingw32-"
"PREFIX_PLUGINAPI_INC=/gnu/store/fnqpagmnahkkjpa1zhvnhs3kcw5ix92s-mingw-w64-x86_64-11.0.1/include/"
"PREFIX_PLUGINAPI_LIB=/gnu/store/fnqpagmnahkkjpa1zhvnhs3kcw5ix92s-mingw-w64-x86_64-11.0.1/lib/"
"makensis" "stubs" "plugins" "utils" failed with status 2
builder for `/gnu/store/j63ck3wy1vfajgl7vww498x6dis2cncp-nsis-x86_64-3.09.drv'
failed with exit code 1
build of /gnu/store/j63ck3wy1vfajgl7vww498x6dis2cncp-nsis-x86_64-3.09.drv failed
Could not find build log for
'/gnu/store/j63ck3wy1vfajgl7vww498x6dis2cncp-nsis-x86_64-3.09.drv'.
guix build: error: build of
`/gnu/store/j63ck3wy1vfajgl7vww498x6dis2cncp-nsis-x86_64-3.09.drv'
failed