How rlmeeson/wkhtmltopdf-packaging works
Project type and purpose
• This is a tooling repository that automates building and packaging of wkhtmltopdf across multiple platforms.
• It decouples packaging logic from releases, using containers (Docker) and VMs (Vagrant) to produce reproducible artifacts.
• CI/CD is orchestrated via Azure Pipelines and GitHub Actions for release workflows.
File structure
• CI/CD configs at top level:
• .azure-pipelines.yml – Azure build definitions
• .github/workflows/release.yml – GitHub Actions release pipeline
• Dependency management:
• .conan/ – conan client configuration and profiles for each target platform
• conanfile.txt – declares external libraries (e.g., patched Qt)
• Build orchestrator:
• build (executable shell or Python wrapper)
• build.yml – YAML configuration of build targets and their parameters
• Packaging and post-build:
• after_compile/amazonlinux2_lambda.sh – post-processing for specific targets
• Multi-platform definitions:
• docker/ – Dockerfiles for Linux distributions and cross-compile images
• vagrant/ – Vagrantfile plus platform plugins (macos.py, windows.py) for non-Linux targets
• Versioning and automation:
• build scripts generate version numbers from git commits, iteration flags for filename variations
README insights
• Workflows:
• build package-docker – runs Docker container builds
• build vagrant – provisions VMs, rsyncs code, executes conan and compilation inside VM
• QEMU for cross-arch emulation in Docker, configurable via --no-qemu / --use-qemu
• Output artifacts are placed in a “targets” folder for later consumption
a. Main components
• CI/CD orchestrator (Azure Pipelines + GitHub Actions)
• Build orchestrator (build script + build.yml)
• Dependency manager (Conan + profiles)
• Docker build subsystem (docker/ Dockerfiles + QEMU integration)
• Vagrant build subsystem (Vagrant core + platform plugins under vagrant/)
• Post-build handlers (after_compile scripts)
• Artifact repository (targets folder, release workflow)
b. Relationships and interactions
• CI/CD initiates the build orchestrator
• Build orchestrator reads build.yml and conanfile.txt, loads conan profiles
• For Linux targets: orchestrator calls Docker subsystem → container spins up → conan installs deps → compile & package → outputs to host targets folder
• For non-Linux targets: orchestrator calls Vagrant subsystem → VM is provisioned → code rsync → conan + Qt build inside VM → package → host targets folder
• Post-build handlers run after compile phase to tweak or wrap outputs
• CI/CD then picks artifacts and pushes to release channel
c. Architectural patterns & design principles
• Separation of concerns: packaging logic is separate from application source
• Plugin-like architecture for Vagrant targets (prepare_build, package_build)
• Declarative config: build.yml defines targets, conan profiles abstract dependencies
• Immutable build environments: containers/VMs ensure reproducible outputs
d. Key technologies, frameworks, libraries
• Python & shell build scripts
• Conan package manager
• Docker & QEMU for containerized cross-compilation
• Vagrant + VirtualBox for VM-based builds
• fpm (optionally) for distro packaging
• Azure Pipelines & GitHub Actions for CI/CD
Detail
• That Vagrant plugins implement a common interface with prepare_build and package_build
• QEMU integration as a conditional component within the Docker subsystem
• That build.yml drives both subsystems via named targets (e.g., buster-amd64, macos, windows)