Skip to content
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

MSYS2 change MINGW64 to UCRT64 #1220

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
184 changes: 74 additions & 110 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,17 @@ pipeline {
}
}


stage('mingw64-gcc') {
stages {
stage('build') {
agent {
label 'omsimulator-windows'
}
environment {
PATH = "${env.PATH};C:\\OMDev\\tools\\msys\\mingw64\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
OMDEV = "/c/OMDev"
OMDEV = "C:\\OMDev"
OMDEV_MSYS = "${env.OMDEV}\\tools\\msys"
MSYSTEM_DIR_PREFIX = "mingw64"
PATH = "${env.PATH};${env.OMDEV_MSYS}\\${env.MSYSTEM_DIR_PREFIX}\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
CC = "gcc"
CXX = "g++"
MSYSTEM = "MINGW64"
Expand All @@ -270,34 +271,36 @@ pipeline {
writeFile file: "buildZip64.sh", text: """#!/bin/sh
set -x -e
export PATH="/c/Program Files/TortoiseSVN/bin/:/c/bin/jdk/bin:/c/bin/nsis/:\$PATH:/c/bin/git/bin"
cd "${env.WORKSPACE}/install/"
zip -r "../OMSimulator-mingw64-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *
cd "${env.WORKSPACE}/install/mingw"
zip -r "../../OMSimulator-${env.MSYSTEM_DIR_PREFIX}-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *
"""

bat """
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip64.sh'
${env.OMDEV_MSYS}\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip64.sh'
"""

archiveArtifacts "OMSimulator-mingw64*.zip"
stash name: 'mingw64-zip', includes: "OMSimulator-mingw64-*.zip"
stash name: 'mingw64-install', includes: "install/**"
archiveArtifacts "OMSimulator-${env.MSYSTEM_DIR_PREFIX}*.zip"
stash name: "msys64-zip", includes: "OMSimulator-${env.MSYSTEM_DIR_PREFIX}-*.zip"
stash name: "msys64-install", includes: "install/mingw/**"
}
}
stage('test') {
agent {
label 'omsimulator-windows'
}
environment {
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw64\\bin\\"
OMDEV = "/c/OMDev"
OMDEV = "C:\\OMDev"
OMDEV_MSYS = "${env.OMDEV}\\tools\\msys"
MSYSTEM_DIR_PREFIX = "mingw64"
PATH = "${env.PATH};${env.OMDEV_MSYS}\\${env.MSYSTEM_DIR_PREFIX}\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
MSYSTEM = "MINGW64"
RUNTESTDB="${env.HOME}/jenkins-cache/runtest/"
}
steps {
unstash name: 'mingw64-install'
unstash name: "msys64-install"

bat 'hostname'
writeFile file: "testMingw64-install.sh", text:"""#!/bin/sh
writeFile file: "testMsys64-install.sh", text:"""#!/bin/sh
set -x -e
cd "${env.WORKSPACE}"
export PATH="/c/Program Files/TortoiseSVN/bin/:/c/bin/jdk/bin:/c/bin/nsis/:\$PATH:/c/bin/git/bin"
Expand All @@ -309,7 +312,7 @@ cd testsuite/partest
"""
bat """
set PATH=C:\\bin\\cmake\\bin;%PATH%
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMingw64-install.sh'
${env.OMDEV_MSYS}\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMsys64-install.sh'
EXIT /b 0
:fail
ECHO Something went wrong!
Expand All @@ -322,104 +325,46 @@ EXIT /b 1
}
}

stage('mingw32-gcc') {
when {
anyOf {
expression { return shouldWeBuildMINGW32() }
expression { return shouldWeUploadArtifacts() }
buildingTag()
}
beforeAgent true
stage('mingw64-clang') {
agent {
label 'omsimulator-windows'
}
environment {
OMDEV = "C:\\OMDev"
OMDEV_MSYS = "${env.OMDEV}\\tools\\msys"
MSYSTEM_DIR_PREFIX = "mingw64"
PATH = "${env.PATH};${env.OMDEV_MSYS}\\${env.MSYSTEM_DIR_PREFIX}\\bin\\;${env.OMDEV_MSYS}\\bin;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
CC="clang"
CXX="clang++"
MSYSTEM = "MINGW64"
VERBOSE = '1'
}
stages {
stage('build') {
agent {
label 'omsimulator-windows'
}
environment {
PATH = "${env.PATH};C:\\OMDev\\tools\\msys\\mingw32\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
OMDEV = "/c/OMDev"
CC = "gcc"
CXX = "g++"
MSYSTEM = "MINGW32"
VERBOSE = '1'
}
steps {
buildOMS()

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

bat """
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip32.sh'
EXIT /b 0
"""

archiveArtifacts "OMSimulator-mingw32*.zip"
stash name: 'mingw32-zip', includes: "OMSimulator-mingw32-*.zip"
stash name: 'mingw32-install', includes: "install/**"
}
}
stage('test') {
agent {
label 'omsimulator-windows'
}
environment {
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw32\\bin\\"
OMDEV = "/c/OMDev"
MSYSTEM = "MINGW32"
RUNTESTDB="${env.HOME}/jenkins-cache/runtest/"
}
steps {
unstash name: 'mingw32-install'

bat 'hostname'
writeFile file: "testMingw32-install.sh", text:"""#!/bin/sh
set -x -e
cd "${env.WORKSPACE}"
export PATH="/c/Program Files/TortoiseSVN/bin/:/c/bin/jdk/bin:/c/bin/nsis/:\$PATH:/c/bin/git/bin"
make -C testsuite difftool resources
cp -f "${env.RUNTESTDB}/"* testsuite/ || true
find testsuite/ -name "*.lua" -exec sed -i /teardown_command/d {} ";"
cd testsuite/partest
./runtests.pl -j\$(nproc) -nocolour -with-xml ${params.RUNTESTS_FLAG}
"""
bat """
set PATH=C:\\bin\\cmake\\bin;%PATH%
C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMingw32-install.sh'
EXIT /b 0
:fail
ECHO Something went wrong!
EXIT /b 1
"""

junit 'testsuite/partest/result.xml'
}
}
steps {
buildOMS()
}
}

stage('mingw64-clang') {
stage('ucrt64-clang') {
agent {
label 'omsimulator-windows'
}
environment {
PATH = "${env.PATH};C:\\OMDev\\tools\\msys\\mingw64\\bin\\;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
VERBOSE = '1'
OMDEV = "C:\\OMDev"
OMDEV_MSYS = "${env.OMDEV}\\tools\\msys"
MSYSTEM_DIR_PREFIX = "ucrt64"
PATH = "${env.PATH};${env.OMDEV_MSYS}\\${env.MSYSTEM_DIR_PREFIX}\\bin\\;${env.OMDEV_MSYS}\\usr\\bin;C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;"
CC="clang"
CXX="clang++"
MSYSTEM = "MINGW64"
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be MSYSTEM = "UCRT64".

VERBOSE = '1'
}

steps {
buildOMS()
}
}


stage('msvc64') {
stages {
stage('build') {
Expand All @@ -431,8 +376,10 @@ EXIT /b 1
label 'omsimulator-windows'
}
environment {
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw64\\bin\\"
OMDEV = "/c/OMDev"
OMDEV = "C:\\OMDev"
OMDEV_MSYS = "${env.OMDEV}\\tools\\msys"
MSYSTEM_DIR_PREFIX = "mingw64"
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;${env.OMDEV_MSYS}\\${env.MSYSTEM_DIR_PREFIX}\\bin;${env.OMDEV_MSYS}\\bin"
MSYSTEM = "MINGW64"
}
steps {
Expand All @@ -456,7 +403,7 @@ IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
call install\\bin\\OMSimulator.exe --version
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail

C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip.sh'
${env.OMDEV_MSYS}\\usr\\bin\\sh --login -i '${env.WORKSPACE}/buildZip.sh'

EXIT /b 0

Expand All @@ -475,8 +422,10 @@ EXIT /b 1
label 'omsimulator-windows'
}
environment {
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;C:\\OMDev\\tools\\msys\\mingw64\\bin\\"
OMDEV = "/c/OMDev"
OMDEV = "C:\\OMDev"
OMDEV_MSYS = "${env.OMDEV}\\tools\\msys"
MSYSTEM_DIR_PREFIX = "mingw64"
PATH = "${env.PATH};C:\\bin\\git\\bin;C:\\bin\\git\\usr\\bin;${env.OMDEV_MSYS}\\${env.MSYSTEM_DIR_PREFIX}\\bin\\"
MSYSTEM = "MINGW64"
RUNTESTDB="${env.HOME}/jenkins-cache/runtest/"
}
Expand All @@ -497,7 +446,7 @@ cd testsuite/partest
bat """
set PATH=C:\\bin\\cmake\\bin;%PATH%

C:\\OMDev\\tools\\msys\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMSVC64-install.sh'
${OMDEV_MSYS}\\usr\\bin\\sh --login -i '${env.WORKSPACE}/testMSVC64-install.sh'

EXIT /b 0

Expand All @@ -515,6 +464,25 @@ EXIT /b 1
}
}

stage('cross-compilation') {
agent {
docker {
image 'anheuermann/ompython:wine-bionic'
label 'linux'
alwaysPull true
}
}
environment {
HOME = "${env.WORKSPACE}"
}
steps {
unstash name: 'msys64-install'
sh """
wine64 install/mingw/bin/OMSimulator.exe --version
"""
}
}

stage('upload') {
parallel {

Expand Down Expand Up @@ -577,8 +545,8 @@ EXIT /b 1
steps {
unstash name: 'amd64-zip' // includes: "OMSimulator-linux-amd64-*.tar.gz"
unstash name: 'arm32-zip' // includes: "OMSimulator-linux-arm32-*.tar.gz"
unstash name: 'mingw32-zip' // includes: "OMSimulator-mingw32-*.zip"
unstash name: 'mingw64-zip' // includes: "OMSimulator-mingw64-*.zip"
unstash name: 'i386-zip' // includes: "OMSimulator-linux-i386-*.tar.gz"
unstash name: 'msys64-zip' // includes: "OMSimulator-msys64-*.zip"
unstash name: 'win64-zip' // includes: "OMSimulator-win64-*.zip"
unstash name: 'osx-zip' // includes: "OMSimulator-osx-*.zip"

Expand All @@ -596,11 +564,8 @@ EXIT /b 1
remoteDirectory: "${DEPLOYMENT_PREFIX}linux-amd64/",
sourceFiles: 'OMSimulator-linux-amd64-*.tar.gz'),
sshTransfer(
remoteDirectory: "${DEPLOYMENT_PREFIX}win-mingw32/",
sourceFiles: 'OMSimulator-mingw32-*.zip'),
sshTransfer(
remoteDirectory: "${DEPLOYMENT_PREFIX}win-mingw64/",
sourceFiles: 'OMSimulator-mingw64-*.zip'),
remoteDirectory: "${DEPLOYMENT_PREFIX}win-msys64/",
sourceFiles: 'OMSimulator-msys64-*.zip'),
sshTransfer(
remoteDirectory: "${DEPLOYMENT_PREFIX}osx/",
sourceFiles: 'OMSimulator-osx-*.zip'),
Expand Down Expand Up @@ -668,7 +633,6 @@ def isWindows() {
void buildOMS() {
if (isWindows()) {
bat ("""
set OMDEV=C:\\OMDev
echo on
(
echo export MSYS_WORKSPACE="`cygpath '${WORKSPACE}'`"
Expand All @@ -681,9 +645,9 @@ void buildOMS() {
echo cmake --build build/ --parallel %NUMBER_OF_PROCESSORS% --target install -v
) > buildOMSimulatorWindows.sh

set MSYSTEM=${env.MSYSTEM ? env.MSYSTEM : "MINGW64"}
set MSYSTEM=${env.MSYSTEM ? env.MSYSTEM : "MSYS64"}
set MSYS2_PATH_TYPE=inherit
%OMDEV%\\tools\\msys\\usr\\bin\\sh --login -c "cd `cygpath '${WORKSPACE}'` && chmod +x buildOMSimulatorWindows.sh && ./buildOMSimulatorWindows.sh && rm -f ./buildOMSimulatorWindows.sh"
${env.OMDEV_MSYS}\\usr\\bin\\sh --login -c "cd `cygpath '${WORKSPACE}'` && chmod +x buildOMSimulatorWindows.sh && ./buildOMSimulatorWindows.sh && rm -f ./buildOMSimulatorWindows.sh"
""")
} else {
echo "running on node: ${env.NODE_NAME}"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The testsuite of OMSimulator is run on Jenkins for every commit and creating
[test reports](https://test.openmodelica.org/jenkins/job/OMSimulator/job/master/lastSuccessfulBuild/testReport/).
The project is tested for the following OS:
- linux64 without OMPython
- mingw64
- cross-compiled msys64
- msvc64
- cross-compiled OSX

Expand Down
2 changes: 1 addition & 1 deletion src/OMSimulatorLib/ComponentFMUME.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ oms::Component* oms::ComponentFMUME::NewComponent(const oms::ComRef& cref, oms::
fmiVersion_t version = fmi4c_getFmiVersion(component->fmu);
if (fmiVersion2 != version)
{
logError("Unsupported FMI version: " + version);
logError("Unsupported FMI version: " + std::to_string(version));
delete component;
return NULL;
}
Expand Down
10 changes: 5 additions & 5 deletions testsuite/difftool/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ifdef OMDEV
CC = gcc
EXT=".exe"
endif

# ugly fix for macosx
detected_OS := $(shell uname -s)
OMBUILDDIR =../../install/

ifeq (MINGW,$(findstring MINGW,$(detected_OS)))
CC = gcc
EXT=".exe"
endif

$(OMBUILDDIR)/bin/omc-diff$(EXT): lex.yy.o $(OMBUILDDIR)/bin
$(CC) -o $@ lex.yy.o
lex.yy.c: omc-diff.l
Expand Down
7 changes: 6 additions & 1 deletion testsuite/rtest
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ if ($cwd =~ m/(.*)testsuite\/(.+)$/) {
if ($os =~ /MINGW/) {
if ($os =~ /MINGW64/) {
$PLATFORM = "mingw";
$TEST_PLATFORM = "mingw64";
if ($ENV{'MSYSTEM'} =~ /UCRT64/) {
$TEST_PLATFORM = "ucrt64";
}
else {
$TEST_PLATFORM = "mingw64";
}
}
else {
$PLATFORM = "mingw";
Expand Down