Skip to content

Commit 16fc596

Browse files
authored
Merge pull request #1099 from cloudfoundry/pr-by-releng-bot-1769608601
Updating version for bundler for 2.X.X
2 parents ece1f30 + ebc60e8 commit 16fc596

7 files changed

Lines changed: 109 additions & 96 deletions

File tree

fixtures/default/rails7/Gemfile.lock

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ GEM
8686
drb (2.2.3)
8787
erb (6.0.1)
8888
erubi (1.13.1)
89+
ffi (1.17.3-aarch64-linux-gnu)
90+
ffi (1.17.3-aarch64-linux-musl)
91+
ffi (1.17.3-arm-linux-gnu)
92+
ffi (1.17.3-arm-linux-musl)
93+
ffi (1.17.3-arm64-darwin)
94+
ffi (1.17.3-x86_64-darwin)
8995
ffi (1.17.3-x86_64-linux-gnu)
96+
ffi (1.17.3-x86_64-linux-musl)
9097
globalid (1.3.0)
9198
activesupport (>= 6.1)
9299
i18n (1.14.8)
@@ -120,12 +127,26 @@ GEM
120127
net-smtp (0.5.1)
121128
net-protocol
122129
nio4r (2.7.5)
130+
nokogiri (1.19.0-aarch64-linux-gnu)
131+
racc (~> 1.4)
132+
nokogiri (1.19.0-aarch64-linux-musl)
133+
racc (~> 1.4)
134+
nokogiri (1.19.0-arm-linux-gnu)
135+
racc (~> 1.4)
136+
nokogiri (1.19.0-arm-linux-musl)
137+
racc (~> 1.4)
138+
nokogiri (1.19.0-arm64-darwin)
139+
racc (~> 1.4)
140+
nokogiri (1.19.0-x86_64-darwin)
141+
racc (~> 1.4)
123142
nokogiri (1.19.0-x86_64-linux-gnu)
124143
racc (~> 1.4)
144+
nokogiri (1.19.0-x86_64-linux-musl)
145+
racc (~> 1.4)
125146
pp (0.6.3)
126147
prettyprint
127148
prettyprint (0.2.0)
128-
prism (1.8.0)
149+
prism (1.9.0)
129150
psych (5.3.1)
130151
date
131152
stringio
@@ -220,7 +241,14 @@ GEM
220241
zeitwerk (2.7.4)
221242

222243
PLATFORMS
223-
x86_64-linux
244+
aarch64-linux-gnu
245+
aarch64-linux-musl
246+
arm-linux-gnu
247+
arm-linux-musl
248+
arm64-darwin
249+
x86_64-darwin
250+
x86_64-linux-gnu
251+
x86_64-linux-musl
224252

225253
DEPENDENCIES
226254
puma (~> 6.0)
@@ -232,4 +260,4 @@ RUBY VERSION
232260
ruby 3.2.9p265
233261

234262
BUNDLED WITH
235-
2.4.19
263+
2.7.2

fixtures/default/relative_gemspec_path/Gemfile.lock

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,34 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
specs:
9-
mustermann (3.0.0)
9+
base64 (0.3.0)
10+
logger (1.7.0)
11+
mustermann (3.0.4)
1012
ruby2_keywords (~> 0.0.1)
11-
rack (2.2.8)
12-
rack-protection (3.0.6)
13-
rack
14-
rackup (1.0.1)
15-
rack (< 3)
16-
webrick
13+
rack (3.2.4)
14+
rack-protection (4.2.1)
15+
base64 (>= 0.1.0)
16+
logger (>= 1.6.0)
17+
rack (>= 3.0.0, < 4)
18+
rack-session (2.1.1)
19+
base64 (>= 0.1.0)
20+
rack (>= 3.0.0)
21+
rackup (2.3.1)
22+
rack (>= 3)
1723
ruby2_keywords (0.0.5)
18-
sinatra (3.0.6)
24+
sinatra (4.2.1)
25+
logger (>= 1.6.0)
1926
mustermann (~> 3.0)
20-
rack (~> 2.2, >= 2.2.4)
21-
rack-protection (= 3.0.6)
27+
rack (>= 3.0.0, < 4)
28+
rack-protection (= 4.2.1)
29+
rack-session (>= 2.0.0, < 3)
2230
tilt (~> 2.0)
23-
tilt (2.2.0)
24-
webrick (1.8.1)
31+
tilt (2.7.0)
32+
webrick (1.9.2)
2533

2634
PLATFORMS
2735
ruby
36+
x86_64-linux
2837

2938
DEPENDENCIES
3039
hola!
@@ -33,7 +42,7 @@ DEPENDENCIES
3342
webrick
3443

3544
RUBY VERSION
36-
ruby 3.2.0p0
45+
ruby 3.2.9p265
3746

3847
BUNDLED WITH
39-
2.4.1
48+
2.7.2
Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
mustermann (3.0.0)
4+
base64 (0.3.0)
5+
logger (1.7.0)
6+
mustermann (3.0.4)
57
ruby2_keywords (~> 0.0.1)
6-
rack (2.2.8)
7-
rack-protection (3.1.0)
8-
rack (~> 2.2, >= 2.2.4)
9-
rackup (1.0.1)
10-
rack (< 3)
11-
webrick
8+
rack (3.2.4)
9+
rack-protection (4.2.1)
10+
base64 (>= 0.1.0)
11+
logger (>= 1.6.0)
12+
rack (>= 3.0.0, < 4)
13+
rack-session (2.1.1)
14+
base64 (>= 0.1.0)
15+
rack (>= 3.0.0)
16+
rackup (2.3.1)
17+
rack (>= 3)
1218
ruby2_keywords (0.0.5)
13-
sinatra (3.1.0)
19+
sinatra (4.2.1)
20+
logger (>= 1.6.0)
1421
mustermann (~> 3.0)
15-
rack (~> 2.2, >= 2.2.4)
16-
rack-protection (= 3.1.0)
22+
rack (>= 3.0.0, < 4)
23+
rack-protection (= 4.2.1)
24+
rack-session (>= 2.0.0, < 3)
1725
tilt (~> 2.0)
18-
tilt (2.3.0)
19-
webrick (1.8.1)
26+
tilt (2.7.0)
27+
webrick (1.9.2)
2028

2129
PLATFORMS
2230
ruby
31+
x86_64-linux
2332

2433
DEPENDENCIES
2534
rackup
2635
sinatra
2736
webrick
2837

2938
RUBY VERSION
30-
ruby 3.2.0p0
39+
ruby 3.2.9p265
3140

3241
BUNDLED WITH
33-
2.4.1
42+
2.7.2
Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
mustermann (3.0.0)
4+
base64 (0.3.0)
5+
logger (1.7.0)
6+
mustermann (3.0.4)
57
ruby2_keywords (~> 0.0.1)
6-
rack (2.2.8)
7-
rack-protection (3.1.0)
8-
rack (~> 2.2, >= 2.2.4)
9-
rackup (1.0.1)
10-
rack (< 3)
11-
webrick
8+
rack (3.2.4)
9+
rack-protection (4.2.1)
10+
base64 (>= 0.1.0)
11+
logger (>= 1.6.0)
12+
rack (>= 3.0.0, < 4)
13+
rack-session (2.1.1)
14+
base64 (>= 0.1.0)
15+
rack (>= 3.0.0)
16+
rackup (2.3.1)
17+
rack (>= 3)
1218
ruby2_keywords (0.0.5)
13-
sinatra (3.1.0)
19+
sinatra (4.2.1)
20+
logger (>= 1.6.0)
1421
mustermann (~> 3.0)
15-
rack (~> 2.2, >= 2.2.4)
16-
rack-protection (= 3.1.0)
22+
rack (>= 3.0.0, < 4)
23+
rack-protection (= 4.2.1)
24+
rack-session (>= 2.0.0, < 3)
1725
tilt (~> 2.0)
18-
tilt (2.3.0)
19-
webrick (1.8.1)
26+
tilt (2.7.0)
27+
webrick (1.9.2)
2028

2129
PLATFORMS
2230
ruby
31+
x86_64-linux
2332

2433
DEPENDENCIES
2534
rackup
2635
sinatra
2736
webrick
2837

2938
RUBY VERSION
30-
ruby 3.4.2p28
39+
ruby 3.2.9p265
3140

3241
BUNDLED WITH
33-
2.6.2
42+
2.7.2

manifest.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ dependencies:
3232
- cflinuxfs3
3333
source: https://github.com/rubygems/rubygems/tree/master/bundlertree/v2.6.5
3434
source_sha256: 9d0eef5779ee569c43f317484f034081f58e9cf7529af6cd59d15266e46a72a3
35+
- name: bundler
36+
version: 2.7.2
37+
uri: https://buildpacks.cloudfoundry.org/dependencies/bundler/bundler_2.7.2_linux_noarch_any-stack_54c53519.tgz
38+
sha256: 54c53519ff41ac0ad0d498086039f6ee2eac5d1bdef5ad31ab33e8ab2c2b1e21
39+
cf_stacks:
40+
- cflinuxfs4
41+
source: https://github.com/rubygems/rubygems/tree/master/bundlertree/v2.7.2
42+
source_sha256: 1decaf9e2e1acb91b6586a2925c8f3f6da2334a82731a62ff2ded1b83c283871
3543
- name: jruby
3644
version: 9.4.8.0
3745
uri: https://buildpacks.cloudfoundry.org/dependencies/jruby/jruby_9.4.8.0-ruby-3.1_linux_x64_cflinuxfs3_70896f95.tgz

src/ruby/supply/supply.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -768,10 +768,6 @@ func (s *Supplier) InstallGems() error {
768768
return err
769769
}
770770

771-
if err := s.regenerateBundlerBinStub(tempDir); err != nil {
772-
return err
773-
}
774-
775771
s.Log.Info("Cleaning up the bundler cache.")
776772
cmd = exec.Command("bundle", "clean")
777773
cmd.Dir = tempDir
@@ -845,18 +841,6 @@ func (s *Supplier) removeIncompatibleBundledWithVersion(bundledWithVersion strin
845841
return os.WriteFile(gemfileLockPath, output, 0666)
846842
}
847843

848-
func (s *Supplier) regenerateBundlerBinStub(appDir string) error {
849-
s.Log.BeginStep("Regenerating bundler binstubs...")
850-
cmd := exec.Command("bundle", "binstubs", "bundler", "--force", "--path", filepath.Join(s.Stager.DepDir(), "binstubs"))
851-
cmd.Dir = appDir
852-
cmd.Stdout = text.NewIndentWriter(os.Stdout, []byte(" "))
853-
cmd.Stderr = text.NewIndentWriter(os.Stderr, []byte(" "))
854-
if err := s.Command.Run(cmd); err != nil {
855-
return err
856-
}
857-
return libbuildpack.CopyFile(filepath.Join(s.Stager.DepDir(), "binstubs", "bundle"), filepath.Join(s.Stager.DepDir(), "bin", "bundle"))
858-
}
859-
860844
func (s *Supplier) EnableLDLibraryPathEnv() error {
861845
if exists, err := libbuildpack.FileExists(filepath.Join(s.Stager.BuildDir(), "ld_library_path")); err != nil {
862846
return err

src/ruby/supply/supply_test.go

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88
"os/exec"
99
"path/filepath"
1010

11-
"reflect"
12-
1311
"github.com/cloudfoundry/ruby-buildpack/src/ruby/cache"
1412
"github.com/cloudfoundry/ruby-buildpack/src/ruby/supply"
1513

@@ -481,32 +479,13 @@ var _ = Describe("Supply", func() {
481479

482480
const windowsWarning = "**WARNING** Windows line endings detected in Gemfile. Your app may fail to stage. Please use UNIX line endings."
483481

484-
handleBundleBinstubRegeneration := func(cmd *exec.Cmd) error {
485-
if len(cmd.Args) > 5 && reflect.DeepEqual(cmd.Args[0:5], []string{"bundle", "binstubs", "bundler", "--force", "--path"}) {
486-
Expect(cmd.Args[5]).To(HavePrefix(filepath.Join(depsDir, depsIdx)))
487-
Expect(os.MkdirAll(cmd.Args[5], 0755)).To(Succeed())
488-
Expect(os.WriteFile(filepath.Join(cmd.Args[5], "bundle"), []byte("new bundle binstub"), 0644)).To(Succeed())
489-
}
490-
return nil
491-
}
492-
493-
itRegeneratesBundleBinstub := func() {
494-
It("Re-generates the bundler binstub to replace older, rails-generated ones that are incompatible with bundler > 1.16.0", func() {
495-
Expect(supplier.InstallGems()).To(Succeed())
496-
Expect(os.ReadFile(filepath.Join(depsDir, depsIdx, "binstubs", "bundle"))).To(Equal([]byte("new bundle binstub")))
497-
Expect(os.ReadFile(filepath.Join(depsDir, depsIdx, "bin", "bundle"))).To(Equal([]byte("new bundle binstub")))
498-
})
499-
}
500-
501482
Context("Windows Gemfile", func() {
502483
BeforeEach(func() {
503484
mockVersions.EXPECT().HasWindowsGemfileLock().Return(false, nil)
504-
mockCommand.EXPECT().Run(gomock.Any()).AnyTimes().Do(handleBundleBinstubRegeneration)
485+
mockCommand.EXPECT().Run(gomock.Any()).AnyTimes()
505486
Expect(os.WriteFile(filepath.Join(buildDir, "Gemfile"), []byte("source \"https://rubygems.org\"\r\ngem \"rack\"\r\n"), 0644)).To(Succeed())
506487
})
507488

508-
itRegeneratesBundleBinstub()
509-
510489
It("Warns the user", func() {
511490
Expect(supplier.InstallGems()).To(Succeed())
512491
Expect(buffer.String()).To(ContainSubstring(windowsWarning))
@@ -521,10 +500,7 @@ var _ = Describe("Supply", func() {
521500
if len(cmd.Args) > 2 && cmd.Args[1] == "install" {
522501
Expect(os.MkdirAll(filepath.Join(cmd.Dir, ".bundle"), 0755)).To(Succeed())
523502
Expect(os.WriteFile(filepath.Join(cmd.Dir, ".bundle", "config"), []byte("new bundle config"), 0644)).To(Succeed())
524-
} else {
525-
return handleBundleBinstubRegeneration(cmd)
526503
}
527-
528504
return nil
529505
})
530506
Expect(os.WriteFile(filepath.Join(buildDir, "Gemfile"), []byte("source \"https://rubygems.org\"\ngem \"rack\"\n"), 0644)).To(Succeed())
@@ -534,8 +510,6 @@ var _ = Describe("Supply", func() {
534510
os.Unsetenv("BUNDLE_CONFIG")
535511
})
536512

537-
itRegeneratesBundleBinstub()
538-
539513
It("Does not warn the user", func() {
540514
Expect(supplier.InstallGems()).To(Succeed())
541515
Expect(buffer.String()).ToNot(ContainSubstring(windowsWarning))
@@ -572,8 +546,6 @@ var _ = Describe("Supply", func() {
572546
if cmd.Args[1] == "install" {
573547
Expect(filepath.Join(cmd.Dir, "Gemfile")).To(BeAnExistingFile())
574548
Expect(filepath.Join(cmd.Dir, "Gemfile.lock")).To(BeAnExistingFile())
575-
} else {
576-
handleBundleBinstubRegeneration(cmd)
577549
}
578550
})
579551
Expect(supplier.InstallGems()).To(Succeed())
@@ -588,8 +560,6 @@ var _ = Describe("Supply", func() {
588560
if cmd.Args[1] == "install" {
589561
Expect(cmd.Dir).ToNot(Equal(buildDir))
590562
installCalled = true
591-
} else {
592-
handleBundleBinstubRegeneration(cmd)
593563
}
594564
})
595565
Expect(supplier.InstallGems()).To(Succeed())
@@ -614,8 +584,6 @@ var _ = Describe("Supply", func() {
614584
Expect(filepath.Join(cmd.Dir, "Gemfile")).To(BeAnExistingFile())
615585
Expect(filepath.Join(cmd.Dir, "Gemfile.lock")).ToNot(BeAnExistingFile())
616586
Expect(os.WriteFile(filepath.Join(cmd.Dir, "Gemfile.lock"), []byte(newGemfileLock), 0644)).To(Succeed())
617-
} else {
618-
handleBundleBinstubRegeneration(cmd)
619587
}
620588
})
621589
Expect(supplier.InstallGems()).To(Succeed())
@@ -630,8 +598,6 @@ var _ = Describe("Supply", func() {
630598
if cmd.Args[1] == "install" {
631599
Expect(cmd.Dir).ToNot(Equal(buildDir))
632600
installCalled = true
633-
} else {
634-
handleBundleBinstubRegeneration(cmd)
635601
}
636602
})
637603
Expect(supplier.InstallGems()).To(Succeed())

0 commit comments

Comments
 (0)