Conan 2 Lockfiles for Cross-Compilation
Pin every dependency for x86-64 and ARMv7 targets and rebuild any release on demand.
- Runs out of the box: yes
- Tests: yes
- CI: yes
- Docs: yes
- Used in production: yes
Purpose#
Conan 2 recipes, profiles and lockfiles for a C++ application that ships for a desktop host and an ARMv7 target. Each release tag carries lockfiles for both platforms, so any release can be rebuilt with exactly the same dependency graph.
The repository shows how host and build profiles differ for cross builds, how to update a lockfile deliberately, and how CI refuses a build whose lockfile is out of date.
What you will learn#
- Write host and build profiles for an ARMv7 cross build
- Create, update and commit lockfiles per platform
- Fail CI when the dependency graph no longer matches the lockfile
Technologies & features#
- Technologies
- C++ConanCMake
- Features
- Dependency PinningCross-Compilation
- Topics
- Build Systemsprimary
Lessons learned#
- Worked
Committing lockfiles per release tag turned "rebuild release 3.2" into a single command instead of an archaeology project.
- Didn’t work
Updating all dependencies at once produced unreadable lockfile diffs. Updating one package per change made reviews tractable.
Try it#
git clone https://git.example.internal/mission-software/conan-lock-demo.git
cd conan-lock-demo
conan install . --lockfile=locks/armv7.lock -pr:h=profiles/armv7 -pr:b=default
cmake --preset armv7 && cmake --build --preset armv7Commands come from the owner’s README. Credentials are never stored here.

