find -maxdepth 1 -name "${gem_name}-*.gem" -delete
# -q appears to be broken in gem version 2.2.2
- $GEM build "$gem_name.gemspec" $DASHQ_UNLESS_DEBUG >"$STDOUT_IF_DEBUG" 2>"$STDERR_IF_DEBUG"
+ gem build "$gem_name.gemspec" $DASHQ_UNLESS_DEBUG >"$STDOUT_IF_DEBUG" 2>"$STDERR_IF_DEBUG"
fi
}
local src=services/workbench2
local dst=/var/www/arvados-workbench2/workbench2
local description="Arvados Workbench 2"
+ if [[ -n "$ONLY_BUILD" ]] && [[ "$pkgname" != "$ONLY_BUILD" ]] ; then
+ return 0
+ fi
cd "$WORKSPACE/$src"
local version="$(version_from_git)"
rm -rf ./build
binpath="$GOPATH/bin/linux_${target_arch}/${basename}"
fi
+ case "$package_format" in
+ # As of April 2024 we package identical Go binaries under different
+ # packages and names. This upsets the build id database, so don't
+ # register ourselves there.
+ rpm) switches+=(--rpm-rpmbuild-define="_build_id_links none") ;;
+ esac
+
systemd_unit="$WORKSPACE/${src_path}/${prog}.service"
if [[ -e "${systemd_unit}" ]]; then
switches+=(
cd "$srcdir"
mkdir -p tmp
git rev-parse HEAD >git-commit.version
+ # Please make sure you read `bundle help config` carefully before you
+ # modify any of these settings. Some of their names are not intuitive.
+ #
+ # `bundle cache` caches from Git and paths, not just rubygems.org.
bundle config set cache_all true
- bundle package
+ # Disallow changes to Gemfile.
+ bundle config set deployment true
+ # Avoid loading system-wide gems (although this seems to not work 100%).
+ bundle config set disable_shared_gems true
+ # `bundle cache` only downloads gems, doesn't install them.
+ # Our Rails postinst script does the install step.
+ bundle config set no_install true
+ # As of April 2024/Bundler 2.4, `bundle cache` seems to skip downloading
+ # gems that are already available system-wide... and then it complains
+ # that your bundle is incomplete. Work around this by fetching gems
+ # manually.
+ # TODO: Once all our supported distros have Ruby 3+, we can modify
+ # the awk script to print "NAME:VERSION" output, and pipe that directly
+ # to `xargs -0r gem fetch` for reduced overhead.
+ mkdir -p vendor/cache
+ awk -- '
+BEGIN { OFS="\0"; ORS="\0"; }
+(/^[A-Z ]*$/) { level1=$0; }
+(/^ [[:alpha:]]+:$/) { level2=substr($0, 3, length($0) - 3); next; }
+(/^ {0,3}[[:alpha:]]/) { level2=""; next; }
+(level1 == "GEM" && level2 == "specs" && NF == 2 && $1 ~ /^[[:alpha:]][-_[:alnum:]]*$/ && $2 ~ /\([[:digit:]]+[-_+.[:alnum:]]*\)$/) {
+ print "--version", substr($2, 2, length($2) - 2), $1;
+}
+' Gemfile.lock | env -C vendor/cache xargs -0r --max-args=3 gem fetch
+ # Despite the bug, we still run `bundle cache` to make sure Bundler is
+ # happy for later steps.
+ bundle cache
)
if [[ 0 != "$?" ]] || ! cd "$WORKSPACE/packages/$TARGET"; then
echo "ERROR: $pkgname package prep failed" >&2
if ! "$PYTHON3_EXECUTABLE" -m venv "$venv_dir"; then
printf "Error, unable to run\n %s -m venv %s\n" "$PYTHON3_EXECUTABLE" "$venv_dir"
exit 1
+ # We must have the dependency resolver introduced in late 2020 for the rest
+ # of our install process to work.
+ # <https://blog.python.org/2020/11/pip-20-3-release-new-resolver.html>
+ elif ! "$venv_dir/bin/pip" install "pip>=20.3"; then
+ printf "Error, unable to run\n %s/bin/pip install 'pip>=20.3'\n" "$venv_dir"
+ exit 1
fi
local pip_wheel="$(ls --sort=time --reverse "$PYTHON_BUILDROOT/wheelhouse/$(echo "$PKG" | sed s/-/_/g)-"*.whl | tail -n1)"