summarylogtreecommitdiffstats
path: root/ruby27.patch
blob: 926a62c865a905ad902bd3c87623d1b70420239c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
diff '--color=auto' -Naur a/cmd/gitaly-backup/restore_test.go b/cmd/gitaly-backup/restore_test.go
--- a/cmd/gitaly-backup/restore_test.go	2022-06-23 06:19:25.280429169 +1000
+++ b/cmd/gitaly-backup/restore_test.go	2022-06-23 06:19:52.068493851 +1000
@@ -34,7 +34,7 @@
 
 	path := testhelper.TempDir(t)
 	existingRepoBundlePath := filepath.Join(path, existingRepo.RelativePath+".bundle")
-	gittest.Exec(t, cfg, "-C", existRepoPath, "bundle", "create", existingRepoBundlePath, "--all")
+	gittest.Exec(t, cfg, "-C", existRepoPath, "bundle-2.7", "create", existingRepoBundlePath, "--all")
 
 	repos := []*gitalypb.Repository{existingRepo}
 	for i := 0; i < 2; i++ {
@@ -77,7 +77,7 @@
 		repoPath := filepath.Join(cfg.Storages[0].Path, gittest.GetReplicaPath(ctx, t, cfg, repo))
 		bundlePath := filepath.Join(path, repo.RelativePath+".bundle")
 
-		output := gittest.Exec(t, cfg, "-C", repoPath, "bundle", "verify", bundlePath)
+		output := gittest.Exec(t, cfg, "-C", repoPath, "bundle-2.7", "verify", bundlePath)
 		require.Contains(t, string(output), "The bundle records a complete history")
 	}
 }
diff '--color=auto' -Naur a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml	2022-06-23 06:19:25.276429156 +1000
+++ b/.gitlab-ci.yml	2022-06-23 06:19:52.068493851 +1000
@@ -261,7 +261,7 @@
   <<: *test_definition
   script:
     - make -j$(nproc)
-    - ruby -rerb -e 'ERB.new(ARGF.read).run' _support/config.praefect.toml.ci-sql-test.erb > config.praefect.toml
+    - ruby-2.7 -rerb -e 'ERB.new(ARGF.read).run' _support/config.praefect.toml.ci-sql-test.erb > config.praefect.toml
     - ./_build/bin/praefect -config config.praefect.toml sql-ping
     - ./_build/bin/praefect -config config.praefect.toml sql-migrate
 
diff '--color=auto' -Naur a/internal/gitaly/linguist/linguist.go b/internal/gitaly/linguist/linguist.go
--- a/internal/gitaly/linguist/linguist.go	2022-06-23 06:19:25.292429197 +1000
+++ b/internal/gitaly/linguist/linguist.go	2022-06-23 06:22:31.868898445 +1000
@@ -87,7 +87,7 @@
 }
 
 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 @@
 	// 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 '--color=auto' -Naur a/internal/gitaly/rubyserver/rubyserver.go b/internal/gitaly/rubyserver/rubyserver.go
--- a/internal/gitaly/rubyserver/rubyserver.go	2022-06-23 06:19:25.296429207 +1000
+++ b/internal/gitaly/rubyserver/rubyserver.go	2022-06-23 06:19:52.072493863 +1000
@@ -190,7 +190,7 @@
 		// 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 '--color=auto' -Naur a/internal/gitaly/service/repository/create_bundle_from_ref_list_test.go b/internal/gitaly/service/repository/create_bundle_from_ref_list_test.go
--- a/internal/gitaly/service/repository/create_bundle_from_ref_list_test.go	2022-06-23 06:19:25.304429227 +1000
+++ b/internal/gitaly/service/repository/create_bundle_from_ref_list_test.go	2022-06-23 06:19:52.072493863 +1000
@@ -62,7 +62,7 @@
 
 	require.NoError(t, bundle.Close())
 
-	output := gittest.Exec(t, cfg, "-C", repoPath, "bundle", "verify", bundle.Name())
+	output := gittest.Exec(t, cfg, "-C", repoPath, "bundle-2.7", "verify", bundle.Name())
 
 	require.Contains(t, string(output), fmt.Sprintf("The bundle contains this ref:\n%s refs/heads/master", masterOID))
 }
@@ -100,7 +100,7 @@
 
 	require.NoError(t, bundle.Close())
 
-	output := gittest.Exec(t, cfg, "-C", repoPath, "bundle", "verify", bundle.Name())
+	output := gittest.Exec(t, cfg, "-C", repoPath, "bundle-2.7", "verify", bundle.Name())
 
 	require.Contains(t, string(output), fmt.Sprintf("The bundle contains this ref:\n%s refs/heads/master", masterOID))
 }
diff '--color=auto' -Naur a/internal/gitaly/service/repository/create_bundle_test.go b/internal/gitaly/service/repository/create_bundle_test.go
--- a/internal/gitaly/service/repository/create_bundle_test.go	2022-06-23 06:19:25.304429227 +1000
+++ b/internal/gitaly/service/repository/create_bundle_test.go	2022-06-23 06:19:52.072493863 +1000
@@ -55,7 +55,7 @@
 	_, err = io.Copy(dstFile, reader)
 	require.NoError(t, err)
 
-	output := gittest.Exec(t, cfg, "-C", repoPath, "bundle", "verify", dstFile.Name())
+	output := gittest.Exec(t, cfg, "-C", repoPath, "bundle-2.7", "verify", dstFile.Name())
 	// Extra sanity; running verify should fail on bad bundles
 	require.Contains(t, string(output), "The bundle records a complete history")
 }
diff '--color=auto' -Naur a/internal/gitaly/service/repository/create_repository_from_bundle_test.go b/internal/gitaly/service/repository/create_repository_from_bundle_test.go
--- a/internal/gitaly/service/repository/create_repository_from_bundle_test.go	2022-06-23 06:19:25.304429227 +1000
+++ b/internal/gitaly/service/repository/create_repository_from_bundle_test.go	2022-06-23 06:19:52.072493863 +1000
@@ -44,7 +44,7 @@
 	const wantDefaultBranch = "refs/heads/markdown"
 	gittest.Exec(t, cfg, "-C", repoPath, "symbolic-ref", "HEAD", wantDefaultBranch)
 
-	gittest.Exec(t, cfg, "-C", repoPath, "bundle", "create", bundlePath, "--all")
+	gittest.Exec(t, cfg, "-C", repoPath, "bundle-2.7", "create", bundlePath, "--all")
 	defer func() { require.NoError(t, os.RemoveAll(bundlePath)) }()
 
 	stream, err := client.CreateRepositoryFromBundle(ctx)
@@ -131,7 +131,7 @@
 		},
 	}))
 
-	bundle := gittest.Exec(t, cfg, "-C", repoPath, "bundle", "create", "-",
+	bundle := gittest.Exec(t, cfg, "-C", repoPath, "bundle-2.7", "create", "-",
 		"refs/heads/master", "refs/heads/feature", "refs/keep-around/1", "refs/keep-around/2")
 	require.Greater(t, len(bundle), 100*1024)
 
diff '--color=auto' -Naur a/internal/gitaly/service/repository/fetch_bundle_test.go b/internal/gitaly/service/repository/fetch_bundle_test.go
--- a/internal/gitaly/service/repository/fetch_bundle_test.go	2022-06-23 06:19:25.304429227 +1000
+++ b/internal/gitaly/service/repository/fetch_bundle_test.go	2022-06-23 06:19:52.072493863 +1000
@@ -34,7 +34,7 @@
 	bundlePath := filepath.Join(tmp, "test.bundle")
 
 	gittest.Exec(t, cfg, "-C", repoPath, "symbolic-ref", "HEAD", "refs/heads/feature")
-	gittest.Exec(t, cfg, "-C", repoPath, "bundle", "create", bundlePath, "--all")
+	gittest.Exec(t, cfg, "-C", repoPath, "bundle-2.7", "create", bundlePath, "--all")
 	expectedRefs := gittest.Exec(t, cfg, "-C", repoPath, "show-ref", "--head")
 
 	targetRepo, targetRepoPath := gittest.CreateRepository(ctx, t, cfg)
diff '--color=auto' -Naur a/Makefile b/Makefile
--- a/Makefile	2022-06-23 06:19:25.276429156 +1000
+++ b/Makefile	2022-06-23 06:19:52.072493863 +1000
@@ -374,7 +374,7 @@
 .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 @@
 .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,7 @@
 # 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 install
 	${Q}touch $@
 
 ${SOURCE_DIR}/NOTICE: ${BUILD_DIR}/NOTICE
diff '--color=auto' -Naur a/ruby/bin/gitaly-ruby b/ruby/bin/gitaly-ruby
--- a/ruby/bin/gitaly-ruby	2022-06-23 06:19:25.316429255 +1000
+++ b/ruby/bin/gitaly-ruby	2022-06-23 06:19:52.072493863 +1000
@@ -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 '--color=auto' -Naur a/ruby/bin/ruby-cd b/ruby/bin/ruby-cd
--- a/ruby/bin/ruby-cd	2022-06-23 06:19:25.316429255 +1000
+++ b/ruby/bin/ruby-cd	2022-06-23 06:19:52.072493863 +1000
@@ -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.
 
diff '--color=auto' -Naur a/ruby/spec/lib/gitlab/git/popen_spec.rb b/ruby/spec/lib/gitlab/git/popen_spec.rb
--- a/ruby/spec/lib/gitlab/git/popen_spec.rb	2022-06-23 06:19:25.320429265 +1000
+++ b/ruby/spec/lib/gitlab/git/popen_spec.rb	2022-06-23 06:19:52.072493863 +1000
@@ -40,7 +40,7 @@
     end
 
     context 'when stderr is included' do
-      let(:result) { klass.new.popen(['ruby', '-e', 'warn "hello world"'], path, include_stderr: true) }
+      let(:result) { klass.new.popen(['ruby-2.7', '-e', 'warn "hello world"'], path, include_stderr: true) }
       let(:output) { result.first }
       let(:status) { result.last }
 
diff '--color=auto' -Naur a/_support/generate-proto-ruby b/_support/generate-proto-ruby
--- a/_support/generate-proto-ruby	2022-06-23 06:19:25.280429169 +1000
+++ b/_support/generate-proto-ruby	2022-06-23 06:19:52.072493863 +1000
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#!/usr/bin/env ruby-2.7
 
 require 'erb'
 require 'fileutils'
@@ -20,7 +20,7 @@
     # 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