Skip to content

Conversation

@t0mdavid-m
Copy link
Member

@t0mdavid-m t0mdavid-m commented Dec 22, 2025

Summary by CodeRabbit

  • Chores
    • Improved Windows executable launcher to automatically include third‑party subfolders in the runtime PATH, ensuring bundled tools and libraries are discovered when the app runs.
    • Adjusted Windows build/runtime behavior to better handle environment variable expansion for reliable startup.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

📝 Walkthrough

Walkthrough

Added EnableDelayedExpansion and a Windows batch-script loop that iterates every subfolder under OPENMS\share\OpenMS\THIRDPARTY and appends each to PATH at runtime in the Windows build workflow.

Changes

Cohort / File(s) Summary
Windows Build Workflow
/.github/workflows/build-windows-executable-app.yaml
Added EnableDelayedExpansion to the generated Windows batch script and inserted a for /D loop that iterates THIRDPARTY\* subdirectories and appends each directory to the PATH environment variable at runtime.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check Windows batch syntax for EnableDelayedExpansion usage and variable expansion semantics.
  • Verify the for /D loop correctly iterates the intended THIRDPARTY subfolders and that appended PATH entries are ordered as expected.
  • Confirm there's no unintended trailing backslash or quoting issues that break path concatenation.

Possibly related PRs

Poem

🐰 I hop in scripts where PATHs expand,
Enabling delayed magic with a command,
Through THIRDPARTY folders I loop and sing,
Adding each directory — a small bright thing. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'enable thirdparty tools for template' directly describes the main change: enabling third-party tools by adding PATH configuration for third-party directories in the Windows build workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch thirdparty_tools

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03db427 and d4f0204.

📒 Files selected for processing (1)
  • .github/workflows/build-windows-executable-app.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build-windows-executable-app.yaml

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2ad2b1 and 03db427.

📒 Files selected for processing (1)
  • .github/workflows/build-windows-executable-app.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-openms
  • GitHub Check: build-full-app
  • GitHub Check: build-simple-app

Comment on lines +264 to +268
echo 'REM Add each subfolder in share\OpenMS\THIRDPARTY to PATH' >> ${{ env.APP_NAME }}.bat
echo 'for /D %%D in ("%OPENMS_DATA_PATH%\THIRDPARTY\*") do (' >> ${{ env.APP_NAME }}.bat
echo ' set "PATH=!PATH!;%%D"' >> ${{ env.APP_NAME }}.bat
echo ')' >> ${{ env.APP_NAME }}.bat
echo '' >> ${{ env.APP_NAME }}.bat
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Delayed expansion not enabled for PATH variable update.

Line 266 uses the !PATH! syntax which requires delayed expansion to be enabled in the batch file. Without setlocal enabledelayedexpansion at the beginning of the batch file, !PATH! will be treated as a literal string rather than expanding the PATH variable, breaking the intended functionality.

Additionally, verify that the share\OpenMS\THIRDPARTY directory structure with subdirectories actually exists in the packaged files, as the build process (lines 108-124) flattens the THIRDPARTY structure during the build.

🔎 Proposed fix for delayed expansion
 echo '@echo off' > ${{ env.APP_NAME }}.bat
+echo 'setlocal enabledelayedexpansion' >> ${{ env.APP_NAME }}.bat
 echo '' >> ${{ env.APP_NAME }}.bat
 echo 'REM Set OpenMS data path for TOPP tools' >> ${{ env.APP_NAME }}.bat
 echo 'set OPENMS_DATA_PATH=%~dp0share\OpenMS' >> ${{ env.APP_NAME }}.bat

Run the following script to verify the THIRDPARTY directory structure in the packaging process:

#!/bin/bash
# Description: Verify if THIRDPARTY subdirectories are preserved in the package
# Expected: Find evidence that THIRDPARTY structure is maintained in share/OpenMS

# Check packaging configuration
rg -n "THIRDPARTY" --type yaml -C3

# Look for any CMake or packaging scripts that handle THIRDPARTY
fd -e cmake -e txt | xargs rg -l "THIRDPARTY" | head -10

@t0mdavid-m t0mdavid-m merged commit 546e091 into main Dec 22, 2025
8 checks passed
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