You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by fg...@apache.org on 2023/06/06 18:11:59 UTC

[nifi-minifi-cpp] branch main updated (716631500 -> 9c3cdeca2)

This is an automated email from the ASF dual-hosted git repository.

fgerlits pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


    from 716631500 MINIFICPP-2119 fix CronTests error with classic locale
     new b0a20690a MINIFICPP-2120 Fix debian bookworm, and various bootstrap issues
     new 9c3cdeca2 MINIFICPP-2126 reenable Windows CI caching

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/ci.yml | 32 ++++++++++++++++++++++----------
 aptitude.sh              | 19 ++++++++++++-------
 arch.sh                  |  5 ++++-
 bootstrap.sh             | 47 ++++++++++++++++++++++++++---------------------
 centos.sh                | 18 +++++++++---------
 darwin.sh                |  3 +++
 debian.sh                | 12 ++++++++----
 fedora.sh                |  9 +++++++--
 linux.sh                 |  2 +-
 rheldistro.sh            |  5 ++++-
 suse.sh                  | 11 +++++------
 win_build_vs.bat         |  4 +++-
 12 files changed, 104 insertions(+), 63 deletions(-)


[nifi-minifi-cpp] 01/02: MINIFICPP-2120 Fix debian bookworm, and various bootstrap issues

Posted by fg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fgerlits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit b0a20690a832b32b09ebb6f0c5c28bbd132d40c3
Author: Marton Szasz <sz...@apache.org>
AuthorDate: Thu May 11 17:41:30 2023 +0200

    MINIFICPP-2120 Fix debian bookworm, and various bootstrap issues
    
    - move backports code to buster only, because cmake is new enough
    - install compiler before the menu, so that entries can be selected
    - Add boost package names
    - devtoolset no longer requires nested calling of bootstrap
    - fix compiler version checks
    
    Signed-off-by: Ferenc Gerlits <fg...@gmail.com>
    This closes #1573
---
 .github/workflows/ci.yml |  8 ++++----
 aptitude.sh              | 19 ++++++++++++-------
 arch.sh                  |  5 ++++-
 bootstrap.sh             | 47 ++++++++++++++++++++++++++---------------------
 centos.sh                | 18 +++++++++---------
 darwin.sh                |  3 +++
 debian.sh                | 12 ++++++++----
 fedora.sh                |  9 +++++++--
 linux.sh                 |  2 +-
 rheldistro.sh            |  5 ++++-
 suse.sh                  | 11 +++++------
 11 files changed, 83 insertions(+), 56 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index faf77bddc..2d912495f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -121,10 +121,10 @@ jobs:
           echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
       - name: build
         run: |
-          ./bootstrap.sh -e -t
-          cd build
           export CC=gcc-11
           export CXX=g++-11
+          ./bootstrap.sh -e -t
+          cd build
           cmake -DUSE_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCI_BUILD=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON -DENABLE_SQL=OFF -DENABLE_LIBRDKAFKA=OFF -DENABLE_AWS=OFF \
               -DENABLE_AZURE=OFF -DENABLE_SPLUNK=OFF -DENABLE_GCP=OFF -DENABLE_PROCFS=OFF -DENABLE_BUSTACHE=ON -DENABLE_PCAP=ON -DENABLE_JNI=ON -DENABLE_SFTP=ON  \
               -DENABLE_LUA_SCRIPTING=OFF -DENABLE_PYTHON_SCRIPTING=OFF -DENABLE_MQTT=OFF -DENABLE_ELASTICSEARCH=OFF -DENABLE_KUBERNETES=OFF -DENABLE_OPC=OFF ..
@@ -177,10 +177,10 @@ jobs:
           echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
       - name: build
         run: |
-          ./bootstrap.sh -e -t
-          cd build
           export CC=clang-14
           export CXX=clang++-14
+          ./bootstrap.sh -e -t
+          cd build
           export CXXFLAGS="${CXXFLAGS} -stdlib=libc++"
           export LDFLAGS="${LDFLAGS} -stdlib=libc++"
           cmake -DUSE_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCI_BUILD=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON -DENABLE_AWS=ON -DENABLE_AZURE=ON -DENABLE_BUSTACHE=ON -DENABLE_COAP=ON \
diff --git a/aptitude.sh b/aptitude.sh
index 08c57d63c..babe25bb0 100644
--- a/aptitude.sh
+++ b/aptitude.sh
@@ -21,11 +21,11 @@ verify_enable_platform(){
     verify_gcc_enable "$feature"
 }
 add_os_flags() {
-    CC=gcc
-    CXX=g++
+    CC=${CC:-gcc}
+    CXX=${CXX:-g++}
     if [[ "$OS" = Ubuntu* && "$OS_MAJOR" -lt 22 ]]; then
-        CC=gcc-11
-        CXX=g++-11
+        CC=${CC:-gcc-11}
+        CXX=${CXX:-g++-11}
     fi
     export CC
     export CXX
@@ -41,14 +41,17 @@ bootstrap_cmake(){
     fi
     sudo apt-get -y install cmake
 }
-build_deps(){
-    ## need to account for debian
+bootstrap_compiler() {
     compiler_pkgs="gcc g++"
     if [[ "$OS" = Ubuntu* && "$OS_MAJOR" -lt 22 ]]; then
         sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
         compiler_pkgs="gcc-11 g++-11"
     fi
-    COMMAND="sudo apt-get -y install cmake $compiler_pkgs zlib1g-dev libssl-dev uuid uuid-dev"
+    # shellcheck disable=SC2086
+    sudo apt-get -y install $compiler_pkgs
+}
+build_deps(){
+    COMMAND="sudo apt-get -y install zlib1g-dev libssl-dev uuid uuid-dev"
 
     export DEBIAN_FRONTEND=noninteractive
     INSTALLED=()
@@ -97,6 +100,8 @@ build_deps(){
                         INSTALLED+=("libgps-dev")
                     elif [ "$FOUND_VALUE" = "libarchive" ]; then
                         INSTALLED+=("liblzma-dev")
+                    elif [ "$FOUND_VALUE" = "boost" ]; then
+                        INSTALLED+=("libboost-dev")
                     fi
                 fi
             done
diff --git a/arch.sh b/arch.sh
index 35921964f..05e536564 100644
--- a/arch.sh
+++ b/arch.sh
@@ -27,8 +27,11 @@ add_os_flags() {
 bootstrap_cmake(){
     sudo pacman -S --noconfirm cmake
 }
+bootstrap_compiler(){
+    sudo pacman -S --noconfirm gcc
+}
 build_deps(){
-    COMMAND="sudo pacman -S --noconfirm --needed cmake gcc zlib openssl util-linux"
+    COMMAND="sudo pacman -S --noconfirm --needed cmake zlib openssl util-linux make patch which pkgconf"
 
     INSTALLED=()
     INSTALLED+=("bzip2")
diff --git a/bootstrap.sh b/bootstrap.sh
index 985f183c5..b524f5ccc 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -169,25 +169,6 @@ else
   LINUX=false
 fi
 
-### Verify the compiler version
-
-COMPILER_VERSION="0.0.0"
-
-COMPILER_COMMAND=""
-
-if [ -x "$(command -v g++)" ]; then
-  COMPILER_COMMAND="g++"
-  COMPILER_VERSION=$(${COMPILER_COMMAND} -dumpversion)
-fi
-
-COMPILER_MAJOR=$(echo "$COMPILER_VERSION" | cut -d. -f1)
-export COMPILER_MAJOR
-COMPILER_MINOR=$(echo "$COMPILER_VERSION" | cut -d. -f2)
-export COMPILER_MINOR
-COMPILER_REVISION=$(echo "$COMPILER_VERSION" | cut -d. -f3)
-export COMPILER_REVISION
-
-
 if [[ "$OS" = "Darwin" ]]; then
   . "${script_directory}/darwin.sh"
 else
@@ -215,10 +196,31 @@ else
     . "${script_directory}/arch.sh"
   fi
 fi
-### verify the cmake version
 
-CMAKE_COMMAND=""
+### Verify the compiler version
+COMPILER_VERSION="0.0.0"
+COMPILER_COMMAND="${CXX:-g++}"
 
+if [ -z "$(command -v "$COMPILER_COMMAND")" ]; then
+  echo "Couldn't find compiler, attempting to install GCC"
+  bootstrap_compiler
+fi
+if [ -x "$(command -v "${COMPILER_COMMAND}")" ]; then
+  COMPILER_VERSION=$(${COMPILER_COMMAND} -dumpversion)
+else
+  echo "Couldn't find compiler, please install one, or set CXX appropriately" 1>&2
+  exit 1
+fi
+
+COMPILER_MAJOR=$(echo "$COMPILER_VERSION" | cut -d. -f1)
+export COMPILER_MAJOR
+COMPILER_MINOR=$(echo "$COMPILER_VERSION" | cut -d. -f2)
+export COMPILER_MINOR
+COMPILER_REVISION=$(echo "$COMPILER_VERSION" | cut -d. -f3)
+export COMPILER_REVISION
+
+### verify the cmake version
+CMAKE_COMMAND=""
 if [ -x "$(command -v cmake3)" ]; then
   CMAKE_COMMAND="cmake3"
 elif [ -x "$(command -v cmake)" ]; then
@@ -251,6 +253,7 @@ if [ "$CMAKE_MAJOR" -lt "$CMAKE_GLOBAL_MIN_VERSION_MAJOR" ] ||
   exit
 fi
 
+
 add_cmake_option PORTABLE_BUILD ${TRUE}
 add_cmake_option DEBUG_SYMBOLS ${FALSE}
 add_cmake_option BUILD_ROCKSDB ${TRUE}
@@ -264,7 +267,9 @@ add_option LIBARCHIVE_ENABLED ${TRUE} "DISABLE_LIBARCHIVE"
 add_dependency LIBARCHIVE_ENABLED "libarchive"
 
 add_option PYTHON_SCRIPTING_ENABLED ${FALSE} "ENABLE_PYTHON_SCRIPTING"
+add_dependency PYTHON_SCRIPTING_ENABLED "python"
 add_option LUA_SCRIPTING_ENABLED ${FALSE} "ENABLE_LUA_SCRIPTING"
+add_dependency LUA_SCRIPTING_ENABLED "lua"
 
 add_option EXPRESSION_LANGUAGE_ENABLED ${TRUE} "DISABLE_EXPRESSION_LANGUAGE"
 add_dependency EXPRESSION_LANGUAGE_ENABLED "bison"
diff --git a/centos.sh b/centos.sh
index 279275604..70af06ca8 100644
--- a/centos.sh
+++ b/centos.sh
@@ -64,22 +64,19 @@ bootstrap_cmake(){
             ;;
         *) install_pkgs cmake ;;
     esac
-    extra_bootstrap_flags=""
-    if [ "$NO_PROMPT" = "true" ]; then extra_bootstrap_flags="$extra_bootstrap_flags -n"; fi
+}
+
+bootstrap_compiler() {
     get_toolset_name
     if [ -n "$TOOLSET_NAME" ]; then
         install_pkgs centos-release-scl
-        scl enable $TOOLSET_NAME "bash ./bootstrap.sh $extra_bootstrap_flags"
-    else
-        # cli flags splitting is intentional
-        # shellcheck disable=SC2086
-        bash ./bootstrap.sh $extra_bootstrap_flags
+        install_pkgs "$TOOLSET_NAME"
     fi
+    source "/opt/rh/$TOOLSET_NAME/enable"
 }
 
 build_deps() {
-    get_toolset_name
-    COMMAND="install_pkgs libuuid libuuid-devel libtool patch epel-release $TOOLSET_NAME"
+    COMMAND="install_pkgs libuuid libuuid-devel libtool patch epel-release"
     INSTALLED=()
     for option in "${OPTIONS[@]}" ; do
         option_value="${!option}"
@@ -111,6 +108,7 @@ build_deps() {
                         INSTALLED+=("python36-devel")
                     elif [ "$FOUND_VALUE" = "lua" ]; then
                         INSTALLED+=("lua-libs")
+                        INSTALLED+=("lua-devel")
                     elif [ "$FOUND_VALUE" = "gpsd" ]; then
                         INSTALLED+=("gpsd-devel")
                     elif [ "$FOUND_VALUE" = "libarchive" ]; then
@@ -118,6 +116,8 @@ build_deps() {
                         INSTALLED+=("bzip2-devel")
                     elif [ "$FOUND_VALUE" = "libssh2" ]; then
                         INSTALLED+=("libssh2-devel")
+                    elif [ "$FOUND_VALUE" = "boost" ]; then
+                        INSTALLED+=("boost-devel")
                     fi
                 fi
             done
diff --git a/darwin.sh b/darwin.sh
index eb5a5c46a..8bdc1ff6d 100644
--- a/darwin.sh
+++ b/darwin.sh
@@ -61,6 +61,9 @@ install_bison() {
 bootstrap_cmake(){
     brew install cmake
 }
+bootstrap_compiler() {
+    :
+}
 build_deps(){
 
     COMMAND="brew install cmake"
diff --git a/debian.sh b/debian.sh
index 35578444b..99d0b6a30 100644
--- a/debian.sh
+++ b/debian.sh
@@ -25,18 +25,20 @@ add_os_flags() {
   :
 }
 bootstrap_cmake(){
-  sudo bash -c 'source /etc/os-release; grep "$VERSION_CODENAME-backports" /etc/apt/sources.list &>/dev/null || echo "deb http://deb.debian.org/debian $VERSION_CODENAME-backports main" >> /etc/apt/sources.list'
-  sudo apt-get -y update
   if [ "$VERSION_CODENAME" = buster ]; then
+    sudo bash -c 'source /etc/os-release; grep "$VERSION_CODENAME-backports" /etc/apt/sources.list &>/dev/null || echo "deb http://deb.debian.org/debian $VERSION_CODENAME-backports main" >> /etc/apt/sources.list'
+    sudo apt-get -y update
     sudo apt-get -t buster-backports install -y cmake
   else
+    sudo apt-get -y update
     sudo apt-get install -y cmake
   fi
 }
+bootstrap_compiler(){
+  sudo apt-get -y install build-essential
+}
 build_deps(){
   sudo apt-get -y update
-  ## need to account for debian
-  sudo apt-get install -y libssl1.0-dev > /dev/null
   RETVAL=$?
   if [ "$RETVAL" -ne "0" ]; then
     sudo apt-get install -y libssl-dev > /dev/null
@@ -85,6 +87,8 @@ build_deps(){
             INSTALLED+=("liblzma-dev")
           elif [ "$FOUND_VALUE" = "libssh2" ]; then
             INSTALLED+=("libssh2-1-dev")
+          elif [ "$FOUND_VALUE" = "boost" ]; then
+            INSTALLED+=("libboost-dev")
           fi
         fi
       done
diff --git a/fedora.sh b/fedora.sh
index d80ed0916..881659888 100644
--- a/fedora.sh
+++ b/fedora.sh
@@ -29,13 +29,16 @@ bootstrap_cmake(){
     sudo yum -y install epel-release-latest-7.noarch.rpm
     sudo yum -y install cmake3
 }
+bootstrap_compiler() {
+    sudo yum -y install gcc gcc-c++
+}
 build_deps(){
     # Install epel-release so that cmake3 will be available for installation
     sudo yum -y install wget
     wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
     sudo yum -y install epel-release-latest-7.noarch.rpm
 
-    COMMAND="sudo yum -y install gcc gcc-c++ libuuid libuuid-devel patch"
+    COMMAND="sudo yum -y install libuuid libuuid-devel patch"
     INSTALLED=()
     INSTALLED+=("bzip2-devel")
     for option in "${OPTIONS[@]}" ; do
@@ -52,7 +55,7 @@ build_deps(){
                     if [ "$FOUND_VALUE" = "libpcap" ]; then
                         INSTALLED+=("libpcap-devel")
                     elif [ "$FOUND_VALUE" = "libusb" ]; then
-                        INSTALLED+=("libusb-devel")
+                        INSTALLED+=("libusb1-devel")
                     elif [ "$FOUND_VALUE" = "libpng" ]; then
                         INSTALLED+=("libpng-devel")
                     elif [ "$FOUND_VALUE" = "bison" ]; then
@@ -79,6 +82,8 @@ build_deps(){
                         INSTALLED+=("xz-devel")
                     elif [ "$FOUND_VALUE" = "libssh2" ]; then
                         INSTALLED+=("libssh2-devel")
+                    elif [ "$FOUND_VALUE" = "boost" ]; then
+                        INSTALLED+=("boost-devel")
                     fi
                 fi
             done
diff --git a/linux.sh b/linux.sh
index 5b19df1d0..c172bdd47 100644
--- a/linux.sh
+++ b/linux.sh
@@ -17,5 +17,5 @@
 # under the License.
 verify_gcc_enable(){
   #feature="$1"
-  { [ "$COMPILER_MAJOR" -eq 8 ] && [ "$COMPILER_MINOR" -ge 2 ] || [ "$COMPILER_MAJOR" -gt 8 ]; } && echo true || echo false
+  [ "$COMPILER_MAJOR" -ge 11 ] && echo true || echo false
 }
diff --git a/rheldistro.sh b/rheldistro.sh
index 709f3a555..8d83d123c 100644
--- a/rheldistro.sh
+++ b/rheldistro.sh
@@ -71,13 +71,16 @@ bootstrap_cmake(){
   sudo yum -y install epel-release-latest-7.noarch.rpm
   sudo yum -y install cmake3
 }
+bootstrap_compiler() {
+  sudo yum -y install gcc gcc-c++
+}
 build_deps(){
 # Install epel-release so that cmake3 will be available for installation
   sudo yum -y install wget
   wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
   sudo yum -y install epel-release-latest-7.noarch.rpm
 
-  COMMAND="sudo yum install cmake3 gcc gcc-c++ libuuid libuuid-devel"
+  COMMAND="sudo yum install cmake3 libuuid libuuid-devel"
   INSTALLED=()
   INSTALLED+=("bzip2-devel")
   for option in "${OPTIONS[@]}" ; do
diff --git a/suse.sh b/suse.sh
index 9e4908d3a..064c560a5 100644
--- a/suse.sh
+++ b/suse.sh
@@ -48,9 +48,6 @@ install_bison() {
     fi
   fi
   if [ "$BISON_INSTALLED" = "false" ]; then
-    ## ensure that the toolchain is installed
-    INSTALL_BASE="sudo zypper in -y gcc gcc-c++"
-    ${INSTALL_BASE}
     wget https://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.xz
     tar xvf bison-3.0.4.tar.xz
     pushd bison-3.0.4 || exit 1
@@ -64,10 +61,12 @@ install_bison() {
 bootstrap_cmake(){
   sudo zypper in -y cmake
 }
+bootstrap_compiler() {
+  sudo zypper in -y gcc gcc-c++
+}
 build_deps(){
-# Install epel-release so that cmake3 will be available for installation
-
-  COMMAND="sudo zypper in -y gcc gcc-c++ libuuid1 libuuid-devel"
+  # Install epel-release so that cmake3 will be available for installation
+  COMMAND="sudo zypper in -y libuuid1 libuuid-devel"
   INSTALLED=()
   INSTALLED+=("libbz2-devel")
   for option in "${OPTIONS[@]}" ; do


[nifi-minifi-cpp] 02/02: MINIFICPP-2126 reenable Windows CI caching

Posted by fg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fgerlits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 9c3cdeca2974a7cd4eacb5dad4a4f86890341f00
Author: Marton Szasz <sz...@apache.org>
AuthorDate: Wed May 24 16:05:55 2023 +0200

    MINIFICPP-2126 reenable Windows CI caching
    
    Signed-off-by: Ferenc Gerlits <fg...@gmail.com>
    This closes #1580
---
 .github/workflows/ci.yml | 24 ++++++++++++++++++------
 win_build_vs.bat         |  4 +++-
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2d912495f..d87303085 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,6 +4,7 @@ env:
   DOCKER_CMAKE_FLAGS: -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DDISABLE_JEMALLOC=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
     -DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \
     -DENABLE_ELASTICSEARCH=OFF -DDOCKER_BUILD_ONLY=ON -DDOCKER_CCACHE_DUMP_LOCATION=$HOME/.ccache
+  SCCACHE_GHA_ENABLE: true
 jobs:
   macos_xcode:
     name: "macos-xcode"
@@ -73,8 +74,19 @@ jobs:
         run: git config --system core.longpaths true
       - id: checkout
         uses: actions/checkout@v3
-      - name: Set up MSBuild
-        uses: microsoft/setup-msbuild@v1.1
+      - name: Run sccache-cache
+        uses: mozilla-actions/sccache-action@v0.0.3
+      - name: sccache cache
+        uses: actions/cache@v3
+        with:
+          path: ~/AppData/Local/Mozilla/sccache/cache
+          key: ${{ runner.os }}-sccache-${{ github.ref }}-${{ github.sha }}
+          restore-keys: |
+            ${{ runner.os }}-sccache-${{ github.ref }}
+            ${{ runner.os }}-sccache-refs/heads/main
+            ${{ runner.os }}-sccache
+      - name: Install ninja-build tool
+        uses: seanmiddleditch/gha-setup-ninja@v3
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
@@ -88,15 +100,15 @@ jobs:
         shell: powershell
       - name: build
         run: |
-          PATH %PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
-          PATH %PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Roslyn
-          win_build_vs.bat ..\b /64 /CI /S /A /PDH /SPLUNK /GCP /ELASTIC /K /L /R /Z /N /RO /PR /PYTHON_SCRIPTING /LUA_SCRIPTING /MQTT
+          for /f "usebackq delims=" %%i in (`vswhere.exe -latest -property installationPath`) do if exist "%%i\Common7\Tools\vsdevcmd.bat" call "%%i\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
+          win_build_vs.bat ..\b /64 /CI /S /A /PDH /SPLUNK /GCP /ELASTIC /K /L /R /Z /N /RO /PR /PYTHON_SCRIPTING /LUA_SCRIPTING /MQTT /SCCACHE /NINJA
+          sccache --show-stats
         shell: cmd
       - name: test
         run: cd ..\b && ctest --timeout 300 --parallel %NUMBER_OF_PROCESSORS% -C Release --output-on-failure
         shell: cmd
       - name: linter
-        run: cd ..\b && msbuild /verbosity:quiet -maxCpuCount linter.vcxproj
+        run: cd ..\b && cmake --build . --target linter --config Release -j 8
         shell: cmd
   ubuntu_20_04:
     name: "ubuntu-20.04"
diff --git a/win_build_vs.bat b/win_build_vs.bat
index bec5cfcb6..b61db5cfd 100755
--- a/win_build_vs.bat
+++ b/win_build_vs.bat
@@ -56,6 +56,7 @@ set build_nanofi=OFF
 set build_opencv=OFF
 set build_prometheus=OFF
 set real_odbc=OFF
+set sccache_arg=
 
 set arg_counter=0
 for %%x in (%*) do (
@@ -100,6 +101,7 @@ for %%x in (%*) do (
     if [%%~x] EQU [/NONFREEUCRT]      set "redist=-DMSI_REDISTRIBUTE_UCRT_NONASL=ON"
     if [%%~x] EQU [/RO]               set real_odbc=ON
     if [%%~x] EQU [/NINJA]            set generator="Ninja"
+    if [%%~x] EQU [/SCCACHE]          set "sccache_arg=-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
 )
 
 mkdir %builddir%
@@ -121,7 +123,7 @@ cmake -G %generator% %build_platform_cmd% -DINSTALLER_MERGE_MODULES=%installer_m
         -DENABLE_MQTT=%enable_mqtt% -DENABLE_OPC=%enable_opc% -DENABLE_OPENWSMAN=%enable_openwsman% -DENABLE_OPS=%enable_ops% -DENABLE_PCAP=%enable_pcap% ^
         -DENABLE_PYTHON_SCRIPTING=%enable_python_scripting% -DENABLE_SENSORS=%enable_sensors% -DENABLE_TENSORFLOW=%enable_tensorflow% -DENABLE_USB_CAMERA=%enable_usb_camera% ^
         -DBUILD_ROCKSDB=ON -DFORCE_WINDOWS=ON -DUSE_SYSTEM_UUID=OFF -DDISABLE_LIBARCHIVE=OFF -DENABLE_WEL=ON -DFAIL_ON_WARNINGS=OFF -DSKIP_TESTS=%skiptests% ^
-        %strict_gsl_checks% %redist% %EXTRA_CMAKE_ARGUMENTS% "%scriptdir%" && %buildcmd%
+        %strict_gsl_checks% %redist% %sccache_arg% %EXTRA_CMAKE_ARGUMENTS% "%scriptdir%" && %buildcmd%
 IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
 if [%cpack%] EQU [ON] (
     cpack -C %cmake_build_type%