diff --git a/.github/workflows/buildcheck.yaml b/.github/workflows/buildcheck.yaml new file mode 100644 index 0000000000..83368427c4 --- /dev/null +++ b/.github/workflows/buildcheck.yaml @@ -0,0 +1,96 @@ +name: Build checks + +on: [push, pull_request] + +jobs: + build-tarball: + name: Build tarball from GIT + runs-on: ubuntu-20.04 + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends libltdl-dev libcairo2-dev libx11-dev libxml2-dev libxml2-utils libncurses5-dev libxnvctrl-dev libpciaccess-dev libudev-dev pkg-config ocl-icd-opencl-dev autoconf automake libtool doxygen-latex transfig w3m + - uses: actions/checkout@v4 + - name: Build and distcheck + run: $GITHUB_WORKSPACE/.github/workflows/job-0-tarball.sh + - name: Archive tarballs + uses: actions/upload-artifact@v3 + with: + name: Tarball + path: hwloc-*.tar.gz + - name: Archive documentation PDF + uses: actions/upload-artifact@v3 + with: + name: Documentation PDF + path: doc/doxygen-doc/hwloc-a4.pdf + check-tarball-inria-centos81amd64: + name: Check tarball on Inria centos81amd64 + needs: build-tarball + runs-on: hwloc-centos81amd64 + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: '.github/workflows' + sparse-checkout-cone-mode: false + - name: Download tarball + uses: actions/download-artifact@v3 + with: + name: Tarball + - name: Extract, build and check + run: $GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz + check-tarball-gh-ubuntu-latest: + name: Check tarball on GH ubuntu-latest + needs: build-tarball + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y --no-install-recommends pkg-config libcairo2-dev libxml2-dev + - run: ls -la + - uses: actions/checkout@v4 + with: + sparse-checkout: '.github/workflows' + sparse-checkout-cone-mode: false + - run: ls -la + - name: Download tarball + uses: actions/download-artifact@v3 + with: + name: Tarball + - name: Extract, build and check + run: $GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz + check-tarball-gh-macos-latest: + name: Check tarball on GH macos-latest + needs: build-tarball + runs-on: macos-latest + steps: + - name: Install dependencies + run: | + brew install pkg-config + brew install cairo + - uses: actions/checkout@v4 + with: + sparse-checkout: '.github/workflows' + sparse-checkout-cone-mode: false + - name: Download tarball + uses: actions/download-artifact@v3 + with: + name: Tarball + - name: Extract, build and check + run: | + $GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz +# check-tarball: +# name: Check tarball on GH runners +# needs: build-tarball +# strategy: +# matrix: +# os: [ubuntu-latest,macos-latest] +# runs-on: ${{ matrix.os }} +# steps: +# - name: Download tarball +# uses: actions/download-artifact@v3 +# with: +# name: Tarball +# - name: Extract +# run: tar xvf hwloc-*.tar.gz diff --git a/contrib/ci.inria.fr/job-0-tarball.sh b/.github/workflows/job-0-tarball.sh similarity index 79% rename from contrib/ci.inria.fr/job-0-tarball.sh rename to .github/workflows/job-0-tarball.sh index feaa5eac0d..34bfc3de23 100755 --- a/contrib/ci.inria.fr/job-0-tarball.sh +++ b/.github/workflows/job-0-tarball.sh @@ -12,21 +12,14 @@ echo "############################" set -e set -x -branch="$1" -if test -z "$branch"; then - echo "Need branch name as argument." - exit 1 -fi - -echo "Got GIT branch name $branch" - # environment variables test -f $HOME/.ciprofile && . $HOME/.ciprofile -# convert "pr/XYZ/head" into "PR-XYZ" -branch=$(echo $branch | sed -r -e 's@pr/([0-9]+)/head@PR-\1@') +# GITHUB_REF contains refs/heads/, refs/pull//merge, or refs/tags/ +# convert into the branch/tag name or into "PR-XYZ" +branch=$(echo $GITHUB_REF | sed -r -e 's@refs/([^/]+)/@@' | sed -r -e 's@([0-9]+)/merge@PR-\1@') -# keep branch-name before the first - (e.g. v2.0-beta becomes v2.0) +# keep branch-name before the first '-' (e.g. v2.0-beta becomes v2.0) # and look for the corresponding autotools. # "PR-XYZ" will get "PR" which means they'll use master autotools (likely OK) basebranch=$( echo $branch | sed -r -e 's@^.*/([^/]+)$@\1@' -e 's/-.*//' ) @@ -38,9 +31,6 @@ else echo using generic $HOME/local/hwloc-master fi -# remove previous artifacts so that they don't exported again by this build -rm -f hwloc-*.tar.gz hwloc-*.tar.bz2 || true - # display autotools versions automake --version | head -1 libtool --version | head -1 diff --git a/contrib/ci.inria.fr/job-1-check.sh b/.github/workflows/job-1-check.sh old mode 100644 new mode 100755 similarity index 95% rename from contrib/ci.inria.fr/job-1-check.sh rename to .github/workflows/job-1-check.sh index 9260e8451a..93dcab6306 --- a/contrib/ci.inria.fr/job-1-check.sh +++ b/.github/workflows/job-1-check.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright © 2012-2020 Inria. All rights reserved. +# Copyright © 2012-2023 Inria. All rights reserved. # See COPYING in top-level directory. # diff --git a/contrib/ci.inria.fr/Jenkinsfile b/contrib/ci.inria.fr/Jenkinsfile deleted file mode 100644 index 5e645a70e3..0000000000 --- a/contrib/ci.inria.fr/Jenkinsfile +++ /dev/null @@ -1,299 +0,0 @@ -#!groovy - -// The GIT checkout must use the remote branch name as the checkout local -// branch name so that tarball names contain the branch name. -// In "Additional Behaviours", enable "Checkout to specific local branch" -// and leave "Branch name" empty. -// Not needed for multi-branch pipelines which already BRANCH_NAME in the environment. - -def gitRepoURL = "" -def gitBranch = "" -def tarballgz -def tarballbz2 -def statusHasChanged = false - -def isBasicJob = env.JOB_NAME.matches("basic/(.*)") -println('This is '+(isBasicJob ? '' : 'NOT ')+'an official Basic job.') - -def isExtendedJob = env.JOB_NAME.matches("extended/(.*)") -println('This is '+(isExtendedJob ? '' : 'NOT ')+'an official Extended job.') - -// all jobs run on Unix nodes (either with debug or not) -def doUnix = (env.NO_UNIX != 'true') -println('Unix is '+(doUnix ? 'enabled.' : 'disabled.')) -def doDebug = (isExtendedJob || env.FORCE_DEBUG == 'true') -println('Debug is '+(doDebug ? 'enabled.' : 'disabled.')) -// extended job doesn't run MSVC and WinCMake -def doMSVC = (!isExtendedJob && env.NO_MSVC != 'true') -println('MSVC is '+(doMSVC ? 'enabled.' : 'disabled.')) -def doWinCMake = (!isExtendedJob && env.NO_WINCMAKE != 'true') -println('WinCMake is '+(doWinCMake ? 'enabled.' : 'disabled.')) -// basic job doesn't run Coverity/Sonarqube/Embedded/MinGW/Cygwin/Android -def doCoverity = (!isBasicJob && env.NO_COVERITY != 'true') -println('Coverity is '+(doCoverity ? 'enabled.' : 'disabled.')) -def doSonarQube = (!isBasicJob && env.NO_SONARQUBE != 'true') -println('SonarQube is '+(doSonarQube ? 'enabled.' : 'disabled.')) -def doEmbedded = (!isBasicJob && env.NO_EMBEDDED != 'true') -println('Embedded is '+(doEmbedded ? 'enabled.' : 'disabled.')) -def doMinGW = (!isBasicJob && env.NO_MINGW != 'true') -println('MinGW is '+(doMinGW ? 'enabled.' : 'disabled.')) -def doCygwin = (!isBasicJob && env.NO_CYGWIN != 'true') -println('Cygwin is '+(doCygwin ? 'enabled.' : 'disabled.')) -def doAndroid = (!isBasicJob && env.NO_ANDROID != 'true') -println('Android is '+(doAndroid ? 'enabled.' : 'disabled.')) - -pipeline { - agent none - - // Trigger the build - triggers { - // extended/* jobs poll GitHub explicitly once per night, in case webhooks aren't used - pollSCM(isExtendedJob ? '0 3 * * *' : '') - } - - stages { - stage('Tarball') { - steps { - node('autotools') { - checkout scm - script { - gitRepoURL = sh (script: 'git config --get remote.origin.url', returnStdout: true).trim() - gitBranch = sh (script: 'if test "$BRANCH_NAME"; then echo $BRANCH_NAME; else git rev-parse --abbrev-ref HEAD; fi', returnStdout: true).trim() - sh 'contrib/ci.inria.fr/job-0-tarball.sh '+gitBranch - tarballgz = sh (script: 'ls *.gz', returnStdout: true).trim() - tarballbz2 = sh (script: 'ls *.bz2', returnStdout: true).trim() - stash includes: tarballgz, name: 'tarballgz' - if (doAndroid) { - sh 'tar zcvf android.tar.gz contrib/android' - stash includes: "android.tar.gz", name: 'tar-android' - } - } - dir('contrib/ci.inria.fr') { - script { - if (doUnix && !doDebug) { - stash includes: "job-1-check.sh", name: 'script-unix-check' - } - if (doUnix && doDebug) { - stash includes: "job-3-debug.sh", name: 'script-unix-debug' - } - if (doMSVC) { - stash includes: "job-1-visualstudio.bat", name: 'script-msvc' - } - if (doWinCMake) { - stash includes: "job-1-wincmake.bat", name: 'script-wincmake' - } - if (doMinGW) { - stash includes: "job-3-mingw.*", name: 'scripts-mingw' - } - if (doCygwin) { - stash includes: "job-3-cygwin.*", name: 'scripts-cygwin' - } - if (doAndroid) { - stash includes: "job-3-android.sh", name: 'script-android' - } - if (doEmbedded) { - stash includes: "job-3-embedded.sh", name: 'script-embedded' - } - if (doCoverity) { - stash includes: "job-3-coverity.sh", name: 'script-coverity' - } - if (doSonarQube) { - stash includes: "job-3-sonarscanner.sh", name: 'script-sonarscanner' - } - } - } - archiveArtifacts artifacts: tarballgz+","+tarballbz2+",doc/doxygen-doc/hwloc-a4.pdf", fingerprint: true, onlyIfSuccessful: true - deleteDir() - } - } - } - stage('Check') { - steps { - script { - listOfNodeNames = [] - if (doUnix) { - listOfNodeNames = nodesByLabel('unix') - } - if (doMSVC) { - listOfNodeNames.push('VisualStudio') - } - if (doWinCMake) { - listOfNodeNames.push('WinCMake') - } - if (doMinGW) { - listOfNodeNames.push('MinGW64') - listOfNodeNames.push('MinGW32') - } - if (doCygwin) { - listOfNodeNames.push('Cygwin') - } - if (doAndroid) { - listOfNodeNames.push('AndroidStudio') - } - if (doCoverity) { - listOfNodeNames.push('Coverity') - } - if (doSonarQube) { - listOfNodeNames.push('SonarQube Scanner') - } - if (doEmbedded) { - listOfNodeNames.push('Embedded') - } - println('listOfNodeNames: '+listOfNodeNames) - - def p = listOfNodeNames.collectEntries { - [ (it): { - if (it == 'VisualStudio') { - node('msvc') { - dir('check-msvc') { - unstash 'tarballgz' - unstash 'script-msvc' - bat 'job-1-visualstudio.bat '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'WinCMake') { - node('wincmake') { - dir('check-wincmake') { - unstash 'tarballgz' - unstash 'script-wincmake' - bat 'job-1-wincmake.bat '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'MinGW64') { - node('mingw64') { - dir('check-mingw64') { - unstash 'tarballgz' - unstash 'scripts-mingw' - bat 'job-3-mingw.bat '+tarballgz+' 64' - archiveArtifacts artifacts: "*.zip", fingerprint: true, onlyIfSuccessful: true - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'MinGW32') { - node('mingw32') { - dir('check-mingw32') { - unstash 'tarballgz' - unstash 'scripts-mingw' - bat 'job-3-mingw.bat '+tarballgz+' 32' - archiveArtifacts artifacts: "*.zip", fingerprint: true, onlyIfSuccessful: true - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'Cygwin') { - node('cygwin') { - dir('check-cygwin') { - unstash 'tarballgz' - unstash 'scripts-cygwin' - bat './job-3-cygwin.bat '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'Coverity') { - node('coverity') { - dir('check-coverity') { - unstash 'tarballgz' - unstash 'script-coverity' - sh 'chmod 755 job-3-coverity.sh && ./job-3-coverity.sh '+gitRepoURL+' '+gitBranch+' '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'SonarQube Scanner') { - node('sonarscanner') { - dir('check-sonarscanner') { - unstash 'tarballgz' - unstash 'script-sonarscanner' - sh 'chmod 755 job-3-sonarscanner.sh && ./job-3-sonarscanner.sh '+gitRepoURL+' '+gitBranch+' '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'Embedded') { - node('autotools') { - dir('check-embedded') { - unstash 'tarballgz' - unstash 'script-embedded' - sh 'chmod 755 job-3-embedded.sh && ./job-3-embedded.sh '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (it == 'AndroidStudio') { - node('android') { - dir('check-android') { - unstash 'script-android' - unstash 'tar-android' - unstash 'tarballgz' - sh 'chmod 755 job-3-android.sh && ./job-3-android.sh '+tarballgz - archiveArtifacts artifacts: "lstopo-android/*.apk", fingerprint: true, onlyIfSuccessful: true - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else if (doDebug) { - node(it) { - dir('check-unix-debug') { - unstash 'tarballgz' - unstash 'script-unix-debug' - sh 'chmod 755 job-3-debug.sh && ./job-3-debug.sh '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } else { - node(it) { - dir('check-unix') { - unstash 'tarballgz' - unstash 'script-unix-check' - sh 'chmod 755 job-1-check.sh && ./job-1-check.sh '+tarballgz - if (env.KEEP_WORKING_DIRECTORY != 'true') - deleteDir() - } - } - } - }]} - parallel p; - } - } - } - } - - post { - // hooks are called in order: always, changed, aborted, failure, success, unstable - changed { - echo "Build status has changed." - script { - statusHasChanged = true - } - } - success { - echo "Build success." - // email when changed to success - script { - if (statusHasChanged || env.EMAIL_NOTIFICATION == 'true') { - emailext(body: '${DEFAULT_CONTENT}', - subject: '${DEFAULT_SUBJECT}', - replyTo: '$DEFAULT_REPLYTO', - to: '$DEFAULT_RECIPIENTS', - recipientProviders: [[$class: 'CulpritsRecipientProvider'],[$class: 'RequesterRecipientProvider']]) - } - } - } - failure { - echo "Build failure." - // always email on failure - emailext(body: '${DEFAULT_CONTENT}', - subject: '${DEFAULT_SUBJECT}', - replyTo: '$DEFAULT_REPLYTO', - to: '$DEFAULT_RECIPIENTS', - recipientProviders: [[$class: 'CulpritsRecipientProvider'],[$class: 'RequesterRecipientProvider']]) - } - } -} diff --git a/contrib/ci.inria.fr/browse_jenkins_logs.sh b/contrib/ci.inria.fr/browse_jenkins_logs.sh deleted file mode 100755 index 6722009a60..0000000000 --- a/contrib/ci.inria.fr/browse_jenkins_logs.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -if test "x$1" = x -o "x$1" = "x-h" -o "x$1" = "x--help"; then - echo "$0 []" - echo " open all build logs from a job on ci.inria.fr jenkins." - echo - echo " If \$HWLOC_JENKINS_BROWSER isn't set (for instance, to 'firefox')," - echo " URLs are listed in the terminal" - echo - echo " may be 'basic/job/master' ('basic' multibranch pipeline on branch 'master')" - echo " or 'basic/view/change-requests/job/PR-302' ('basic' multibranch pipeline on pull request #302)" - echo " or 'bgoglin' (normal pipeline)" - echo - echo " If the build number isn't specified, 'lastBuild' is used." - exit 1 -fi - -JOB="$1" -shift - -BUILD="$1" -if test "x$BUILD" = x; then - BUILD=lastBuild -fi - -URL=https://ci.inria.fr/hwloc/job/$JOB/$BUILD/flowGraphTable/ -echo "Reading $URL" - -LIST=$(wget -O - $URL \ - | sed -e 's@@\n@g' \ - | egrep '(Shell|Windows Batch) Script' \ - | egrep 'job-[0-9]-' \ - | sed -r -e 's#.*href="(/hwloc/[^"]+)".*#https://ci.inria.fr\1/\?consoleFull#') - -echo -if test "x$HWLOC_JENKINS_BROWSER" = x; then - echo "URLs are:" - echo $LIST -else - echo "Opening URLs with HWLOC_JENKINS_BROWSER=$HWLOC_JENKINS_BROWSER ..." - $HWLOC_JENKINS_BROWSER $LIST -fi diff --git a/contrib/ci.inria.fr/job-1-visualstudio.bat b/contrib/ci.inria.fr/job-1-visualstudio.bat deleted file mode 100644 index ce27690d64..0000000000 --- a/contrib/ci.inria.fr/job-1-visualstudio.bat +++ /dev/null @@ -1,35 +0,0 @@ -REM -REM Copyright © 2012-2021 Inria. All rights reserved. -REM See COPYING in top-level directory. -REM - -call %JENKINS_CONFIG_DIR%\\ciprofile.bat - -set TARBALL=%1 - -echo ############################### -echo Running on: -hostname -ver -echo Tarball: %TARBALL% -echo ############################ - -sh -c "tar xfz %TARBALL%" -if %errorlevel% neq 0 exit /b %errorlevel% - -cd %TARBALL:~0,-7%\contrib\windows -if %errorlevel% neq 0 exit /b %errorlevel% - -MSBuild /p:Configuration=Release /p:Platform=x64 hwloc.sln -if %errorlevel% neq 0 exit /b %errorlevel% - -x64\Release\lstopo-no-graphics.exe -v -if %errorlevel% neq 0 exit /b %errorlevel% - -x64\Release\lstopo-no-graphics.exe --windows-processor-groups -if %errorlevel% neq 0 exit /b %errorlevel% - -x64\Release\hwloc-info.exe --support -if %errorlevel% neq 0 exit /b %errorlevel% - -exit /b 0 diff --git a/contrib/ci.inria.fr/job-1-wincmake.bat b/contrib/ci.inria.fr/job-1-wincmake.bat deleted file mode 100644 index d543376fc7..0000000000 --- a/contrib/ci.inria.fr/job-1-wincmake.bat +++ /dev/null @@ -1,51 +0,0 @@ -REM -REM Copyright © 2012-2023 Inria. All rights reserved. -REM See COPYING in top-level directory. -REM - -call %JENKINS_CONFIG_DIR%\\ciprofile.bat - -set TARBALL=%1 -set BASENAME=%TARBALL:~0,-7% -REM reduce the build path name to avoid issues with very long file names in cmake/nmake -set SHORTNAME=%BASENAME:~-9% - -echo ############################### -echo Running on: -hostname -ver -echo Tarball: %TARBALL% -echo Build short name: %SHORTNAME% -echo ############################ - -sh -c "tar xfz %TARBALL%" -if %errorlevel% neq 0 exit /b %errorlevel% - -move %BASENAME% %SHORTNAME% -if %errorlevel% neq 0 exit /b %errorlevel% - -cd %SHORTNAME%\contrib\windows-cmake -if %errorlevel% neq 0 exit /b %errorlevel% - -cmake %HWLOC_WINCMAKE_OPTS% --install-prefix=%cd%/install -DCMAKE_BUILD_TYPE=Release -B build -if %errorlevel% neq 0 exit /b %errorlevel% - -cmake --build build --parallel -if %errorlevel% neq 0 exit /b %errorlevel% - -cmake --install build -if %errorlevel% neq 0 exit /b %errorlevel% - -install\bin\lstopo-no-graphics.exe -v -if %errorlevel% neq 0 exit /b %errorlevel% - -install\bin\lstopo-no-graphics.exe --windows-processor-groups -if %errorlevel% neq 0 exit /b %errorlevel% - -install\bin\hwloc-info.exe --support -if %errorlevel% neq 0 exit /b %errorlevel% - -ctest --test-dir build -V -if %errorlevel% neq 0 exit /b %errorlevel% - -exit /b 0 diff --git a/contrib/ci.inria.fr/job-3-android.sh b/contrib/ci.inria.fr/job-3-android.sh deleted file mode 100644 index 5e6ac0e664..0000000000 --- a/contrib/ci.inria.fr/job-3-android.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Copyright © 2012-2020 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -echo "############################" -echo "Running on:" -uname -a -echo "Tarball: $1" -echo "############################" - -set -e -set -x - -# environment variables -test -f $HOME/.ciprofile && . $HOME/.ciprofile - -# extract the tarball -tarball="$1" -basename=$(basename $tarball .tar.gz) -test -d $basename && chmod -R u+rwX $basename && rm -rf $basename -tar xfz $tarball -rm $tarball -cd $basename - -# build android -tar zxvf ../android.tar.gz -cd contrib/android/AndroidApp -./gradlew --full-stacktrace build - -# move apk in specific folder (alphabetically ordered after the main tarballs in the jenkins artifacts) -rm -rf ../../../../lstopo-android -mkdir ../../../../lstopo-android -mv lstopo/build/outputs/apk/debug/*.apk ../../../../lstopo-android - -exit 0 diff --git a/contrib/ci.inria.fr/job-3-coverity.sh b/contrib/ci.inria.fr/job-3-coverity.sh deleted file mode 100755 index 966255a5f8..0000000000 --- a/contrib/ci.inria.fr/job-3-coverity.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# Copyright © 2012-2022 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -echo "############################" -echo "Running on:" -uname -a -echo "Tarball: $3" -echo "############################" - -set -e -set -x - -git_repo_url="$1" -hwloc_branch="$2" -tarball="$3" - -if test -z "$git_repo_url" || test -z "$hwloc_branch"; then - echo "Need repo URL and branch name as arguments." - exit 1 -fi - -# environment variables -test -f $HOME/.ciprofile && . $HOME/.ciprofile - -# check that the repo is the official one -# check that this is master -if test x$hwloc_branch != xmaster -o x$git_repo_url != xhttps://github.com/open-mpi/hwloc.git; then - if test x$FORCE_COVERITY = xtrue; then - echo "Forcing coverity on non-master-branch or non-official repository." - else - echo "Ignoring non-master-branch or non-official repository." - exit 0 - fi -fi - -# extract the tarball -basename=$(basename $tarball .tar.gz) -test -d $basename && chmod -R u+rwX $basename && rm -rf $basename -tar xfz $tarball -rm $tarball -cd $basename - -# ignore clock problems -touch configure - -# configure things -EMAIL=brice.goglin@labri.fr -VERSION=$basename -COVDIR=cov-int -COVBALL=myproject.tgz - -# run -./configure --enable-plugins -cov-build --dir ${COVDIR} make all -# run 'make check' even if NO_CHECK is set -# (we don't want some issues to disappear from coverity depending on custom job config) -cov-build --dir ${COVDIR} make check - -tar cfvz ${COVBALL} ${COVDIR} -curl --form file=@${COVBALL} \ - --form "token=<${COVERITY_TOKEN_FILE}" \ - --form email=${EMAIL} \ - --form version=${VERSION} \ - --form description=manual \ - https://scan.coverity.com/builds?project=hwloc - -exit 0 diff --git a/contrib/ci.inria.fr/job-3-cygwin.bat b/contrib/ci.inria.fr/job-3-cygwin.bat deleted file mode 100644 index 0d6a4e64a8..0000000000 --- a/contrib/ci.inria.fr/job-3-cygwin.bat +++ /dev/null @@ -1,12 +0,0 @@ -REM -REM Copyright © 2012-2018 Inria. All rights reserved. -REM See COPYING in top-level directory. -REM - -call %JENKINS_CONFIG_DIR%\\ciprofile.bat - -sh -c "chmod 755 job-3-cygwin.sh" -sh -c "./job-3-cygwin.sh %1" -if %errorlevel% neq 0 exit /b %errorlevel% - -exit /b 0 \ No newline at end of file diff --git a/contrib/ci.inria.fr/job-3-cygwin.sh b/contrib/ci.inria.fr/job-3-cygwin.sh deleted file mode 100644 index f5943fe8a8..0000000000 --- a/contrib/ci.inria.fr/job-3-cygwin.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# Copyright © 2012-2021 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -echo "############################" -echo "Running on:" -uname -a -echo "Tarball: $1" -echo "############################" - -set -e -set -x - -# extract the tarball -tarball="$1" -basename=$(basename $tarball .tar.gz) -test -d $basename && chmod -R u+rwX $basename && rm -rf $basename -tar xfz $tarball -rm $tarball -cd $basename - -# ignore clock problems -touch configure - -# build without plugins, with relative VPATH -mkdir build -cd build -../configure -make -test x$NO_CHECK = xtrue || make check -utils/lstopo/lstopo-no-graphics -v -utils/lstopo/lstopo-no-graphics --windows-processor-groups -utils/hwloc/hwloc-info --support -cd .. - -exit 0 diff --git a/contrib/ci.inria.fr/job-3-debug.sh b/contrib/ci.inria.fr/job-3-debug.sh deleted file mode 100755 index 10cd9adcb2..0000000000 --- a/contrib/ci.inria.fr/job-3-debug.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# Copyright © 2012-2020 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -echo "############################" -echo "Running on:" -uname -a -echo "Tarball: $1" -echo "############################" - -set -e -set -x - -# environment variables -test -f $HOME/.ciprofile && . $HOME/.ciprofile - -# extract the tarball -tarball="$1" -basename=$(basename $tarball .tar.gz) -test -d $basename && chmod -R u+rwX $basename && rm -rf $basename -tar xfz $tarball -rm $tarball -cd $basename - -# ignore clock problems -touch configure - -# build with plugins and debug -mkdir build-plugins-debug -cd build-plugins-debug -../configure --enable-plugins --enable-debug $HWLOC_CI_JOB3DEBUG_CONFOPTS -make -test x$NO_CHECK = xtrue || make check -tests/hwloc/wrapper.sh utils/lstopo/lstopo-no-graphics -cd .. - -exit 0 diff --git a/contrib/ci.inria.fr/job-3-embedded.sh b/contrib/ci.inria.fr/job-3-embedded.sh deleted file mode 100755 index 8d7e066c6a..0000000000 --- a/contrib/ci.inria.fr/job-3-embedded.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# Copyright © 2012-2018 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -echo "############################" -echo "Running on:" -uname -a -echo "Tarball: $1" -echo "############################" - -set -e -set -x - -# environment variables -test -f $HOME/.ciprofile && . $HOME/.ciprofile - -# extract the tarball -tarball="$1" -basename=$(basename $tarball .tar.gz) -test -d $basename && chmod -R u+rwX $basename && rm -rf $basename -tar xfz $tarball -mv $tarball $basename # keep the tarball, we'll need it for the embedded test below -cd $basename - -# ignore clock problems -touch configure - -# embedded tests -(cd tests/hwloc/embedded && ./run-embedded-tests.sh ../../../$tarball) - -exit 0 diff --git a/contrib/ci.inria.fr/job-3-mingw.bat b/contrib/ci.inria.fr/job-3-mingw.bat deleted file mode 100644 index 7eb4f4a0d4..0000000000 --- a/contrib/ci.inria.fr/job-3-mingw.bat +++ /dev/null @@ -1,30 +0,0 @@ -REM -REM Copyright © 2012-2021 Inria. All rights reserved. -REM See COPYING in top-level directory. -REM - -call %JENKINS_CONFIG_DIR%\\ciprofile.bat - -REM %MINGW32SH% and %MINGW64SH% should be defined on the slave to something like: -REM C:\msys64\usr\bin\env MSYSTEM=MINGW32 HOME=%cd% /usr/bin/bash -li -REM (either in ciprofile.bat or custom Windows environment variables) - -REM bashrc should then define $MSLIB32_PATH and $MSLIB64_PATH pointing to MSVC -REM lib.exe directory for 32/64 builds, such as: -REM export MSLIB32_PATH=/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx86/x86/ -REM export MSLIB64_PATH=/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/ - -REM bashrc also must make sure MSYS isn't going to rewrite lib.exe options -REM such as "/def:.libs/libhwloc.def" into Windows paths. -REM Can be avoided in MSYS2 with: -REM export MSYS2_ARG_CONV_EXCL="/machine;/def;/out;/name" - -sh -c "chmod 755 job-3-mingw.sh" - -if %2 equ 32 set MINGWSH=%MINGW32SH% -if %2 equ 64 set MINGWSH=%MINGW64SH% - -%MINGWSH% -c "./job-3-mingw.sh %1 %2" -if %errorlevel% neq 0 exit /b %errorlevel% - -exit /b 0 diff --git a/contrib/ci.inria.fr/job-3-mingw.sh b/contrib/ci.inria.fr/job-3-mingw.sh deleted file mode 100644 index 8a90ad480b..0000000000 --- a/contrib/ci.inria.fr/job-3-mingw.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# Copyright © 2012-2021 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -echo "############################" -echo "Running on:" -uname -a -echo "Options: $0" -echo "############################" - -set -e -set -x - -tarball="$1" -arch="$2" - -if test "x$arch" = "x32"; then - # check the mingw shell - if test "x$MINGW_CHOST" != xi686-w64-mingw32; then - echo "MINGW_CHOST is $MINGW_CHOST instead of i686-w64-mingw32." - exit 1 - fi - # for MS 'lib' program - export PATH=$PATH:$MSLIB32_PATH -else if test "x$arch" = "x64"; then - # check the mingw shell - if test "x$MINGW_CHOST" != xx86_64-w64-mingw32; then - echo "MINGW_CHOST is $MINGW_CHOST instead of x86_64-w64-mingw32." - exit 1 - fi - # for MS 'lib' program - export PATH=$PATH:$MSLIB64_PATH -else - echo "Architecture parameter must be 32 or 64." - exit 1 -fi -fi - -# check that we have a lib.exe -if ! which lib.exe ; then - echo "Couldn't find MSVC lib.exe" - exit 1 -fi - -# remove previous artifacts so that they aren't exported again by this build -rm -f hwloc-win*-build-*.zip || true - -# extract the tarball -if ! test -f "$tarball"; then - echo "Invalid tarball parameter." - exit 1 -fi -basename=$(basename $tarball .tar.gz) -version=$(echo $basename | cut -d- -f2-) -test -d $basename && chmod -R u+rwX $basename && rm -rf $basename -tar xfz $tarball - -mkdir ${basename}/build || true -cd ${basename}/build - -winball=hwloc-win${arch}-build-${version} -prefix=${PWD}/../${winball} -../configure --prefix=$prefix --enable-static CC="gcc -static-libgcc" $confopts - -make - -if test x$NO_CHECK != xtrue; then - make check -fi - -make install - -cd .. - -zip -r ../${winball}.zip ${winball} -test -f ${winball}/lib/libhwloc.lib || false - -build/utils/lstopo/lstopo-no-graphics -v -build/utils/lstopo/lstopo-no-graphics --windows-processor-groups -build/utils/hwloc/hwloc-info --support - -cd .. - -rm -f $tarball - -exit 0 diff --git a/contrib/ci.inria.fr/job-3-sonarscanner.sh b/contrib/ci.inria.fr/job-3-sonarscanner.sh deleted file mode 100755 index c0d307c166..0000000000 --- a/contrib/ci.inria.fr/job-3-sonarscanner.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/bin/bash -# -# Copyright © 2012-2022 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -echo "############################" -echo "Running on:" -uname -a -echo "Tarball: $3" -echo "############################" - -set -e -set -x - -git_repo_url="$1" -hwloc_branch="$2" -tarball="$3" - -if test -z "$git_repo_url" || test -z "$hwloc_branch"; then - echo "Need repo URL and branch name as arguments." - exit 1 -fi - -# environment variables -test -f $HOME/.ciprofile && . $HOME/.ciprofile - -# check that this is either master or vX.Y -if test x$hwloc_branch != xmaster; then - if test x$(echo "x${hwloc_branch}x" | sed -r -e 's/xv[0-9]+\.[0-9]+x//') != x; then - echo "Sending non-master and non-stable branch output to 'tmp' branch on sonarqube server." - hwloc_branch=tmp - fi -fi - -# check that the repo is the official one -if test x$git_repo_url != xhttps://github.com/open-mpi/hwloc.git; then - if test x$FORCE_SONARQUBE = xtrue; then - echo "Sending non-official repository output to 'tmp' branch on sonarqube server." - hwloc_branch=tmp - else - echo "Ignoring non-official repository." - exit 0 - fi -fi - -# extract the tarball -basename=$(basename $tarball .tar.gz) -test -d $basename && chmod -R u+rwX $basename && rm -rf $basename -tar xfz $tarball -rm $tarball -cd $basename - -# ignore clock problems -touch configure - -# Configure, Make and Install -export CFLAGS="-O0 -g -fPIC --coverage -Wall -Wunused-parameter -Wundef -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wstrict-prototypes -Wcomment -pedantic -fdiagnostics-show-option -fno-inline" -export LDFLAGS="--coverage" -./configure --enable-plugins -make V=1 | tee hwloc-build.log -# run 'make check' even if NO_CHECK is set -# (we don't want some issues to disappear from sonarqube depending on custom job config) -make check - -# Collect coverage data -find . -path '*/.libs/*.gcno' -exec rename 's@/.libs/@/@' {} \; -find . -path '*/.libs/*.gcda' -exec rename 's@/.libs/@/@' {} \; -lcov --directory . --capture --output-file hwloc.lcov -lcov_cobertura.py hwloc.lcov --output hwloc-coverage.xml - -# Clang/Scan-build -make distclean -export CFLAGS="-Wall -std=gnu99" -unset LDFLAGS -scan-build -plist --intercept-first --analyze-headers -o analyzer_reports ./configure --enable-plugins | tee scan-build.log -scan-build -plist --intercept-first --analyze-headers -o analyzer_reports make | tee -a scan-build.log -test x$NO_CHECK = xtrue || scan-build -plist --intercept-first --analyze-headers -o analyzer_reports make check | tee -a scan-build.log - -# Run cppcheck analysis -SOURCES_TO_ANALYZE="hwloc tests utils" -SOURCES_TO_EXCLUDE="-itests/hwloc/ports -ihwloc/topology-aix.c -ihwloc/topology-darwin.c -ihwloc/topology-freebsd.c -ihwloc/topology-hpux.c -ihwloc/topology-netbsd.c -ihwloc/topology-solaris.c -ihwloc/topology-solaris-chiptype.c -ihwloc/topology-windows.c -ihwloc/topology-cuda.c -ihwloc/topology-gl.c -ihwloc/topology-nvml.c -ihwloc/topology-rsmi.c -ihwloc/topology-levelzero.c -ihwloc/topology-opencl.c -iutils/lstopo/lstopo-windows.c -iutils/lstopo/lstopo-android.c" -CPPCHECK_INCLUDES="-Iinclude -Ihwloc -Iutils/lstopo -Iutils/hwloc" -CPPCHECK="cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=purgedConfiguration --suppress=missingIncludeSystem ${CPPCHECK_INCLUDES}" -# Main cppcheck -DEFINITIONS="-Dhwloc_getpagesize=getpagesize -DMAP_ANONYMOUS=0x20 -Dhwloc_thread_t=pthread_t -DSYS_gettid=128" -DEFINITIONS="${DEFINITIONS} -UHASH_BLOOM -UHASH_EMIT_KEYS -UHASH_FUNCTION" -${CPPCHECK} ${DEFINITIONS} ${SOURCES_TO_ANALYZE} ${SOURCES_TO_EXCLUDE} 2> hwloc-cppcheck.xml -# cppcheck on non-Linux ports -DEFINITIONS="-DR_THREAD=6 -DP_DEFAULT=0 -DR_L2CSDL=11 -DR_PCORESDL=12 -DR_REF1SDL=13" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-aix.c -Itests/hwloc/ports/include/aix 2> hwloc-cppcheck-aix.xml -DEFINITIONS= -${CPPCHECK} ${DEFINITIONS} hwloc/topology-darwin.c -Itests/hwloc/ports/include/darwin 2> hwloc-cppcheck-darwin.xml -DEFINITIONS="-Dhwloc_thread_t=pthread_t -DCPU_WHICH_DOMAIN=6" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-freebsd.c -Itests/hwloc/ports/include/freebsd 2> hwloc-cppcheck-freebsd.xml -DEFINITIONS="-DMAP_MEM_FIRST_TOUCH=2 -Dhwloc_thread_t=pthread_t" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-hpux.c -Itests/hwloc/ports/include/hpux 2> hwloc-cppcheck-hpux.xml -DEFINITIONS="-Dhwloc_thread_t=pthread_t" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-netbsd.c -Itests/hwloc/ports/include/netbsd 2> hwloc-cppcheck-netbsd.xml -DEFINITIONS="-DMADV_ACCESS_LWP=7" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-solaris.c hwloc/topology-solaris-chiptype.c -Itests/hwloc/ports/include/solaris 2> hwloc-cppcheck-solaris.xml -DEFINITIONS="-Dhwloc_thread_t=HANDLE" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-windows.c -Itests/hwloc/ports/include/windows 2> hwloc-cppcheck-windows.xml -# cppcheck on GPU ports -DEFINITIONS= -${CPPCHECK} ${DEFINITIONS} hwloc/topology-cuda.c -Itests/hwloc/ports/include/cuda 2> hwloc-cppcheck-cuda.xml -DEFINITIONS="-DNV_CTRL_PCI_DOMAIN=306" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-gl.c -Itests/hwloc/ports/include/gl 2> hwloc-cppcheck-gl.xml -DEFINITIONS= -${CPPCHECK} ${DEFINITIONS} hwloc/topology-nvml.c -Itests/hwloc/ports/include/nvml 2> hwloc-cppcheck-nvml.xml -DEFINITIONS="-DCL_DEVICE_BOARD_NAME_AMD=0x4038 -DCL_DEVICE_TOPOLOGY_AMD=0x4037" -${CPPCHECK} ${DEFINITIONS} hwloc/topology-opencl.c -Itests/hwloc/ports/include/opencl 2> hwloc-cppcheck-opencl.xml -DEFINITIONS= -${CPPCHECK} ${DEFINITIONS} hwloc/topology-rsmi.c -Itests/hwloc/ports/include/rsmi 2> hwloc-cppcheck-rsmi.xml -DEFINITIONS= -${CPPCHECK} ${DEFINITIONS} hwloc/topology-levelzero.c -Itests/hwloc/ports/include/levelzero 2> hwloc-cppcheck-levelzero.xml -# cppcheck on non-Linux lstopo -DEFINITIONS= -${CPPCHECK} ${DEFINITIONS} utils/lstopo/lstopo-windows.c -Itests/hwloc/ports/include/windows 2> hwloc-cppcheck-lstopo-windows.xml -DEFINITIONS= -${CPPCHECK} ${DEFINITIONS} utils/lstopo/lstopo-android.c 2> hwloc-cppcheck-lstopo-android.xml - -CPPCHECK_XMLS=$(ls -m hwloc-cppcheck*.xml) - -# Run rats analysis -rats -w 3 --xml ${SOURCES_TO_ANALYZE} > hwloc-rats.xml - -RATS_XMLS=$(ls -m hwloc-rats*.xml) - -# Run valgrind analysis -VALGRIND="libtool --mode=execute valgrind --leak-check=full --xml=yes" -$VALGRIND --xml-file=hwloc-valgrind-local.xml utils/lstopo/lstopo-no-graphics - >/dev/null -$VALGRIND --xml-file=hwloc-valgrind-xml1.xml utils/lstopo/lstopo-no-graphics -i tests/hwloc/xml/32em64t-2n8c2t-pci-normalio.xml -.xml >/dev/null - -VALGRIND_XMLS=$(ls -m hwloc-valgrind*.xml) - -# Disable GCC attributes, sonar-scanner doesn't support it -sed -e '/#define HWLOC_HAVE_ATTRIBUTE/d' -i include/private/autogen/config.h - -# Create the config for sonar-scanner -# The text between '<< EOF' and 'EOF' doesn't appear in the xtrace output (set -x) -# hence the contents ~/.sonarqube-hwloc-token doesn't appear in the public logs. -cat > sonar-project.properties << EOF -sonar.host.url=https://sonarqube.inria.fr/sonarqube -sonar.login=$(cat ~/.sonarqube-hwloc-token) -sonar.links.homepage=https://www.open-mpi.org/projects/hwloc/ -sonar.links.ci=https://ci.inria.fr/hwloc/ -sonar.links.scm=https://github.com/open-mpi/hwloc -sonar.links.issue=https://github.com/open-mpi/hwloc/issues -sonar.projectKey=tadaam:hwloc:github:$hwloc_branch -sonar.projectDescription=Hardware locality (hwloc) -# SED doesn't want us to define projectName -sonar.projectVersion=$hwloc_branch -sonar.scm.disabled=false -# sonar.scm.provider=git requires sonar-scanner to run inside a git clone -sonar.sourceEncoding=UTF-8 -sonar.sources=hwloc, tests, utils -sonar.exclusions=tests/hwloc/ports/**,tests/hwloc/xml/*.xml -sonar.c.clangsa.reportPath=analyzer_reports/*/*.plist -sonar.c.errorRecoveryEnabled=true -sonar.c.compiler.parser=GCC -sonar.c.compiler.charset=UTF-8 -sonar.c.compiler.regex=^(.*):(\\\d+):\\\d+: warning: (.*)\\\[(.*)\\\]$ -sonar.c.compiler.reportPath=hwloc-build.log -sonar.c.coverage.reportPath=hwloc-coverage.xml -sonar.c.cppcheck.reportPath=${CPPCHECK_XMLS} -sonar.c.includeDirectories=$(echo | gcc -E -Wp,-v - 2>&1 | grep "^ " | tr '\n' ',')include,hwloc,utils/lstopo,utils/hwloc -sonar.c.rats.reportPath=${RATS_XMLS} -sonar.c.valgrind.reportPath=${VALGRIND_XMLS} -# make sure only C matches our .c files -sonar.lang.patterns.c++=**/*.cpp,**/*.hpp -EOF - -# Log the sonar-scanner version in case of problem -sonar-scanner --version - -# Run the sonar-scanner analysis and submit to SonarQube server -sonar-scanner -X > sonar.log - -exit 0