autoproj 2.13.0 → 2.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +25 -0
- data/.github/workflows/test.yml +30 -0
- data/.rubocop.yml +79 -91
- data/.rubocop_todo.yml +1473 -0
- data/Gemfile +9 -9
- data/Rakefile +24 -24
- data/autoproj.gemspec +24 -22
- data/bin/alocate +4 -4
- data/bin/alog +5 -7
- data/bin/amake +4 -4
- data/bin/aup +4 -4
- data/bin/autoproj +3 -3
- data/bin/autoproj_bootstrap +224 -199
- data/bin/autoproj_bootstrap.in +7 -8
- data/bin/autoproj_install +223 -198
- data/bin/autoproj_install.in +6 -7
- data/lib/autoproj/aruba_minitest.rb +6 -11
- data/lib/autoproj/autobuild.rb +9 -6
- data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
- data/lib/autoproj/autobuild_extensions/dsl.rb +64 -34
- data/lib/autoproj/autobuild_extensions/git.rb +27 -26
- data/lib/autoproj/autobuild_extensions/package.rb +23 -22
- data/lib/autoproj/autobuild_extensions/python.rb +18 -0
- data/lib/autoproj/autobuild_extensions/svn.rb +1 -2
- data/lib/autoproj/base.rb +1 -1
- data/lib/autoproj/bash_completion.rb +5 -6
- data/lib/autoproj/build_option.rb +22 -24
- data/lib/autoproj/cli/base.rb +26 -26
- data/lib/autoproj/cli/bootstrap.rb +14 -16
- data/lib/autoproj/cli/build.rb +10 -7
- data/lib/autoproj/cli/cache.rb +11 -11
- data/lib/autoproj/cli/clean.rb +10 -10
- data/lib/autoproj/cli/commit.rb +7 -8
- data/lib/autoproj/cli/doc.rb +2 -2
- data/lib/autoproj/cli/envsh.rb +1 -2
- data/lib/autoproj/cli/exec.rb +60 -20
- data/lib/autoproj/cli/inspection_tool.rb +13 -7
- data/lib/autoproj/cli/locate.rb +30 -41
- data/lib/autoproj/cli/log.rb +7 -7
- data/lib/autoproj/cli/main.rb +213 -204
- data/lib/autoproj/cli/main_doc.rb +22 -21
- data/lib/autoproj/cli/main_global.rb +44 -19
- data/lib/autoproj/cli/main_plugin.rb +18 -18
- data/lib/autoproj/cli/main_test.rb +28 -27
- data/lib/autoproj/cli/manifest.rb +7 -7
- data/lib/autoproj/cli/osdeps.rb +12 -11
- data/lib/autoproj/cli/patcher.rb +2 -3
- data/lib/autoproj/cli/query.rb +17 -18
- data/lib/autoproj/cli/reconfigure.rb +1 -2
- data/lib/autoproj/cli/reset.rb +9 -12
- data/lib/autoproj/cli/show.rb +38 -39
- data/lib/autoproj/cli/status.rb +45 -39
- data/lib/autoproj/cli/switch_config.rb +5 -6
- data/lib/autoproj/cli/tag.rb +12 -11
- data/lib/autoproj/cli/test.rb +7 -7
- data/lib/autoproj/cli/update.rb +35 -37
- data/lib/autoproj/cli/utility.rb +11 -10
- data/lib/autoproj/cli/version.rb +42 -40
- data/lib/autoproj/cli/versions.rb +14 -15
- data/lib/autoproj/cli/watch.rb +33 -37
- data/lib/autoproj/cli/which.rb +16 -20
- data/lib/autoproj/cli.rb +4 -2
- data/lib/autoproj/configuration.rb +77 -85
- data/lib/autoproj/default.osdeps +18 -3
- data/lib/autoproj/environment.rb +42 -23
- data/lib/autoproj/exceptions.rb +9 -3
- data/lib/autoproj/find_workspace.rb +20 -25
- data/lib/autoproj/git_server_configuration.rb +40 -44
- data/lib/autoproj/gitorious.rb +1 -1
- data/lib/autoproj/installation_manifest.rb +64 -29
- data/lib/autoproj/local_package_set.rb +13 -11
- data/lib/autoproj/manifest.rb +137 -130
- data/lib/autoproj/metapackage.rb +2 -6
- data/lib/autoproj/ops/atomic_write.rb +7 -6
- data/lib/autoproj/ops/build.rb +4 -6
- data/lib/autoproj/ops/cache.rb +41 -43
- data/lib/autoproj/ops/cached_env.rb +5 -4
- data/lib/autoproj/ops/configuration.rb +525 -507
- data/lib/autoproj/ops/import.rb +76 -64
- data/lib/autoproj/ops/install.rb +217 -191
- data/lib/autoproj/ops/loader.rb +77 -76
- data/lib/autoproj/ops/main_config_switcher.rb +36 -45
- data/lib/autoproj/ops/phase_reporting.rb +4 -4
- data/lib/autoproj/ops/snapshot.rb +250 -247
- data/lib/autoproj/ops/tools.rb +76 -78
- data/lib/autoproj/ops/watch.rb +6 -6
- data/lib/autoproj/ops/which.rb +17 -14
- data/lib/autoproj/options.rb +13 -2
- data/lib/autoproj/os_package_installer.rb +102 -92
- data/lib/autoproj/os_package_query.rb +7 -13
- data/lib/autoproj/os_package_resolver.rb +189 -140
- data/lib/autoproj/os_repository_installer.rb +4 -4
- data/lib/autoproj/os_repository_resolver.rb +8 -6
- data/lib/autoproj/package_definition.rb +12 -13
- data/lib/autoproj/package_managers/apt_dpkg_manager.rb +19 -11
- data/lib/autoproj/package_managers/bundler_manager.rb +186 -129
- data/lib/autoproj/package_managers/debian_version.rb +25 -21
- data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
- data/lib/autoproj/package_managers/gem_manager.rb +68 -77
- data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
- data/lib/autoproj/package_managers/manager.rb +8 -3
- data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
- data/lib/autoproj/package_managers/pip_manager.rb +30 -28
- data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
- data/lib/autoproj/package_managers/port_manager.rb +2 -3
- data/lib/autoproj/package_managers/shell_script_manager.rb +47 -25
- data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
- data/lib/autoproj/package_managers/yum_manager.rb +12 -15
- data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
- data/lib/autoproj/package_manifest.rb +28 -74
- data/lib/autoproj/package_selection.rb +187 -187
- data/lib/autoproj/package_set.rb +144 -113
- data/lib/autoproj/python.rb +297 -0
- data/lib/autoproj/query_base.rb +20 -14
- data/lib/autoproj/reporter.rb +19 -19
- data/lib/autoproj/repository_managers/apt.rb +102 -68
- data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
- data/lib/autoproj/ros_condition_parser.rb +84 -0
- data/lib/autoproj/ros_package_manifest.rb +125 -0
- data/lib/autoproj/shell_completion.rb +16 -13
- data/lib/autoproj/source_package_query.rb +29 -36
- data/lib/autoproj/system.rb +32 -21
- data/lib/autoproj/test.rb +127 -104
- data/lib/autoproj/variable_expansion.rb +7 -9
- data/lib/autoproj/vcs_definition.rb +35 -32
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +142 -108
- data/lib/autoproj/zsh_completion.rb +8 -9
- data/lib/autoproj.rb +55 -55
- data/samples/autoproj/init.rb +1 -2
- metadata +80 -46
- data/.travis.yml +0 -24
data/lib/autoproj/ops/import.rb
CHANGED
@@ -94,7 +94,7 @@ module Autoproj
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def post_package_import(selection, manifest, pkg, reverse_dependencies,
|
97
|
-
|
97
|
+
auto_exclude: auto_exclude?)
|
98
98
|
Rake::Task["#{pkg.name}-import"]
|
99
99
|
.instance_variable_set(:@already_invoked, true)
|
100
100
|
if pkg.checked_out?
|
@@ -103,8 +103,10 @@ module Autoproj
|
|
103
103
|
rescue StandardError => e
|
104
104
|
raise unless auto_exclude
|
105
105
|
|
106
|
-
manifest.add_exclusion(
|
107
|
-
"
|
106
|
+
manifest.add_exclusion(
|
107
|
+
pkg.name, "#{pkg.name} failed to import "\
|
108
|
+
"with #{e} and auto_exclude was true"
|
109
|
+
)
|
108
110
|
end
|
109
111
|
end
|
110
112
|
|
@@ -172,35 +174,35 @@ module Autoproj
|
|
172
174
|
# allowed. Set to zero for no retry
|
173
175
|
# @param [Hash] import_options options passed to {Autobuild::Importer#import}
|
174
176
|
def queue_import_work(executor, completion_queue, pkg,
|
175
|
-
|
176
|
-
import_future =
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
177
|
+
retry_count: nil, **import_options)
|
178
|
+
import_future =
|
179
|
+
Concurrent::Promises.future_on(executor) do
|
180
|
+
## COMPLETELY BYPASS RAKE HERE
|
181
|
+
# The reason is that the ordering of import/prepare between
|
182
|
+
# packages is not important BUT the ordering of import vs.
|
183
|
+
# prepare in one package IS important: prepare is the method
|
184
|
+
# that takes into account dependencies.
|
185
|
+
pkg.autobuild.importer.retry_count = retry_count if retry_count
|
186
|
+
pkg.autobuild.import(**import_options)
|
187
|
+
end
|
188
|
+
|
189
|
+
import_future.on_resolution! do |time, result, reason|
|
187
190
|
completion_queue << [pkg, time, result, reason]
|
188
191
|
end
|
189
|
-
import_future.execute
|
190
192
|
end
|
191
193
|
|
192
194
|
# Import all packages from the given selection, and their
|
193
195
|
# dependencies
|
194
196
|
def import_selected_packages(selection,
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
197
|
+
parallel: ws.config.parallel_import_level,
|
198
|
+
recursive: true,
|
199
|
+
retry_count: nil,
|
200
|
+
keep_going: false,
|
201
|
+
install_vcs_packages: Hash.new,
|
202
|
+
non_imported_packages: :checkout,
|
203
|
+
auto_exclude: auto_exclude?,
|
204
|
+
filter: ->(package) { true },
|
205
|
+
**import_options)
|
204
206
|
|
205
207
|
unless %i[checkout ignore return].include?(non_imported_packages)
|
206
208
|
raise ArgumentError, "invalid value for 'non_imported_packages'. "\
|
@@ -234,7 +236,7 @@ module Autoproj
|
|
234
236
|
|
235
237
|
failures = Array.new
|
236
238
|
missing_vcs = Array.new
|
237
|
-
installed_vcs_packages = Set[
|
239
|
+
installed_vcs_packages = Set["none", "local"]
|
238
240
|
while failures.empty? || keep_going
|
239
241
|
# Allow 'filter' to parallelize as well
|
240
242
|
if filter.respond_to?(:lookahead)
|
@@ -288,7 +290,8 @@ module Autoproj
|
|
288
290
|
queue_import_work(
|
289
291
|
executor, completion_queue, pkg,
|
290
292
|
retry_count: retry_count,
|
291
|
-
**import_options.merge(allow_interactive: false)
|
293
|
+
**import_options.merge(allow_interactive: false)
|
294
|
+
)
|
292
295
|
rescue Exception
|
293
296
|
pending_packages.delete(pkg)
|
294
297
|
raise
|
@@ -301,8 +304,8 @@ module Autoproj
|
|
301
304
|
installed_vcs_packages.merge(
|
302
305
|
install_vcs_packages_for(
|
303
306
|
*missing_vcs,
|
304
|
-
|
305
|
-
|
307
|
+
install_only: import_options[:checkout_only],
|
308
|
+
**install_vcs_packages
|
306
309
|
)
|
307
310
|
)
|
308
311
|
package_queue.concat(missing_vcs)
|
@@ -317,17 +320,17 @@ module Autoproj
|
|
317
320
|
break
|
318
321
|
else
|
319
322
|
main_thread_imports.delete_if do |pkg|
|
320
|
-
# rubocop:disable Lint/HandleExceptions
|
321
323
|
begin
|
322
324
|
if retry_count
|
323
325
|
pkg.autobuild.importer.retry_count = retry_count
|
324
326
|
end
|
325
327
|
result = pkg.autobuild.import(
|
326
|
-
**import_options.merge(allow_interactive: true)
|
328
|
+
**import_options.merge(allow_interactive: true)
|
329
|
+
)
|
327
330
|
rescue StandardError => e
|
328
331
|
end
|
329
|
-
completion_queue << [pkg,
|
330
|
-
|
332
|
+
completion_queue << [pkg,
|
333
|
+
Time.now, result, e]
|
331
334
|
end
|
332
335
|
end
|
333
336
|
end
|
@@ -341,7 +344,8 @@ module Autoproj
|
|
341
344
|
elsif auto_exclude
|
342
345
|
manifest.add_exclusion(
|
343
346
|
pkg.name, "#{pkg.name} failed to import with "\
|
344
|
-
"#{reason} and auto_exclude was true"
|
347
|
+
"#{reason} and auto_exclude was true"
|
348
|
+
)
|
345
349
|
selection.filter_excluded_and_ignored_packages(manifest)
|
346
350
|
else
|
347
351
|
# One importer failed... terminate
|
@@ -352,7 +356,8 @@ module Autoproj
|
|
352
356
|
else
|
353
357
|
new_packages = post_package_import(
|
354
358
|
selection, manifest, pkg, reverse_dependencies,
|
355
|
-
auto_exclude: auto_exclude
|
359
|
+
auto_exclude: auto_exclude
|
360
|
+
)
|
356
361
|
if new_packages
|
357
362
|
# Excluded dependencies might have caused the package to be
|
358
363
|
# excluded as well ... do not add any dependency to the
|
@@ -382,8 +387,8 @@ module Autoproj
|
|
382
387
|
end
|
383
388
|
|
384
389
|
def finalize_package_load(processed_packages,
|
385
|
-
|
386
|
-
|
390
|
+
ignore_optional_dependencies: false,
|
391
|
+
auto_exclude: auto_exclude?)
|
387
392
|
manifest = ws.manifest
|
388
393
|
|
389
394
|
all = Set.new
|
@@ -411,7 +416,8 @@ module Autoproj
|
|
411
416
|
manifest.exclude_package(
|
412
417
|
pkg.name, "#{pkg.name} had an error when "\
|
413
418
|
"being loaded (#{e.message}) and "\
|
414
|
-
"auto_exclude is true"
|
419
|
+
"auto_exclude is true"
|
420
|
+
)
|
415
421
|
next
|
416
422
|
end
|
417
423
|
end
|
@@ -436,15 +442,15 @@ module Autoproj
|
|
436
442
|
end
|
437
443
|
|
438
444
|
def import_packages(selection,
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
445
|
+
non_imported_packages: :checkout,
|
446
|
+
warn_about_ignored_packages: true,
|
447
|
+
warn_about_excluded_packages: true,
|
448
|
+
recursive: true,
|
449
|
+
keep_going: false,
|
450
|
+
install_vcs_packages: Hash.new,
|
451
|
+
auto_exclude: auto_exclude?,
|
452
|
+
filter: ->(pkg) { true },
|
453
|
+
**import_options)
|
448
454
|
|
449
455
|
manifest = ws.manifest
|
450
456
|
|
@@ -456,11 +462,14 @@ module Autoproj
|
|
456
462
|
install_vcs_packages: install_vcs_packages,
|
457
463
|
auto_exclude: auto_exclude,
|
458
464
|
filter: filter,
|
459
|
-
**import_options
|
465
|
+
**import_options
|
466
|
+
)
|
460
467
|
|
461
468
|
raise failures.first if !keep_going && !failures.empty?
|
462
469
|
|
463
|
-
install_internal_dependencies_for(
|
470
|
+
install_internal_dependencies_for(
|
471
|
+
*all_processed_packages, install_only: import_options[:checkout_only]
|
472
|
+
)
|
464
473
|
finalize_package_load(all_processed_packages, auto_exclude: auto_exclude)
|
465
474
|
|
466
475
|
all_enabled_osdeps = selection.each_osdep_package_name.to_set
|
@@ -489,12 +498,13 @@ module Autoproj
|
|
489
498
|
end
|
490
499
|
end
|
491
500
|
|
492
|
-
if
|
501
|
+
if failures.empty?
|
502
|
+
[all_enabled_sources, all_enabled_osdeps]
|
503
|
+
else
|
493
504
|
raise PackageImportFailed.new(
|
494
505
|
failures, source_packages: all_enabled_sources,
|
495
|
-
osdep_packages: all_enabled_osdeps
|
496
|
-
|
497
|
-
return all_enabled_sources, all_enabled_osdeps
|
506
|
+
osdep_packages: all_enabled_osdeps
|
507
|
+
)
|
498
508
|
end
|
499
509
|
ensure
|
500
510
|
create_report(all_processed_packages || []) if @report_path
|
@@ -503,7 +513,8 @@ module Autoproj
|
|
503
513
|
Autoproj::Ops::Snapshot.update_log_available?(manifest)
|
504
514
|
if update_log
|
505
515
|
update_log_for_processed_packages(
|
506
|
-
all_processed_packages || Array.new, $!
|
516
|
+
all_processed_packages || Array.new, $!
|
517
|
+
)
|
507
518
|
end
|
508
519
|
end
|
509
520
|
|
@@ -528,13 +539,15 @@ module Autoproj
|
|
528
539
|
}
|
529
540
|
end
|
530
541
|
|
531
|
-
report = JSON.pretty_generate(
|
532
|
-
|
533
|
-
|
534
|
-
|
542
|
+
report = JSON.pretty_generate(
|
543
|
+
{
|
544
|
+
import_report: {
|
545
|
+
timestamp: Time.now,
|
546
|
+
packages: packages
|
547
|
+
}
|
535
548
|
}
|
536
|
-
|
537
|
-
|
549
|
+
)
|
550
|
+
File.write(@report_path, report)
|
538
551
|
end
|
539
552
|
|
540
553
|
def update_log_for_processed_packages(all_processed_packages, exception)
|
@@ -544,13 +557,12 @@ module Autoproj
|
|
544
557
|
|
545
558
|
unless all_updated_packages.empty?
|
546
559
|
failure_message =
|
547
|
-
if exception
|
548
|
-
" (#{exception.message.split("\n").first})"
|
549
|
-
end
|
560
|
+
(" (#{exception.message.split("\n").first})" if exception)
|
550
561
|
ops = Ops::Snapshot.new(ws.manifest, keep_going: true)
|
551
562
|
ops.update_package_import_state(
|
552
563
|
"#{$0} #{ARGV.join(' ')}#{failure_message}",
|
553
|
-
all_updated_packages.map(&:name)
|
564
|
+
all_updated_packages.map(&:name)
|
565
|
+
)
|
554
566
|
end
|
555
567
|
end
|
556
568
|
end
|