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

Sven-Hendrik Haase svenstaro at archlinux.org
Tue Oct 8 15:12:36 UTC 2019


    Date: Tuesday, October 8, 2019 @ 15:12:36
  Author: svenstaro
Revision: 514241

upgpkg: gitlab-gitaly 1.66.0-1

Added:
  gitlab-gitaly/trunk/ruby2.5.patch
Modified:
  gitlab-gitaly/trunk/PKGBUILD

---------------+
 PKGBUILD      |   31 +++---------
 ruby2.5.patch |  144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 153 insertions(+), 22 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-10-08 14:35:08 UTC (rev 514240)
+++ PKGBUILD	2019-10-08 15:12:36 UTC (rev 514241)
@@ -1,11 +1,11 @@
-# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Maintainer: Sven-Hendrik Haase <svenstaro at gmail.com>
 
 # NOTE: Gitlab isn't always compatible with modern Ruby versions. In that case, check the
 # 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=1.56.0
-pkgrel=2
+pkgver=1.66.0
+pkgrel=1
 pkgdesc="Speed up Git access using caching"
 arch=('x86_64')
 url="https://gitlab.com/gitlab-org/gitaly"
@@ -15,8 +15,10 @@
 makedepends=(go ruby2.5-bundler cmake)
 backup=("etc/gitlab-gitaly/config.toml")
 source=("${pkgname}-${pkgver}.tar.gz::https://gitlab.com/api/v4/projects/gitlab-org%2Fgitaly/repository/archive?sha=v${pkgver}"
+        ruby2.5.patch
         "gitlab-gitaly.service")
-sha512sums=('19656c7bd2829e0e7c6405e1d6ee71e27b26a1c1d4a66ef378fa80579e94fb234dfb67465e0f448c41e64ead284d752f114a149b6537b5b6937714d98083f511'
+sha512sums=('f6e0ee9178bd2b87e9885827ef28775f8a6cc6e0ce007592f288e0e3e44c0764962fd0d424a281cd2720e9e4e617f97283f7943183ecf449c89927ba790f33a2'
+            'a82c15379900fde6f88a96bbdeb0029cab9b785ef7248f7f7f395af8aa812ba7fc94f933d07f560011e00c4853278b091660b3b0a1d852514c197ce0df205f61'
             'b330c0f42592322ad2131079ca554a13a364007182dded8c556198caff2c9ec642acf5bb7dfecb05de5a3d89bffec6588b6d05c8c7c5c771a46df3d296deed28')
 
 _homedir="/var/lib/gitlab"
@@ -24,23 +26,8 @@
 prepare() {
   cd "gitaly-"*
 
-  sed -i "s/bundle install/bundle-2.5 install/" Makefile
-  sed -i "s/bundle config/bundle-2.5 config/" Makefile
-  sed -i "s/bundle show/bundle-2.5 show/" Makefile
-  sed -i "s/bundle/bundle-2.5/" \
-    internal/rubyserver/rubyserver.go \
-    internal/linguist/linguist.go \
-    _support/makegen.go
-  sed -i "s/env ruby/env ruby-2.5/g" \
-    ruby/gitlab-shell/bin/test-logger \
-    ruby/gitlab-shell/bin/check \
-    ruby/gitlab-shell/hooks/post-receive \
-    ruby/gitlab-shell/hooks/update \
-    ruby/gitlab-shell/hooks/pre-receive
-  sed -i "s/\"ruby\"/\"ruby-2.5\"/" internal/linguist/linguist.go
-  sed -i "s/env ruby/env ruby-2.5/" ruby/bin/gitaly-ruby
-  sed -i "s/env ruby/env ruby-2.5/" ruby/bin/ruby-cd
-  sed -i "s/VERSION = .*/VERSION = ${pkgver}/" Makefile
+  patch -Np1 -i "$srcdir"/ruby2.5.patch
+
   sed -i "s|dir = \"/home/git/gitaly/ruby\"|dir = \"/usr/share/webapps/gitlab-gitaly/ruby\"|" config.toml.example
   sed -i "s|dir = \"/home/git/gitlab-shell\"|dir = \"/usr/share/webapps/gitlab-shell\"|" config.toml.example
   sed -i "s|bin_dir = \"/home/git/gitaly\"|bin_dir = \"/usr/bin\"|" config.toml.example
@@ -52,7 +39,7 @@
 build() {
   cd "gitaly-"*
 
-  make build
+  make BUILD_TAGS="tracer_static tracer_static_jaeger"
 }
 
 package() {

Added: ruby2.5.patch
===================================================================
--- ruby2.5.patch	                        (rev 0)
+++ ruby2.5.patch	2019-10-08 15:12:36 UTC (rev 514241)
@@ -0,0 +1,144 @@
+diff --git a/_support/Makefile.template b/_support/Makefile.template
+index 592c1e7f..a1eef028 100644
+--- a/_support/Makefile.template
++++ b/_support/Makefile.template
+@@ -55,8 +55,8 @@ build: ../.ruby-bundle
+ # step. Both Omnibus and CNG assume it is in the Gitaly root, not in
+ # _build. Hence the '../' in front.
+ ../.ruby-bundle:  {{ .GitalyRubyDir }}/Gemfile.lock  {{ .GitalyRubyDir }}/Gemfile
+-	cd  {{ .GitalyRubyDir }} && bundle config # for debugging
+-	cd  {{ .GitalyRubyDir }} && bundle install $(BUNDLE_FLAGS)
++	cd  {{ .GitalyRubyDir }} && bundle-2.5 config # for debugging
++	cd  {{ .GitalyRubyDir }} && bundle-2.5 install $(BUNDLE_FLAGS)
+ 	touch $@
+ 
+ .PHONY: install
+@@ -135,12 +135,12 @@ race-go: prepare-tests
+ 
+ .PHONY: rspec
+ rspec: assemble-go prepare-tests
+-	cd  {{ .GitalyRubyDir }} && bundle exec rspec
++	cd  {{ .GitalyRubyDir }} && bundle-2.5 exec rspec
+ 
+ .PHONY: rspec-gitlab-shell
+ rspec-gitlab-shell: {{ .GitlabShellDir }}/config.yml assemble-go prepare-tests
+ 	# rspec in {{ .GitlabShellRelDir }}
+-	@cd  {{ .GitalyRubyDir }} && bundle exec bin/ruby-cd {{ .GitlabShellDir }} rspec
++	@cd  {{ .GitalyRubyDir }} && bundle-2.5 exec bin/ruby-cd {{ .GitlabShellDir }} rspec
+ 
+ .PHONY: verify
+ verify: check-mod-tidy lint check-formatting staticcheck notice-up-to-date check-proto rubocop
+@@ -217,7 +217,7 @@ check-proto: proto no-changes
+ 
+ .PHONY: rubocop
+ rubocop: ../.ruby-bundle
+-	cd  {{ .GitalyRubyDir }} && bundle exec rubocop --parallel
++	cd  {{ .GitalyRubyDir }} && bundle-2.5 exec rubocop --parallel
+ 
+ .PHONY: cover
+ cover: prepare-tests {{ .GoCovMerge }}
+diff --git a/go.mod b/go.mod
+index 3302cc02..86cabc19 100644
+--- a/go.mod
++++ b/go.mod
+@@ -23,3 +23,5 @@ require (
+ 	google.golang.org/grpc v1.16.0
+ 	gopkg.in/yaml.v2 v2.2.2
+ )
++
++go 1.13
+diff --git a/internal/linguist/linguist.go b/internal/linguist/linguist.go
+index 419f2299..86cdb2ff 100644
+--- a/internal/linguist/linguist.go
++++ b/internal/linguist/linguist.go
+@@ -103,7 +103,7 @@ func LoadColors(cfg config.Cfg) error {
+ }
+ 
+ func startGitLinguist(ctx context.Context, repoPath string, commitID string, linguistCommand string) (io.Reader, error) {
+-	cmd := exec.Command("bundle", "exec", "bin/ruby-cd", repoPath, "git-linguist", "--commit="+commitID, linguistCommand)
++	cmd := exec.Command("bundle-2.5", "exec", "bin/ruby-cd", repoPath, "git-linguist", "--commit="+commitID, linguistCommand)
+ 	cmd.Dir = config.Config.Ruby.Dir
+ 
+ 	var env []string
+@@ -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.5", "exec", "ruby-2.5", "-rfileutils", "-e", rubyScript, linguistPathSymlink.Name())
+ 	cmd.Dir = config.Config.Ruby.Dir
+ 
+ 	// We have learned that in practice the command we are about to run is a
+diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go
+index b9cc7d19..845060db 100644
+--- a/internal/rubyserver/rubyserver.go
++++ b/internal/rubyserver/rubyserver.go
+@@ -145,7 +145,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.5", "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 4e608739..8e725c66 100755
+--- a/ruby/bin/gitaly-ruby
++++ b/ruby/bin/gitaly-ruby
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.5
+ 
+ require 'fileutils'
+ 
+diff --git a/ruby/bin/ruby-cd b/ruby/bin/ruby-cd
+index 9c60fcd4..c1b23f5c 100755
+--- a/ruby/bin/ruby-cd
++++ b/ruby/bin/ruby-cd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.5
+ 
+ # This script lets you run `bundle exec` in one directory, and then changes into another.
+ 
+diff --git a/ruby/gitlab-shell/bin/check b/ruby/gitlab-shell/bin/check
+index d2224a64..5de42e5b 100755
+--- a/ruby/gitlab-shell/bin/check
++++ b/ruby/gitlab-shell/bin/check
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.5
+ 
+ require_relative '../lib/gitlab_init'
+ require_relative '../lib/gitlab_net'
+diff --git a/ruby/gitlab-shell/hooks/post-receive b/ruby/gitlab-shell/hooks/post-receive
+index 2b6538f0..835e3065 100755
+--- a/ruby/gitlab-shell/hooks/post-receive
++++ b/ruby/gitlab-shell/hooks/post-receive
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.5
+ 
+ # This file was placed here by GitLab. It makes sure that your pushed commits
+ # will be processed properly.
+diff --git a/ruby/gitlab-shell/hooks/pre-receive b/ruby/gitlab-shell/hooks/pre-receive
+index 6ce58795..3f49689f 100755
+--- a/ruby/gitlab-shell/hooks/pre-receive
++++ b/ruby/gitlab-shell/hooks/pre-receive
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.5
+ 
+ # This file was placed here by GitLab. It makes sure that your pushed commits
+ # will be processed properly.
+diff --git a/ruby/gitlab-shell/hooks/update b/ruby/gitlab-shell/hooks/update
+index 4c2fc08b..0bc81ce7 100755
+--- a/ruby/gitlab-shell/hooks/update
++++ b/ruby/gitlab-shell/hooks/update
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/env ruby-2.5
+ 
+ # This file was placed here by GitLab. It makes sure that your pushed commits
+ # will be processed properly.



More information about the arch-commits mailing list