The release artifacts were not self-contained. qdl links libxml2 and
libzip (and, on Linux, their transitive closure), but packaging copied
only a subset of those libraries, so qdl failed to start on hosts
without them installed. Inspecting the uploaded artifacts:
Artifact Missing Status
--------------- ---------------------------- ------
ubuntu-22-x64 libxml2.so.2, libzip.so.4 broken
ubuntu-22-arm64 libxml2.so.2, libzip.so.4 broken
ubuntu-24-x64 libxml2.so.2, libzip.so.4 broken
ubuntu-24-arm64 libxml2.so.2, libzip.so.4 broken
macos-arm64 libzip.5.dylib (Homebrew) broken
macos-intel libzip.5.dylib (Homebrew) broken
windows-x64 - ok
windows-arm64 - ok
On Linux only libusb was copied; libxml2 and libzip (plus their closure:
libz, liblzma, libzstd, libbz2, libcrypto, libudev) were left to the
host. On macOS libzip was never handled, so the binary kept an absolute
Homebrew path to libzip.5.dylib. Windows already bundled the full set.
Bundle the complete dependency closure on Linux (every ldd entry except
the C runtime and dynamic loader) and set an $ORIGIN RUNPATH on the
binary and each bundled library, since RUNPATH is not inherited by
transitively-loaded libraries.
On macOS, use dylibbundler to recursively copy the non-system dylibs and
rewrite the load commands to @executable_path, replacing the
hand-maintained install_name_tool calls that missed libzip.
Both jobs now fail if any non-system library remains unresolved after
packaging.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The dependencies has been extended, but necessary dll files was not
added to the list of artifacts. Fix this to make it possible to run the
artifacts.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
The parsing of rawprogram files as well as the fallback and precedence
rules, is complex and subject for upcoming changes as part of the
introduction of contents XML support.
Introduce cmocka and a set of test cases to validate the <program>
entries in the rawprogram files are handled as expected.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Until now checkpatch had two divergent code paths: the local meson
'check' target ran 'checkpatch.pl --no-tree -f' against every tracked
source file, while the CI workflow used the webispy/checkpatch-action
action, which runs checkpatch in patch mode against each commit in the
PR. The two modes report different defects -- in particular, file mode
flags style issues in long-untouched code and skips commit-log checks,
while patch mode validates the commit message (Signed-off-by, subject
length, ...) and only inspects added/changed lines. Contributors could
end up with a green local 'check' but a red CI run, and vice versa.
Introduce a 'check-range' mode in scripts/checkpatch_wrapper.sh that
mirrors what the GitHub Action does: iterate over every commit in
CHECKPATCH_BASE..CHECKPATCH_HEAD (defaulting to origin/master..HEAD),
feed each commit through 'git format-patch -1 --stdout' and pipe the
result into checkpatch.pl. All commits are processed even on failure
so the user sees every offending commit in one go.
Expose the new mode as a meson run_target ('meson compile check-range
-C build') and switch the CI workflow to invoke the wrapper directly
with the PR base/head SHAs, so local and CI invocations exercise the
exact same code path. Document the new target in README under the
Contributing section.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The markdown lint check previously only ran in CI via the
markdownlint-cli2 GitHub Action, which meant developers had no
straightforward way to reproduce the check locally before pushing. As a
result, contributors only discovered lint errors after opening a PR.
Introduce scripts/markdownlint_wrapper.sh that drives mdl on the same
set of files the CI workflow lints. mdl is shipped as a Debian/Ubuntu
package, so contributors can install it with 'sudo apt install mdl'
without pulling in a Node.js toolchain. Wire the wrapper up as a meson
run_target so it can be invoked with:
meson compile markdown-lint -C build
Switch the markdown-lint workflow to install mdl from apt and invoke
the wrapper directly, making the script the single source of truth for
both local and CI runs. Document the usage in README under the
Contributing section.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The flashmap support saves the user from having to specify programmer,
program and patch XML files, it allows reading the flashmap.json either
among the flat files, or as part of a zip-container of all the parts.
Add dry-run tests for the two cases, by introducing a flashmap.json and
zipping up all the files, then run qdl on the two versions.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
The flashmap and related files form a package, suitable for distribution
and one-step installation, but having to unzip the archive in order to
flash/install its content is not convenient for the user.
Extend the qdl_file helper code to also provide access to files within a
zip file, then extend the flashmap code to attempt to decode the package
file as such.
Pass the optional zip object around to the various places where we might
read files from the package.
With this we can now "flash" the installer.zip directly:
qdl flash installer.zip
The selective flashing mechanism is carried into the zip handling,
allowing the user to flash specific memories only, such as:
qdl flash installer.zip::spinor
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Replace the existing Makefile-based build system with Meson to improve
build performance, cross-platform support, and maintainability.
Key improvements:
* Build performance: Shared source files (sahara.c, util.c, oscompat.c,
ux.c, sim.c, io.c) are now compiled once and linked into multiple
targets instead of being compiled separately for each executable.
This reduces total compilation units from ~30 to ~20 and speeds up
build.
Full build benchmark results below
Before (Make): $ time make
...
real 0m1.668s
user 0m1.424s
sys 0m0.242s
After (Meson): $ time bash -c '
meson setup build
meson compile -C build
'
...
real 0m0.759s
user 0m0.877s
sys 0m0.237s
* Flexible build directory: Unlike Make which builds in-tree, Meson
supports out-of-tree builds with custom build directories.
Example workflows:
meson setup builddir # Default debug build
meson setup build-release --buildtype=release
meson setup build-asan -Db_sanitize=address
meson setup build-arm64 --cross-file=aarch64-linux.txt
This enables:
- Multiple build configurations simultaneously
- Clean source tree (no .o files polluting git status)
- Easy comparison between debug/release builds
- Separate builds for different architectures
* Cross-compilation: Native support for cross-compilation via Meson
cross-files enables building for multiple architectures without
requiring separate build runners for each target platform.
Before (Make): Requires native ARM64 runner in GitHub Actions
runs-on: ubuntu-24.04-arm # Dedicated ARM64 hardware
run: make
After (Meson): Cross-compile from x64 host
runs-on: ubuntu-24.04 # x64 host
run: |
meson setup build-arm64 --cross-file=ci/aarch64-linux.txt
meson compile -C build-arm64
* Automatic dependency tracking: Meson automatically tracks header
dependencies, eliminating the need for manual dependency declarations
and preventing missed recompilation on header changes.
Before (Make): Manual dependency tracking
util.o: version.h # Must be manually maintained
After (Meson): Automatic header scanning
# No manual declarations needed
# Changing qdl.h automatically rebuilds all files that include it
Result: Prevents subtle bugs where changing a header doesn't trigger
necessary recompilation.
* Platform handling: Windows-specific linking (ws2_32) and platform
detection are now handled declaratively without shell conditionals.
* Testing integration: Test suite is now integrated into the build
system with proper dependency tracking and timeout handling.
Before (Make):
make tests # Shells out to bash script
After (Meson):
meson test -C builddir
meson test -C builddir --verbose
meson test -C builddir --wrapper='valgrind --leak-check=full'
Result: Better test output formatting, timeout handling, and ability
to run tests under valgrind or sanitizers.
* Installation: Standard installation paths and packaging support
through Meson's built-in install infrastructure.
Before (Make):
make install prefix=/usr/local DESTDIR=/tmp/package
After (Meson):
meson setup builddir --prefix=/usr/local
DESTDIR=/tmp/package meson install -C builddir
# Correctly installs to:
# - /usr/local/bin/{qdl,qdl-ramdump,ks}
# - /usr/local/share/man/man1/{qdl.1,qdl-ramdump.1,ks.1}
Result: Better integration with distribution packaging (Debian .deb,
RPM) and standard FHS paths.
Migration maintains full feature parity with the existing build system:
- All three executables (qdl, qdl-ramdump, ks) build correctly
- Version string generation from git tags
- Optional man page generation
- Support for Linux, macOS, and Windows (MSYS2/MinGW)
- Recreated tests integration via Meson’s test() function,
including support for script arguments (e.g. --builddir)
Usage:
$ meson setup build
$ meson compile -C build
$ meson test -C build
$ meson compile check -C build
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Malformed commit messages (overlong lines, missing blank line between
subject and body) have slipped through review. Automate the check in
CI so every PR is validated before merge.
Uses commitlint with a Linux kernel-style config: 72-char limit on
subject and body lines, blank-line rules enforced, Conventional
Commits type enforcement disabled.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The Windows builds suddenly fails with:
Cannot find path 'C:\a\_temp\msys64\mingw64\bin\liblzma-5.dll' because it does not exist.
The internet indicates that this is caused by the lack of
mingw-w64-x86_64-xz, so let's introduce this.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Add a step for generating manual pages using recently added `manpages`
target in [1].
[1] commit 0a3c1175bd ("Add 'manpages' as new target to generate manpages by help2man")
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Make sure we can get the version into the binary for '--version' and
does not show up as "unknown-version" by installing git.
Additionally make sure to configure autocrlf to avoid -dirty suffix.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
With only a --depth=1 checkout we do not get good build info for
'qdl --version'.
Check out the full history so that the version is printed nicely.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
As announced by GitHub, the "macos-13" runners are being retired. The
x86_64 build has been using this, so bump it to "macos-15-intel", in
case we have any x86_64 users.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Increase fetch-depth property for [1] action, which indicates that all
history for all branches and tags should be fetched.
This fix address such checkpatch issues as:
WARNING: Unknown commit id '4ed250c18436', maybe rebased or not pulled?
Fixes: 4ed250c184 ("qdl: add support for vip table of digests generation")
Error: WARNING: Unknown commit id '4ed250c18436', maybe rebased or not pulled?
[1] https://github.com/webispy/checkpatch-action
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
* Enable running tests on Windows
* Don't install cmake package, as it's not needed
* Install base-devel package, which contains regular make, diff and cmp
tools.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Add tests make target and a simple test that executes qdl in dry-run mode
for a synthetic reference FLAT build with VIP table generation.
The FLAT build contains:
- patch0.xml
- patch1.xml
- rawprogram0.xml
- rawprogram1.xml
All binaries that these XML files point to are filled with zeros, generated
during github action execution.
Tests ensures that the table is generated correctly by comparing
calculated and expected SHA256 hashes of DigestToSign.bin file.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Add Linux arm64, Mac Intel and Windows arm64 to the CI build. GitHub Actions runners for those platforms are available for OSS repos for free.
Signed-off-by: Julien Vanier <jvanier@gmail.com>
GitHub Actions doesn't provide workers for Ubuntu arm64 or Mac x64. A paid plan with hosted runners is necessary for those architectures.
Signed-off-by: Julien Vanier <jvanier@gmail.com>
Compile for Linux x64 and arm64, Mac x64 and arm64 and Windows x64 on GitHub Actions. Upload binaries and required libraries for testing on those systems.
Signed-off-by: Julien Vanier <jvanier@gmail.com>