Fix native Linux build and add a native Linux CI job - #5813
Conversation
952c3e9 to
834d4e1
Compare
|
I don't know why this diff is so short when reading #5631 (comment) |
834d4e1 to
f6c843c
Compare
cmd/build-linux.ts had drifted from premake and from recent source changes: - sync test_util sources (DocProperties, PdfDarkMode Oklab/ImageRules and their _ut tests, all called unconditionally by test_util) - add the a-gumbo dependency lib (GumboHtmlParser) and the PdfCadDetect/PdfCadEnhanceDevice/PdfDarkModeNoOp sources premake lists for test_engines - fix renamed a-zlib/a-openjpeg archive names in the link list - link -lcrypto (Crypto_posix.cpp uses OpenSSL MD5) - wrap test_engines archives in --start-group: harfbuzz's custom allocator symbols live in mupdf's mupdf_load_system_font.c, behind it in link order a-openjpeg: include the x86 intrinsic headers before the malloc poison pragma. clang, unlike gcc, enforces poison inside system headers, and mm_malloc.h (pulled in by SSE headers) calls malloc; never seen on macOS because arm64 has no xmmintrin.h. Extend the Linux workflow with a native job that builds all dependency libs with clang, runs test_util's unit-test suite natively on Linux, and links test_engines. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012mBFgiNUBqbB5x2dg996Ft prompt: get SumatraPDF fully working on Linux with a minimal patch and working CI; second PR, stacked on the Wine one: the native Linux build fixes plus its CI job
f6c843c to
6e4972a
Compare
|
@koppor I don't really have a preference about doing mac or linux first. It's just I use mac and not linux, so it's easier for me to work on mac. If you want to work on Linux UI feel free. You can commit directly, no need to wait for me to review - it's a lot of work and wouldn't be efficient to wait for approval for every change. Just don't break Windows build. I think I started on the right foundation for mac/linux port. My general idea is to replicate the Windows UI but no need to be 100%. Especially in the beginning it's more important to implement features that reproduce windows UI 100%. I prefer re-using as much code/logic from windows but I understand the realities. It's ok to duplicate, sharing code can always be improved in the future. |

🤖 This description was generated by Claude Code.
Stacked on #5812 (
linux-wine-ci) — it needs that PR's shared lib-def fixes. GitHub will retarget this tomasterautomatically when the base PR merges and its branch is deleted.What
cmd/build-linux.ts(native Linux build of all dependency libs plus the portabletest_util/test_enginestools) had drifted from premake and from recent source changes:test_utilsources synced with premake:DocProperties.cpp,PdfDarkModeImageRules/Oklab.cppand their_uttests — all called unconditionally bytest_util.cppandSumatraUnitTests.cpp, so the link was brokentest_engines: add thea-gumbodependency lib (GumboHtmlParserneeds it) and thePdfCadDetect/PdfCadEnhanceDevice/PdfDarkModeNoOpsources premake lists for itlibzlib.a/libopenjpeg.a→liba-zlib.a/liba-openjpeg.a)-lcrypto:Crypto_posix.cppuses OpenSSL's MD5 (the native build now needslibssl-dev)test_enginesarchives in-Wl,--start-group: harfbuzz is built with custom allocators (sumatra_hb_*) whose definitions live in mupdf'smupdf_load_system_font.c, behind harfbuzz in link order — single-pass ld can't resolve that without a groupext/a-openjpeg/opj_malloc.h: include the x86 intrinsic headers before the#pragma GCC poison malloc …. clang — unlike gcc — enforces poison inside system headers, andmm_malloc.h(pulled in by the SSE headers that a later chunk of the amalgamation includes) callsmalloc. Never seen on macOS because arm64 has noxmmintrin.h. (Note: regenerating the amalgamation viacmd/a-openjpeg.tswould drop this line; its ownvalidateCompilestep will catch that.)CI: extends
.github/workflows/linux.ymlwith anativejob (samedebian:trixiecontainer): builds all dependency libs with clang, runstest_util's unit-test suite natively on Linux as part of the build, and linkstest_engines.How tested
On Linux, inside a
debian:trixiecontainer (same as the CI job):The workflow job was validated locally with
nektos/actin the same container. No Windows-facing changes in this PR (build-linux.tsis Linux-only; theopj_malloc.hchange is inside#if defined(__GNUC__)).🤖 Generated with Claude Code