Move the build tree out of the source tree (fixed ../build)

The build directory is now a fixed 'build' next to the tree
(qt6-after/build), not in-tree build4 / build4_<timestamp>_<pid> dirs.

- CMakeLists: the $ORIGIN RTI RUNPATH entry is now 4 levels up from a
  bin/ or lib/ artifact (the build tree is one level shallower)
- new_docker_build_release2.sh: BUILD_DIR is the fixed ../build; the DEB
  tar drops the ./build4* exclude (the build dir is outside the tree)
- new_docker_build.sh: Docker mounts the tree's parent so ../build lands
  next to the tree on the host; in-container paths (cmake source,
  SRCROOT, deb_stage, rpms, staging tar) updated accordingly
- rpmbuild/make_rpm_ubuntu26*.py: stale build4/ references now say build/
- README: build4 -> ../build in every snippet and doc line

Verified: fresh full-scope configure + ninja all in qt6-after/build is
green; ctest 20/22 (same 2 pre-existing out-of-scope failures as the
previous baseline); RUNPATH carries the 4-level $ORIGIN entry and
ddscore_unit_test runs with no LD_LIBRARY_PATH / RTI_LICENSE.
This commit is contained in:
berrux-dev committed 2026-11-16 22:20:12 +01:00
1 parent 874efd4733
commit dc2c3e358b
6 files changed
+56 -46

No files matched your search

+22 -18
View File
@@ -21,7 +21,8 @@ Entries at the tree root:
- `Dockerfile` — recipe of the prebuilt build image (Ubuntu 26.04 + Qt 6.10.2 + deps)
- `rpmbuild/make_rpm_ubuntu26.py` — in-tree DEB package producer (self-contained)
- `jenkins-ci-rme/` — in-tree copy of the Jenkins CI flow (see its own `README.md`)
- `build4/` — build tree, created by the driver (git-ignored scratch area)
- `../build/` — build tree, created by the driver **next to the tree**
(`qt6-after/build`), never inside it (git-ignored scratch area)
Toolchain inside the image: **Ubuntu 26.04, GCC 15.2.0, Qt 6.10.2**
(`/opt/Qt/6.10.2/gcc_64`), C++17, Release build. No license file is
@@ -32,9 +33,11 @@ required.
1. **Docker** available on the host.
2. The tree must be reachable inside the container at
`/workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus`, i.e.
mount the pipeline root on `/workspace` — this is how
`new_docker_build.sh` invokes Docker, so running the driver as-is
satisfies this.
mount the tree's parent directory on `/workspace` — this is how
`new_docker_build.sh` invokes Docker (it mounts
`${MIGRATE_PIPELINE_ROOT}/..`), so running the driver as-is satisfies
this. The build tree then lives at `/workspace/build` in the container,
which is `../build` next to the tree on the host.
The driver resolves the pipeline root from its own location (override
with the exported `MIGRATE_PIPELINE_ROOT` or the `.envrc` in this
@@ -68,11 +71,12 @@ To remove it later:
What the driver does inside the container:
1. `rm -rf build4 && mkdir build4 && cd build4` (fresh build tree)
1. `rm -rf ../build && mkdir -p ../build && cd ../build` (fresh build tree,
next to the source tree)
2. Configure with CMake:
```bash
cmake .. \
cmake /workspace/qt6-migrated-legatus \
-DBUILD_TESTING=ON \
-DRELEASE_BUILD=ON \
-DCMAKE_CXX_STANDARD=17 \
@@ -89,24 +93,24 @@ What the driver does inside the container:
Output to inspect after the run:
- `build4/release_build.log` — full make output (the build must end with
- `../build/release_build.log` — full make output (the build must end with
**0 warnings**)
- `build4/bin/` — executables (apps + test binaries)
- `build4/lib/` — shared libraries
- `../build/bin/` — executables (apps + test binaries)
- `../build/lib/` — shared libraries
To rebuild incrementally without a fresh tree, run `make` directly in an
interactive container against the existing `build4/`:
interactive container against the existing `../build/`:
```bash
docker run --rm -it -v /path/to/pipeline-root:/workspace legatus-qt6:1.0 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/build \
&& make -j8'
```
## Run an executable directly
To run a built executable interactively — e.g. the GUI apps under
`build4/bin/` (`LogView`, `PrtCnv`) against your local display — start a
`../build/bin/` (`LogView`, `PrtCnv`) against your local display — start a
shell inside the container with X11 forwarding:
```bash
@@ -116,14 +120,14 @@ docker run --rm -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /path/to/pipeline-root:/workspace \
legatus-qt6:1.0 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 && exec bash'
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/build && exec bash'
```
## Step 3 — Run the tests
### 3.1 ctest (automatic)
`new_docker_build.sh` already runs `ctest --test-dir build4
`new_docker_build.sh` already runs `ctest --test-dir ../build
--output-on-failure` after the compile. Expected baseline (7 tests, all
passed):
@@ -141,7 +145,7 @@ passed):
```bash
docker run --rm -v /path/to/pipeline-root:/workspace legatus-qt6:1.0 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/build \
&& make -j8 coprtcnv_unit_test logview_unit_test prtcnv_unit_test'
```
@@ -152,7 +156,7 @@ GUI-free tests need the offscreen Qt platform in a headless container:
```bash
docker run --rm -it -v /path/to/pipeline-root:/workspace legatus-qt6:1.0 \
bash -c 'export QT_QPA_PLATFORM=offscreen
cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4
cd /workspace/qt-migration-legatus/qt6-after/build
./bin/coprtcnv_unit_test # CoPrtCnv: telegrams, fragmentation, helpers
./bin/logview_unit_test # LogView: IntegerCalculator
./bin/prtcnv_unit_test # PrtCnv: PrtCnvMember fragmented-telegram handling
@@ -292,8 +296,8 @@ Environment overrides: `DOCKER_IMAGE`, `RUN_JENKINS_BUILDER`,
- **"no Qt platform plugin could be initialized"** when running a test
binary by hand → `export QT_QPA_PLATFORM=offscreen`.
- **Stale build tree** → the driver always recreates `build4/`; for
manual builds delete `build4/` and rerun Step 2 if CMake behaves oddly.
- **Stale build tree** → the driver always recreates `../build/`; for
manual builds delete `../build/` and rerun Step 2 if CMake behaves oddly.
- **DEBs not on the host** → the output dir must be a path that exists
*on the host* (it is bind-mounted into the container as
`/workspace/packages-out`); check the `package-output-dir` argument.