[arch-commits] Commit in gitlab-gitaly/trunk (PKGBUILD ruby27.patch)

Anatol Pomozov anatolik at archlinux.org
Tue Mar 23 01:50:08 UTC 2021


    Date: Tuesday, March 23, 2021 @ 01:50:08
  Author: anatolik
Revision: 899620

upgpkg: gitlab-gitaly 13.10.0-1

Pin to ruby2.7

Added:
  gitlab-gitaly/trunk/ruby27.patch
Modified:
  gitlab-gitaly/trunk/PKGBUILD

--------------+
 PKGBUILD     |   20 ++++++----
 ruby27.patch |  107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-03-23 01:45:14 UTC (rev 899619)
+++ PKGBUILD	2021-03-23 01:50:08 UTC (rev 899620)
@@ -4,27 +4,31 @@
 # commit log for an old fix on how to tell it to use older versions of Ruby. I'm afraid we'll
 # need this again at some point in the future.
 pkgname=gitlab-gitaly
-pkgver=13.9.1
+pkgver=13.10.0
 pkgrel=1
 pkgdesc="Speed up Git access using caching"
 arch=('x86_64')
 url="https://gitlab.com/gitlab-org/gitaly"
 license=('MIT')
-depends=(glibc ruby libxml2 libxslt libssh2)
+depends=(glibc ruby2.7 libxml2 libxslt libssh2)
 options=(!buildflags)
-makedepends=(go ruby-bundler cmake git)
+makedepends=(go cmake git)
 backup=("etc/gitlab-gitaly/config.toml")
 _tag=v${pkgver}
 source=("https://gitlab.com/gitlab-org/gitaly/-/archive/${_tag}/gitaly-${_tag}.tar.gz"
         "configs.patch"
-        "gitlab-gitaly.service")
-sha512sums=('314b19bc0371589ad29f092f065763eb6c8a140e30779ef7e26def6585a03cf13674add95254bffef627b322b74ab1255205bd483c4472331d496f68d09cfed1'
+        "gitlab-gitaly.service"
+	"ruby27.patch")
+sha512sums=('f9b999feeffa07904e52a4fe8dbfe19abac1250dd64cb21b6cf9e9a215c482601ae1d09fe712bc9b21c81551ee4cbe3ad7d688ebac25f1ce95c345327cdc7c6c'
             '1b83abe2034a195c33a6dbb7907f93d33b53bd94dc983be5dee5533a1e61cc41fd5228e04dcd2b2576a87a371bf5ab7c81212262421ee7c6ec46c949da4c1153'
-            '7f5cd528c873a5e43e18aa6a88bd7298422c047e0e61cf3208be7d9fcfdfdc8a844b5c439ab6afc2098c5c4c60ed9c3d167c2f87517f1e93b34f39be3d3dad09')
+            '7f5cd528c873a5e43e18aa6a88bd7298422c047e0e61cf3208be7d9fcfdfdc8a844b5c439ab6afc2098c5c4c60ed9c3d167c2f87517f1e93b34f39be3d3dad09'
+            '69a39aa1c4ec5cda6bbd3d71fefc6b06b8d294f9663a9af7a09288cea336b0b3dd03aef6688479c79b3ca2afa52b21a0e71b5ab49328bb938c7b38aa9fb0b4ac')
 
 prepare() {
   cd gitaly-$_tag
 
+  patch -p1 < ../ruby27.patch
+
   patch -p1 < ../configs.patch
   # At this point the config file should not contain any references to '/home/git'
 
@@ -35,7 +39,7 @@
 build() {
   cd gitaly-$_tag
 
-  bundle config force_ruby_platform true # build from sources as some prebuilt gems are not available for newer ruby
+  bundle-2.7 config force_ruby_platform true # build from sources as some prebuilt gems are not available for newer ruby
   make BUILD_TAGS="tracer_static tracer_static_jaeger"
 }
 
@@ -49,5 +53,5 @@
 
   install -Dm644 config.toml.example "${pkgdir}"/etc/${pkgname}/config.toml
   install -Dm644 "LICENSE" "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
-  install -Dm0644 "${srcdir}"/gitlab-gitaly.service "${pkgdir}"/usr/lib/systemd/system/gitlab-gitaly.service
+  install -Dm644 "${srcdir}"/gitlab-gitaly.service "${pkgdir}"/usr/lib/systemd/system/gitlab-gitaly.service
 }

Added: ruby27.patch
===================================================================
--- ruby27.patch	                        (rev 0)
+++ ruby27.patch	2021-03-23 01:50:08 UTC (rev 899620)
@@ -0,0 +1,107 @@
+commit 11cf218d4946602c7315fd5d661912ac58fd6780
+Author: Anatol Pomozov <anatol.pomozov at gmail.com>
+Date:   Mon Mar 22 18:23:32 2021 -0700
+
+    Pin sources to ruby2.7 package
+
+diff --git a/Makefile b/Makefile
+index db944c7e9..a025583bf 100644
+--- a/Makefile
++++ b/Makefile
+@@ -273,7 +273,7 @@ race-go: test-go
+ 
+ .PHONY: rspec
+ rspec: assemble-go prepare-tests
+-	${Q}cd ${GITALY_RUBY_DIR} && PATH='${SOURCE_DIR}/internal/testhelper/testdata/home/bin:${PATH}' bundle exec rspec
++	${Q}cd ${GITALY_RUBY_DIR} && PATH='${SOURCE_DIR}/internal/testhelper/testdata/home/bin:${PATH}' bundle-2.7 exec rspec
+ 
+ .PHONY: verify
+ verify: check-mod-tidy check-formatting notice-up-to-date check-proto rubocop
+@@ -323,7 +323,7 @@ check-proto: proto no-proto-changes lint-proto
+ 
+ .PHONY: rubocop
+ rubocop: ${SOURCE_DIR}/.ruby-bundle
+-	${Q}cd ${GITALY_RUBY_DIR} && bundle exec rubocop --parallel
++	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 exec rubocop --parallel
+ 
+ .PHONY: cover
+ cover: GO_BUILD_TAGS := ${GO_BUILD_TAGS},postgres
+@@ -381,8 +381,8 @@ libgit2: ${LIBGIT2_INSTALL_DIR}/lib/libgit2.a
+ # step. Both Omnibus and CNG assume it is in the Gitaly root, not in
+ # _build. Hence the '../' in front.
+ ${SOURCE_DIR}/.ruby-bundle: ${GITALY_RUBY_DIR}/Gemfile.lock ${GITALY_RUBY_DIR}/Gemfile
+-	${Q}cd ${GITALY_RUBY_DIR} && bundle config # for debugging
+-	${Q}cd ${GITALY_RUBY_DIR} && bundle install ${BUNDLE_FLAGS}
++	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 config # for debugging
++	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 install ${BUNDLE_FLAGS}
+ 	${Q}touch $@
+ 
+ ${SOURCE_DIR}/NOTICE: ${BUILD_DIR}/NOTICE
+diff --git a/_support/generate-proto-ruby b/_support/generate-proto-ruby
+index 6ddb15cbb..bf4bc51f0 100755
+--- a/_support/generate-proto-ruby
++++ b/_support/generate-proto-ruby
+@@ -20,7 +20,7 @@ def main
+     # locations. `protoc` requires this.
+     proto_include_abs = File.absolute_path(File.join('..', PROTO_INCLUDE))
+ 
+-    run!(%W[bundle exec grpc_tools_ruby_protoc -I #{proto_include_abs} --ruby_out=../#{ruby_lib_gitaly} --grpc_out=../#{ruby_lib_gitaly}] + PROTO_FILES)
++    run!(%W[bundle-2.7 exec grpc_tools_ruby_protoc -I #{proto_include_abs} --ruby_out=../#{ruby_lib_gitaly} --grpc_out=../#{ruby_lib_gitaly}] + PROTO_FILES)
+   end
+ 
+   write_ruby_requires
+diff --git a/internal/gitaly/linguist/linguist.go b/internal/gitaly/linguist/linguist.go
+index 9356a8af1..02aa84239 100644
+--- a/internal/gitaly/linguist/linguist.go
++++ b/internal/gitaly/linguist/linguist.go
+@@ -74,7 +74,7 @@ func LoadColors(cfg *config.Cfg) error {
+ }
+ 
+ func startGitLinguist(ctx context.Context, cfg config.Cfg, repoPath string, commitID string, linguistCommand string) (*command.Command, error) {
+-	bundle, err := exec.LookPath("bundle")
++	bundle, err := exec.LookPath("bundle-2.7")
+ 	if err != nil {
+ 		return nil, err
+ 	}
+@@ -136,7 +136,7 @@ func openLanguagesJSON(cfg *config.Cfg) (io.ReadCloser, error) {
+ 	// We use a symlink because we cannot trust Bundler to not print garbage
+ 	// on its stdout.
+ 	rubyScript := `FileUtils.ln_sf(Bundler.rubygems.find_name('github-linguist').first.full_gem_path, ARGV.first)`
+-	cmd := exec.Command("bundle", "exec", "ruby", "-rfileutils", "-e", rubyScript, linguistPathSymlink.Name())
++	cmd := exec.Command("bundle-2.7", "exec", "ruby-2.7", "-rfileutils", "-e", rubyScript, linguistPathSymlink.Name())
+ 	cmd.Dir = cfg.Ruby.Dir
+ 
+ 	// We have learned that in practice the command we are about to run is a
+diff --git a/internal/gitaly/rubyserver/rubyserver.go b/internal/gitaly/rubyserver/rubyserver.go
+index 237b01c42..2dc8743e7 100644
+--- a/internal/gitaly/rubyserver/rubyserver.go
++++ b/internal/gitaly/rubyserver/rubyserver.go
+@@ -123,7 +123,7 @@ func (s *Server) start() error {
+ 		// Use 'ruby-cd' to make sure gitaly-ruby has the same working directory
+ 		// as the current process. This is a hack to sort-of support relative
+ 		// Unix socket paths.
+-		args := []string{"bundle", "exec", "bin/ruby-cd", wd, gitalyRuby, strconv.Itoa(os.Getpid()), socketPath}
++		args := []string{"bundle-2.7", "exec", "bin/ruby-cd", wd, gitalyRuby, strconv.Itoa(os.Getpid()), socketPath}
+ 
+ 		events := make(chan supervisor.Event)
+ 		check := func() error { return ping(socketPath) }
+diff --git a/ruby/bin/gitaly-ruby b/ruby/bin/gitaly-ruby
+index d37352945..7f096fa33 100755
+--- a/ruby/bin/gitaly-ruby
++++ b/ruby/bin/gitaly-ruby
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.7
+ 
+ # Gitaly always spawns this executable with LANG=en_US.UTF-8. In case the
+ # system doesn't have this local, Ruby will fall back to the C locale and as a
+diff --git a/ruby/bin/ruby-cd b/ruby/bin/ruby-cd
+index 9c60fcd42..15f0cb05a 100755
+--- a/ruby/bin/ruby-cd
++++ b/ruby/bin/ruby-cd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.7
+ 
+ # This script lets you run `bundle exec` in one directory, and then changes into another.
+ 



More information about the arch-commits mailing list