Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build-windows-executable-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,16 @@ jobs:
- name: Create .bat file
run: |
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
echo '' >> ${{ env.APP_NAME }}.bat
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
Comment on lines +265 to +269
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

echo 'REM Create .streamlit directory in user''s home if it doesn''t exist' >> ${{ env.APP_NAME }}.bat
echo 'if not exist "%USERPROFILE%\.streamlit" mkdir "%USERPROFILE%\.streamlit"' >> ${{ env.APP_NAME }}.bat
echo '' >> ${{ env.APP_NAME }}.bat
Expand Down