autobuild 1.18.0 → 1.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3203bb516411ada5796ebf11313d0be7731f6068361ac526424938700c886bf
4
- data.tar.gz: 5b988ac45c9c2cc3216e73d7917a61555a0171d830e94fe4d59edb95938ed49d
3
+ metadata.gz: ba0c35a9d6c2a15141684c9836ca9b5763b90dfdc46832a31d0f343a6837ef4d
4
+ data.tar.gz: 3d5b3c22bdd6b3c082e9ed209a656b637274bd2054c8e211260ff28f8d058cd9
5
5
  SHA512:
6
- metadata.gz: 46805b87b14989037a618067c414b046945e586a138f9dfb56c3ab80d34132c233f9df28a55860cf41f69b799ffe98b0d22bdcbe6d86aea7c788f4783bfc1838
7
- data.tar.gz: b3afdff0d56e867853f4d440eb758c9866885efedea1099cedaf19271653d8680646d5efeca895aa814024e09e58cef7cbe5966116ef02337d1d546582319f86
6
+ metadata.gz: 12cd8fb953e0ce63ba4679dce12ab0e8fb46678815c6baab0db97c44097fd74fe5c684f43a2e6f0de04630cf0ee6cb70a9a34fbe94b88e390a062de65cf335fc
7
+ data.tar.gz: aee8a423d0b011b6d17b70554a79527e67280a2004aa7b0709a4bce740d7ff3d6df4a5c2923f9f26e9d12971d8c2657cfda989952a7cfdfbda5e6516f0c82005
@@ -1,8 +1,6 @@
1
1
  sudo: true
2
2
  language: ruby
3
3
  rvm:
4
- - '2.1'
5
- - '2.2'
6
4
  - '2.3'
7
5
  - '2.4'
8
6
  - '2.5'
@@ -12,6 +10,7 @@ matrix:
12
10
  - rvm: 'jruby-9.1.15.0'
13
11
 
14
12
  install:
13
+ - sudo apt-get install build-essential
15
14
  - gem install bundler
16
15
  - bundle install --path vendor/bundle
17
16
 
@@ -44,7 +44,7 @@ def self.lfs_setup(importer, package)
44
44
  "files may be missing from checkout"
45
45
  end
46
46
 
47
- lfs_dir = File.join(package.srcdir, '.git', 'lfs')
47
+ lfs_dir = File.join(package.importdir, '.git', 'lfs')
48
48
  Autobuild.lfs_setup(importer, package) if File.directory?(lfs_dir)
49
49
  end
50
50
  end
@@ -1160,7 +1160,7 @@ def uses_lfs?(package)
1160
1160
  def self.lfs_installed?
1161
1161
  return @lfs_installed unless @lfs_installed.nil?
1162
1162
 
1163
- _, _, status = Open3.capture3('git lfs env')
1163
+ _, _, status = Open3.capture3('git lfs')
1164
1164
  @lfs_installed = status.success?
1165
1165
  end
1166
1166
 
@@ -664,10 +664,10 @@ def post_install(*args, &block)
664
664
  # fingerprint the result will be nil
665
665
  # @return [String]
666
666
  def fingerprint(recursive: true, memo: {})
667
+ return memo[name] if memo.key?(name)
668
+
667
669
  self_fingerprint = importer.fingerprint(self)
668
670
  return unless self_fingerprint
669
-
670
- memo[name] = self_fingerprint
671
671
  return self_fingerprint if !recursive || dependencies.empty?
672
672
 
673
673
  dependency_fingerprints = dependencies.sort.map do |pkg_name|
@@ -675,12 +675,12 @@ def fingerprint(recursive: true, memo: {})
675
675
  unless (fingerprint = memo[pkg.name])
676
676
  fingerprint = pkg.fingerprint(recursive: true, memo: memo)
677
677
  return unless fingerprint
678
- memo[pkg.name] = fingerprint
679
678
  end
680
679
  fingerprint
681
680
  end
682
681
 
683
- Digest::SHA1.hexdigest(self_fingerprint + dependency_fingerprints.join(""))
682
+ memo[name] = Digest::SHA1.hexdigest(
683
+ self_fingerprint + dependency_fingerprints.join(""))
684
684
  end
685
685
 
686
686
  # Returns the name of all the packages +self+ depends on
@@ -1,19 +1,46 @@
1
1
  require 'rubygems/version'
2
2
 
3
3
  module Autobuild
4
- def self.make_is_gnumake?(pkg, path = Autobuild.tool(:make))
4
+ def self.reset_gnumake_detection
5
+ @make_is_gnumake = Hash.new
6
+ @gnumake_version = Hash.new
7
+ end
8
+
9
+ def self.ensure_gnumake_detected(pkg, path = Autobuild.tool(:make))
5
10
  @make_is_gnumake ||= Hash.new
6
11
  @gnumake_version ||= Hash.new
7
- if @make_is_gnumake.key?(path)
8
- @make_is_gnumake[path]
12
+ return @make_is_gnumake[path] if @make_is_gnumake.key?(path)
13
+
14
+ begin
15
+ gnumake_version_string = pkg.run('prepare', path, '--version')
16
+ rescue Autobuild::SubcommandFailed
17
+ @make_is_gnumake[path] = false
18
+ return
19
+ end
20
+
21
+ gnumake_match = /^GNU Make[^\d]+(\d[\d.]+)/.match(gnumake_version_string.first)
22
+ unless gnumake_match
23
+ @make_is_gnumake[path] = false
24
+ return
25
+ end
26
+
27
+ @gnumake_version[path] = Gem::Version.new(gnumake_match[1])
28
+ @make_is_gnumake[path] = true
29
+ end
30
+
31
+ def self.make_is_gnumake?(pkg, path = Autobuild.tool(:make))
32
+ ensure_gnumake_detected(pkg, path)
33
+ end
34
+
35
+ class NotGNUMake < RuntimeError
36
+ end
37
+
38
+ def self.gnumake_version(pkg, path = Autobuild.tool(:make))
39
+ if ensure_gnumake_detected(pkg, path)
40
+ @gnumake_version.fetch(path)
9
41
  else
10
- begin
11
- result = pkg.run('prepare', path, '--version')
12
- @make_is_gnumake[path] = (result.first =~ /GNU Make/)
13
- @gnumake_version[path] = Gem::Version.new(result.first.scan(/[\d.]+/)[0])
14
- rescue Autobuild::SubcommandFailed
15
- @make_is_gnumake[path] = false
16
- end
42
+ raise NotGNUMake, "either #{path} is not a GNU Make or it does not have "\
43
+ "the expected version string"
17
44
  end
18
45
  end
19
46
 
@@ -25,34 +52,44 @@ def self.make_has_gnumake_jobserver?(pkg, path = Autobuild.tool(:make))
25
52
  make_is_gnumake?(pkg, path)
26
53
  end
27
54
 
55
+ GNUMAKE_JOBSERVER_AUTH_VERSION = Gem::Version.new("4.2.0")
56
+
57
+ def self.gnumake_jobserver_option(job_server, pkg, path = Autobuild.tool(:make))
58
+ jobserver_fds_arg = "#{job_server.rio.fileno},#{job_server.wio.fileno}"
59
+
60
+ version = gnumake_version(pkg, path)
61
+ if version >= GNUMAKE_JOBSERVER_AUTH_VERSION
62
+ ["--jobserver-auth=#{jobserver_fds_arg}"]
63
+ else
64
+ ["--jobserver-fds=#{jobserver_fds_arg}", "-j"]
65
+ end
66
+ end
67
+
28
68
  def self.invoke_make_parallel(pkg, cmd_path = Autobuild.tool(:make))
29
69
  reserved = nil
30
- if make_has_j_option?(pkg, cmd_path) && pkg.parallel_build_level != 1
31
- if (manager = Autobuild.parallel_task_manager)
32
- job_server = manager.job_server
33
-
34
- specific_parallel_level = (pkg.parallel_build_level !=
35
- Autobuild.parallel_build_level)
36
- if !make_has_gnumake_jobserver?(pkg, cmd_path) || specific_parallel_level
37
- reserved = pkg.parallel_build_level
38
- # Account for the one token autobuild uses
39
- job_server.get(reserved - 1)
40
- yield("-j#{pkg.parallel_build_level}")
41
- end
42
-
43
- jobserver_fds_arg = "#{job_server.rio.fileno},#{job_server.wio.fileno}"
44
-
45
- if @gnumake_version[cmd_path] >= Gem::Version.new("4.2.0")
46
- yield("--jobserver-auth=#{jobserver_fds_arg}", "-j")
47
- else
48
- yield("--jobserver-fds=#{jobserver_fds_arg}", "-j")
49
- end
70
+ return yield unless make_has_j_option?(pkg, cmd_path)
71
+
72
+ manager = Autobuild.parallel_task_manager
73
+ return yield("-j#{pkg.parallel_build_level}") unless manager
74
+
75
+ job_server = manager.job_server
76
+
77
+ specific_parallel_level = (
78
+ pkg.parallel_build_level != Autobuild.parallel_build_level
79
+ )
80
+ if !make_has_gnumake_jobserver?(pkg, cmd_path) || specific_parallel_level
81
+ reserved = pkg.parallel_build_level
82
+ # Account for the one token autobuild uses
83
+ begin
84
+ job_server.get(reserved - 1)
85
+ return yield("-j#{pkg.parallel_build_level}")
86
+ ensure
87
+ job_server.put(reserved - 1)
50
88
  end
51
- yield("-j#{pkg.parallel_build_level}")
52
- else yield
53
89
  end
54
- ensure
55
- job_server.put(reserved) if reserved
90
+
91
+ options = gnumake_jobserver_option(job_server, pkg, cmd_path)
92
+ yield(*options)
56
93
  end
57
94
 
58
95
  def self.make_subcommand(pkg, phase, *options, &block)
@@ -20,8 +20,8 @@ def silent?
20
20
  end
21
21
 
22
22
  def silent
23
- @silent = true
24
23
  silent = @silent
24
+ @silent = true
25
25
  yield
26
26
  ensure
27
27
  @silent = silent
@@ -57,6 +57,7 @@ def teardown
57
57
 
58
58
  Autobuild::Package.clear
59
59
  Rake::Task.clear
60
+ Autobuild.reset_gnumake_detection
60
61
 
61
62
  @temp_dirs.each do |dir|
62
63
  FileUtils.rm_rf dir
@@ -1,3 +1,3 @@
1
1
  module Autobuild
2
- VERSION = "1.18.0".freeze unless defined? Autobuild::VERSION
2
+ VERSION = "1.18.1".freeze unless defined? Autobuild::VERSION
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-27 00:00:00.000000000 Z
11
+ date: 2019-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel
@@ -261,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  version: '0'
262
262
  requirements: []
263
263
  rubyforge_project:
264
- rubygems_version: 2.7.6
264
+ rubygems_version: 2.7.6.2
265
265
  signing_key:
266
266
  specification_version: 4
267
267
  summary: Library to handle build systems and import mechanisms