Skip to content

[FIX] Windows NSIS packaging: locate Cfg_Settings.nsh via absolute path - #9978

Merged
timosachsenberg merged 1 commit into
developfrom
claude/sweet-fermat-ssuqmv
Aug 28, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/sweet-fermat-ssuqmv

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

The nightly Release workflow's Windows packaging job ("Build, Test, and Package (windows-2025, cl.exe)") has failed on its CPack "Package" step for 5 consecutive nightly runs (Aug 24–28), always with:

!include: could not find: "..\..\..\Cfg_Settings.nsh"
Error in script "C:/cpk/_CPack_Packages/win64/NSIS/project.nsi" on line 24 -- aborting creation process

Root cause: cmake/Windows/NSIS.template.in includes Cfg_Settings.nsh (generated by cmake/package_nsis.cmake into ${PROJECT_BINARY_DIR}) via a hardcoded ..\..\..\ relative path from CPack's NSIS staging directory. This only worked because CPACK_PACKAGE_DIRECTORY used to default to the build directory, putting the staging dir exactly 3 levels below it. Commit 54363c8 ("Fix Windows NSIS packaging failure from MAX_PATH doc filenames") started redirecting CPACK_PACKAGE_DIRECTORY to a short path (C:/cpk) on Windows CI to dodge MAX_PATH issues with deeply nested Doxygen filenames — which broke the implicit relative-path assumption, since C:/cpk/_CPack_Packages/win64/NSIS/..\..\..\ no longer resolves anywhere near ${PROJECT_BINARY_DIR}.

Fix: pass the absolute path of the generated Cfg_Settings.nsh to the NSIS template via a CPACK_ variable (CPACK_OPENMS_CFG_SETTINGS_FILE), which CMake automatically forwards into CPackConfig.cmake and is available for substitution when CPack's NSIS generator configures project.nsi from the template. This removes the dependency on the staging directory's depth relative to the build tree entirely, so it stays correct regardless of where CPACK_PACKAGE_DIRECTORY points.

I could not build/test this on Windows in this environment (no Windows/NSIS toolchain here), so please double check by CI on this PR (or the next nightly run) that Windows packaging succeeds.

Checklist

  • Add relevant changes and new features to the CHANGELOG file — not applicable (CI infra fix, not a user-facing feature)
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes — not applicable, this only affects Windows CPack/NSIS packaging which isn't covered by the unit test suite; verified via CI on nightly
  • Updated or added python bindings for changed or new classes — not applicable (no Python-visible API changes)

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows installer packaging by reliably locating and including generated configuration settings.
    • Replaced fragile relative path handling with native absolute paths to help ensure successful installer creation across environments.

The nightly Release workflow's Windows packaging step has been failing
since the CI started overriding CPACK_PACKAGE_DIRECTORY to a short path
(C:/cpk) to avoid MAX_PATH issues with deep Doxygen filenames. The NSIS
template included Cfg_Settings.nsh via a hardcoded "..\..\..\" relative
path from CPack's NSIS staging directory, which only happened to resolve
correctly back to PROJECT_BINARY_DIR when CPACK_PACKAGE_DIRECTORY
defaulted to the build directory. Pass the absolute path as a CPACK_
variable instead, so packaging no longer depends on the staging
directory's depth relative to the build tree.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9bc47d56-b663-4aee-b853-4e22f15dc0c4

📥 Commits

Reviewing files that changed from the base of the PR and between 3b05e47 and 159f6f1.

📒 Files selected for processing (2)
  • cmake/Windows/NSIS.template.in
  • cmake/package_nsis.cmake

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The NSIS packaging configuration now creates a native absolute path for Cfg_Settings.nsh. The NSIS template uses the CMake-provided path instead of a relative include path.

Changes

NSIS settings path wiring

Layer / File(s) Summary
Configure and consume the absolute settings path
cmake/package_nsis.cmake, cmake/Windows/NSIS.template.in
CMake stores the native absolute Cfg_Settings.nsh path in CPACK_OPENMS_CFG_SETTINGS_FILE. The NSIS template includes that path.

Suggested reviewers: jcharkow

Poem

A rabbit hops through CMake bright

And finds the settings file just right
An absolute path leads the way
NSIS includes it without delay
Build paths now stay clear and true

Merge Risk: ⚪ Minimal · up to 159f6

This localized packaging change replaces a fragile relative path with the generated settings file's absolute path. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing Windows NSIS packaging by locating Cfg_Settings.nsh through an absolute path.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/sweet-fermat-ssuqmv

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@timosachsenberg
timosachsenberg merged commit 11235c4 into develop Aug 28, 2026
13 checks passed
@timosachsenberg
timosachsenberg deleted the claude/sweet-fermat-ssuqmv branch August 28, 2026 10:24
pull Bot pushed a commit to matchy233/OpenMS that referenced this pull request Aug 30, 2026
- -feat_dir (ProteomicsLFQ) and the imzML dropped-array warning shipped
  without their PR citation (OpenMS#9989, OpenMS#10002).
- The Biosaur2/FAIMS fix entry cited only the tracking issue (OpenMS#9980),
  not the merged PR (OpenMS#9996).
- No entry existed for the NSIS Cfg_Settings.nsh path fix (OpenMS#9978,
  OpenMS#9991) or the multi-arch container deploy race fix (OpenMS#9951, OpenMS#9954).
timosachsenberg added a commit that referenced this pull request Aug 31, 2026
…#10014)

Adds entries for PRs merged after the last CHANGELOG update (#9995,
#10009, #10010, #10012) that were not yet reflected in the file, and
fills in missing PR references on the FeatureFinderIdentification
external-path removal. Also rewrites the NSIS Cfg_Settings.nsh entry,
whose previously documented fix (#9978, #9991) turned out to be
insufficient and was superseded by the definitive fix in #10009.

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants