Skip to content

Commit 5191950

Browse files
authored
ci: pass Eigen3_DIR with its PATH type to the release configure (#796)
1 parent d1c1934 commit 5191950

7 files changed

Lines changed: 30 additions & 35 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ jobs:
615615
# VERSION has no tag at all.
616616
cmake -B build \
617617
-DCMAKE_BUILD_TYPE=Release \
618-
-DEigen3_DIR=/usr/share/eigen3/cmake \
618+
-DEigen3_DIR:PATH=/usr/share/eigen3/cmake \
619619
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
620620
-DPINEFORGE_BUILD_TESTS=OFF \
621621
-DPINEFORGE_BUILD_TUTORIAL=OFF \

‎scripts/build_prebuilt_bookworm.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ inside_build() {
160160
-DCMAKE_BUILD_TYPE=Release \
161161
-DCMAKE_C_COMPILER=/usr/bin/gcc \
162162
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
163-
-DEigen3_DIR=/usr/share/eigen3/cmake \
163+
-DEigen3_DIR:PATH=/usr/share/eigen3/cmake \
164164
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
165165
-DPINEFORGE_BUILD_TESTS=OFF \
166166
-DPINEFORGE_BUILD_TUTORIAL=OFF \

‎scripts/ci_preflight.py‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3561,7 +3561,7 @@ def _compiler_cache_restore_with(step: str) -> list[str]:
35613561
# VERSION has no tag at all.
35623562
cmake -B build \
35633563
-DCMAKE_BUILD_TYPE=Release \
3564-
-DEigen3_DIR=/usr/share/eigen3/cmake \
3564+
-DEigen3_DIR:PATH=/usr/share/eigen3/cmake \
35653565
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
35663566
-DPINEFORGE_BUILD_TESTS=OFF \
35673567
-DPINEFORGE_BUILD_TUTORIAL=OFF \
@@ -3981,7 +3981,7 @@ def _compiler_cache_restore_with(step: str) -> list[str]:
39813981
# VERSION has no tag at all.
39823982
cmake -B build \
39833983
-DCMAKE_BUILD_TYPE=Release \
3984-
-DEigen3_DIR=/usr/share/eigen3/cmake \
3984+
-DEigen3_DIR:PATH=/usr/share/eigen3/cmake \
39853985
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
39863986
-DPINEFORGE_BUILD_TESTS=OFF \
39873987
-DPINEFORGE_BUILD_TUTORIAL=OFF \
@@ -4186,7 +4186,8 @@ def prebuilt_hosted_diagnostic_findings(workflow: str) -> list[str]:
41864186
# expectation corrected: daaf2fe0541b5d0f8aab0746b35dcf069862afa3 -> f02008afa4d3503e3b71531b26853f7e712c9ffe, because hosted transport records real Docker versions and host UID/GID under /home/runner/work.
41874187
# Host UID 1001 and the container's 1001:123 identity remain required.
41884188
# expectation corrected: f02008afa4d3503e3b71531b26853f7e712c9ffe -> dc2f8a2768eed52109d49d1d1098f22201710477, because Docker's image Id is pinned to the recorded config digest, separately from the unchanged registry manifest digest.
4189-
RELEASE_BOOKWORM_HELPER_BLOB = 'dc2f8a2768eed52109d49d1d1098f22201710477'
4189+
# expectation corrected: dc2f8a2768eed52109d49d1d1098f22201710477 -> a7ecf38c891bc81424a89d8b97e35880cea9bd15, because the configure passes -DEigen3_DIR:PATH= so the cache line it checks is written with its type; the rest of the helper is unchanged.
4190+
RELEASE_BOOKWORM_HELPER_BLOB = 'a7ecf38c891bc81424a89d8b97e35880cea9bd15'
41904191
# The helper delegates the shipped-archive execution to this exact consumer.
41914192
# This is a source contract, never a native-runtime verdict.
41924193
RELEASE_BOOKWORM_CONSUMER_BLOB = 'd066968913c0d4ff7358e6fd4dde2a794e1be600'
@@ -4768,19 +4769,7 @@ def _release_split_steps(job: str) -> list[str]:
47684769
EIGEN_DIR_TYPED = '-DEigen3_DIR:PATH=/usr/share/eigen3/cmake'
47694770

47704771

4771-
def _eigen_dir_accept_typed(text: str) -> str:
4772-
"""Read the typed Eigen3_DIR flag as the reviewed one.
4773-
4774-
Without a type CMake caches Eigen3_DIR as UNINITIALIZED, so the reviewed
4775-
`grep -Fx 'Eigen3_DIR:PATH=...'` never matches. The typed flag is the fix;
4776-
both forms are admitted until the workflow switches, then the contract
4777-
keeps the typed form only.
4778-
"""
4779-
return text.replace(EIGEN_DIR_TYPED, EIGEN_DIR_UNTYPED)
4780-
4781-
47824772
def _release_split_job_findings(job: str, body: str) -> list[str]:
4783-
body = _eigen_dir_accept_typed(body)
47844773
findings = []
47854774
metadata = []
47864775
in_steps, step_mappings = False, 0
@@ -4873,7 +4862,6 @@ def _release_split_workflow_findings(workflow: str) -> list[str]:
48734862

48744863
def release_prebuilt_workflow_findings(workflow: str) -> list[str]:
48754864
"""Pin artifact structure and its token-only admission surface."""
4876-
workflow = _eigen_dir_accept_typed(workflow)
48774865
if _release_split_requested(_jobs(workflow)):
48784866
return _release_split_workflow_findings(workflow)
48794867
prebuilt = _jobs(workflow).get('prebuilt', '')

‎scripts/fixtures/ci_preflight/release_legacy.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ jobs:
460460
# VERSION has no tag at all.
461461
cmake -B build \
462462
-DCMAKE_BUILD_TYPE=Release \
463-
-DEigen3_DIR=/usr/share/eigen3/cmake \
463+
-DEigen3_DIR:PATH=/usr/share/eigen3/cmake \
464464
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
465465
-DPINEFORGE_BUILD_TESTS=OFF \
466466
-DPINEFORGE_BUILD_TUTORIAL=OFF \

‎scripts/fixtures/ci_preflight/release_split_hosted_2167.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ jobs:
615615
# VERSION has no tag at all.
616616
cmake -B build \
617617
-DCMAKE_BUILD_TYPE=Release \
618-
-DEigen3_DIR=/usr/share/eigen3/cmake \
618+
-DEigen3_DIR:PATH=/usr/share/eigen3/cmake \
619619
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
620620
-DPINEFORGE_BUILD_TESTS=OFF \
621621
-DPINEFORGE_BUILD_TUTORIAL=OFF \

‎scripts/test_build_prebuilt_bookworm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def test_helper_pin_consumes_changed_source_and_refuses_unsafe_transport_mutatio
514514
("target=/output", "target=/var/run/docker.sock"),
515515
("source=$source_dir", "source=$workspace/.git"),
516516
("CMAKE_PROJECT_INCLUDE", "CMAKE_PROJECT_INCLUDE_BEFORE"),
517-
("Eigen3_DIR=/usr/share/eigen3/cmake", "Eigen3_DIR=/host/eigen"),
517+
("Eigen3_DIR:PATH=/usr/share/eigen3/cmake", "Eigen3_DIR:PATH=/host/eigen"),
518518
("PINEFORGE_VERSION_SOURCE=FILE", "PINEFORGE_VERSION_SOURCE=AUTO"),
519519
("FETCHCONTENT_FULLY_DISCONNECTED=ON", "FETCHCONTENT_FULLY_DISCONNECTED=OFF"),
520520
("EIGEN_MINOR_VERSION[[:space:]]+0", "EIGEN_MINOR_VERSION[[:space:]]+1"),

‎scripts/test_ci_preflight.py‎

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ def test_release_eigen_exact(self):
11861186
self.assertNotIn('dpkg-query', install)
11871187
# The ARM configure consumes exactly the system Eigen the ARM step asserted.
11881188
for line in (" if: matrix.triple == 'linux-aarch64'",
1189-
' -DEigen3_DIR=/usr/share/eigen3/cmake \\',
1189+
' -DEigen3_DIR:PATH=/usr/share/eigen3/cmake \\',
11901190
' -DFETCHCONTENT_FULLY_DISCONNECTED=ON \\',
11911191
" grep -Fx 'Eigen3_DIR:PATH=/usr/share/eigen3/cmake' build/CMakeCache.txt"):
11921192
self.assertIn(line, ci_preflight._code(configure))
@@ -1253,8 +1253,10 @@ def test_release_eigen_exact(self):
12531253
(arm_name, arm_name, 'Assert Eigen3 3.4.0 on arm64', False),
12541254
(arm_name, arm, '', False),
12551255
# Configure: the Eigen directory, the cache proof and offline FetchContent.
1256-
(configure_name, '-DEigen3_DIR=/usr/share/eigen3/cmake',
1257-
'-DEigen3_DIR=/other/eigen', False),
1256+
(configure_name, '-DEigen3_DIR:PATH=/usr/share/eigen3/cmake',
1257+
'-DEigen3_DIR:PATH=/other/eigen', False),
1258+
(configure_name, '-DEigen3_DIR:PATH=/usr/share/eigen3/cmake',
1259+
'-DEigen3_DIR=/usr/share/eigen3/cmake', False),
12581260
(configure_name,
12591261
"grep -Fx 'Eigen3_DIR:PATH=/usr/share/eigen3/cmake' build/CMakeCache.txt",
12601262
'true', False),
@@ -12821,10 +12823,10 @@ def setUp(self):
1282112823
announce_compare_fixture_paths(fixture, legacy, gke_fixture, release)
1282212824
split_bytes = fixture.read_bytes()
1282312825
self.assertEqual(hashlib.sha256(split_bytes).hexdigest(),
12824-
'00e84f8d45028105c580ac84818ccdd96ff08aeab352286273a29a02eaeed062')
12826+
'0c782f0b663c83fcd0ea47646ba3f4f24a87d59b94cde51d95bb95407218b310')
1282512827
legacy_bytes = legacy.read_bytes()
1282612828
self.assertEqual(hashlib.sha256(legacy_bytes).hexdigest(),
12827-
'3f6443192ad993e59e543b85ef00ebca226dba4a2e4c2647a02ac371daa2b267')
12829+
'9572e9f99ef22b7d4aa21fcab2009deb812f00b682d65184c867b4d768e47eee')
1282812830
gke_bytes = gke_fixture.read_bytes()
1282912831
self.assertEqual(hashlib.sha256(gke_bytes).hexdigest(),
1283012832
'21025075090a0a40bfd7360e54a36a0c9bbac9bb8109fbbaa86edce347c27b87')
@@ -12853,20 +12855,25 @@ def assert_refused(self, changed, finding):
1285312855
self.assertIn(finding, main_admission_data_findings(
1285412856
{'gke-pr.yml': self.gke, 'release.yml': changed}))
1285512857

12856-
def test_typed_eigen_dir_flag_is_admitted_in_both_layouts(self):
12858+
def test_only_the_typed_eigen_dir_flag_is_admitted_in_both_layouts(self):
1285712859
# The untyped flag leaves Eigen3_DIR UNINITIALIZED in the cache, so the
12858-
# reviewed grep for Eigen3_DIR:PATH fails; the typed flag is admitted.
12860+
# reviewed grep for Eigen3_DIR:PATH fails: only the typed flag is admitted.
1285912861
untyped = ci_preflight.EIGEN_DIR_UNTYPED
1286012862
typed = ci_preflight.EIGEN_DIR_TYPED
1286112863
for workflow in (self.split, self.legacy):
12862-
changed = workflow.replace(untyped, typed)
1286312864
with self.subTest(jobs=tuple(_jobs(workflow))):
12864-
self.assertNotEqual(changed, workflow)
12865-
self.assertEqual(ci_preflight.release_prebuilt_workflow_findings(changed), [])
12866-
self.assertEqual(ci_preflight.runner_findings({'release.yml': changed}), [])
12865+
self.assertIn(typed, workflow)
12866+
self.assertEqual(ci_preflight.release_prebuilt_workflow_findings(workflow), [])
12867+
self.assertEqual(ci_preflight.runner_findings({'release.yml': workflow}), [])
1286712868
self.assertEqual(main_admission_data_findings(
12868-
{'gke-pr.yml': self.gke, 'release.yml': changed}), [])
12869-
moved = self.split.replace(untyped, '-DEigen3_DIR:PATH=/outside')
12869+
{'gke-pr.yml': self.gke, 'release.yml': workflow}), [])
12870+
reverted = workflow.replace(typed, untyped)
12871+
self.assertNotEqual(reverted, workflow)
12872+
self.assertTrue(ci_preflight.release_prebuilt_workflow_findings(reverted))
12873+
self.assertTrue(ci_preflight.runner_findings({'release.yml': reverted}))
12874+
self.assertTrue(main_admission_data_findings(
12875+
{'gke-pr.yml': self.gke, 'release.yml': reverted}))
12876+
moved = self.split.replace(typed, '-DEigen3_DIR:PATH=/outside')
1287012877
self.assertTrue(ci_preflight.release_prebuilt_workflow_findings(moved))
1287112878

1287212879
def test_legacy_and_split_layouts_dispatch_through_real_parsers(self):
@@ -13167,7 +13174,7 @@ def test_arm_eigen_configure_build_install_and_archive_steps_stay_applicable(sel
1316713174
('Install Eigen3 (Linux)', 'sudo apt-get install -y libeigen3-dev', 'true'),
1316813175
('Assert Eigen3 3.4.0 on ARM', 'EIGEN_MAJOR_VERSION[[:space:]]+4',
1316913176
'EIGEN_MAJOR_VERSION[[:space:]]+3'),
13170-
('Configure', '-DEigen3_DIR=/usr/share/eigen3/cmake', '-DEigen3_DIR=/outside'),
13177+
('Configure', '-DEigen3_DIR:PATH=/usr/share/eigen3/cmake', '-DEigen3_DIR:PATH=/outside'),
1317113178
('Configure', '-DFETCHCONTENT_FULLY_DISCONNECTED=ON', '-DFETCHCONTENT_FULLY_DISCONNECTED=OFF'),
1317213179
('Build', 'cmake --build build -j 4', 'true'),
1317313180
('Install to staging', 'cmake --install build', 'true'),

0 commit comments

Comments
 (0)