prebundler 0.11.6 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +97 -98
- data/lib/prebundler/cli/install.rb +12 -3
- data/lib/prebundler/gem_ref.rb +81 -25
- data/lib/prebundler/gemfile_interpreter.rb +4 -0
- data/lib/prebundler/git_gem_ref.rb +4 -4
- data/lib/prebundler/s3_backend.rb +1 -1
- data/lib/prebundler/version.rb +1 -1
- data/lib/prebundler.rb +4 -4
- data/prebundler.gemspec +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1b4617c0c426fe9ac76ca98f6d9a80e849a6f8fb848817f7bfa6a9c5393b238
|
4
|
+
data.tar.gz: be95fbc3f0f4f39682c2ee929d9a3c8ea27fd8db087f4a0d3d9c2c39f87c4b98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 244764066b66efdc4feb132dc3f94ed455cf141fdeb14b758d935e6dd1d8b960f3bdef4d2c783709a41fff7e30e6405e4871514d4220f757181af4e0951e72fe
|
7
|
+
data.tar.gz: 67d0a49d079f337e6522ed6765652f12e3fcd93546744f3ed0efae8e554e9f6604f8957118293c4d826985445048b7b65618cfbeb01a9af7b0a56b64a2cfa118
|
data/CHANGELOG.md
CHANGED
@@ -1,98 +1,97 @@
|
|
1
|
-
0.
|
2
|
-
|
3
|
-
|
4
|
-
-
|
5
|
-
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
0.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
0.11.
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
0.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
0.
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
0.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
0.
|
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
|
-
0.0.1
|
97
|
-
|
98
|
-
- Birthday!
|
1
|
+
## 0.13.0
|
2
|
+
* Support the `eval_gemfile` function in gemfiles.
|
3
|
+
* Avoid shelling out to the `tar` command.
|
4
|
+
- The GNU and BSD versions annoyingly don't accept the same flags, meaning Prebundler can succeed or fail depending on the system it's run on.
|
5
|
+
- All tar files are now read and written using pure Ruby.
|
6
|
+
* Upgrade S3 client to non-EOL version.
|
7
|
+
* Stop ignoring gems that don't match the current platform.
|
8
|
+
- Prebundler shells out to `gem install` when installing individual gems. Older versions of rubygems would fetch gems for the "ruby" platform when the `--ignore-dependencies` option was given, ignoring any platform-specific gems. This resulted in either a) unnecessarily building a bunch of native extensions, or b) installing a gem for the wrong platform (i.e. when no gem existed for the "ruby" platform, eg. helm-rb). I addressed the problem by instructing Prebundler to ignore gems with native extensions, relying on `bundle install` to fix them up. However, the bug has been fixed in modern versions of rubygems, so we can stop ignoring gems.
|
9
|
+
* Run `bundle lock` before storing or installing gems to make sure the lockfile matches the Gemfile.
|
10
|
+
|
11
|
+
## 0.12.0
|
12
|
+
* Switch out ohai for ohey, which has many fewer dependencies.
|
13
|
+
|
14
|
+
## 0.11.8
|
15
|
+
* Don't store gems in the backend if they failed to install.
|
16
|
+
* Use an absolute bundle path.
|
17
|
+
* Only consider a gem from the lockfile if it matches the current platform.
|
18
|
+
* Fix `#install` methods so they all return true/false.
|
19
|
+
|
20
|
+
## 0.11.7
|
21
|
+
* Fix bug causing platform-specific gems to be installed from source even if they were already present in the backend.
|
22
|
+
|
23
|
+
## 0.11.6
|
24
|
+
* Fix bug causing native extension compile errors.
|
25
|
+
* Fix bug causing executables to not be included in tarballs.
|
26
|
+
* Fix bug (maybe introduced by bundler 2?) causing incorrect directory to be tarred. Directory can now include platform apparently.
|
27
|
+
|
28
|
+
## 0.11.5
|
29
|
+
* Add `--retry` flag to CLI (currently does nothing).
|
30
|
+
|
31
|
+
## 0.11.4
|
32
|
+
* Ensure .bundle/config directory exists before writing to it.
|
33
|
+
|
34
|
+
## 0.11.3
|
35
|
+
* Support (well, add stubs for) `ruby` and `git_source` methods in Gemfiles.
|
36
|
+
* Don't attempt to install gems we can't get a spec for.
|
37
|
+
|
38
|
+
## 0.11.2
|
39
|
+
* Always run `bundle install` just in case.
|
40
|
+
* Make sure `bundle check` is the _last_ thing that runs.
|
41
|
+
|
42
|
+
## 0.11.1
|
43
|
+
* Exit with nonzero status code if fallback `bundle install` fails.
|
44
|
+
|
45
|
+
## 0.11.0
|
46
|
+
* Allow the caller to pass in a s3 client for non-standard setups
|
47
|
+
|
48
|
+
## 0.10.0
|
49
|
+
* Update aws-sdk client creation to be able to support non-aws s3 api endpoints (e.g. minio)
|
50
|
+
|
51
|
+
## 0.9.1
|
52
|
+
* Woops, also use platform version when determining the gems that have already been built.
|
53
|
+
* Fix the subsetter so it outputs gems inside correct source blocks.
|
54
|
+
|
55
|
+
## 0.9.0
|
56
|
+
* Include platform version when uploading gem tarballs to the storage backend (this will cause bundles installed by previous versions of prebundler to be rebuilt).
|
57
|
+
|
58
|
+
## 0.8.1
|
59
|
+
* Fix bug causing config to not be loaded.
|
60
|
+
|
61
|
+
## 0.8.0
|
62
|
+
* Add the subset command for generating subsets of gemfiles.
|
63
|
+
|
64
|
+
## 0.7.2
|
65
|
+
* Fix use of continuation token when listing remote files in S3 backend.
|
66
|
+
|
67
|
+
## 0.7.1
|
68
|
+
* Support git-based gems with non-standard repo names.
|
69
|
+
* Fix `bundle install` fallback (group args were wrong).
|
70
|
+
|
71
|
+
## 0.7.0
|
72
|
+
* Add prefix option to install command.
|
73
|
+
|
74
|
+
## 0.6.2
|
75
|
+
* Provide CLI option to generate binstubs.
|
76
|
+
|
77
|
+
## 0.5.2
|
78
|
+
* Set `BUNDLE_GEMFILE` during prepare step so bundler doesn't complain when we try to call `Bundler.app_config_path`.
|
79
|
+
|
80
|
+
## 0.5.1
|
81
|
+
* Remove pry-byebug require.
|
82
|
+
|
83
|
+
## 0.5.0
|
84
|
+
* Works for a repository with a significant number of dependencies (~ 400).
|
85
|
+
* Testing on staging server indicates bundle is installed correctly.
|
86
|
+
|
87
|
+
## 0.0.4
|
88
|
+
* Pass bundle path to `gem install`.
|
89
|
+
|
90
|
+
## 0.0.3
|
91
|
+
* Add --with and --without flags to install command.
|
92
|
+
|
93
|
+
## 0.0.2
|
94
|
+
* Better CLI interface.
|
95
|
+
|
96
|
+
## 0.0.1
|
97
|
+
* Birthday!
|
@@ -17,6 +17,7 @@ module Prebundler
|
|
17
17
|
|
18
18
|
class Install < Base
|
19
19
|
def run
|
20
|
+
lock
|
20
21
|
prepare
|
21
22
|
install
|
22
23
|
update_bundle_config
|
@@ -30,6 +31,10 @@ module Prebundler
|
|
30
31
|
|
31
32
|
private
|
32
33
|
|
34
|
+
def lock
|
35
|
+
system "bundle lock --gemfile #{gemfile_path}"
|
36
|
+
end
|
37
|
+
|
33
38
|
def prepare
|
34
39
|
FileUtils.mkdir_p(bundle_path)
|
35
40
|
ENV['BUNDLE_GEMFILE'] = gemfile_path
|
@@ -102,8 +107,12 @@ module Prebundler
|
|
102
107
|
FileUtils.rm(dest_file)
|
103
108
|
else
|
104
109
|
out.puts "Installing #{gem_ref.id} from source"
|
105
|
-
|
106
|
-
|
110
|
+
|
111
|
+
if gem_ref.install
|
112
|
+
store_gem(gem_ref, dest_file) if gem_ref.storable?
|
113
|
+
else
|
114
|
+
out.puts "Failed to install #{gem_ref.id} from source"
|
115
|
+
end
|
107
116
|
end
|
108
117
|
end
|
109
118
|
|
@@ -179,7 +188,7 @@ module Prebundler
|
|
179
188
|
end
|
180
189
|
|
181
190
|
def bundle_path
|
182
|
-
options.fetch(:'bundle-path')
|
191
|
+
File.expand_path(options.fetch(:'bundle-path'))
|
183
192
|
end
|
184
193
|
|
185
194
|
def config
|
data/lib/prebundler/gem_ref.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'rubygems/package'
|
1
2
|
require 'fileutils'
|
2
3
|
require 'set'
|
3
4
|
|
@@ -48,33 +49,62 @@ module Prebundler
|
|
48
49
|
end
|
49
50
|
|
50
51
|
def install
|
52
|
+
# NOTE: the --platform argument used to not work when --ignore-dependencies
|
53
|
+
# was specified, but has been fixed in modern versions of rubygems. See:
|
54
|
+
# https://github.com/rubygems/rubygems/pull/2446 for a very long rabbit hole.
|
51
55
|
Bundler.with_unbundled_env do
|
52
|
-
system(
|
56
|
+
system(
|
57
|
+
{ "GEM_HOME" => bundle_path },
|
58
|
+
'gem install -N --ignore-dependencies '\
|
59
|
+
"--source #{source} #{name} "\
|
60
|
+
"--version #{version} "\
|
61
|
+
"--platform #{Bundler.local_platform.to_s}"
|
62
|
+
)
|
53
63
|
end
|
54
64
|
|
55
|
-
$?.exitstatus
|
56
|
-
end
|
57
|
-
|
58
|
-
def install_from_tar(tar_file)
|
59
|
-
system "tar -C #{bundle_path} -xf #{tar_file}"
|
60
65
|
$?.exitstatus == 0
|
61
66
|
end
|
62
67
|
|
63
|
-
def
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
68
|
+
def install_from_tar(tar_file)
|
69
|
+
File.open(tar_file) do |f|
|
70
|
+
Gem::Package::TarReader.new(f) do |tar|
|
71
|
+
tar.each do |entry|
|
72
|
+
path = File.join(bundle_path, entry.full_name)
|
73
|
+
|
74
|
+
if entry.directory?
|
75
|
+
FileUtils.mkdir_p(path)
|
76
|
+
else
|
77
|
+
FileUtils.mkdir_p(File.dirname(path))
|
78
|
+
File.open(path, 'wb') do |new_file|
|
79
|
+
new_file.write(entry.read)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
70
84
|
end
|
71
85
|
|
72
|
-
|
73
|
-
|
74
|
-
|
86
|
+
true
|
87
|
+
rescue => e
|
88
|
+
return false
|
89
|
+
end
|
75
90
|
|
76
|
-
|
77
|
-
|
91
|
+
def add_to_tar(tar_file)
|
92
|
+
File.open(tar_file, 'wb') do |f|
|
93
|
+
Gem::Package::TarWriter.new(f) do |tar_io|
|
94
|
+
Dir.chdir(bundle_path) do
|
95
|
+
add_files_to_tar(
|
96
|
+
tar_io, Dir.glob(File.join(relative_gem_dir, '**', '*'))
|
97
|
+
)
|
98
|
+
|
99
|
+
add_files_to_tar(tar_io, relative_gemspec_files)
|
100
|
+
|
101
|
+
if File.directory?(extension_dir)
|
102
|
+
add_files_to_tar(
|
103
|
+
tar_io, Dir.glob(File.join(relative_extension_dir, '**', '*'))
|
104
|
+
)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
78
108
|
end
|
79
109
|
end
|
80
110
|
|
@@ -105,7 +135,13 @@ module Prebundler
|
|
105
135
|
end
|
106
136
|
|
107
137
|
def install_dir
|
108
|
-
|
138
|
+
@install_dir ||= begin
|
139
|
+
base = File.join(install_path, id)
|
140
|
+
|
141
|
+
find_platform_dir(base) do |dir|
|
142
|
+
File.directory?(dir)
|
143
|
+
end
|
144
|
+
end
|
109
145
|
end
|
110
146
|
|
111
147
|
def extension_dir
|
@@ -119,14 +155,10 @@ module Prebundler
|
|
119
155
|
def relative_gem_dir
|
120
156
|
@relative_gem_dir ||= begin
|
121
157
|
base = File.join('gems', id)
|
122
|
-
platform = Bundler.local_platform.to_a
|
123
158
|
|
124
|
-
|
125
|
-
|
126
|
-
return dir if File.directory?(File.join(bundle_path, dir))
|
159
|
+
find_platform_dir(base) do |dir|
|
160
|
+
File.directory?(File.join(bundle_path, dir))
|
127
161
|
end
|
128
|
-
|
129
|
-
base
|
130
162
|
end
|
131
163
|
end
|
132
164
|
|
@@ -140,5 +172,29 @@ module Prebundler
|
|
140
172
|
file = File.join(Bundler.local_platform.to_s, Prebundler.platform_version, Gem.extension_api_version.to_s, "#{id}.tar")
|
141
173
|
prefix && !prefix.empty? ? File.join(prefix, file) : file
|
142
174
|
end
|
175
|
+
|
176
|
+
private
|
177
|
+
|
178
|
+
def add_files_to_tar(tar_io, files)
|
179
|
+
files.each do |file|
|
180
|
+
next if File.directory?(file)
|
181
|
+
|
182
|
+
mode = File.stat(file).mode
|
183
|
+
tar_io.add_file(file, mode) do |new_file|
|
184
|
+
new_file.write(File.binread(file))
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
def find_platform_dir(base)
|
190
|
+
platform = Bundler.local_platform.to_a
|
191
|
+
|
192
|
+
platform.size.downto(0) do |i|
|
193
|
+
dir = [base, *platform[0...i]].join('-')
|
194
|
+
return dir if yield(dir)
|
195
|
+
end
|
196
|
+
|
197
|
+
base
|
198
|
+
end
|
143
199
|
end
|
144
200
|
end
|
@@ -22,15 +22,15 @@ module Prebundler
|
|
22
22
|
FileUtils.mkdir_p(install_path)
|
23
23
|
FileUtils.mkdir_p(cache_path)
|
24
24
|
|
25
|
-
return if File.exist?(cache_dir) || File.exist?(install_dir)
|
25
|
+
return true if File.exist?(cache_dir) || File.exist?(install_dir)
|
26
26
|
system "git clone #{uri} \"#{cache_dir}\" --bare --no-hardlinks --quiet"
|
27
|
-
return
|
27
|
+
return false if $?.exitstatus != 0
|
28
28
|
system "git clone --no-checkout --quiet \"#{cache_dir}\" \"#{install_dir}\""
|
29
|
-
return
|
29
|
+
return false if $?.exitstatus != 0
|
30
30
|
Dir.chdir(install_dir) { system "git reset --hard --quiet #{revision}" }
|
31
31
|
serialize_gemspecs
|
32
32
|
copy_gemspecs
|
33
|
-
|
33
|
+
$?.exitstatus == 0
|
34
34
|
end
|
35
35
|
|
36
36
|
def to_gem
|
data/lib/prebundler/version.rb
CHANGED
data/lib/prebundler.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'ohey'
|
2
2
|
|
3
3
|
module Prebundler
|
4
4
|
autoload :Cli, 'prebundler/cli'
|
@@ -27,13 +27,13 @@ module Prebundler
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def platform_version
|
30
|
-
@platform_version ||= "#{
|
30
|
+
@platform_version ||= "#{platform.name}-#{platform.version}"
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
-
def
|
36
|
-
|
35
|
+
def platform
|
36
|
+
@platform ||= Ohey.current_platform
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
data/prebundler.gemspec
CHANGED
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.add_dependency 'bundler'
|
15
15
|
s.add_dependency 'parallel', '~> 1.0'
|
16
16
|
s.add_dependency 'gli', '~> 2.0'
|
17
|
-
s.add_dependency '
|
17
|
+
s.add_dependency 'ohey', '~> 1.0'
|
18
18
|
|
19
19
|
# @TODO: move s3 support into separate gem
|
20
|
-
s.add_dependency 'aws-sdk', '~>
|
20
|
+
s.add_dependency 'aws-sdk-s3', '~> 1.0'
|
21
21
|
|
22
22
|
s.executables << 'prebundle'
|
23
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prebundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,33 +53,33 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: ohey
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: aws-sdk
|
70
|
+
name: aws-sdk-s3
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '1.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '1.0'
|
83
83
|
description: Gem dependency prebuilder
|
84
84
|
email:
|
85
85
|
- camertron@gmail.com
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.3.3
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Gem dependency prebuilder
|