Skip to content

Add headless CLI CMake options and fix Alpine Dockerfile for v4 - #218

Merged
BJNFNE merged 1 commit into
horsicq:masterfrom
doomedraven:headless-cli-docker-v4
Nov 17, 2026
Merged

BJNFNE merged 1 commit into
horsicq:masterfrom
doomedraven:headless-cli-docker-v4

Conversation

@doomedraven

@doomedraven doomedraven commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds CMake build options to compile diec without Qt GUI/translation components and updates Dockerfile so headless Alpine Linux v4 builds succeed out of the box (both standalone from the DIE-engine repository root, as invoked by .github/workflows/docker-image.yml, and from a parent Detect-It-Easy checkout containing DIE-engine_src/).

(Rebased onto 26f77b4 after horsicq/XArchive#11 merged and dep/XArchive updated, removing the temporary PAGE_SIZE sed guard.)


Why These Changes Are Needed

  1. Unconditional Qt GUI / translation dependencies in src/CMakeLists.txt

    • src/CMakeLists.txt previously hard-required Widgets PrintSupport OpenGL Svg Sql ScriptTools LinguistTools and always added gui, lite, and deploy_add_translations even when building only --target diec.
    • Adding DIE_BUILD_GUI, DIE_BUILD_LITE, and DIE_BUILD_TRANSLATIONS (all defaulting to ON, preserving existing full builds) alongside DIE_BUILD_UPDATER narrows headless diec dependencies to Core Concurrent + Script (Qt5) / Qml (Qt6), eliminating qt5-qtsvg-dev, qt5-qttools-dev, libQt5Gui, libQt5Widgets, libQt5Svg, and libQt5Network when DIE_BUILD_UPDATER=OFF (while keeping add_subdirectory(updater) active so static die_updater_qt remains available to diec).
  2. Broken build context and submodule initialization in Dockerfile

    • .github/workflows/docker-image.yml checks out DIE-engine without submodules: recursive and runs docker build . --file Dockerfile, whereas Dockerfile previously expected COPY DIE-engine_src . from a parent directory.
    • Resolving /ctx/DIE-engine_src vs /ctx, initializing submodules when dep/XArchive/CMakeLists.txt is absent, and resolving databases from /ctx/db or dep/Detect-It-Easy allows both workflows to build cleanly.
  3. Shared library symlink extraction and v4 database cleanup in Dockerfile

    • cp -v on ldd paths copied symlinks without dereferencing targets (cp -Lv copies resolved shared objects cleanly while skipping /lib/ld-musl-*, which already exists in the base alpine:latest runtime stage).
    • Removed the obsolete v3 sed workaround on dep/XOptions/xoptions.cpp and deprecated db_extra copy, and added X_WITH_PEID=ON peid_rules handling.

Verification

  • Built cleanly on alpine:latest via docker build . --file Dockerfile (~61.5 MB final image).
  • Verified diec --version, diec --showdatabase, and ldd /usr/bin/diec inside the runtime container (only Qt5Core, Qt5Script, and base C++/ICU/compression libraries linked; zero GUI/X11/Network libraries).

@BJNFNE
BJNFNE merged commit c461f4f into horsicq:master Nov 17, 2026
22 of 24 checks passed
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