mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-11 02:52:56 +01:00
Build ruby with jemalloc
This should improve memory usage and test Ruby the way we do in production.
This commit is contained in:
parent
4019ae1df0
commit
d8636ff0e8
1 changed files with 19 additions and 2 deletions
|
|
@ -7,9 +7,26 @@ set -xeou pipefail
|
||||||
RUBY_VERSION=${1}
|
RUBY_VERSION=${1}
|
||||||
RUBY_MAJOR=${1%.*} # strip last component
|
RUBY_MAJOR=${1%.*} # strip last component
|
||||||
RUBY_DOWNLOAD_SHA256=${2}
|
RUBY_DOWNLOAD_SHA256=${2}
|
||||||
|
|
||||||
RUBY_DOWNLOAD_URL="https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.gz"
|
RUBY_DOWNLOAD_URL="https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.gz"
|
||||||
|
|
||||||
|
JEMALLOC_VERSION=5.2.1
|
||||||
|
JEMALLOC_DOWNLOAD_SHA256="34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6"
|
||||||
|
JEMALLOC_DOWNLOAD_URL="https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2"
|
||||||
|
|
||||||
|
# Download jemalloc
|
||||||
|
mkdir -p /usr/src/jemalloc
|
||||||
|
cd /usr/src/jemalloc
|
||||||
|
curl --retry 6 -L -so jemalloc.tar.bz2 ${JEMALLOC_DOWNLOAD_URL}
|
||||||
|
echo "${JEMALLOC_DOWNLOAD_SHA256} jemalloc.tar.bz2" | sha256sum -c -
|
||||||
|
|
||||||
|
# Install jemalloc
|
||||||
|
tar -xjf jemalloc.tar.bz2
|
||||||
|
rm jemalloc.tar.bz2
|
||||||
|
cd jemalloc-${JEMALLOC_VERSION}
|
||||||
|
./autogen.sh --prefix=/usr --enable-prof
|
||||||
|
make -j "$(nproc)" install
|
||||||
|
cd /tmp
|
||||||
|
|
||||||
# Download Ruby
|
# Download Ruby
|
||||||
curl -fsSL "$RUBY_DOWNLOAD_URL" -o ruby.tar.gz
|
curl -fsSL "$RUBY_DOWNLOAD_URL" -o ruby.tar.gz
|
||||||
echo "${RUBY_DOWNLOAD_SHA256} ruby.tar.gz" | sha256sum -c -
|
echo "${RUBY_DOWNLOAD_SHA256} ruby.tar.gz" | sha256sum -c -
|
||||||
|
|
@ -38,7 +55,7 @@ if [[ -d "/patches/ruby/$RUBY_VERSION" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
./configure --enable-shared --disable-install-doc --disable-install-rdoc --disable-install-capi
|
./configure --enable-shared --with-jemalloc --disable-install-doc --disable-install-rdoc --disable-install-capi
|
||||||
make install -j $(nproc)
|
make install -j $(nproc)
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue