From 112999b1a55cbd9317c4d9db576ec90b2cbab9a3 Mon Sep 17 00:00:00 2001 From: blyxyas Date: Tue, 5 Mar 2024 23:24:13 +0100 Subject: [PATCH 1/5] Use jemalloc to compile dist on CI --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index fe84c23a11c14..779831310c788 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -33,12 +33,15 @@ RUN yum upgrade -y && \ xz \ zlib-devel.i686 \ zlib-devel.x86_64 \ + jemalloc-devel && yum clean all RUN mkdir -p /rustroot/bin ENV PATH=/rustroot/bin:$PATH ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib +# This is a RUN command because we need to do some command interpolation +RUN export LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig WORKDIR /tmp RUN mkdir /home/user From 30e01c2d2992e6e5ed8d50492b74ad1d040313bf Mon Sep 17 00:00:00 2001 From: blyxyas Date: Wed, 6 Mar 2024 00:00:45 +0100 Subject: [PATCH 2/5] Move that LD_PRELOAD line to later in the file --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index 779831310c788..2bb843c380ceb 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -40,8 +40,6 @@ RUN mkdir -p /rustroot/bin ENV PATH=/rustroot/bin:$PATH ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib -# This is a RUN command because we need to do some command interpolation -RUN export LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig WORKDIR /tmp RUN mkdir /home/user @@ -58,7 +56,7 @@ RUN ./cmake.sh # Now build LLVM+Clang, afterwards configuring further compilations to use the # clang/clang++ compilers. COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/ -RUN ./build-clang.sh +RUN LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` ./build-clang.sh ENV CC=clang CXX=clang++ # rustc-perf version from 2023-10-22 From f6093dc534d7adc62492a4e9b97ce65b554e2ad0 Mon Sep 17 00:00:00 2001 From: blyxyas Date: Wed, 6 Mar 2024 00:30:08 +0100 Subject: [PATCH 3/5] Move the ENV even more --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index 2bb843c380ceb..be519e1670823 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -56,7 +56,7 @@ RUN ./cmake.sh # Now build LLVM+Clang, afterwards configuring further compilations to use the # clang/clang++ compilers. COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/ -RUN LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` ./build-clang.sh +RUN ./build-clang.sh ENV CC=clang CXX=clang++ # rustc-perf version from 2023-10-22 @@ -89,7 +89,7 @@ ENV RUST_CONFIGURE_ARGS \ --set rust.lto=thin \ --set rust.codegen-units=1 -ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ +ENV SCRIPT LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` python3 ../x.py build --set rust.debug=true opt-dist && \ ./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ --host $HOSTS --target $HOSTS \ --include-default-paths \ From 9780abb9de0848e40f55b8cf673a6b671f61fc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandra=20Gonz=C3=A1lez?= Date: Wed, 6 Mar 2024 14:19:19 +0100 Subject: [PATCH 4/5] Update src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rémy Rakic --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index be519e1670823..1ca64a10d9558 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -33,7 +33,7 @@ RUN yum upgrade -y && \ xz \ zlib-devel.i686 \ zlib-devel.x86_64 \ - jemalloc-devel + jemalloc-devel \ && yum clean all RUN mkdir -p /rustroot/bin From ccadda5a243a70e4a710bf482af65dd68b606859 Mon Sep 17 00:00:00 2001 From: blyxyas Date: Thu, 7 Mar 2024 18:24:56 +0100 Subject: [PATCH 5/5] Move LD_PRELOAD to the correct place, this time --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index 1ca64a10d9558..d53141541c6c0 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -89,8 +89,8 @@ ENV RUST_CONFIGURE_ARGS \ --set rust.lto=thin \ --set rust.codegen-units=1 -ENV SCRIPT LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` python3 ../x.py build --set rust.debug=true opt-dist && \ - ./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ +ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ + LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` ./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ --host $HOSTS --target $HOSTS \ --include-default-paths \ build-manifest bootstrap