diff --git a/.ci/scripts/install-tools.bat b/.ci/scripts/install-tools.bat index d6e0296a11f..0fb4813bf09 100755 --- a/.ci/scripts/install-tools.bat +++ b/.ci/scripts/install-tools.bat @@ -1,6 +1,12 @@ set GOPATH=%WORKSPACE% set MAGEFILE_CACHE=%WORKSPACE%\.magefile -set PATH=%WORKSPACE%\bin;C:\ProgramData\chocolatey\bin;C:\tools\mingw64\bin;%PATH% + +REM Configure GCC for either 32 or 64 bits +set MINGW_ARCH=64 +IF NOT EXIST "%PROGRAMFILES(X86)%" ( + set MINGW_ARCH=32 +) +set PATH=%WORKSPACE%\bin;C:\ProgramData\chocolatey\bin;C:\tools\mingw%MINGW_ARCH%\bin;%PATH% where /q curl IF ERRORLEVEL 1 ( @@ -35,9 +41,13 @@ if not exist C:\Python38\python.exe ( python --version where python -if not exist C:\tools\mingw64\bin\gcc.exe ( +where /q gcc +IF ERRORLEVEL 1 ( REM Install mingw 5.3.0 - choco install mingw -y -r --no-progress --version 5.3.0 || echo ERROR && exit /b + choco install mingw -y -r --no-progress --version 5.3.0 + IF NOT ERRORLEVEL 0 ( + exit /b 1 + ) ) gcc --version where gcc diff --git a/Jenkinsfile b/Jenkinsfile index be00ae1f4e9..5455a097f68 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -284,15 +284,17 @@ def withBeatsEnv(Map args = [:], Closure body) { testResults = '**/build/TEST*.xml' artifacts = '**/build/TEST*.out' } else { + // NOTE: to support Windows 7 32 bits the arch in the mingw and go context paths is required. + def mingwArch = is32() ? '32' : '64' + def goArch = is32() ? '386' : 'amd64' def chocoPath = 'C:\\ProgramData\\chocolatey\\bin' - def mingw64Path = 'C:\\tools\\mingw64\\bin' def chocoPython3Path = 'C:\\Python38;C:\\Python38\\Scripts' - goRoot = "${env.USERPROFILE}\\.gvm\\versions\\go${GO_VERSION}.windows.amd64" - path = "${env.WORKSPACE}\\bin;${goRoot}\\bin;${chocoPath};${chocoPython3Path};${env.PATH};${mingw64Path}" + goRoot = "${env.USERPROFILE}\\.gvm\\versions\\go${GO_VERSION}.windows.${goArch}" + path = "${env.WORKSPACE}\\bin;${goRoot}\\bin;${chocoPath};${chocoPython3Path};C:\\tools\\mingw${mingwArch}\\bin;${env.PATH}" magefile = "${env.WORKSPACE}\\.magefile" testResults = "**\\build\\TEST*.xml" artifacts = "**\\build\\TEST*.out" - gox_flags = '-arch amd64' + gox_flags = '-arch 386' } deleteDir() diff --git a/auditbeat/Jenkinsfile.yml b/auditbeat/Jenkinsfile.yml index 07acc93570c..3ed44ddedf8 100644 --- a/auditbeat/Jenkinsfile.yml +++ b/auditbeat/Jenkinsfile.yml @@ -47,6 +47,7 @@ stages: mage: "mage build unitTest" platforms: ## override default labels in this specific stage. - "windows-2019" + #- "windows-7-32-bit" https://github.com/elastic/beats/issues/19831 #- "windows-2008-r2" https://github.com/elastic/beats/issues/19799 windows-2016: mage: "mage build unitTest" diff --git a/filebeat/Jenkinsfile.yml b/filebeat/Jenkinsfile.yml index 25d31e2ffac..658e3d60dbd 100644 --- a/filebeat/Jenkinsfile.yml +++ b/filebeat/Jenkinsfile.yml @@ -79,4 +79,15 @@ stages: labels: - "windows-8" branches: true ## for all the branches - tags: true ## for all the tags \ No newline at end of file + tags: true ## for all the tags + windows-7-32: + mage: "mage build unitTest" + platforms: ## override default labels in this specific stage. + - "windows-7-32-bit" + when: ## Override the top-level when. + comments: + - "/test filebeat for windows-7-32" + labels: + - "windows-7-32" + branches: true ## for all the branches + tags: true ## for all the tags diff --git a/heartbeat/Jenkinsfile.yml b/heartbeat/Jenkinsfile.yml index ba1b19d9215..d068a7798ad 100644 --- a/heartbeat/Jenkinsfile.yml +++ b/heartbeat/Jenkinsfile.yml @@ -100,3 +100,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tag + windows-7-32: + mage: "mage build unitTest" + platforms: ## override default labels in this specific stage. + - "windows-7-32-bit" + when: ## Override the top-level when. + comments: + - "/test heartbeat for windows-7-32" + labels: + - "windows-7-32" + branches: true ## for all the branches + tags: true ## for all the tags diff --git a/metricbeat/Jenkinsfile.yml b/metricbeat/Jenkinsfile.yml index a06e886b17d..3d17e9c6ce2 100644 --- a/metricbeat/Jenkinsfile.yml +++ b/metricbeat/Jenkinsfile.yml @@ -41,6 +41,7 @@ stages: platforms: ## override default labels in this specific stage. - "windows-2019" #- "windows-2008-r2" https://github.com/elastic/beats/issues/19800 + #- "windows-7-32-bit" https://github.com/elastic/beats/issues/19835 windows-2016: mage: "mage build unitTest" platforms: ## override default labels in this specific stage. diff --git a/packetbeat/Jenkinsfile.yml b/packetbeat/Jenkinsfile.yml index 39b3682ffd0..a75bbd3bf60 100644 --- a/packetbeat/Jenkinsfile.yml +++ b/packetbeat/Jenkinsfile.yml @@ -100,3 +100,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + #windows-7-32: See https://github.com/elastic/beats/issues/22303 + # mage: "mage build unitTest" + # platforms: ## override default labels in this specific stage. + # - "windows-7-32-bit" + # when: ## Override the top-level when. + # comments: + # - "/test packetbeat for windows-7-32" + # labels: + # - "windows-7-32" + # branches: true ## for all the branches + # tags: true ## for all the tags diff --git a/winlogbeat/Jenkinsfile.yml b/winlogbeat/Jenkinsfile.yml index f56fa84567a..56427c4f19b 100644 --- a/winlogbeat/Jenkinsfile.yml +++ b/winlogbeat/Jenkinsfile.yml @@ -42,7 +42,7 @@ stages: - "windows-2012" branches: true ## for all the branches tags: true ## for all the tags - # windows-10: See https://github.com/elastic/beats/issues/22046 + #windows-10: See https://github.com/elastic/beats/issues/22046 # mage: "mage build unitTest" # platforms: ## override default labels in this specific stage. # - "windows-10" @@ -64,3 +64,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + #windows-7-32: See https://github.com/elastic/beats/issues/19829 + # mage: "mage build unitTest" + # platforms: ## override default labels in this specific stage. + # - "windows-7-32-bit" + # when: ## Override the top-level when. + # comments: + # - "/test winlogbeat for windows-7-32" + # labels: + # - "windows-7-32" + # branches: true ## for all the branches + # tags: true ## for all the tags diff --git a/x-pack/auditbeat/Jenkinsfile.yml b/x-pack/auditbeat/Jenkinsfile.yml index fc0c153300f..7e40a4047ad 100644 --- a/x-pack/auditbeat/Jenkinsfile.yml +++ b/x-pack/auditbeat/Jenkinsfile.yml @@ -101,3 +101,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + windows-7-32: + mage: "mage build unitTest" + platforms: ## override default labels in this specific stage. + - "windows-7-32-bit" + when: ## Override the top-level when. + comments: + - "/test auditbeat for windows-7-32" + labels: + - "windows-7-32" + branches: true ## for all the branches + tags: true ## for all the tags diff --git a/x-pack/elastic-agent/Jenkinsfile.yml b/x-pack/elastic-agent/Jenkinsfile.yml index 96fdf9a435f..890a2cbb4c4 100644 --- a/x-pack/elastic-agent/Jenkinsfile.yml +++ b/x-pack/elastic-agent/Jenkinsfile.yml @@ -100,3 +100,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + #windows-7-32: See https://github.com/elastic/beats/issues/22316 + # mage: "mage build unitTest" + # platforms: ## override default labels in this specific stage. + # - "windows-7-32-bit" + # when: ## Override the top-level when. + # comments: + # - "/test x-pack/elastic-agent for windows-7-32" + # labels: + # - "windows-7-32" + # branches: true ## for all the branches + # tags: true ## for all the tags diff --git a/x-pack/filebeat/Jenkinsfile.yml b/x-pack/filebeat/Jenkinsfile.yml index dbb262ee7e6..b3ef5fad8c3 100644 --- a/x-pack/filebeat/Jenkinsfile.yml +++ b/x-pack/filebeat/Jenkinsfile.yml @@ -101,3 +101,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + #windows-7-32: See https://github.com/elastic/beats/issues/22315 + # mage: "mage build unitTest" + # platforms: ## override default labels in this specific stage. + # - "windows-7-32-bit" + # when: ## Override the top-level when. + # comments: + # - "/test x-pack/filebeat for windows-7-32" + # labels: + # - "windows-7-32" + # branches: true ## for all the branches + # tags: true ## for all the tags diff --git a/x-pack/functionbeat/Jenkinsfile.yml b/x-pack/functionbeat/Jenkinsfile.yml index 785b3960686..18451764289 100644 --- a/x-pack/functionbeat/Jenkinsfile.yml +++ b/x-pack/functionbeat/Jenkinsfile.yml @@ -98,3 +98,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + windows-7-32: + mage: "mage build unitTest" + platforms: ## override default labels in this specific stage. + - "windows-7-32-bit" + when: ## Override the top-level when. + comments: + - "/test x-pack/functionbeat for windows-7-32" + labels: + - "windows-7-32" + branches: true ## for all the branches + tags: true ## for all the tags diff --git a/x-pack/metricbeat/Jenkinsfile.yml b/x-pack/metricbeat/Jenkinsfile.yml index be79daee718..5fe7cff4134 100644 --- a/x-pack/metricbeat/Jenkinsfile.yml +++ b/x-pack/metricbeat/Jenkinsfile.yml @@ -35,6 +35,7 @@ stages: mage: "mage build unitTest" platforms: ## override default labels in this specific stage. - "windows-2019" + #- "windows-7-32-bit" https://github.com/elastic/beats/issues/19835 windows-2016: mage: "mage build unitTest" platforms: ## override default labels in this specific stage. diff --git a/x-pack/packetbeat/Jenkinsfile.yml b/x-pack/packetbeat/Jenkinsfile.yml index c696de51e0f..08f666bc43e 100644 --- a/x-pack/packetbeat/Jenkinsfile.yml +++ b/x-pack/packetbeat/Jenkinsfile.yml @@ -73,3 +73,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + windows-7-32: + mage: "mage build unitTest" + platforms: ## override default labels in this specific stage. + - "windows-7-32-bit" + when: ## Override the top-level when. + comments: + - "/test x-pack/packetbeat for windows-7-32" + labels: + - "windows-7-32" + branches: true ## for all the branches + tags: true ## for all the tags diff --git a/x-pack/winlogbeat/Jenkinsfile.yml b/x-pack/winlogbeat/Jenkinsfile.yml index 9e5cb052e10..405ce1aa1d4 100644 --- a/x-pack/winlogbeat/Jenkinsfile.yml +++ b/x-pack/winlogbeat/Jenkinsfile.yml @@ -73,3 +73,14 @@ stages: - "windows-8" branches: true ## for all the branches tags: true ## for all the tags + #windows-7-32: See https://github.com/elastic/beats/issues/19829 + # mage: "mage build unitTest" + # platforms: ## override default labels in this specific stage. + # - "windows-7-32-bit" + # when: ## Override the top-level when. + # comments: + # - "/test x-pack/winlogbeat for windows-7-32" + # labels: + # - "windows-7-32" + # branches: true ## for all the branches + # tags: true ## for all the tags