autoproj 2.1.2 → 2.2.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
  SHA1:
3
- metadata.gz: 446bfd7b052bedbb573c7eecf69fee6db6fa9331
4
- data.tar.gz: 6bf58cc533bcb37ecee2c1d95fe54ae0e73f1cc9
3
+ metadata.gz: 60531973b1e5068ee8e84846d5314fd6ffe01abf
4
+ data.tar.gz: b58a9052db03178e6e52dafdb2f776eb314f14c5
5
5
  SHA512:
6
- metadata.gz: 1d87bc69018b5bfe2f6cdb737966ec0b0b862888c493cba9437ec85e03b4a2ba875d3811d80c4d552cd2c3381bf1255524125c5a63b8ca3189b71af13c85ded7
7
- data.tar.gz: bd41f335d883331c1950c7da1181d5427c59d7bba2c09577aaaac9fe71a43920af5973e6281035b41390db0dbd12ace9f251cdbf9b142f5f97bfde1d92dbf712
6
+ metadata.gz: f914b0ad12e9dd0d8e3c56f975f97f30e6eb86ede4a5061d3d342e79a20b0c96db609f5a8b131fffc69a8f0ca8ace53a2b2d11b236db61166a6071c5a28e95f1
7
+ data.tar.gz: 2416f891515b54a88bc702f69e3f097904618b0bfd29c42fef9b20a36b8a8059dadc36de7775b298c03132e9d99e2c2abff462d92645eb425f9be6f5ff3867c7
@@ -128,6 +128,8 @@ def doc(*packages)
128
128
  desc: 'maximum number of parallel jobs'
129
129
  option :mainline, type: :string,
130
130
  desc: "compare to the given baseline. if 'true', the comparison will ignore any override, otherwise it will take into account overrides only up to the given package set"
131
+ option :auto_exclude, type: :boolean,
132
+ desc: 'if true, packages that fail to import will be excluded from the build'
131
133
  def update(*packages)
132
134
  run_autoproj_cli(:update, :Update, Hash[silent: false], *packages)
133
135
  end
@@ -157,7 +159,8 @@ def update(*packages)
157
159
  desc: 'provide -n for --no-deps'
158
160
  option :parallel, aliases: :p, type: :numeric,
159
161
  desc: 'maximum number of parallel jobs'
160
-
162
+ option :auto_exclude, type: :boolean,
163
+ desc: 'if true, packages that fail to import will be excluded from the build'
161
164
  def build(*packages)
162
165
  run_autoproj_cli(:build, :Build, Hash[silent: false], *packages)
163
166
  end
@@ -117,7 +117,8 @@ def run(selected_packages, options)
117
117
  deps: options[:deps],
118
118
  keep_going: options[:keep_going],
119
119
  parallel: options[:parallel] || ws.config.parallel_import_level,
120
- retry_count: options[:retry_count])
120
+ retry_count: options[:retry_count],
121
+ auto_exclude: options[:auto_exclude])
121
122
 
122
123
  ws.finalize_setup
123
124
  ws.export_installation_manifest
@@ -176,7 +177,7 @@ def normalize_osdeps_options(
176
177
  def update_packages(selected_packages,
177
178
  from: nil, checkout_only: false, only_local: false, reset: false,
178
179
  deps: true, keep_going: false, parallel: 1,
179
- retry_count: 0, osdeps: true, osdeps_options: Hash.new)
180
+ retry_count: 0, osdeps: true, auto_exclude: false, osdeps_options: Hash.new)
180
181
 
181
182
  if from
182
183
  setup_update_from(from)
@@ -192,7 +193,8 @@ def update_packages(selected_packages,
192
193
  keep_going: keep_going,
193
194
  parallel: parallel,
194
195
  retry_count: retry_count,
195
- install_vcs_packages: (osdeps_options if osdeps))
196
+ install_vcs_packages: (osdeps_options if osdeps),
197
+ auto_exclude: auto_exclude)
196
198
  return source_packages, osdep_packages, nil
197
199
  rescue PackageImportFailed => import_failure
198
200
  if !keep_going
@@ -2,8 +2,19 @@ module Autoproj
2
2
  module Ops
3
3
  class Import
4
4
  attr_reader :ws
5
+
6
+ # Whether packages are added to exclusions if they error during the
7
+ # import process
8
+ #
9
+ # This is mostly meant for CI operations
10
+ def auto_exclude?
11
+ @auto_exclude
12
+ end
13
+ attr_writer :auto_exclude
14
+
5
15
  def initialize(ws)
6
16
  @ws = ws
17
+ @auto_exclude = false
7
18
  end
8
19
 
9
20
  def mark_exclusion_along_revdeps(pkg_name, revdeps, chain = [], reason = nil)
@@ -80,10 +91,15 @@ def pre_package_import(selection, manifest, pkg, reverse_dependencies)
80
91
  end
81
92
  end
82
93
 
83
- def post_package_import(selection, manifest, pkg, reverse_dependencies)
94
+ def post_package_import(selection, manifest, pkg, reverse_dependencies, auto_exclude: auto_exclude?)
84
95
  Rake::Task["#{pkg.name}-import"].instance_variable_set(:@already_invoked, true)
85
96
  if pkg.checked_out?
86
- manifest.load_package_manifest(pkg.name)
97
+ begin
98
+ manifest.load_package_manifest(pkg.name)
99
+ rescue Exception => e
100
+ raise if !auto_exclude
101
+ manifest.add_exclusion(pkg.name, "#{pkg.name} failed to import with #{e} and auto_exclude was true")
102
+ end
87
103
  end
88
104
 
89
105
  # The package setup mechanisms might have added an exclusion
@@ -158,6 +174,7 @@ def import_selected_packages(selection,
158
174
  keep_going: false,
159
175
  install_vcs_packages: Hash.new,
160
176
  non_imported_packages: :checkout,
177
+ auto_exclude: auto_exclude?,
161
178
  **import_options)
162
179
 
163
180
  if ![:checkout, :ignore, :return].include?(non_imported_packages)
@@ -275,6 +292,9 @@ def import_selected_packages(selection,
275
292
  if reason
276
293
  if reason.kind_of?(Autobuild::InteractionRequired)
277
294
  main_thread_imports << pkg
295
+ elsif auto_exclude
296
+ manifest.add_exclusion(pkg.name, "#{pkg.name} failed to import with #{reason} and auto_exclude was true")
297
+ selection.filter_excluded_and_ignored_packages(manifest)
278
298
  else
279
299
  # One importer failed... terminate
280
300
  Autoproj.error "import of #{pkg.name} failed"
@@ -284,7 +304,9 @@ def import_selected_packages(selection,
284
304
  failures << reason
285
305
  end
286
306
  else
287
- if new_packages = post_package_import(selection, manifest, pkg.autobuild, reverse_dependencies)
307
+ if new_packages = post_package_import(
308
+ selection, manifest, pkg.autobuild, reverse_dependencies,
309
+ auto_exclude: auto_exclude)
288
310
  # Excluded dependencies might have caused the package to be
289
311
  # excluded as well ... do not add any dependency to the
290
312
  # processing queue if it is the case
@@ -363,6 +385,7 @@ def import_packages(selection,
363
385
  recursive: true,
364
386
  keep_going: false,
365
387
  install_vcs_packages: Hash.new,
388
+ auto_exclude: auto_exclude?,
366
389
  **import_options)
367
390
 
368
391
  manifest = ws.manifest
@@ -373,6 +396,7 @@ def import_packages(selection,
373
396
  keep_going: keep_going,
374
397
  recursive: recursive,
375
398
  install_vcs_packages: install_vcs_packages,
399
+ auto_exclude: auto_exclude,
376
400
  **import_options)
377
401
 
378
402
  if !keep_going && !failures.empty?
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.1.2"
2
+ VERSION = "2.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.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: 2017-09-25 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -365,3 +365,4 @@ signing_key:
365
365
  specification_version: 4
366
366
  summary: Easy installation and management of sets of software packages
367
367
  test_files: []
368
+ has_rdoc: