autobuild 1.18.1 → 1.19.0

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: ba0c35a9d6c2a15141684c9836ca9b5763b90dfdc46832a31d0f343a6837ef4d
4
- data.tar.gz: 3d5b3c22bdd6b3c082e9ed209a656b637274bd2054c8e211260ff28f8d058cd9
3
+ metadata.gz: 2db3dc0a2d21505b88966e48b4019800e42f39e4a44cbd113a874a4aefad8dc8
4
+ data.tar.gz: 3f19bf595f8c258899f1cfd3636257e9c58bd0ca02680a1e205d12d645cb9354
5
5
  SHA512:
6
- metadata.gz: 12cd8fb953e0ce63ba4679dce12ab0e8fb46678815c6baab0db97c44097fd74fe5c684f43a2e6f0de04630cf0ee6cb70a9a34fbe94b88e390a062de65cf335fc
7
- data.tar.gz: aee8a423d0b011b6d17b70554a79527e67280a2004aa7b0709a4bce740d7ff3d6df4a5c2923f9f26e9d12971d8c2657cfda989952a7cfdfbda5e6516f0c82005
6
+ metadata.gz: ac1af6ad08365cda04b28c52e8283fdaf2b4f56ae0b320961fb8600c7126e242c7e83569d8ac8f6722b441efc5f10d18b90a576a76efee1dc53c9c442327562f
7
+ data.tar.gz: e716f6c428ea5c6384465697abd8124a9e6aa739ab78025129beec71dd4ec14630e81804f0109a6707575713e69d86fbcd2d16fea4031cff1953ae6ff702fcf9
@@ -24,6 +24,11 @@ class << self
24
24
  # AUTOBUILD_GIT_CACHE_DIR and AUTOBUILD_CACHE_DIR environment
25
25
  # variables
26
26
  #
27
+ # Because of its role within the caching system in autobuild/autoproj,
28
+ # these defaults are not applied to git repositories that are using
29
+ # submodules. The autoproj cache builder does not generate repositories
30
+ # compatible with having submodules
31
+ #
27
32
  # @return [Array]
28
33
  # @see default_alternates=, Git#alternates
29
34
  def default_alternates
@@ -111,7 +116,6 @@ def self.at_least_version(*version)
111
116
  # workflow, it is recommended to not use submodules but checkout all
112
117
  # repositories separately instead.
113
118
  def initialize(repository, branch = nil, options = {})
114
- @alternates = Git.default_alternates.dup
115
119
  @git_dir_cache = Array.new
116
120
  @local_branch = @remote_branch = nil
117
121
  @tag = @commit = nil
@@ -155,6 +159,13 @@ def initialize(repository, branch = nil, options = {})
155
159
 
156
160
  @single_branch = gitopts[:single_branch]
157
161
  @with_submodules = gitopts.delete(:with_submodules)
162
+ @alternates =
163
+ if @with_submodules
164
+ []
165
+ else
166
+ Git.default_alternates.dup
167
+ end
168
+
158
169
  @remote_name = 'autobuild'
159
170
  @push_to = nil
160
171
  relocate(repository, gitopts)
@@ -207,28 +207,20 @@ def checked_out?
207
207
  File.directory?(srcdir)
208
208
  end
209
209
 
210
- def prepare_invoked?
211
- task("#{name}-prepare").already_invoked?
212
- end
213
-
214
- def prepared?
215
- @prepared
216
- end
217
-
218
210
  def import_invoked?
219
- task("#{name}-import").already_invoked?
211
+ @import_invoked
220
212
  end
221
213
 
222
214
  def imported?
223
215
  @imported
224
216
  end
225
217
 
226
- def build_invoked?
227
- task("#{name}-build").already_invoked?
218
+ def install_invoked?
219
+ @install_invoked
228
220
  end
229
221
 
230
- def built?
231
- @built
222
+ def installed?
223
+ @installed
232
224
  end
233
225
 
234
226
  def to_s
@@ -459,12 +451,13 @@ def isolate_errors(options = Hash.new)
459
451
  def import(options = Hash.new)
460
452
  options = Hash[only_local: options] unless options.respond_to?(:to_hash)
461
453
 
454
+ @import_invoked = true
462
455
  if @importer
463
456
  result = @importer.import(self, options)
464
- @imported = true
465
457
  elsif update?
466
458
  message "%s: no importer defined, doing nothing"
467
459
  end
460
+ @imported = true
468
461
 
469
462
  # Add the dependencies declared in spec
470
463
  depends_on(*@spec_dependencies) if @spec_dependencies
@@ -480,7 +473,10 @@ def prepare
480
473
  stamps = dependencies.map { |p| Package[p].installstamp }
481
474
 
482
475
  file installstamp => stamps do
483
- isolate_errors { install }
476
+ isolate_errors do
477
+ @install_invoked = true
478
+ install
479
+ end
484
480
  end
485
481
  task "#{name}-build" => installstamp
486
482
 
@@ -563,7 +559,7 @@ def install
563
559
 
564
560
  Autobuild.touch_stamp(installstamp)
565
561
 
566
- @built = true
562
+ @installed = true
567
563
  end
568
564
 
569
565
  def run(*args, &block)
@@ -580,6 +576,14 @@ def run(*args, &block)
580
576
 
581
577
  module TaskExtension
582
578
  attr_accessor :package
579
+
580
+ def disabled?
581
+ if @disabled.nil? && package
582
+ package.disabled?
583
+ else
584
+ super
585
+ end
586
+ end
583
587
  end
584
588
 
585
589
  def source_tree(*args, &block)
@@ -820,17 +824,13 @@ def disable_phases(*phases)
820
824
  phases.each do |phase|
821
825
  task "#{name}-#{phase}"
822
826
  t = Rake::Task["#{name}-#{phase}"]
823
- t.disable!
827
+ t.disable
824
828
  end
825
829
  end
826
830
 
827
831
  # Make sure that this package will be ignored in the build
828
832
  def disable(phases = Autobuild.all_phases)
829
833
  @disabled = true
830
- disable_phases(*phases)
831
- task(installstamp)
832
- t = Rake::Task[installstamp]
833
- t.disable!
834
834
  end
835
835
 
836
836
  def utility(utility_name)
@@ -22,9 +22,8 @@ def initialize(options)
22
22
  super
23
23
  end
24
24
 
25
- def prepare
26
- super
27
- @install_mode = File.file?(File.join(srcdir, 'setup.py'))
25
+ def install_mode?
26
+ File.file?(File.join(srcdir, 'setup.py'))
28
27
  end
29
28
 
30
29
  def prepare_for_forced_build
@@ -65,7 +64,7 @@ def python_path
65
64
 
66
65
  # Do the build in builddir
67
66
  def build
68
- return unless @install_mode
67
+ return unless install_mode?
69
68
 
70
69
  command = generate_build_command
71
70
  command << '--force' if @forced
@@ -78,7 +77,7 @@ def build
78
77
 
79
78
  # Install the result in prefix
80
79
  def install
81
- return unless @install_mode
80
+ return unless install_mode?
82
81
 
83
82
  command = generate_install_command
84
83
  command << '--force' if @forced
@@ -91,7 +90,7 @@ def install
91
90
 
92
91
  def update_environment
93
92
  super
94
- path = @install_mode ? python_path : srcdir
93
+ path = install_mode? ? python_path : srcdir
95
94
  env_add_path 'PYTHONPATH', path
96
95
  end
97
96
  end
@@ -188,12 +188,16 @@ def invoke_parallel(required_tasks)
188
188
  break if !pending_task && available_workers.size == workers.size
189
189
  end
190
190
 
191
- if state.trivial_task?(pending_task)
192
- Worker.execute_task(pending_task)
191
+ bypass_task = pending_task.disabled? ||
192
+ pending_task.already_invoked? ||
193
+ !pending_task.needed?
194
+
195
+ if bypass_task
196
+ pending_task.already_invoked = true
193
197
  state.process_finished_task(pending_task)
194
198
  next
195
- elsif pending_task.already_invoked? || !pending_task.needed?
196
- pending_task.already_invoked = true
199
+ elsif state.trivial_task?(pending_task)
200
+ Worker.execute_task(pending_task)
197
201
  state.process_finished_task(pending_task)
198
202
  next
199
203
  end
@@ -6,11 +6,16 @@ def already_invoked?
6
6
 
7
7
  attr_writer :already_invoked
8
8
 
9
- def disable!
10
- @already_invoked = true
11
- singleton_class.class_eval do
12
- define_method(:needed?) { false }
13
- end
9
+ def disabled?
10
+ @disabled
11
+ end
12
+
13
+ def disabled!
14
+ disable
15
+ end
16
+
17
+ def disable
18
+ @disabled = true
14
19
  end
15
20
  end
16
21
  end
@@ -29,6 +29,10 @@ def initialize(name, package, install_on_error: false)
29
29
  @source_dir = nil
30
30
  @target_dir = nil
31
31
  @install_on_error = install_on_error
32
+
33
+ @invoked = false
34
+ @success = false
35
+ @installed = false
32
36
  end
33
37
 
34
38
  # Directory in which the utility will generate some files The
@@ -98,7 +102,10 @@ def task(&block)
98
102
  end
99
103
 
100
104
  def call_task_block
105
+ @invoked = true
106
+
101
107
  yield if block_given?
108
+ @success = true
102
109
 
103
110
  # Allow the user to install manually in the task
104
111
  # block
@@ -107,6 +114,7 @@ def call_task_block
107
114
  raise
108
115
  rescue ::Exception => e
109
116
  install if install_on_error? && !@installed && target_dir
117
+ @success = false
110
118
 
111
119
  if Autobuild.send("pass_#{name}_errors")
112
120
  raise
@@ -167,6 +175,24 @@ def install
167
175
  @installed = true
168
176
  end
169
177
 
178
+ # True if the utility has been invoked
179
+ def invoked?
180
+ @invoked
181
+ end
182
+
183
+ # True if the utility has been successful
184
+ #
185
+ # Combine with {#invoked?} to determine whether 'false' means 'not run'
186
+ # or 'failed'
187
+ def success?
188
+ @success
189
+ end
190
+
191
+ # True if the utility's results have been installed
192
+ def installed?
193
+ @installed
194
+ end
195
+
170
196
  # Can be called in the block given to {task} to announce that the
171
197
  # utility is to be disabled for that package. This is mainly used
172
198
  # when a runtime check is necessary to know if a package can run
@@ -1,3 +1,3 @@
1
1
  module Autobuild
2
- VERSION = "1.18.1".freeze unless defined? Autobuild::VERSION
2
+ VERSION = "1.19.0".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.1
4
+ version: 1.19.0
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-05-10 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel