Skip to content

Commit 589055b

Browse files
authored
adapt to new OMDev (#1286)
* adapt to new OMDev - use the ucrt64 perl and not the msys2 one which freezes - change mingw64 to ucrt64 - remove mingw32 support - define LOCALAPPDATA for the Windows batch files - update 3rdParty to get the latest fmi4c changes * disable some tests: tankYPipe.lua, multipleInstance.lua, fmuState01.lua as they fail with ucrt64 OMSimulator - we should generate new ucrt64 based FMUs for these models - the problem seems to be in fmi2FreeFMUstate
1 parent c66d712 commit 589055b

112 files changed

Lines changed: 250 additions & 351 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3rdParty

Jenkinsfile

Lines changed: 48 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ pipeline {
99
}
1010
parameters {
1111
booleanParam(name: 'MSVC64', defaultValue: true, description: 'Build with MSVC64 (often hangs)')
12-
booleanParam(name: 'MINGW32', defaultValue: false, description: 'Build with MINGW32')
12+
booleanParam(name: 'MINGW_UCRT64', defaultValue: true, description: 'Build with MINGW/UCRT64')
1313
booleanParam(name: 'MACOS_ARM64', defaultValue: false, description: 'Build with macOS-arm64 (M1 mac)')
1414
booleanParam(name: 'LINUX64_ASAN', defaultValue: false, description: 'Build with linux64 asan')
1515
booleanParam(name: 'SUBMODULE_UPDATE', defaultValue: false, description: 'Allow pull request to update submodules (disabled by default due to common user errors)')
16-
booleanParam(name: 'UPLOAD_BUILD_OPENMODELICA', defaultValue: false, description: 'Upload install artifacts to build.openmodelica.org/omsimulator. Activates MINGW32 as well.')
16+
booleanParam(name: 'UPLOAD_BUILD_OPENMODELICA', defaultValue: false, description: 'Upload install artifacts to build.openmodelica.org/omsimulator. Activates MINGW_UCRT64 as well.')
1717
string(name: 'RUNTESTS_FLAG', defaultValue: '', description: 'runtests.pl flag')
1818
}
1919
stages {
@@ -248,84 +248,10 @@ pipeline {
248248
}
249249

250250

251-
stage('mingw64-gcc') {
252-
stages {
253-
stage('build') {
254-
agent {
255-
label 'omsimulator-windows'
256-
}
257-
environment {
258-
PATH = "${env.PATH};C:\\OMDev\\tools\\msys\\mingw64\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
259-
OMDEV = "/c/OMDev"
260-
CC = "gcc"
261-
CXX = "g++"
262-
MSYSTEM = "MINGW64"
263-
VERBOSE = '1'
264-
}
265-
steps {
266-
bat 'hostname'
267-
268-
buildOMS()
269-
270-
writeFile file: "buildZip64.sh", text: """#!/bin/sh
271-
set -x -e
272-
export PATH="/c/Program Files/TortoiseSVN/bin/:/c/bin/jdk/bin:/c/bin/nsis/:\$PATH:/c/bin/git/bin"
273-
cd "${env.WORKSPACE}/install/"
274-
zip -r "../OMSimulator-mingw64-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *
275-
"""
276-
277-
bat """
278-
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip64.sh'
279-
"""
280-
281-
archiveArtifacts "OMSimulator-mingw64*.zip"
282-
stash name: 'mingw64-zip', includes: "OMSimulator-mingw64-*.zip"
283-
stash name: 'mingw64-install', includes: "install/**"
284-
}
285-
}
286-
stage('test') {
287-
agent {
288-
label 'omsimulator-windows'
289-
}
290-
environment {
291-
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw64\\bin\\"
292-
OMDEV = "/c/OMDev"
293-
MSYSTEM = "MINGW64"
294-
RUNTESTDB="${env.HOME}/jenkins-cache/runtest/"
295-
}
296-
steps {
297-
unstash name: 'mingw64-install'
298-
299-
bat 'hostname'
300-
writeFile file: "testMingw64-install.sh", text:"""#!/bin/sh
301-
set -x -e
302-
cd "${env.WORKSPACE}"
303-
export PATH="/c/Program Files/TortoiseSVN/bin/:/c/bin/jdk/bin:/c/bin/nsis/:\$PATH:/c/bin/git/bin"
304-
make -C testsuite difftool resources
305-
cp -f "${env.RUNTESTDB}/"* testsuite/ || true
306-
find testsuite/ -name "*.lua" -exec sed -i /teardown_command/d {} ";"
307-
cd testsuite/partest
308-
./runtests.pl -j\$(nproc) -nocolour -with-xml ${params.RUNTESTS_FLAG}
309-
"""
310-
bat """
311-
set PATH=C:\\bin\\cmake\\bin;%PATH%
312-
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMingw64-install.sh'
313-
EXIT /b 0
314-
:fail
315-
ECHO Something went wrong!
316-
EXIT /b 1
317-
"""
318-
319-
junit 'testsuite/partest/result.xml'
320-
}
321-
}
322-
}
323-
}
324-
325-
stage('mingw32-gcc') {
251+
stage('mingw-ucrt64-gcc') {
326252
when {
327253
anyOf {
328-
expression { return shouldWeBuildMINGW32() }
254+
expression { return shouldWeBuildMINGW() }
329255
expression { return shouldWeUploadArtifacts() }
330256
buildingTag()
331257
}
@@ -337,60 +263,62 @@ EXIT /b 1
337263
label 'omsimulator-windows'
338264
}
339265
environment {
340-
PATH = "${env.PATH};C:\\OMDev\\tools\\msys\\mingw32\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
341-
OMDEV = "/c/OMDev"
266+
PATH = "C:\\OMDevUCRT\\tools\\msys\\ucrt64\\bin;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;${env.PATH};"
267+
OMDEV = "/c/OMDevUCRT"
342268
CC = "gcc"
343269
CXX = "g++"
344-
MSYSTEM = "MINGW32"
270+
MSYSTEM = "UCRT64"
345271
VERBOSE = '1'
346272
}
347273
steps {
274+
bat 'hostname'
275+
348276
buildOMS()
349277

350-
writeFile file: "buildZip32.sh", text: """#!/bin/sh
278+
writeFile file: "buildZip64.sh", text: """#!/bin/sh
351279
set -x -e
352280
export PATH="/c/Program Files/TortoiseSVN/bin/:/c/bin/jdk/bin:/c/bin/nsis/:\$PATH:/c/bin/git/bin"
353281
cd "${env.WORKSPACE}/install/"
354-
zip -r "../OMSimulator-mingw32-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *
282+
zip -r "../OMSimulator-mingw-ucrt64-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *
355283
"""
356284

357285
bat """
358-
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip32.sh'
359-
EXIT /b 0
286+
C:\\OMDevUCRT\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip64.sh'
360287
"""
361288

362-
archiveArtifacts "OMSimulator-mingw32*.zip"
363-
stash name: 'mingw32-zip', includes: "OMSimulator-mingw32-*.zip"
364-
stash name: 'mingw32-install', includes: "install/**"
289+
archiveArtifacts "OMSimulator-mingw-ucrt64*.zip"
290+
stash name: 'mingw-ucrt64-zip', includes: "OMSimulator-mingw-ucrt64-*.zip"
291+
stash name: 'mingw-ucrt64-install', includes: "install/**"
365292
}
366293
}
367294
stage('test') {
368295
agent {
369296
label 'omsimulator-windows'
370297
}
371298
environment {
372-
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw32\\bin\\"
373-
OMDEV = "/c/OMDev"
374-
MSYSTEM = "MINGW32"
299+
PATH = "C:\\OMDevUCRT\\tools\\msys\\ucrt64\\bin;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;${env.PATH};"
300+
OMDEV = "/c/OMDevUCRT"
301+
MSYSTEM = "UCRT64"
375302
RUNTESTDB="${env.HOME}/jenkins-cache/runtest/"
376303
}
377304
steps {
378-
unstash name: 'mingw32-install'
305+
unstash name: 'mingw-ucrt64-install'
379306

380307
bat 'hostname'
381-
writeFile file: "testMingw32-install.sh", text:"""#!/bin/sh
308+
writeFile file: "testMinGWUCRT64-install.sh", text:"""#!/bin/sh
382309
set -x -e
383310
cd "${env.WORKSPACE}"
384311
export PATH="/c/Program Files/TortoiseSVN/bin/:/c/bin/jdk/bin:/c/bin/nsis/:\$PATH:/c/bin/git/bin"
385312
make -C testsuite difftool resources
386313
cp -f "${env.RUNTESTDB}/"* testsuite/ || true
387314
find testsuite/ -name "*.lua" -exec sed -i /teardown_command/d {} ";"
388315
cd testsuite/partest
389-
./runtests.pl -j\$(nproc) -nocolour -with-xml ${params.RUNTESTS_FLAG}
316+
perl ./runtests.pl -j\$(nproc) -nocolour -with-xml ${params.RUNTESTS_FLAG}
390317
"""
391318
bat """
319+
If Defined LOCALAPPDATA (echo LOCALAPPDATA: %LOCALAPPDATA%) Else (Set "LOCALAPPDATA=C:\\Users\\OpenModelica\\AppData\\Local")
392320
set PATH=C:\\bin\\cmake\\bin;%PATH%
393-
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMingw32-install.sh'
321+
C:\\OMDevUCRT\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMinGWUCRT64-install.sh'
394322
EXIT /b 0
395323
:fail
396324
ECHO Something went wrong!
@@ -403,12 +331,13 @@ EXIT /b 1
403331
}
404332
}
405333

406-
stage('mingw64-clang') {
334+
stage('mingw-ucrt64-clang') {
407335
agent {
408336
label 'omsimulator-windows'
409337
}
410338
environment {
411-
PATH = "${env.PATH};C:\\OMDev\\tools\\msys\\mingw64\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
339+
PATH = "C:\\OMDevUCRT\\tools\\msys\\ucrt64\\bin;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;${env.PATH};"
340+
OMDEV = "/c/OMDevUCRT"
412341
VERBOSE = '1'
413342
CC="clang"
414343
CXX="clang++"
@@ -431,9 +360,9 @@ EXIT /b 1
431360
label 'omsimulator-windows'
432361
}
433362
environment {
434-
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw64\\bin\\"
435-
OMDEV = "/c/OMDev"
436-
MSYSTEM = "MINGW64"
363+
PATH = "C:\\OMDevUCRT\\tools\\msys\\ucrt64\\bin;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;${env.PATH};"
364+
OMDEV = "/c/OMDevUCRT"
365+
MSYSTEM = "UCRT64"
437366
}
438367
steps {
439368
bat 'hostname'
@@ -445,6 +374,7 @@ zip -r "../OMSimulator-win64-`git describe --tags --abbrev=7 --match=v*.* --excl
445374
"""
446375

447376
retry(2) { bat """
377+
If Defined LOCALAPPDATA (echo LOCALAPPDATA: %LOCALAPPDATA%) Else (Set "LOCALAPPDATA=C:\\Users\\OpenModelica\\AppData\\Local")
448378
set PATH=C:\\bin\\cmake\\bin;%PATH%
449379
450380
cmake -S . -B build/ -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install/ -DOM_OMS_ENABLE_TESTSUITE:BOOL=ON
@@ -456,7 +386,7 @@ IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
456386
call install\\bin\\OMSimulator.exe --version
457387
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
458388
459-
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip.sh'
389+
C:\\OMDevUCRT\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip.sh'
460390
461391
EXIT /b 0
462392
@@ -475,9 +405,9 @@ EXIT /b 1
475405
label 'omsimulator-windows'
476406
}
477407
environment {
478-
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw64\\bin\\"
479-
OMDEV = "/c/OMDev"
480-
MSYSTEM = "MINGW64"
408+
PATH = "C:\\OMDevUCRT\\tools\\msys\\ucrt64\\bin;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;${env.PATH};"
409+
OMDEV = "/c/OMDevUCRT"
410+
MSYSTEM = "UCRT64"
481411
RUNTESTDB="${env.HOME}/jenkins-cache/runtest/"
482412
}
483413
steps {
@@ -492,12 +422,13 @@ make -C testsuite difftool resources
492422
cp -f "${env.RUNTESTDB}/"* testsuite/ || true
493423
find testsuite/ -name "*.lua" -exec sed -i /teardown_command/d {} ";"
494424
cd testsuite/partest
495-
./runtests.pl -j\$(nproc) -platform=win -nocolour -with-xml ${params.RUNTESTS_FLAG}
425+
perl ./runtests.pl -j\$(nproc) -platform=win -nocolour -with-xml ${params.RUNTESTS_FLAG}
496426
"""
497427
bat """
428+
If Defined LOCALAPPDATA (echo LOCALAPPDATA: %LOCALAPPDATA%) Else (Set "LOCALAPPDATA=C:\\Users\\OpenModelica\\AppData\\Local")
498429
set PATH=C:\\bin\\cmake\\bin;%PATH%
499430
500-
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMSVC64-install.sh'
431+
C:\\OMDevUCRT\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMSVC64-install.sh'
501432
502433
EXIT /b 0
503434
@@ -577,8 +508,7 @@ EXIT /b 1
577508
steps {
578509
unstash name: 'amd64-zip' // includes: "OMSimulator-linux-amd64-*.tar.gz"
579510
unstash name: 'arm32-zip' // includes: "OMSimulator-linux-arm32-*.tar.gz"
580-
unstash name: 'mingw32-zip' // includes: "OMSimulator-mingw32-*.zip"
581-
unstash name: 'mingw64-zip' // includes: "OMSimulator-mingw64-*.zip"
511+
unstash name: 'mingw-ucrt64-zip' // includes: "OMSimulator-mingw-ucrt64-*.zip"
582512
unstash name: 'win64-zip' // includes: "OMSimulator-win64-*.zip"
583513
unstash name: 'osx-zip' // includes: "OMSimulator-osx-*.zip"
584514

@@ -596,11 +526,8 @@ EXIT /b 1
596526
remoteDirectory: "${DEPLOYMENT_PREFIX}linux-amd64/",
597527
sourceFiles: 'OMSimulator-linux-amd64-*.tar.gz'),
598528
sshTransfer(
599-
remoteDirectory: "${DEPLOYMENT_PREFIX}win-mingw32/",
600-
sourceFiles: 'OMSimulator-mingw32-*.zip'),
601-
sshTransfer(
602-
remoteDirectory: "${DEPLOYMENT_PREFIX}win-mingw64/",
603-
sourceFiles: 'OMSimulator-mingw64-*.zip'),
529+
remoteDirectory: "${DEPLOYMENT_PREFIX}win-mingw-ucrt64/",
530+
sourceFiles: 'OMSimulator-mingw-ucrt64-*.zip'),
604531
sshTransfer(
605532
remoteDirectory: "${DEPLOYMENT_PREFIX}osx/",
606533
sourceFiles: 'OMSimulator-osx-*.zip'),
@@ -668,7 +595,8 @@ def isWindows() {
668595
void buildOMS() {
669596
if (isWindows()) {
670597
bat ("""
671-
set OMDEV=C:\\OMDev
598+
If Defined LOCALAPPDATA (echo LOCALAPPDATA: %LOCALAPPDATA%) Else (Set "LOCALAPPDATA=C:\\Users\\OpenModelica\\AppData\\Local")
599+
set OMDEV=C:\\OMDevUCRT
672600
echo on
673601
(
674602
echo export MSYS_WORKSPACE="`cygpath '${WORKSPACE}'`"
@@ -681,8 +609,10 @@ void buildOMS() {
681609
echo cmake --build build/ --parallel %NUMBER_OF_PROCESSORS% --target install -v
682610
) > buildOMSimulatorWindows.sh
683611
684-
set MSYSTEM=${env.MSYSTEM ? env.MSYSTEM : "MINGW64"}
612+
set MSYSTEM=${env.MSYSTEM ? env.MSYSTEM : "UCRT64"}
685613
set MSYS2_PATH_TYPE=inherit
614+
cat buildOMSimulatorWindows.sh
615+
echo \$PATH
686616
%OMDEV%\\tools\\msys\\usr\\bin\\sh --login -c "cd `cygpath '${WORKSPACE}'` && chmod +x buildOMSimulatorWindows.sh && ./buildOMSimulatorWindows.sh && rm -f ./buildOMSimulatorWindows.sh"
687617
""")
688618
} else {
@@ -736,12 +666,12 @@ def shouldWeUpdateSubmodules() {
736666
return params.SUBMODULE_UPDATE
737667
}
738668

739-
def shouldWeBuildMINGW32() {
669+
def shouldWeBuildMINGW() {
740670
if (isPR()) {
741-
if (pullRequest.labels.contains("CI/MINGW32")) {
671+
if (pullRequest.labels.contains("CI/MINGW_UCRT64")) {
742672
return true
743673
}
744-
return params.MINGW32
674+
return params.MINGW_UCRT64
745675
}
746676
return true
747677
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ The testsuite of OMSimulator is run on Jenkins for every commit and creating
127127
[test reports](https://test.openmodelica.org/jenkins/job/OMSimulator/job/master/lastSuccessfulBuild/testReport/).
128128
The project is tested for the following OS:
129129
- linux64 without OMPython
130-
- mingw64
130+
- mingw-ucrt64
131131
- msvc64
132132
- cross-compiled OSX
133133

src/pip/setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ def fetch_oms(self):
7575
elif (sysconfig.get_platform() == 'linux-arm32'):
7676
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/linux-arm32/OMSimulator-linux-arm32-@OMS_VERSION_STRING@.tar.gz')
7777
elif (sysconfig.get_platform() == 'mingw' and platform.architecture()[0] == '64bit'):
78-
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-mingw64/OMSimulator-mingw64-@OMS_VERSION_STRING@.zip')
79-
elif (sysconfig.get_platform() == 'mingw' and platform.architecture()[0] == '32bit'):
80-
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-mingw32/OMSimulator-mingw32-@OMS_VERSION_STRING@.zip')
78+
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-mingw-ucrt64/OMSimulator-mingw-ucrt64-@OMS_VERSION_STRING@.zip')
8179
elif (sysconfig.get_platform() == 'win-amd64'):
8280
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-msvc64/OMSimulator-win64-@OMS_VERSION_STRING@.zip')
8381
elif (platform.system() == 'Darwin'):

testsuite/AircraftVehicleDemonstrator/AircraftVehicleDemonstrator.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
-- status: correct
22
-- teardown_command: rm -rf AircraftVehicleDemonstrator_tmp/ AircraftVehicleDemonstrator.log AircraftVehicleDemonstrator*.dot AircraftVehicleDemonstrator_res.mat
33
-- linux: no
4-
-- mingw32: no
5-
-- mingw64: yes
4+
-- ucrt64: yes
65
-- win: yes
76
-- mac: no
87

testsuite/api/addExternalResources1.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
-- status: correct
22
-- teardown_command: rm -rf addExternalResources1_lua/
33
-- linux: yes
4-
-- mingw32: yes
5-
-- mingw64: yes
4+
-- ucrt64: yes
65
-- win: yes
76
-- mac: no
87

testsuite/api/addExternalResources2.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
-- status: correct
22
-- teardown_command: rm -rf addExternalResources2_from_ssm_lua/
33
-- linux: yes
4-
-- mingw32: yes
5-
-- mingw64: yes
4+
-- ucrt64: yes
65
-- win: yes
76
-- mac: no
87

testsuite/api/addExternalResources5.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
-- status: correct
22
-- teardown_command: rm -rf addExternalResources5_from_ssm_lua/
33
-- linux: yes
4-
-- mingw32: yes
5-
-- mingw64: yes
4+
-- ucrt64: yes
65
-- win: yes
76
-- mac: no
87

testsuite/api/buses.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
-- status: correct
22
-- teardown_command: rm -rf buses-lua/
33
-- linux: yes
4-
-- mingw32: yes
5-
-- mingw64: yes
4+
-- ucrt64: yes
65
-- win: yes
76
-- mac: no
87

0 commit comments

Comments
 (0)