Skip to content

Fix Windows NSIS packaging: invalid CMake escape breaks nightly build - #9991

Merged
timosachsenberg merged 1 commit into
developfrom
claude/laughing-wozniak-b97bcv
Aug 29, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/laughing-wozniak-b97bcv

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

The nightly Release workflow's Windows (cl.exe) packaging job has been failing every night since a prior fix (159f6f1, merged via #9985... actually via develop directly on 2026-08-28) changed how CPACK_OPENMS_CFG_SETTINGS_FILE is computed:

CMake Error at .../CPackConfig.cmake:36 (set):
  Syntax error in cmake code at
    .../CPackConfig.cmake:36
  when parsing string
    D:\a\OpenMS\OpenMS\build\windows-x64-ci\Cfg_Settings.nsh
  Invalid character escape '\a'.

Root cause: cmake/package_nsis.cmake used file(TO_NATIVE_PATH ...) to compute the absolute path to the generated Cfg_Settings.nsh, producing a Windows path with literal backslashes (GitHub Actions checks out the repo under D:\a\<owner>\<repo>, so the path contains \a\OpenMS\...). This value is a CPACK_-prefixed variable, so CPack re-serializes it into a quoted CMake string literal inside the generated CPackConfig.cmake. CMake's string parser does not recognize \a as a valid escape sequence, so parsing that generated file fails outright, which fails the whole packaging step on every matrix job that produces an NSIS installer (the nightly Release workflow on windows-2025/cl.exe).

Fix: build the path with forward slashes instead ("${PROJECT_BINARY_DIR}/Cfg_Settings.nsh"), the same convention already used by CPack's own path variables (e.g. CPACK_TOPLEVEL_DIRECTORY) in the same NSIS template (cmake/Windows/NSIS.template.in). NSIS's !include accepts forward-slash paths just fine, so this avoids the backslash-escaping problem entirely without reintroducing the original bug (a hardcoded relative !include path that broke when CPACK_PACKAGE_DIRECTORY is redirected to a short path).

This is not a workaround (skipping the packaging step, disabling the check, etc.) — it fixes the actual path being generated so cpack -G NSIS can parse its own generated config file.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes (no unit tests cover CPack/NSIS packaging; validated by reasoning through CPack's variable serialization and by reproducing the exact log context)
  • Updated or added python bindings for changed or new classes (not applicable — build/packaging script only, no Python-bound classes changed)

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows installer packaging by ensuring configuration files are referenced with valid paths.
    • Prevented packaging failures caused by incorrectly escaped Windows paths during installer generation.

…FILE

TO_NATIVE_PATH produced a Windows path with literal backslashes (e.g.
D:\a\OpenMS\OpenMS\build\...\Cfg_Settings.nsh, since GitHub Actions
checks out under D:\a\<owner>\<repo>). CPack re-serializes this CPACK_
variable into a quoted string in the generated CPackConfig.cmake, where
"\a" is not a valid CMake string escape, breaking the nightly Windows
package step ("Invalid character escape '\a'."). Use the forward-slash
CMake path instead, consistent with CPack's own path variables
(CPACK_TOPLEVEL_DIRECTORY etc.) used in the same NSIS template; NSIS's
!include accepts forward slashes.
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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: 475229f3-37a1-47cc-ac05-2f1c44643002

📥 Commits

Reviewing files that changed from the base of the PR and between 61f6fcc and 3c2cac7.

📒 Files selected for processing (1)
  • 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 stores CPACK_OPENMS_CFG_SETTINGS_FILE with forward slashes. This prevents invalid escape sequences when CPack serializes the path into CPackConfig.cmake.

Changes

Cohort / File(s) Summary
NSIS path serialization
cmake/package_nsis.cmake
Removes native Windows path conversion and assigns the binary-directory path directly with forward slashes.

Suggested reviewers: claude

Poem

A rabbit checked the path at night
Forward slashes made it right
CPack wrote each mark with care
NSIS found its include there
Hops and builds now share delight

Merge Risk: ⚪ Minimal · up to 3c2ca

The change makes the generated Windows packaging path CMake-safe by using forward slashes, preventing the nightly NSIS configuration parse failure. No actionable merge-blocking risk remains beyond 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 identifies the main change: fixing invalid CMake escape sequences that break Windows NSIS packaging and nightly builds.
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. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/laughing-wozniak-b97bcv

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 47eadf4 into develop Aug 29, 2026
36 checks passed
@timosachsenberg
timosachsenberg deleted the claude/laughing-wozniak-b97bcv branch August 29, 2026 05:58
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