New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix path generation to internal mingw #9383
base: master
Are you sure you want to change the base?
Conversation
|
Ok there are even more issues than I've expected:
Fix for these would be to simply remove the |
@scrouthtv Thank you for your contribution!
Do you want to add these to your PR or open a new one for that problem? In the later case I'll merge this PR. |
I'm not really sure about this one: b309373 |
Maybe we should remove the trailing |
I guess we could leave the |
Makes more sense to me as well. On unix it's normal to not have trailing On Windows, most env variables don't have one either (e. g.
I tried doing that locally as well. The script now works when run from the command line, however, I still get errors when trying to simulate from OM directly. I'm not sure why that is. |
@@ -18,7 +18,7 @@ set C_INCLUDE_PATH= | |||
set LIBRARY_PATH= | |||
set OLD_PATH=%PATH% | |||
call :CONVERT_OPENMODELICAHOME_TO_SHORT_PATH_NAME "%OPENMODELICAHOME%" | |||
set MINGW="%OPENMODELICAHOME%\tools\msys\%OM_PLATFORM%" | |||
set "MINGW=%OPENMODELICAHOME%tools\msys\%OM_PLATFORM%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set "MINGW=%OPENMODELICAHOME%tools\msys\%OM_PLATFORM%" | |
set "MINGW=%OPENMODELICAHOME%\tools\msys\%OM_PLATFORM%" |
I am also unsure what is going on here: OpenModelica/OMCompiler/Compiler/scripts/Compile.bat Lines 39 to 42 in b309373
and why they're not simply using set "PATH=%MINGW%\bin;%MINGW%\..\usr\bin;"
echo PATH = %PATH% This weird construct is used again when exiting: OpenModelica/OMCompiler/Compiler/scripts/Compile.bat Lines 120 to 121 in b309373
I guess they're safe to fix, I can't tell however, why it is the way it is... |
- Set `%PATH%` directly by variable expansion - No need to store the current directory anymore - Quit directly with `%RESULT%` without first opening a child shell
This is what I'm currently using. The script is working from the command line, though I'm still getting an error when running from OM. To test this I manually added debugging to the script:
Upper part of the image: If I run "Simulate" from OM the script seems to have finished, as it first says "end" and then gives the error. I'm not sure if this issue is at all related to this specific script. Lower part of the image: If I run the same command line from the correct folder, the script seems to work & even calls I fear that there are some internal issues with OM unrelated to this script, that I'm unable to assess. |
In the image you are missing a |
I think we do this to get the short names instead of the path names with special chars or spaces, but I am not sure. |
Related Issues
I recently installed OpenModelica and when first trying to compile a model, I encountered this issue:
Upon further investigation, I found this issue when generating the path to the packaged mingw's
make
:set MINGW="%OPENMODELICAHOME%\tools\msys\%OM_PLATFORM%"
. Now, %MINGW% holds the path including double quotes around the entire path:Purpose
make
is badly called as (e.g. for my system):It should instead be
Note the extra quotes + the extra backslash.
This results in a failing compilation run.
Approach
%MINGW%
variable (https://stackoverflow.com/a/34717386)