fix: install TimingDetector GMX and hoist GNUInstallDirs#35
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughReplaces the single ChangesTimingDetector install-path support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@subsystems/TimingDetector/CMakeLists.txt`:
- Line 52: The TIMING_DETECTOR_GMX_INSTALL_PATH variable definition concatenates
CMAKE_INSTALL_PREFIX with CMAKE_INSTALL_DATADIR, which can produce invalid paths
when CMAKE_INSTALL_DATADIR is absolute. Replace the concatenation of
CMAKE_INSTALL_PREFIX and CMAKE_INSTALL_DATADIR with CMAKE_INSTALL_FULL_DATADIR,
which already contains the full path and handles both relative and absolute
cases correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d9e31952-e231-4264-b588-4dba62c72b1a
📒 Files selected for processing (3)
CMakeLists.txtsubsystems/TimingDetector/CMakeLists.txtsubsystems/TimingDetector/src/TimingDetectorFactory.cpp
Install timing_detector.gmx (and the co-located geomodel.dtd) into
${CMAKE_INSTALL_FULL_DATADIR}/SHiPGeometry/TimingDetector. Bake both
the build-tree path and the install-tree path as compile-time defines
and pick the first one that exists at runtime, so the factory works in
both development and installed deployments.
a29ff02 to
4ecb42c
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Two related installation fixes that together let installed deployments find subsystem data files without environment overrides.
include(GNUInstallDirs)aboveadd_subdirectory(subsystems). The top-level include sat after the subsystems were processed, so\${CMAKE_INSTALL_DATADIR}was empty in their install rules.calo.tomlandsbt.tomlwere silently being installed to absolute/SHiPGeometry/; with the hoist they land under\$PREFIX/share/SHiPGeometry/(and so does the new TimingDetector GMX).timing_detector.gmx+ resolve path at runtime. Mirror the existing pattern fromCalorimeter/DecayVolume: bake both aTIMING_DETECTOR_GMX_DEFAULT_PATH(build tree) andTIMING_DETECTOR_GMX_INSTALL_PATH(\${CMAKE_INSTALL_PREFIX}/share/SHiPGeometry/TimingDetector/...) compile definition, install the GMX and the co-locatedgeomodel.dtd(Xerces resolves the document SYSTEM identifier against it), and resolve at runtime via a small file-scope helper that prefers build-tree → install-tree. Without this, packaged builds oflibTimingDetector.socarried a build-time absolute path that didn't exist on the consumer's machine.Test plan
pixi run buildsucceedspixi run test— all 33 tests pass (includingTimingDetectorTestandBuilderTest)cmake --install build --prefix=/tmp/td-installputsshare/SHiPGeometry/calo.toml,share/SHiPGeometry/sbt.toml,share/SHiPGeometry/TimingDetector/timing_detector.gmx, andshare/SHiPGeometry/TimingDetector/geomodel.dtdunder the prefixSummary by CodeRabbit