From f79c569b2534dd14a3ef8ffbcfe26286c238321f Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 09:15:20 +0000 Subject: [PATCH 01/14] appveyor cache invalidate --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f1e46ae4..e62dc0fb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -50,8 +50,8 @@ for: TRIPLET: $PLATFORM-osx HAVE_PRECISE_TIMER: OFF cache: - #- $WS/vcpkg - - $WS/vcpkg/installed + ##- $WS/vcpkg + #- $WS/vcpkg/installed init: - sh: if [ $PLATFORM = "x86" ]; then exit 1; fi - sh: brew install p7zip #lcov From a6ed431f131870e05d819a3388ce18c73720689d Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 09:20:17 +0000 Subject: [PATCH 02/14] appveyor vcpkg bootstrap --- appveyor.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e62dc0fb..1d40586a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -51,7 +51,7 @@ for: HAVE_PRECISE_TIMER: OFF cache: ##- $WS/vcpkg - #- $WS/vcpkg/installed + - $WS/vcpkg/installed init: - sh: if [ $PLATFORM = "x86" ]; then exit 1; fi - sh: brew install p7zip #lcov @@ -82,8 +82,10 @@ before_build: - cmd: cd C:\tools\vcpkg - sh : cd $WS/vcpkg - git pull - - cmd: IF NOT EXIST vcpkg.exe .\bootstrap-vcpkg.bat - - sh : test -f vcpkg || ./bootstrap-vcpkg.sh + #- cmd: IF NOT EXIST vcpkg.exe .\bootstrap-vcpkg.bat + #- sh : test -f vcpkg || ./bootstrap-vcpkg.sh + - cmd: .\bootstrap-vcpkg.bat + - sh : ./bootstrap-vcpkg.sh - cmd: vcpkg install sdl2 sdl2-image gtest --triplet %PLATFORM%-windows - sh : ./vcpkg install sdl2 sdl2-image gtest --triplet $TRIPLET - cmd: cd %APPVEYOR_BUILD_FOLDER% From cc081ead51904b0a287e894d9313bebd1189d6d3 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 10:41:42 +0000 Subject: [PATCH 03/14] disabling SDL2-static switch --- CMakeLists.txt | 4 +++- azure-pipelines/variables/build_switches.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 169da651..9aec16de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,9 @@ option(BUILD_SNAPSHOT "build snapshot test" OFF) include(CMakeDependentOption) CMAKE_DEPENDENT_OPTION(TEST_DUMP_SNAPSHOT "build test to dump the expected output instead of verifing it" OFF "BUILD_SNAPSHOT" OFF) -option(WITH_SDL2_STATIC "linking STATIC LIB with SDL2 STATIC" OFF) +### Disabling SDL2-static as it requires to use the x64-windows-static +### and therefore all the libs must be static. +#option(WITH_SDL2_STATIC "linking STATIC LIB with SDL2 STATIC" OFF) option(HAVE_PRECISE_TIMER "if SDL2 timers are precise" ON) add_subdirectory ("sdl2-vga-terminal") diff --git a/azure-pipelines/variables/build_switches.yml b/azure-pipelines/variables/build_switches.yml index 90adc661..35434834 100644 --- a/azure-pipelines/variables/build_switches.yml +++ b/azure-pipelines/variables/build_switches.yml @@ -1,5 +1,5 @@ variables: - SDL2_STATIC: ON + SDL2_STATIC: OFF BUILD_TESTING: ON BUILD_SHARED_LIBS: ON BUILD_EXAMPLES: ON From e21496a11db61a227addd02dbc51eed1940faaac Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 11:32:16 +0000 Subject: [PATCH 04/14] azure pipeline linux vcpkg sdl2[x11] fix --- azure-pipelines/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines/linux.yml b/azure-pipelines/linux.yml index d23cf45e..b41e06f3 100644 --- a/azure-pipelines/linux.yml +++ b/azure-pipelines/linux.yml @@ -41,6 +41,7 @@ stages: parameters: vcpkg_key_cache: $(CACHE_VCPKG_KEY) triplet: x64-linux + packages: 'sdl2[x11] sdl2-image gtest' - stage: CI jobs: From 6dd9a6e3c773b117f59f8a8f6482cc149d0c3ef2 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 11:57:50 +0000 Subject: [PATCH 05/14] azure pipelines invalidate cache --- azure-pipelines/linux.yml | 2 +- azure-pipelines/variables/global.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines/linux.yml b/azure-pipelines/linux.yml index b41e06f3..a5ec84e6 100644 --- a/azure-pipelines/linux.yml +++ b/azure-pipelines/linux.yml @@ -41,7 +41,7 @@ stages: parameters: vcpkg_key_cache: $(CACHE_VCPKG_KEY) triplet: x64-linux - packages: 'sdl2[x11] sdl2-image gtest' + packages: 'sdl2 sdl2[x11] sdl2-image gtest' - stage: CI jobs: diff --git a/azure-pipelines/variables/global.yml b/azure-pipelines/variables/global.yml index 159a36f3..e8bc0c84 100644 --- a/azure-pipelines/variables/global.yml +++ b/azure-pipelines/variables/global.yml @@ -1,5 +1,5 @@ variables: - CACHE_VCPKG_KEY: v4-1 | vcpkg-root + CACHE_VCPKG_KEY: v0-4-1 | vcpkg-root VCPKG_CMAKE: "$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake" CMAKE_ARGS: -DWITH_SDL2_STATIC=$(SDL2_STATIC) -DBUILD_TESTING=$(BUILD_TESTING) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS) -DBUILD_EXAMPLES=$(BUILD_EXAMPLES) -DBUILD_SNAPSHOT=$(BUILD_SNAPSHOT) -DENABLE_CODE_COVERAGE=$(ENABLE_CODE_COVERAGE) -DHAVE_PRECISE_TIMER=$(HAVE_PRECISE_TIMER) CMAKE_IGNORE_PATH_WIN: "C:/MinGW/bin;C:/Strawberry/c/bin;C:/Program Files (x86)/LLVM/bin;C:/ProgramData/chocolatey/bin" From 1217aea0a019b64a830b9fb8cc782f515760d5c9 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 12:04:07 +0000 Subject: [PATCH 06/14] azure pipelines disabling sdl2-static switch for matrix pipeline --- README.md | 10 +++++++++- azure-pipelines/matrix.yml | 4 ++-- azure-pipelines/templates/matrix-job.yml | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 79f36338..c3af82fa 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ there are 5 pipelines, 1 for each OS and one dedicated to "Analysis", plus 1 for | Debug | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Release | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | BUILD_SHARED_LIBS | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| WITH_SDL2_STATIC | :heavy_check_mark: | only | only | +| ~~WITH_SDL2_STATIC~~ | :heavy_check_mark: | only | only | | BUILD_TESTING | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | BUILD_EXAMPLES | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | BUILD_SNAPSHOT | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | @@ -59,6 +59,14 @@ there are 5 pipelines, 1 for each OS and one dedicated to "Analysis", plus 1 for - code coverage available only with LLVM and GCC in `cmake`, on CI working only on macos - `TEST_DUMP_SNAPSHOT` is "forbidden" to test for the build as an helper flag only. +### Linux Note + +It is required to install `sdl[x11]` along side `sdl` pacakge otherwise linking error. + +### SDL2-static switch +It has been disabled as it has been moved to a different triplet `x64-windows-static` and just makes it annoying to test for it as it requires to have also a VCPKG_TARGET_TRIPLET to be changed and so it should be used as a different job itself rather than a switch, even though the switch in CMAKE is required to link the proper `SDL2::SDL2` or `SDL2::SDL2-static`. + +At the moment the `WITH_SDL2_STATIC` option in CMAKE has been disabled. ## Synopsis diff --git a/azure-pipelines/matrix.yml b/azure-pipelines/matrix.yml index 309062ea..273c6131 100644 --- a/azure-pipelines/matrix.yml +++ b/azure-pipelines/matrix.yml @@ -68,7 +68,7 @@ stages: jobName: "linux" vmImageName: ${{ variables.linux_image }} triplet: x64-linux - sdl2_static: ['ON'] + #sdl2_static: ['ON'] enable_code_coverage: ['OFF'] - stage: matrix_windows displayName: Matrix Windows @@ -93,4 +93,4 @@ stages: jobName: "macos" vmImageName: ${{ variables.mac_image }} triplet: x64-osx - sdl2_static: ['ON'] + #sdl2_static: ['ON'] diff --git a/azure-pipelines/templates/matrix-job.yml b/azure-pipelines/templates/matrix-job.yml index a818b5e8..25628de8 100644 --- a/azure-pipelines/templates/matrix-job.yml +++ b/azure-pipelines/templates/matrix-job.yml @@ -1,6 +1,6 @@ parameters: configuration: ['Debug', 'Release'] - sdl2_static: ['ON', 'OFF'] + #sdl2_static: ['ON', 'OFF'] build_testing: ['ON', 'OFF'] build_shared_libs: ['ON', 'OFF'] build_examples: ['ON', 'OFF'] @@ -18,7 +18,7 @@ jobs: strategy: matrix: ${{ each configuration in parameters.configuration }}: - ${{ each sdl2_static in parameters.sdl2_static}}: + #${{ each sdl2_static in parameters.sdl2_static}}: ${{ each build_testing in parameters.build_testing }}: ${{ each build_shared_libs in parameters.build_shared_libs }}: ${{ each build_examples in parameters.build_examples }}: From b4049df870f4d00502a58575d2f5aa6a66c78cb6 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 12:11:31 +0000 Subject: [PATCH 07/14] [azure pipelines] remove WITH_SDL2_STATIC from cmake cli --- azure-pipelines/variables/global.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/variables/global.yml b/azure-pipelines/variables/global.yml index e8bc0c84..f0767052 100644 --- a/azure-pipelines/variables/global.yml +++ b/azure-pipelines/variables/global.yml @@ -1,5 +1,5 @@ variables: CACHE_VCPKG_KEY: v0-4-1 | vcpkg-root VCPKG_CMAKE: "$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake" - CMAKE_ARGS: -DWITH_SDL2_STATIC=$(SDL2_STATIC) -DBUILD_TESTING=$(BUILD_TESTING) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS) -DBUILD_EXAMPLES=$(BUILD_EXAMPLES) -DBUILD_SNAPSHOT=$(BUILD_SNAPSHOT) -DENABLE_CODE_COVERAGE=$(ENABLE_CODE_COVERAGE) -DHAVE_PRECISE_TIMER=$(HAVE_PRECISE_TIMER) + CMAKE_ARGS: -DBUILD_TESTING=$(BUILD_TESTING) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS) -DBUILD_EXAMPLES=$(BUILD_EXAMPLES) -DBUILD_SNAPSHOT=$(BUILD_SNAPSHOT) -DENABLE_CODE_COVERAGE=$(ENABLE_CODE_COVERAGE) -DHAVE_PRECISE_TIMER=$(HAVE_PRECISE_TIMER) CMAKE_IGNORE_PATH_WIN: "C:/MinGW/bin;C:/Strawberry/c/bin;C:/Program Files (x86)/LLVM/bin;C:/ProgramData/chocolatey/bin" From dd8fcf740c89a64bb51f983a968ea9000d9a3d53 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 12:15:31 +0000 Subject: [PATCH 08/14] [azure pipelines] debug task find llcov --- azure-pipelines/templates/sonarcloud-job.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/templates/sonarcloud-job.yml b/azure-pipelines/templates/sonarcloud-job.yml index 562a5dc9..067382e1 100644 --- a/azure-pipelines/templates/sonarcloud-job.yml +++ b/azure-pipelines/templates/sonarcloud-job.yml @@ -140,9 +140,9 @@ jobs: workingDirectory: build condition: ne(variables['Agent.OS'], 'Windows_NT') - #- bash: sudo find / -name llvm-cov 2> /dev/null - # displayName: llvm-cov DEBUG - # condition: ne(variables['Agent.OS'], 'Windows_NT') + - bash: sudo find / -name llvm-cov 2> /dev/null + displayName: DEBUG find llvm-cov + condition: ne(variables['Agent.OS'], 'Windows_NT') - bash: | echo $OSTYPE test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov From e5c97470660ea8f68eb6b0e5c44c7546eb88cde1 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 12:27:21 +0000 Subject: [PATCH 09/14] [azure pipelines] CI analize update llvm 10 -> 13 for macOS image --- azure-pipelines/templates/sonarcloud-job.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/azure-pipelines/templates/sonarcloud-job.yml b/azure-pipelines/templates/sonarcloud-job.yml index 067382e1..bb2a47a4 100644 --- a/azure-pipelines/templates/sonarcloud-job.yml +++ b/azure-pipelines/templates/sonarcloud-job.yml @@ -133,16 +133,20 @@ jobs: - bash: | echo '#!/bin/bash' > g.sh - echo 'exec /usr/local/Cellar/llvm/10.0.0_3/bin/llvm-cov gcov "$@"' >> g.sh + echo 'exec /usr/local/Cellar/llvm/13.0.0_1/bin/llvm-cov gcov "$@"' >> g.sh + chmod +x g.sh cat g.sh displayName: llvm-cov gcov wrapper workingDirectory: build condition: ne(variables['Agent.OS'], 'Windows_NT') - - - bash: sudo find / -name llvm-cov 2> /dev/null - displayName: DEBUG find llvm-cov - condition: ne(variables['Agent.OS'], 'Windows_NT') + + - bash: env + displayName: DEBUG display environment + #- bash: sudo find / -name llvm-cov 2> /dev/null + # displayName: DEBUG find llvm-cov + # condition: ne(variables['Agent.OS'], 'Windows_NT') + - bash: | echo $OSTYPE test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov From 67457401b1985930f4afaa5379244dbf0b312c67 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 12:41:40 +0000 Subject: [PATCH 10/14] [azure pipelines] CI analyzer lcov debug --- azure-pipelines/templates/sonarcloud-job.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines/templates/sonarcloud-job.yml b/azure-pipelines/templates/sonarcloud-job.yml index bb2a47a4..57dbf4f6 100644 --- a/azure-pipelines/templates/sonarcloud-job.yml +++ b/azure-pipelines/templates/sonarcloud-job.yml @@ -137,6 +137,7 @@ jobs: chmod +x g.sh cat g.sh + pwd displayName: llvm-cov gcov wrapper workingDirectory: build condition: ne(variables['Agent.OS'], 'Windows_NT') From ad4995db71cd0af16a5d9593a4e929808d9a5962 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 12:50:18 +0000 Subject: [PATCH 11/14] [azure pipelines] analyzer disabling installing lcov --- azure-pipelines/templates/sonarcloud-job.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/templates/sonarcloud-job.yml b/azure-pipelines/templates/sonarcloud-job.yml index 57dbf4f6..b3b493c0 100644 --- a/azure-pipelines/templates/sonarcloud-job.yml +++ b/azure-pipelines/templates/sonarcloud-job.yml @@ -142,15 +142,15 @@ jobs: workingDirectory: build condition: ne(variables['Agent.OS'], 'Windows_NT') - - bash: env - displayName: DEBUG display environment + #- bash: env + # displayName: DEBUG display environment #- bash: sudo find / -name llvm-cov 2> /dev/null # displayName: DEBUG find llvm-cov # condition: ne(variables['Agent.OS'], 'Windows_NT') - bash: | echo $OSTYPE - test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov + #test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov ./g.sh -f -b -u $(find . -name *.gcda) lcov --directory . --base-directory . --gcov-tool ./g.sh --capture -o cov.info lcov --remove cov.info '/Applications/*' --output-file coverage.info From b9383cfbad57095d3dc8318707dc7b60224e0e75 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 13:01:12 +0000 Subject: [PATCH 12/14] [azure pipelines] analyzer debug lcov path --- azure-pipelines/templates/sonarcloud-job.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines/templates/sonarcloud-job.yml b/azure-pipelines/templates/sonarcloud-job.yml index b3b493c0..21203d8b 100644 --- a/azure-pipelines/templates/sonarcloud-job.yml +++ b/azure-pipelines/templates/sonarcloud-job.yml @@ -149,8 +149,10 @@ jobs: # condition: ne(variables['Agent.OS'], 'Windows_NT') - bash: | + pwd + ls echo $OSTYPE - #test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov + test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov ./g.sh -f -b -u $(find . -name *.gcda) lcov --directory . --base-directory . --gcov-tool ./g.sh --capture -o cov.info lcov --remove cov.info '/Applications/*' --output-file coverage.info From 02936ed6fc11566c99f4dbd66fdd65e1bf0befa7 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 13:14:41 +0000 Subject: [PATCH 13/14] [azure pipelines] analyzer lcov g.sh path patch --- azure-pipelines/templates/sonarcloud-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/templates/sonarcloud-job.yml b/azure-pipelines/templates/sonarcloud-job.yml index 21203d8b..4023bf92 100644 --- a/azure-pipelines/templates/sonarcloud-job.yml +++ b/azure-pipelines/templates/sonarcloud-job.yml @@ -154,7 +154,7 @@ jobs: echo $OSTYPE test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov ./g.sh -f -b -u $(find . -name *.gcda) - lcov --directory . --base-directory . --gcov-tool ./g.sh --capture -o cov.info + lcov --directory . --base-directory . --gcov-tool /Users/runner/work/1/s/build/g.sh --capture -o cov.info lcov --remove cov.info '/Applications/*' --output-file coverage.info lcov --list coverage.info #gcovr -r ../ --filter ../sdl2-vga-terminal/src -o sonarcube.xml --sonarqube From 710e176313d5be6fe779fc0bd3e7cf177b980af3 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Mon, 29 Nov 2021 13:26:33 +0000 Subject: [PATCH 14/14] [azure pipelines] remove sdl2-static switch --- azure-pipelines/variables/build_switches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/variables/build_switches.yml b/azure-pipelines/variables/build_switches.yml index 35434834..189a3d1a 100644 --- a/azure-pipelines/variables/build_switches.yml +++ b/azure-pipelines/variables/build_switches.yml @@ -1,5 +1,5 @@ variables: - SDL2_STATIC: OFF + #SDL2_STATIC: OFF BUILD_TESTING: ON BUILD_SHARED_LIBS: ON BUILD_EXAMPLES: ON