[arch-commits] Commit in gitlab-gitaly/repos/community-x86_64 (8 files)

Anatol Pomozov anatolik at gemini.archlinux.org
Tue Aug 9 19:46:48 UTC 2022


    Date: Tuesday, August 9, 2022 @ 19:46:48
  Author: anatolik
Revision: 1264539

archrelease: copy trunk to community-x86_64

Added:
  gitlab-gitaly/repos/community-x86_64/PKGBUILD
    (from rev 1264538, gitlab-gitaly/trunk/PKGBUILD)
  gitlab-gitaly/repos/community-x86_64/configs.patch
    (from rev 1264538, gitlab-gitaly/trunk/configs.patch)
  gitlab-gitaly/repos/community-x86_64/gitlab-gitaly.service
    (from rev 1264538, gitlab-gitaly/trunk/gitlab-gitaly.service)
  gitlab-gitaly/repos/community-x86_64/ruby27.patch
    (from rev 1264538, gitlab-gitaly/trunk/ruby27.patch)
Deleted:
  gitlab-gitaly/repos/community-x86_64/PKGBUILD
  gitlab-gitaly/repos/community-x86_64/configs.patch
  gitlab-gitaly/repos/community-x86_64/gitlab-gitaly.service
  gitlab-gitaly/repos/community-x86_64/ruby27.patch

-----------------------+
 PKGBUILD              |  114 ++++++++++++-------------
 configs.patch         |  198 ++++++++++++++++++++++----------------------
 gitlab-gitaly.service |   28 +++---
 ruby27.patch          |  214 ++++++++++++++++++++++++------------------------
 4 files changed, 277 insertions(+), 277 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2022-08-09 19:45:28 UTC (rev 1264538)
+++ PKGBUILD	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -1,57 +0,0 @@
-# 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=15.2.2
-pkgrel=1
-pkgdesc="Speed up Git access using caching"
-arch=('x86_64')
-url="https://gitlab.com/gitlab-org/gitaly"
-license=('MIT')
-depends=(glibc ruby2.7 libxml2 libxslt libssh2)
-options=(!buildflags)
-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"
-	"ruby27.patch")
-sha512sums=('5cd8418eab3cfdc1f9bc506a27102f18cf51786bf5d7296e25090d4745baedf149ca80e241e0ae614f62b3d1f1798d892d9d8386d9a7510ac10aca7b54fad1e2'
-            '17a8080eaaef88c53bbe84836a2fa861cf04239346e44bb77d6a4b1c9255b5fefcc3413a23cf7c8156c9189f2825b4bd6e72c98439cf3facceb11748b669185a'
-            '7f5cd528c873a5e43e18aa6a88bd7298422c047e0e61cf3208be7d9fcfdfdc8a844b5c439ab6afc2098c5c4c60ed9c3d167c2f87517f1e93b34f39be3d3dad09'
-            '3fcd67cc574d30adda3ac0f0bb0e665b2ed41ae6364bcffb6faf208008cf4ceac2477619d943d251fadf00ff4720967da29297ad925b9efdf95000e1f88ced61')
-
-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'
-
-  # https://github.com/bundler/bundler/issues/6882
-  sed -e '/BUNDLED WITH/,+1d' -i ruby/Gemfile.lock
-}
-
-build() {
-  cd gitaly-$_tag
-
-  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"
-}
-
-package() {
-  cd gitaly-$_tag
-
-  make PREFIX=/usr DESTDIR="${pkgdir}" install
-  mkdir -p "${pkgdir}"/etc/gitlab-gitaly
-  mkdir -p "${pkgdir}"/usr/share/webapps/gitlab-gitaly
-  cp -r ruby "${pkgdir}"/usr/share/webapps/gitlab-gitaly/ruby
-
-  install -Dm644 config.toml.example "${pkgdir}"/etc/${pkgname}/config.toml
-  install -Dm644 "LICENSE" "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
-  install -Dm644 "${srcdir}"/gitlab-gitaly.service "${pkgdir}"/usr/lib/systemd/system/gitlab-gitaly.service
-}

Copied: gitlab-gitaly/repos/community-x86_64/PKGBUILD (from rev 1264538, gitlab-gitaly/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -0,0 +1,57 @@
+# 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=15.2.2
+pkgrel=1
+pkgdesc="Speed up Git access using caching"
+arch=('x86_64')
+url="https://gitlab.com/gitlab-org/gitaly"
+license=('MIT')
+depends=(glibc ruby2.7 libxml2 libxslt libssh2)
+options=(!buildflags)
+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"
+	"ruby27.patch")
+sha512sums=('5cd8418eab3cfdc1f9bc506a27102f18cf51786bf5d7296e25090d4745baedf149ca80e241e0ae614f62b3d1f1798d892d9d8386d9a7510ac10aca7b54fad1e2'
+            '17a8080eaaef88c53bbe84836a2fa861cf04239346e44bb77d6a4b1c9255b5fefcc3413a23cf7c8156c9189f2825b4bd6e72c98439cf3facceb11748b669185a'
+            '7f5cd528c873a5e43e18aa6a88bd7298422c047e0e61cf3208be7d9fcfdfdc8a844b5c439ab6afc2098c5c4c60ed9c3d167c2f87517f1e93b34f39be3d3dad09'
+            '3fcd67cc574d30adda3ac0f0bb0e665b2ed41ae6364bcffb6faf208008cf4ceac2477619d943d251fadf00ff4720967da29297ad925b9efdf95000e1f88ced61')
+
+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'
+
+  # https://github.com/bundler/bundler/issues/6882
+  sed -e '/BUNDLED WITH/,+1d' -i ruby/Gemfile.lock
+}
+
+build() {
+  cd gitaly-$_tag
+
+  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"
+}
+
+package() {
+  cd gitaly-$_tag
+
+  make PREFIX=/usr DESTDIR="${pkgdir}" install
+  mkdir -p "${pkgdir}"/etc/gitlab-gitaly
+  mkdir -p "${pkgdir}"/usr/share/webapps/gitlab-gitaly
+  cp -r ruby "${pkgdir}"/usr/share/webapps/gitlab-gitaly/ruby
+
+  install -Dm644 config.toml.example "${pkgdir}"/etc/${pkgname}/config.toml
+  install -Dm644 "LICENSE" "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+  install -Dm644 "${srcdir}"/gitlab-gitaly.service "${pkgdir}"/usr/lib/systemd/system/gitlab-gitaly.service
+}

Deleted: configs.patch
===================================================================
--- configs.patch	2022-08-09 19:45:28 UTC (rev 1264538)
+++ configs.patch	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -1,99 +0,0 @@
-commit 9aef34b89229e115ebf7a8e86f2370e9b1a3f1e4
-Author: Anatol Pomozov <anatol.pomozov at gmail.com>
-Date:   Tue Jun 21 09:35:40 2022 -0700
-
-    Patch config files with Arch Linux specific locations
-    
-    Arch uses upstream's default config files as a base for its configs.
-    But directory structure at Arch is completely different from the default
-    one specified by gitlab project.
-    We used to have a lot of seds expressions to adjust the files but as
-    complexity of configs grew 'sed' makes it easy to miss a changed/added
-    option.
-    
-    Track set of diffs as a patch. If upstream modifies config file then it
-    will cause a conflict that needs to be reviewed manually.
-
-diff --git a/config.toml.example b/config.toml.example
-index 9a4753e1e..682083d8e 100644
---- a/config.toml.example
-+++ b/config.toml.example
-@@ -2,10 +2,10 @@
- # Documentation lives at https://docs.gitlab.com/ee/administration/gitaly/ and
- # https://docs.gitlab.com/ee//administration/gitaly/reference
- 
--socket_path = "/home/git/gitlab/tmp/sockets/private/gitaly.socket"
-+socket_path = "/run/gitlab/gitlab-gitaly.socket"
- 
- # The directory where Gitaly's executables are stored
--bin_dir = "/home/git/gitaly/_build/bin"
-+bin_dir = "/usr/bin"
- 
- # # Optional: The directory where Gitaly can create all files required to
- # # properly operate at runtime. If not set, Gitaly will create a directory in
-@@ -22,7 +22,7 @@ bin_dir = "/home/git/gitaly/_build/bin"
- # # Optional: configure where the Gitaly creates the sockets for internal connections. If unset, Gitaly will create a randomly
- # # named temp directory each time it boots.
- # # Non Gitaly clients should never connect to these sockets.
--# internal_socket_dir = "/home/git/gitlab/tmp/sockets/private/internal"
-+# internal_socket_dir = "/run/gitlab/private"
- 
- # # Optional: authenticate Gitaly requests using a shared secret
- # [auth]
-@@ -30,8 +30,8 @@ bin_dir = "/home/git/gitaly/_build/bin"
- # transitioning = false # Set `transitioning` to true to temporarily allow unauthenticated while rolling out authentication.
- 
- # [tls]
--# certificate_path = '/home/git/cert.cert'
--# key_path = '/home/git/key.pem'
-+# certificate_path = '/var/lib/gitlab/cert.cert'
-+# key_path = '/var/lib/gitlab/key.pem'
- 
- # # Git settings
- # [git]
-@@ -51,7 +51,7 @@ bin_dir = "/home/git/gitaly/_build/bin"
- 
- [[storage]]
- name = "default"
--path = "/home/git/repositories"
-+path = "/var/lib/gitlab/repositories"
- 
- # # You can optionally configure more storages for this Gitaly instance to serve up
- #
-@@ -63,7 +63,7 @@ path = "/home/git/repositories"
- # # You can optionally configure Gitaly to output JSON-formatted log messages to stdout
- # [logging]
- # # The directory where Gitaly stores extra log files
--dir = "/home/git/gitlab/log"
-+dir = "/var/log/gitlab"
- # format = "json"
- # # Optional: Set log level to only log entries with that severity or above
- # # One of, in order: debug, info, warn, errror, fatal, panic
-@@ -81,7 +81,7 @@ dir = "/home/git/gitlab/log"
- 
- [gitaly-ruby]
- # The directory where gitaly-ruby is installed
--dir = "/home/git/gitaly/ruby"
-+dir = "/usr/share/webapps/gitlab-gitaly/ruby"
- 
- # # Gitaly-ruby resident set size (RSS) that triggers a memory restart (bytes)
- # max_rss = 200000000
-@@ -101,14 +101,14 @@ dir = "/home/git/gitaly/ruby"
- 
- [gitlab-shell]
- # The directory where gitlab-shell is installed
--dir = "/home/git/gitlab-shell"
-+dir = "/usr/share/webapps/gitlab-shell"
- 
- [hooks]
--custom_hooks_dir = "/home/git/custom_hooks"
-+custom_hooks_dir = "/var/lib/gitlab/custom_hooks"
- 
- [gitlab]
--secret_file = "/home/git/gitlab-shell/.gitlab_shell_secret"
--url = "http+unix://%2Fhome%2Fgit%2Fgitlab%2Ftmp%2Fsockets%2Fgitlab-workhorse.socket"
-+secret_file = "/etc/webapps/gitlab-shell/secret"
-+url = "http+unix://%2Frun%2Fgitlab%2Fgitlab.socket"
- # Only needed if a UNIX socket is used in `url` and GitLab is configured to
- # use a relative path (e.g. /gitlab).
- # relative_url_root = '/'

Copied: gitlab-gitaly/repos/community-x86_64/configs.patch (from rev 1264538, gitlab-gitaly/trunk/configs.patch)
===================================================================
--- configs.patch	                        (rev 0)
+++ configs.patch	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -0,0 +1,99 @@
+commit 9aef34b89229e115ebf7a8e86f2370e9b1a3f1e4
+Author: Anatol Pomozov <anatol.pomozov at gmail.com>
+Date:   Tue Jun 21 09:35:40 2022 -0700
+
+    Patch config files with Arch Linux specific locations
+    
+    Arch uses upstream's default config files as a base for its configs.
+    But directory structure at Arch is completely different from the default
+    one specified by gitlab project.
+    We used to have a lot of seds expressions to adjust the files but as
+    complexity of configs grew 'sed' makes it easy to miss a changed/added
+    option.
+    
+    Track set of diffs as a patch. If upstream modifies config file then it
+    will cause a conflict that needs to be reviewed manually.
+
+diff --git a/config.toml.example b/config.toml.example
+index 9a4753e1e..682083d8e 100644
+--- a/config.toml.example
++++ b/config.toml.example
+@@ -2,10 +2,10 @@
+ # Documentation lives at https://docs.gitlab.com/ee/administration/gitaly/ and
+ # https://docs.gitlab.com/ee//administration/gitaly/reference
+ 
+-socket_path = "/home/git/gitlab/tmp/sockets/private/gitaly.socket"
++socket_path = "/run/gitlab/gitlab-gitaly.socket"
+ 
+ # The directory where Gitaly's executables are stored
+-bin_dir = "/home/git/gitaly/_build/bin"
++bin_dir = "/usr/bin"
+ 
+ # # Optional: The directory where Gitaly can create all files required to
+ # # properly operate at runtime. If not set, Gitaly will create a directory in
+@@ -22,7 +22,7 @@ bin_dir = "/home/git/gitaly/_build/bin"
+ # # Optional: configure where the Gitaly creates the sockets for internal connections. If unset, Gitaly will create a randomly
+ # # named temp directory each time it boots.
+ # # Non Gitaly clients should never connect to these sockets.
+-# internal_socket_dir = "/home/git/gitlab/tmp/sockets/private/internal"
++# internal_socket_dir = "/run/gitlab/private"
+ 
+ # # Optional: authenticate Gitaly requests using a shared secret
+ # [auth]
+@@ -30,8 +30,8 @@ bin_dir = "/home/git/gitaly/_build/bin"
+ # transitioning = false # Set `transitioning` to true to temporarily allow unauthenticated while rolling out authentication.
+ 
+ # [tls]
+-# certificate_path = '/home/git/cert.cert'
+-# key_path = '/home/git/key.pem'
++# certificate_path = '/var/lib/gitlab/cert.cert'
++# key_path = '/var/lib/gitlab/key.pem'
+ 
+ # # Git settings
+ # [git]
+@@ -51,7 +51,7 @@ bin_dir = "/home/git/gitaly/_build/bin"
+ 
+ [[storage]]
+ name = "default"
+-path = "/home/git/repositories"
++path = "/var/lib/gitlab/repositories"
+ 
+ # # You can optionally configure more storages for this Gitaly instance to serve up
+ #
+@@ -63,7 +63,7 @@ path = "/home/git/repositories"
+ # # You can optionally configure Gitaly to output JSON-formatted log messages to stdout
+ # [logging]
+ # # The directory where Gitaly stores extra log files
+-dir = "/home/git/gitlab/log"
++dir = "/var/log/gitlab"
+ # format = "json"
+ # # Optional: Set log level to only log entries with that severity or above
+ # # One of, in order: debug, info, warn, errror, fatal, panic
+@@ -81,7 +81,7 @@ dir = "/home/git/gitlab/log"
+ 
+ [gitaly-ruby]
+ # The directory where gitaly-ruby is installed
+-dir = "/home/git/gitaly/ruby"
++dir = "/usr/share/webapps/gitlab-gitaly/ruby"
+ 
+ # # Gitaly-ruby resident set size (RSS) that triggers a memory restart (bytes)
+ # max_rss = 200000000
+@@ -101,14 +101,14 @@ dir = "/home/git/gitaly/ruby"
+ 
+ [gitlab-shell]
+ # The directory where gitlab-shell is installed
+-dir = "/home/git/gitlab-shell"
++dir = "/usr/share/webapps/gitlab-shell"
+ 
+ [hooks]
+-custom_hooks_dir = "/home/git/custom_hooks"
++custom_hooks_dir = "/var/lib/gitlab/custom_hooks"
+ 
+ [gitlab]
+-secret_file = "/home/git/gitlab-shell/.gitlab_shell_secret"
+-url = "http+unix://%2Fhome%2Fgit%2Fgitlab%2Ftmp%2Fsockets%2Fgitlab-workhorse.socket"
++secret_file = "/etc/webapps/gitlab-shell/secret"
++url = "http+unix://%2Frun%2Fgitlab%2Fgitlab.socket"
+ # Only needed if a UNIX socket is used in `url` and GitLab is configured to
+ # use a relative path (e.g. /gitlab).
+ # relative_url_root = '/'

Deleted: gitlab-gitaly.service
===================================================================
--- gitlab-gitaly.service	2022-08-09 19:45:28 UTC (rev 1264538)
+++ gitlab-gitaly.service	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -1,14 +0,0 @@
-[Unit]
-Description=Gitaly is a Git RPC service for handling all the git calls made by GitLab.
-
-[Service]
-Type=simple
-User=gitlab
-Group=gitlab
-WorkingDirectory=/usr/share/webapps/gitlab
-SyslogIdentifier=gitlab-gitaly
-PIDFile=/run/gitlab/gitaly.pid
-ExecStart=/usr/bin/gitaly /etc/gitlab-gitaly/config.toml
-
-[Install]
-WantedBy=multi-user.target

Copied: gitlab-gitaly/repos/community-x86_64/gitlab-gitaly.service (from rev 1264538, gitlab-gitaly/trunk/gitlab-gitaly.service)
===================================================================
--- gitlab-gitaly.service	                        (rev 0)
+++ gitlab-gitaly.service	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -0,0 +1,14 @@
+[Unit]
+Description=Gitaly is a Git RPC service for handling all the git calls made by GitLab.
+
+[Service]
+Type=simple
+User=gitlab
+Group=gitlab
+WorkingDirectory=/usr/share/webapps/gitlab
+SyslogIdentifier=gitlab-gitaly
+PIDFile=/run/gitlab/gitaly.pid
+ExecStart=/usr/bin/gitaly /etc/gitlab-gitaly/config.toml
+
+[Install]
+WantedBy=multi-user.target

Deleted: ruby27.patch
===================================================================
--- ruby27.patch	2022-08-09 19:45:28 UTC (rev 1264538)
+++ ruby27.patch	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -1,107 +0,0 @@
-commit 97a8954f6d7764a0f010875093395d42578e309f
-Author: Anatol Pomozov <anatol.pomozov at gmail.com>
-Date:   Tue Jun 21 09:37:26 2022 -0700
-
-    Pin sources to ruby2.7 package
-
-diff --git a/Makefile b/Makefile
-index 117498e19..74e3254ec 100644
---- a/Makefile
-+++ b/Makefile
-@@ -374,7 +374,7 @@ race-go: test-go
- .PHONY: rspec
- ## Run Ruby tests.
- rspec: 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
- 
- # This is a workaround for our unprivileged CI builds. We manually execute the
- # build target as privileged user, but then run the rspec target unprivileged.
-@@ -425,7 +425,7 @@ clean-ruby-vendor-go:
- .PHONY: rubocop
- ## Run Rubocop.
- rubocop: ${SOURCE_DIR}/.ruby-bundle
--	${Q}cd ${GITALY_RUBY_DIR} && bundle exec rubocop --parallel --config ${GITALY_RUBY_DIR}/.rubocop.yml ${GITALY_RUBY_DIR} ${SOURCE_DIR}/_support/test-boot
-+	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 exec rubocop --parallel --config ${GITALY_RUBY_DIR}/.rubocop.yml ${GITALY_RUBY_DIR} ${SOURCE_DIR}/_support/test-boot
- 
- .PHONY: cover
- ## Generate coverage report via Go tests.
-@@ -497,7 +497,9 @@ 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 install
-+	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 config set --local deployment "true"
-+	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 config # for debugging
-+	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 install
- 	${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 4ac9abfd2..29b6add09 100644
---- a/internal/gitaly/linguist/linguist.go
-+++ b/internal/gitaly/linguist/linguist.go
-@@ -87,7 +87,7 @@ func (inst *Instance) Color(language string) string {
- }
- 
- func (inst *Instance) startGitLinguist(ctx context.Context, repoPath string, commitID string) (*command.Command, error) {
--	bundle, err := exec.LookPath("bundle")
-+	bundle, err := exec.LookPath("bundle-2.7")
- 	if err != nil {
- 		return nil, fmt.Errorf("finding bundle executable: %w", err)
- 	}
-@@ -127,7 +127,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 5ac213e72..5d71ddeed 100644
---- a/internal/gitaly/rubyserver/rubyserver.go
-+++ b/internal/gitaly/rubyserver/rubyserver.go
-@@ -190,7 +190,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 c0f17b1e5..31121e12e 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.
- 

Copied: gitlab-gitaly/repos/community-x86_64/ruby27.patch (from rev 1264538, gitlab-gitaly/trunk/ruby27.patch)
===================================================================
--- ruby27.patch	                        (rev 0)
+++ ruby27.patch	2022-08-09 19:46:48 UTC (rev 1264539)
@@ -0,0 +1,107 @@
+commit 97a8954f6d7764a0f010875093395d42578e309f
+Author: Anatol Pomozov <anatol.pomozov at gmail.com>
+Date:   Tue Jun 21 09:37:26 2022 -0700
+
+    Pin sources to ruby2.7 package
+
+diff --git a/Makefile b/Makefile
+index 117498e19..74e3254ec 100644
+--- a/Makefile
++++ b/Makefile
+@@ -374,7 +374,7 @@ race-go: test-go
+ .PHONY: rspec
+ ## Run Ruby tests.
+ rspec: 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
+ 
+ # This is a workaround for our unprivileged CI builds. We manually execute the
+ # build target as privileged user, but then run the rspec target unprivileged.
+@@ -425,7 +425,7 @@ clean-ruby-vendor-go:
+ .PHONY: rubocop
+ ## Run Rubocop.
+ rubocop: ${SOURCE_DIR}/.ruby-bundle
+-	${Q}cd ${GITALY_RUBY_DIR} && bundle exec rubocop --parallel --config ${GITALY_RUBY_DIR}/.rubocop.yml ${GITALY_RUBY_DIR} ${SOURCE_DIR}/_support/test-boot
++	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 exec rubocop --parallel --config ${GITALY_RUBY_DIR}/.rubocop.yml ${GITALY_RUBY_DIR} ${SOURCE_DIR}/_support/test-boot
+ 
+ .PHONY: cover
+ ## Generate coverage report via Go tests.
+@@ -497,7 +497,9 @@ 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 install
++	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 config set --local deployment "true"
++	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 config # for debugging
++	${Q}cd ${GITALY_RUBY_DIR} && bundle-2.7 install
+ 	${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 4ac9abfd2..29b6add09 100644
+--- a/internal/gitaly/linguist/linguist.go
++++ b/internal/gitaly/linguist/linguist.go
+@@ -87,7 +87,7 @@ func (inst *Instance) Color(language string) string {
+ }
+ 
+ func (inst *Instance) startGitLinguist(ctx context.Context, repoPath string, commitID string) (*command.Command, error) {
+-	bundle, err := exec.LookPath("bundle")
++	bundle, err := exec.LookPath("bundle-2.7")
+ 	if err != nil {
+ 		return nil, fmt.Errorf("finding bundle executable: %w", err)
+ 	}
+@@ -127,7 +127,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 5ac213e72..5d71ddeed 100644
+--- a/internal/gitaly/rubyserver/rubyserver.go
++++ b/internal/gitaly/rubyserver/rubyserver.go
+@@ -190,7 +190,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 c0f17b1e5..31121e12e 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