diff --git a/Jenkinsfile b/Jenkinsfile index e9727dd420..2a48bf8a34 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ def runOnNativeBuildAgent(String platform, Closure body) { def final nativeBuildStageName = 'Build SWT-native binaries' - if (platform == 'gtk.linux.x86_64') { + if (platform == 'gtk4.linux.x86_64') { podTemplate(inheritFrom: 'basic' /* inherit general configuration */, containers: [ containerTemplate(name: 'swtbuild', image: 'eclipse/platformreleng-debian-swtnativebuild:12', resourceRequestCpu:'1000m', resourceRequestMemory:'512Mi', @@ -26,6 +26,15 @@ def runOnNativeBuildAgent(String platform, Closure body) { ]) { node(POD_LABEL) { stage(nativeBuildStageName) { container('swtbuild') { body() } } } } + } else if (platform == 'gtk.linux.x86_64') { + podTemplate(inheritFrom: 'basic' /* inherit general configuration */, containers: [ + containerTemplate(name: 'swtbuild', image: 'eclipse/platformreleng-debian-swtgtk3nativebuild:10', + resourceRequestCpu:'1000m', resourceRequestMemory:'512Mi', + resourceLimitCpu:'2000m', resourceLimitMemory:'4096Mi', + alwaysPullImage: true, command: 'cat', ttyEnabled: true) + ]) { + node(POD_LABEL) { stage(nativeBuildStageName) { container('swtbuild') { body() } } } + } } else { // See the Definition of the RelEng Jenkins instance in // https://github.com/eclipse-cbi/jiro/tree/master/instances/eclipse.platform.releng @@ -199,6 +208,7 @@ pipeline { 'gtk.linux.ppc64le',\ 'gtk.linux.riscv64',\ 'gtk.linux.x86_64',\ + 'gtk4.linux.x86_64',\ 'win32.win32.aarch64',\ 'win32.win32.x86_64' } @@ -220,7 +230,7 @@ pipeline { runOnNativeBuildAgent("${PLATFORM}") { cleanWs() // Workspace is not cleaned up by default, so we do it explicitly echo "OS: ${os}, ARCH: ${arch}" - unstash "swt.binaries.sources.${ws}" + unstash "swt.binaries.sources.${ws == 'gtk4' ? 'gtk' : ws }" dir('jdk.resources') { unstash "jdk.resources.${os}.${arch}" } @@ -228,14 +238,21 @@ pipeline { if (isUnix()){ sh ''' mkdir libs - if [ "${PLATFORM}" = "gtk.linux.aarch64" ]; then + if [[ ${PLATFORM} == gtk.linux.* ]]; then sh build.sh -gtk3 install - elif [ "${PLATFORM}" = "gtk.linux.ppc64le" ]; then - sh build.sh -gtk3 install - elif [ "${PLATFORM}" = "gtk.linux.riscv64" ]; then - sh build.sh -gtk3 install - else + elif [[ ${PLATFORM} == gtk4.linux.* ]]; then + # We build both 3 + 4, but we only keep libswt-pi4-gtk + # (see 'Collect and sign binaries' stage) + # + # We build both to help catch build errors as this + # build runs against more modern gcc/libs and helps + # with verification + sh build.sh install + elif [[ ${PLATFORM} == cocoa.macosx.* ]]; then sh build.sh install + else + echo "Unexpected build platform ${PLATFORM}" + exit 1 fi ls -1R libs ''' @@ -259,9 +276,13 @@ pipeline { dir("libs/${PLATFORM}") { unstash "swt.binaries.${PLATFORM}" sh ''' + DEST_PLATFORM=${PLATFORM} if [[ ${PLATFORM} == cocoa.macosx.* ]]; then binariesExtension='jnilib' signerUrl='https://cbi.eclipse.org/macos/codesign/sign' + elif [[ ${PLATFORM} == gtk4.linux.x86_64 ]]; then + binariesExtension='so' + DEST_PLATFORM=gtk.linux.x86_64 elif [[ ${PLATFORM} == gtk.linux.* ]]; then binariesExtension='so' elif [[ ${PLATFORM} == win32.win32.* ]]; then @@ -278,7 +299,11 @@ pipeline { done fi fi - cp *.$binariesExtension "${WORKSPACE}/eclipse.platform.swt/binaries/org.eclipse.swt.${PLATFORM}/" + if [[ ${PLATFORM} == gtk4.linux.x86_64 ]]; then + cp libswt-pi4-gtk*.so "${WORKSPACE}/eclipse.platform.swt/binaries/org.eclipse.swt.${DEST_PLATFORM}/" + else + cp *.$binariesExtension "${WORKSPACE}/eclipse.platform.swt/binaries/org.eclipse.swt.${DEST_PLATFORM}/" + fi ''' } }