Skip to content

Files

Latest commit

 

History

History
137 lines (118 loc) · 6.6 KB

VersionSelectorScript.groovy

File metadata and controls

137 lines (118 loc) · 6.6 KB
 
Jan 2, 2020
Jan 2, 2020
1
2
3
// https://wiki.jenkins.io/display/JENKINS/matrix+groovy+execution+strategy+plugin
// https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
May 30, 2018
May 30, 2018
4
// Helper closures to make our buildExclusions DSL terse and readable
Jan 2, 2020
Jan 2, 2020
5
6
def lt = { v -> { nodeVersion -> nodeVersion < v } }
def gte = { v -> { nodeVersion -> nodeVersion >= v } }
Apr 19, 2022
Apr 19, 2022
7
def gteLt = { vGte, vLt -> { nodeVersion -> gte(vGte)(nodeVersion) && lt(vLt)(nodeVersion) } }
Jan 2, 2020
Jan 2, 2020
8
9
10
def ltGte = { vLt, vGte -> { nodeVersion -> lt(vLt)(nodeVersion) || gte(vGte)(nodeVersion) } }
def allVer = { nodeVersion -> true }
def noVer = { nodeVersion -> false }
May 30, 2018
May 30, 2018
11
def releaseType = { buildType -> buildType == 'release' }
Jan 2, 2020
Jan 2, 2020
12
def testType = { buildType -> buildType == 'test' }
May 30, 2018
May 30, 2018
13
def anyType = { buildType -> true }
May 30, 2018
May 30, 2018
15
def buildExclusions = [
May 30, 2018
May 30, 2018
16
17
18
19
20
21
22
// Given a machine label, build type (release or !release) and a Node.js
// major version number, determine which ones to _exclude_ from a build
// -------------------------------------------------------
// Machine Label, Build Type, Node Version
// Linux -------------------------------------------------
Aug 6, 2024
Aug 6, 2024
23
[ /debian11/, anyType, gte(23) ],
May 6, 2024
May 6, 2024
24
[ /alpine-last-latest/, anyType, gte(22) ], // Alpine 3.18. Bug in GCC 12.2.
Mar 22, 2022
Mar 22, 2022
25
[ /rhel7/, anyType, gte(18) ],
Apr 11, 2024
Apr 11, 2024
26
27
[ /^ubuntu1604-32/, anyType, gte(18) ], // 32-bit linux for <10 only
[ /^ubuntu1604-64/, anyType, gte(18) ],
May 30, 2018
May 30, 2018
29
// ARM --------------------------------------------------
May 3, 2024
May 3, 2024
30
[ /^ubuntu1804-arm64/, anyType, gte(20) ], // 20.x: gcc8 builds stop
Apr 11, 2024
Apr 11, 2024
31
32
33
[ /^cross-compiler-ubuntu1604-armv[67]-gcc-4.9/, anyType, gte(18) ],
[ /^cross-compiler-ubuntu1604-armv[67]-gcc-6/, anyType, gte(18) ],
[ /^cross-compiler-ubuntu1804-armv7-gcc-6/, anyType, gte(18) ],
Aug 11, 2023
Aug 11, 2023
34
35
36
[ /^cross-compiler-ubuntu1804-armv7-gcc-8/, anyType, gte(18) ],
[ /^cross-compiler-rhel8-armv7-gcc-8-glibc-2.28/, anyType, gte(20) ],
[ /^cross-compiler-rhel8-armv7-gcc-10-glibc-2.28/, anyType, lt(20) ],
Sep 6, 2024
Sep 6, 2024
37
38
[ /^cross-compiler-rhel8-armv7-gcc-10-glibc-2.28/, anyType, gte(23) ],
[ /^cross-compiler-rhel9-armv7-gcc-12-glibc-2.28/, anyType, lt(23) ],
May 30, 2018
May 30, 2018
39
40
// Windows -----------------------------------------------
Jul 12, 2022
Jul 12, 2022
41
// https://github.com/nodejs/build/blob/main/doc/windows-visualstudio-supported-versions.md
Jan 2, 2020
Jan 2, 2020
42
// Release Builders - should only match one VS version per Node.js version
Apr 11, 2024
Apr 11, 2024
43
44
[ /vs2015/, releaseType, gte(18) ],
[ /vs2017/, releaseType, gte(18) ],
Aug 11, 2023
Aug 11, 2023
45
[ /vs2019-arm64/, releaseType, lt(20) ],
Oct 7, 2023
Oct 7, 2023
46
[ /vs2019/, releaseType, gte(21) ],
May 29, 2024
May 29, 2024
47
[ /vs2022-x86/, releaseType, gte(23) ],
Oct 7, 2023
Oct 7, 2023
48
[ /vs2022/, releaseType, lt(21) ],
Apr 17, 2025
Apr 17, 2025
49
50
[ /vs2022(?!_clang)(-\w+)?$/, releaseType, gte(24) ],
[ /vs2022_clang/, releaseType, lt(24) ],
Jan 2, 2020
Jan 2, 2020
51
// VS versions supported to compile Node.js - also matches labels used by test runners
Apr 11, 2024
Apr 11, 2024
52
53
[ /vs2015(-\w+)?$/, testType, gte(18) ],
[ /vs2017(-\w+)?$/, testType, gte(18) ],
Jan 3, 2024
Jan 3, 2024
54
[ /vs2019(-\w+)?$/, testType, gte(21) ],
Oct 14, 2024
Oct 14, 2024
55
56
[ /vs2022(-\w+)?$/, testType, lt(21) ],
[ /vs2022-x86$/, testType, gte(23) ], // x86 was dropped on Windows in v23
Apr 17, 2025
Apr 17, 2025
57
[ /vs2022(?!_clang)(-\w+)?$/, testType, gte(24) ], // MSVC was dropped on Windows in v24
Feb 24, 2025
Feb 24, 2025
58
[ /vs2022_clang(-\w+)?$/, testType, lt(24) ], // ClangCL support was added in v23
Aug 11, 2023
Aug 11, 2023
59
[ /COMPILED_BY-\w+-arm64$/, testType, lt(20) ], // run tests on arm64 for >=19
Jan 2, 2020
Jan 2, 2020
60
// VS versions supported to build add-ons
Aug 11, 2023
Aug 11, 2023
61
[ /vs2015-COMPILED_BY/, testType, gte(20) ],
Jan 8, 2024
Jan 8, 2024
62
[ /vs2017-COMPILED_BY/, testType, gte(22) ],
May 30, 2018
May 30, 2018
64
// SmartOS -----------------------------------------------
Apr 11, 2024
Apr 11, 2024
65
[ /^smartos18/, anyType, gte(18) ],
May 30, 2018
May 30, 2018
66
Dec 21, 2023
Dec 21, 2023
67
68
// FreeBSD -----------------------------------------------
[ /^freebsd12/, anyType, gte(22) ],
Nov 6, 2024
Nov 6, 2024
69
[ /^freebsd13/, anyType, gte(22) ], // https://github.com/nodejs/node/issues/54576
Dec 21, 2023
Dec 21, 2023
70
May 30, 2018
May 30, 2018
71
// Shared libs docker containers -------------------------
Apr 14, 2022
Apr 14, 2022
72
[ /sharedlibs_debug_x64/, anyType, gte(18) ],
Apr 11, 2024
Apr 11, 2024
73
74
[ /sharedlibs_openssl110/, anyType, gte(18) ],
[ /sharedlibs_openssl102/, anyType, gte(18) ],
Mar 22, 2025
Mar 22, 2025
75
[ /sharedlibs_openssl35/, anyType, lt(24) ], // Temporary until test fixes are backported
Apr 11, 2024
Apr 11, 2024
76
[ /sharedlibs_fips20/, anyType, gte(18) ],
May 30, 2018
May 30, 2018
77
Jul 25, 2018
Jul 25, 2018
78
// OSX ---------------------------------------------------
Sep 5, 2023
Sep 5, 2023
79
[ /osx1015/, anyType, gte(21) ],
Mar 13, 2020
Mar 13, 2020
80
Apr 18, 2019
Apr 18, 2019
81
// Source / headers / docs -------------------------------
Mar 8, 2022
Mar 8, 2022
82
[ /^rhel8-release-sources$/, releaseType, lt(18) ],
Apr 18, 2019
Apr 18, 2019
83
Jul 25, 2018
Jul 25, 2018
84
// -------------------------------------------------------
May 30, 2018
May 30, 2018
85
86
87
88
89
90
91
92
93
94
95
96
]
def canBuild = { nodeVersion, builderLabel, buildType ->
buildExclusions.findResult(true) { // this works like an array.contains(), returns true (default) or false
def match = it[0]
def type = it[1]
def version = it[2]
if (version(nodeVersion) && type(buildType) && builderLabel =~ match)
return false
return null
}
97
98
99
100
101
}
// setup for execution of the above rules
int nodeMajorVersion = -1