Jenkinsfile: Link the binaries statically with muslc instead of linking them dynamically with glibc
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
		
							parent
							
								
									1469d92bdf
								
							
						
					
					
						commit
						853f904528
					
				
							
								
								
									
										20
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
								
							@ -6,7 +6,7 @@ def buildTarget(String path, String rpmArch = 'noarch', String debArch = 'noarch
 | 
			
		||||
    final String system_name = !path.contains('mingw') ? sh(returnStdout: true, script: 'uname -s').trim() : 'Windows'
 | 
			
		||||
    // Note: CMake 3.20 or higher is needed
 | 
			
		||||
    cmakeBuild buildDir: "cmake-build-${packageArch}${suffix}", buildType: 'release', cleanBuild: true, installation: 'Latest',
 | 
			
		||||
        cmakeArgs: "--no-warn-unused-cli -DCMAKE_SYSTEM_NAME=\"${system_name}\" -DCMAKE_C_COMPILER=/usr/bin/${path}-gcc -DCMAKE_CXX_COMPILER=/usr/bin/${path}-g++ -DCMAKE_LINKER=/usr/bin/${path}-ld.gold -DCMAKE_AR=/usr/bin/${path}-ar -DCMAKE_RC_COMPILER=/usr/bin/${path}-windres -DCPACK_RPM_PACKAGE_ARCHITECTURE=${rpmArch} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=${debArch} -DCXX_TARGET=${packageArch} -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS=/usr/${path}/lib/ -DIGNORE_MINIMAL_COMPILER_VERSION=ON ${no_compilation_cache_flags()}",
 | 
			
		||||
        cmakeArgs: "--no-warn-unused-cli -DCMAKE_SYSTEM_NAME=\"${system_name}\" -DCMAKE_C_COMPILER=/usr/bin/${path}-gcc -DCMAKE_CXX_COMPILER=/usr/bin/${path}-g++ -DCMAKE_LINKER=/usr/bin/${path}-ld.gold -DCMAKE_AR=/usr/bin/${path}-ar -DCMAKE_RC_COMPILER=/usr/bin/${path}-windres -DCPACK_RPM_PACKAGE_ARCHITECTURE=${rpmArch} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=${debArch} -DCXX_TARGET=${packageArch} -DCMAKE_EXE_LINKER_FLAGS=-static -DIGNORE_MINIMAL_COMPILER_VERSION=ON ${no_compilation_cache_flags()}",
 | 
			
		||||
        generator: cmake_generator()
 | 
			
		||||
    cmake arguments: "--build ./cmake-build-${packageArch}${suffix} --target ybcon", installation: 'Latest'
 | 
			
		||||
    sh "/usr/bin/${path}-strip -s ./cmake-build-${packageArch}${suffix}/ybcon*"
 | 
			
		||||
@ -20,9 +20,9 @@ final String windowsSuffix = '-windows'
 | 
			
		||||
    - Sidebar Link
 | 
			
		||||
    - Workspace Cleanup
 | 
			
		||||
   Required Compilers:
 | 
			
		||||
    - G++ for x86_64, i686, armel, armhf, aarch64 and riscv64
 | 
			
		||||
    - Emscripten Clang (https://github.com/emscripten-core/emsdk)
 | 
			
		||||
    - MinGW32 G++/Clang (https://github.com/mstorsjo/llvm-mingw) for x86_64, i686, armhf and aarch64
 | 
			
		||||
    - Musl cross-compiling toolchains (archives ending in "-cross" from https://musl.cc/#binaries) for x86_64, i686, armel, armhf, aarch64, riscv64, x86_64-w64 and i686-w64, unzipped into /usr/, along with soft links from /usr/bin/ to the binaries
 | 
			
		||||
    - Emscripten Clang (https://github.com/emscripten-core/emsdk) in /usr/share/
 | 
			
		||||
    - MinGW32 G++/Clang (https://github.com/mstorsjo/llvm-mingw) for armhf and aarch64, unzipped into /usr/, along with soft links from /usr/bin/ to the binaries
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pipeline {
 | 
			
		||||
@ -42,8 +42,8 @@ pipeline {
 | 
			
		||||
        stage('Build') {
 | 
			
		||||
            steps {
 | 
			
		||||
                echo "Building the ${env.BRANCH_NAME} branch.."
 | 
			
		||||
                buildTarget('x86_64-linux-gnu', 'x86_64', 'amd64')
 | 
			
		||||
                buildTarget('i686-linux-gnu', 'i386', 'i386')
 | 
			
		||||
                buildTarget('x86_64-linux-musl', 'x86_64', 'amd64')
 | 
			
		||||
                buildTarget('i686-linux-musl', 'i386', 'i386')
 | 
			
		||||
                cmakeBuild buildDir: "cmake-build-release-emscripten", buildType: 'release', cleanBuild: true, installation: 'Latest',
 | 
			
		||||
                    cmakeArgs: "-DCMAKE_TOOLCHAIN_FILE=\"/usr/share/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake\" ${no_compilation_cache_flags()}",
 | 
			
		||||
                    generator: cmake_generator()
 | 
			
		||||
@ -53,10 +53,10 @@ pipeline {
 | 
			
		||||
        stage('Build for other architectures') {
 | 
			
		||||
            steps {
 | 
			
		||||
                catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
 | 
			
		||||
                    buildTarget('arm-linux-gnueabi', 'armv4l', 'armel')
 | 
			
		||||
                    buildTarget('arm-linux-gnueabihf', 'armv7hl', 'armhf')
 | 
			
		||||
                    buildTarget('aarch64-linux-gnu', 'aarch64', 'arm64', false)
 | 
			
		||||
                    buildTarget('riscv64-linux-gnu', 'riscv64', 'riscv64')
 | 
			
		||||
                    buildTarget('armel-linux-musleabi', 'armv4l', 'armel')
 | 
			
		||||
                    buildTarget('armv7l-linux-musleabihf', 'armv7hl', 'armhf')
 | 
			
		||||
                    buildTarget('aarch64-linux-musl', 'aarch64', 'arm64', false)
 | 
			
		||||
                    buildTarget('riscv64-linux-musl', 'riscv64', 'riscv64')
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user