From b5731265465b483ca95cd98d8355520d93b4e9dc Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Sun, 11 Oct 2026 11:19:27 -0400 Subject: [PATCH] Upgrade to Quilt.cpp 0.69.3 and drop the NSIS CRLF workaround Quilt.cpp now honors --strip-trailing-cr in QUILT_DIFF_OPTS, set in src/quiltrc, so a refresh against a CRLF file produces an LF-only patch, and push still applies it with the file's CRLF line endings. NSIS's Source/build.cpp no longer needs its carriage returns stripped before patching. The NSIS patches are refreshed accordingly. This release also makes push --refresh honor QUILT_REFRESH_ARGS. Co-Authored-By: Claude Opus 5.5 --- Dockerfile | 9 +++------ src/README.md | 7 ------- src/nsis/cross-makensis.patch | 38 ++++++++++++++++++++++++++--------- src/nsis/no-ansi.patch | 4 ++++ src/quiltrc | 1 + 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8205419..7e28c2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -145,8 +145,8 @@ RUN 7z x tugz-amalgams-$TUGZ_VERSION.zip \ && mv tugz-amalgams-$TUGZ_VERSION tugz FROM base AS dl-quilt -ARG QUILT_VERSION=0.69.2 \ - QUILT_SHA256=dad74cd1021f83e5ab1ce72febd474bf5ccc9c3429949e91caae15e03505cc8c +ARG QUILT_VERSION=0.69.3 \ + QUILT_SHA256=893973b92ca541d85b86a389a1ba43528ca48ec40e2b19b127c3660a4ffcfaed WORKDIR /dl ADD --checksum=sha256:$QUILT_SHA256 \ https://github.com/skeeto/quilt.cpp/releases/download/v$QUILT_VERSION/quilt-$QUILT_VERSION.tar.gz ./ @@ -1021,10 +1021,7 @@ FROM cross AS build-nsis COPY --from=dl-nsis /dl/nsis /dl/nsis COPY src/nsis/ $PREFIX/src/nsis/ WORKDIR /dl/nsis -# Source/build.cpp ships with CRLF line endings; everything else in -# the tree is LF. Strip the carriage returns so our LF patch applies. -RUN sed -i 's/\r$//' Source/build.cpp \ - && QUILT_PATCHES=$PREFIX/src/nsis quilt push -a \ +RUN QUILT_PATCHES=$PREFIX/src/nsis quilt push -a \ && rm -rf .pc \ && scons -j$(nproc) \ XGCC_W32_PREFIX=$ARCH- \ diff --git a/src/README.md b/src/README.md index 7d7e2e8..9978aeb 100644 --- a/src/README.md +++ b/src/README.md @@ -26,13 +26,6 @@ Always start from a freshly unpacked tree. Quilt records applied patches in `.pc/`, and a tree reused with a different `QUILT_PATCHES` acts on the queue recorded there. -Some components get scripted edits in the Dockerfile before their queue -is pushed. Repeat any that touch a patched file, or a refresh records -them in the patch. Currently that is NSIS, whose `Source/build.cpp` ships -with CRLF line endings: - - $ sed -i 's/\r$//' Source/build.cpp - ## Updating a component When a component's version changes, refresh its entire queue against the diff --git a/src/nsis/cross-makensis.patch b/src/nsis/cross-makensis.patch index ba157fa..321878c 100644 --- a/src/nsis/cross-makensis.patch +++ b/src/nsis/cross-makensis.patch @@ -15,37 +15,51 @@ accept a plain libz.a alongside the import-lib variants in ZLIB_W32 lookup so makensis can static-link zlib like the rest of w64devkit, and skip the Source/Tests SConscript. +--- + SCons/Config/gnu | 2 ++ + Source/build.cpp | 8 ++++++-- + Source/SConscript | 9 ++++----- + SConstruct | 15 ++++----------- + 4 files changed, 16 insertions(+), 18 deletions(-) + --- a/SCons/Config/gnu +++ b/SCons/Config/gnu @@ -122,6 +122,8 @@ ### makensis environment - + makensis_env = tdefenv.Clone() +cross_env(makensis_env) +makensis_env.Append(CXXFLAGS = ['-std=gnu++14']) - + makensis_env.Append(CPPPATH = ['#$BUILD_CONFIG']) --- a/Source/build.cpp +++ b/Source/build.cpp -@@ -3744,3 +3744,5 @@ +@@ -3742,7 +3742,9 @@ + } + }; size_t io[] = { false, (size_t) path, pathcap }, cb; - TinyGrowBuf inputbuf((IGrowBuf::size_type) (cb = FIELD_OFFSET(PROMPT_FILEPATH_DATA, Path[pathcap]))); + TinyGrowBuf inputbuf((IGrowBuf::size_type) (cb = + FIELD_OFFSET(PROMPT_FILEPATH_DATA, Path) + + pathcap * sizeof(((PROMPT_FILEPATH_DATA*)0)->Path[0]))); PROMPT_FILEPATH_DATA *p = (PROMPT_FILEPATH_DATA*) inputbuf.get(); -@@ -4189,3 +4191,5 @@ + p->Platform = (sizeof(void*) * 8) | sizeof(TCHAR), p->Reserved = 0; + _tcscpy(p->Path, path); +@@ -4187,7 +4189,9 @@ + + CEXEBuild::postbuild_cmd* CEXEBuild::postbuild_cmd::make(const TCHAR *cmdstr, int cmpop, int cmpval) { - postbuild_cmd *p = (postbuild_cmd*) (new BYTE[FIELD_OFFSET(postbuild_cmd, cmd[_tcsclen(cmdstr)+!0])]); + postbuild_cmd *p = (postbuild_cmd*) (new BYTE[ + FIELD_OFFSET(postbuild_cmd, cmd) + + (_tcsclen(cmdstr)+1) * sizeof(((postbuild_cmd*)0)->cmd[0])]); p->next = NULL, _tcscpy(p->cmd, cmdstr); - + p->cmpop = cmpop, p->cmpval = cmpval; + return p; --- a/Source/SConscript +++ b/Source/SConscript -@@ -65,12 +65,11 @@ +@@ -65,13 +65,12 @@ ##### Use available libraries @@ -65,13 +79,16 @@ skip the Source/Tests SConscript. --- a/SConstruct +++ b/SConstruct -@@ -541,4 +541,4 @@ +@@ -540,7 +540,7 @@ + ) )) # Search for import library of zlib for mingw or VisualC - for importlib in ['libzdll.a', 'libz.dll.a', 'zdll.lib']: + for importlib in ['libzdll.a', 'libz.dll.a', 'libz.a', 'zdll.lib']: defenv['ZLIB_W32_LIB'] = os.path.dirname(str( -@@ -929,19 +929,12 @@ + defenv.FindFile(importlib, + [ +@@ -929,20 +929,13 @@ ####### Tests ### ###################################################################### @@ -82,7 +99,7 @@ skip the Source/Tests SConscript. build_dir = '$BUILD_PREFIX/tests' exports = {'env' : test_env.Clone()} -- + -defenv.SConscript( - dirs = 'Source/Tests', - duplicate = False, @@ -91,6 +108,7 @@ skip the Source/Tests SConscript. -) - -defenv.Ignore('$BUILD_PREFIX', '$BUILD_PREFIX/tests') - +- # test scripts + test_scripts_env = defenv.Clone(ENV = os.environ) # env needed for some scripts diff --git a/src/nsis/no-ansi.patch b/src/nsis/no-ansi.patch index d105be3..0e9d643 100644 --- a/src/nsis/no-ansi.patch +++ b/src/nsis/no-ansi.patch @@ -9,6 +9,10 @@ target, and a script requesting "Target x86-ansi" fails cleanly with multilib kit's secondary x86 stub set Unicode-only and identical in shape to the amd64 set. +--- + SConstruct | 7 ------- + 1 file changed, 7 deletions(-) + --- a/SConstruct +++ b/SConstruct @@ -695,11 +695,6 @@ diff --git a/src/quiltrc b/src/quiltrc index baf3bb8..3fb126b 100644 --- a/src/quiltrc +++ b/src/quiltrc @@ -4,3 +4,4 @@ QUILT_NO_DIFF_INDEX=1 QUILT_NO_DIFF_TIMESTAMPS=1 QUILT_REFRESH_ARGS="-p ab --diffstat" +QUILT_DIFF_OPTS=--strip-trailing-cr