Skip to content

Commit a83b007

Browse files
Sophie Wigmorerobdimsdale
authored andcommitted
enable bundler 1.17 fixture to build successfully
1 parent fb254c5 commit a83b007

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

bundle_install_process.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,19 @@ func (ip BundleInstallProcess) Execute(workingDir, layerPath string, config map[
183183
}
184184

185185
buffer := bytes.NewBuffer(nil)
186+
errorBuffer := bytes.NewBuffer(nil)
186187
args := []string{"config", "--global", "cache_path", "--parseable"}
187188

188189
ip.logger.Subprocess("Running 'bundle %s'", strings.Join(args, " "))
189190

190191
err = ip.executable.Execute(pexec.Execution{
191192
Args: args,
192193
Stdout: buffer,
193-
Stderr: buffer,
194+
Stderr: errorBuffer,
194195
Env: env,
195196
})
196197
if err != nil {
197-
return fmt.Errorf("failed to execute bundle config output:\n%s\nerror: %s", buffer.String(), err)
198+
return fmt.Errorf("failed to execute bundle config output:\n%s\nerror: %s", errorBuffer.String(), err)
198199
}
199200

200201
cachePath := filepath.Join("vendor", "cache")

integration/simple_app_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,16 @@ func testSimpleApp(t *testing.T, context spec.G, it spec.S) {
224224
source, err = occam.Source(filepath.Join("testdata", "bundler_version_1_17"))
225225
Expect(err).NotTo(HaveOccurred())
226226

227+
// must build with MRI 3.0 or 3.1, as some Bundler 1.17 code is not compatible with Ruby 3.2
228+
// for example: `/usr/local/bundle/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.`
227229
image, logs, err = pack.WithVerbose().Build.
228230
WithBuildpacks(
229231
settings.Buildpacks.MRI.Online,
230232
settings.Buildpacks.Bundler.Online,
231233
settings.Buildpacks.BundleInstall.Online,
232234
settings.Buildpacks.BundleList.Online,
233235
).
236+
WithEnv(map[string]string{"BP_MRI_VERSION": "3.1"}).
234237
WithPullPolicy("never").
235238
Execute(name, source)
236239
Expect(err).NotTo(HaveOccurred())
@@ -269,13 +272,17 @@ func testSimpleApp(t *testing.T, context spec.G, it spec.S) {
269272

270273
Expect(logs).To(ContainLines(
271274
"Paketo Buildpack for Bundle List",
275+
))
276+
Expect(logs).To(ContainLines(
272277
" Gems included by the bundle:",
273278
MatchRegexp(` \* bundler`),
274279
MatchRegexp(` \* coderay`),
275280
MatchRegexp(` \* diff-lcs`),
276281
MatchRegexp(` \* method_source`),
277282
MatchRegexp(` \* mustermann`),
283+
MatchRegexp(` \* nio4r`),
278284
MatchRegexp(` \* pry`),
285+
MatchRegexp(` \* puma`),
279286
MatchRegexp(` \* rack`),
280287
MatchRegexp(` \* rack-protection`),
281288
MatchRegexp(` \* rspec`),
@@ -327,6 +334,8 @@ func testSimpleApp(t *testing.T, context spec.G, it spec.S) {
327334
"Gems included by the bundle:",
328335
MatchRegexp(` \* bundler`),
329336
MatchRegexp(` \* mustermann`),
337+
MatchRegexp(` \* nio4r`),
338+
MatchRegexp(` \* puma`),
330339
MatchRegexp(` \* rack`),
331340
MatchRegexp(` \* rack-protection`),
332341
MatchRegexp(` \* ruby2_keywords`),

integration/testdata/bundler_version_1_17/Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
source 'https://rubygems.org'
22

3-
ruby '~> 3.1'
3+
ruby '~> 3.0'
44

55
gem 'sinatra', '~>2.1.0'
6+
gem 'puma'
67

78
group :development do
89
gem 'pry'

integration/testdata/bundler_version_1_17/Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ GEM
66
method_source (1.0.0)
77
mustermann (1.1.1)
88
ruby2_keywords (~> 0.0.1)
9+
nio4r (2.5.9)
910
pry (0.14.0)
1011
coderay (~> 1.1)
1112
method_source (~> 1.0)
13+
puma (6.2.1)
14+
nio4r (~> 2.0)
1215
rack (2.2.3)
1316
rack-protection (2.1.0)
1417
rack
@@ -38,6 +41,7 @@ PLATFORMS
3841

3942
DEPENDENCIES
4043
pry
44+
puma
4145
rspec
4246
sinatra (~> 2.1.0)
4347

0 commit comments

Comments
 (0)