From 4b566bc04d2df7ab3110d5ba46a16198ceebca9f Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Fri, 9 May 2025 19:48:28 +0700 Subject: [PATCH] chore(build): try to use mold instead --- Jenkinsfile | 10 +++++++++- config.toml | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 config.toml diff --git a/Jenkinsfile b/Jenkinsfile index 5bca249..e08d4a5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,14 @@ pipeline { agent any stages { + stage('Preparation') { + steps { + sh ''' + mkdir -p .local + wget -O- https://github.com/rui314/mold/releases/download/v2.39.0/mold-2.39.0-x86_64-linux.tar.gz | tar -xzv --strip-components=1 -C .local/ + ''' + } + } stage('Main') { matrix { axes { @@ -22,7 +30,7 @@ pipeline { steps { sh ''' export CARGO_HOME="$(pwd)/.cargo" - export CC="$TARGET_CC" + export PATH="$(pwd)/.local/bin:${PATH}" printenv | sort cargo build \ --release diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..797a3fd --- /dev/null +++ b/config.toml @@ -0,0 +1,2 @@ +[target.'cfg(target_os = "linux")'] +rustflags = ["-C", "link-arg=-fuse-ld=mold"] \ No newline at end of file