8000 Link the static Windows build with the image's libiconv by zotabee · Pull Request #400 · rockdaboot/wget2 · GitHub
[go: up one dir, main page]

Skip to content

Link the static Windows build with the image's libiconv - #400

Closed
zotabee wants to merge 1 commit into
rockdaboot:masterfrom
zotabee:win32-static-iconv
Closed

zotabee wants to merge 1 commit into
rockdaboot:masterfrom
zotabee:win32-static-iconv

Conversation

@zotabee
@zotabee zotabee commented Oct 18, 2026
Copy link
Copy Markdown
Contributor

Part of #388 (case 2). Companion to #399.

The release wget2.exe is built -iconv, so a non-ASCII file name taken from a UTF-8 page is written as raw UTF-8 and shows up as mojibake on Windows: 8.½.(1963).DSP.V1.zip instead of 8.½.(1963).DSP.V1.zip.

The image builds a static libiconv into $INSTALLDIR and sets LDFLAGS="-L$INSTALLDIR/lib", but the wget2 step sets its own LDFLAGS, which replaces it, so configure can't link its iconv test. This appends instead, in the Dockerfile and in the MinGW64-static CI job.

Checked with an llvm-mingw cross-build against a static libiconv 1.18, using the same CPPFLAGS and LDFLAGS as the image (I didn't run the full Docker build):

  • LDFLAGS replaced, as now: checking for iconv... no, consider installing GNU libiconv, so -iconv.
  • LDFLAGS appended: checking for iconv... yes and checking how to link with libiconv... $INSTALLDIR/lib/libiconv.a, so +iconv.

On Windows 11, the +iconv build saves 8.½.(1963).DSP.V1.zip from a UTF-8 page with --restrict-file-names=nocontrol, and with windows,nocontrol once #399 is in.

One side effect: with iconv, the default windows mode escapes the name in the local code page, so it becomes 8.%BD.(1963).DSP.V1.zip instead of 8.%C2%BD.(1963).DSP.V1.zip. That's the spelling wget 1.x used, so --no-clobber mirrors made with wget 1.x match again, but mirrors made with the current 2.x release will see those names change once.

I couldn't check whether the CI image sets LDFLAGS the same way. If it doesn't, the CI change is a no-op.

* contrib/Dockerfile.win32.static: Append to LDFLAGS instead of
  replacing it, so configure finds libiconv in $INSTALLDIR/lib.
* .gitlab-ci.yml (MinGW64-static): Likewise.

Part of #388 (case 2)

Copyright-paperwork-exempt: Yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Q2J3trRVSmFTMeMeCmd64
@zotabee
zotabee commented Oct 18, 2026
Copy link
Copy Markdown
Contributor Author

I've now run the full Docker build, contrib/Dockerfile.win32.static as on master and with this change, and tested both on Windows 11:

  • master: -iconv, the same feature line as the 2.2.1 release exe.
  • this PR: checking how to link with libiconv... /usr/local/x86_64-w64-mingw32/lib/libiconv.a, so +iconv.

On the page from #388 (https://www.sous-titres.eu/films/8_.html, with --recursive --level 1 --no-directories --no-parent --accept zip):

--restrict-file-names master this PR this PR + #399
nocontrol 8.½.(1963).DSP.V1.zip 8.½.(1963).DSP.V1.zip 8.½.(1963).DSP.V1.zip
windows,nocontrol 8.%C2%BD.(1963).DSP.V1.zip 8.%BD.(1963).DSP.V1.zip 8.½.(1963).DSP.V1.zip

The other two files on that page come out the same way.

@rockdaboot
Copy link
Copy Markdown
Owner

Thank you for your contribution. Fixed by 5d9644d (different hash because cherry-picked your commit to test in CI on gitlab.com).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0