From 693a0d0d1247af022040700c7a9524f35b2237ca Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Thu, 18 Apr 2024 11:11:31 -0400 Subject: [PATCH] 21254: Add workaround for Bundler zlib bug See comments for discussion. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- build/rails-package-scripts/postinst.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/rails-package-scripts/postinst.sh b/build/rails-package-scripts/postinst.sh index e317f85aaf..17802a7b52 100644 --- a/build/rails-package-scripts/postinst.sh +++ b/build/rails-package-scripts/postinst.sh @@ -208,6 +208,18 @@ configure_version() { run_and_report "Running bundle install" \ $COMMAND_PREFIX bin/bundle install --local --quiet + # As of April 2024/Bundler 2.4, for some reason `bundle install` skips + # zlib if it's already installed as a system-wide gem, which it often will + # be because arvados gems pull it in. If this happened, install it in the + # bundle manually as a workaround. + if ! $COMMAND_PREFIX bin/bundle info zlib >/dev/null 2>&1; then + local RUBY_VERSION="$($COMMAND_PREFIX ruby -e 'puts RUBY_VERSION')" + run_and_report "Adding zlib to bundle" \ + $COMMAND_PREFIX gem install \ + --install-dir="$SHARED_PATH/vendor_bundle/ruby/$RUBY_VERSION" \ + vendor/cache/zlib-*.gem + fi + echo -n "Ensuring directory and file permissions ..." # Ensure correct ownership of a few files chown "$WWW_OWNER:" $RELEASE_PATH/config/environment.rb -- 2.30.2