autoproj 2.11.0 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -8
  3. data/.travis.yml +5 -3
  4. data/autoproj.gemspec +6 -6
  5. data/bin/alog +1 -0
  6. data/bin/autoproj +1 -1
  7. data/bin/autoproj_bootstrap +130 -67
  8. data/bin/autoproj_bootstrap.in +9 -7
  9. data/bin/autoproj_install +129 -63
  10. data/bin/autoproj_install.in +8 -3
  11. data/lib/autoproj/autobuild_extensions/dsl.rb +27 -12
  12. data/lib/autoproj/base.rb +18 -0
  13. data/lib/autoproj/cli/base.rb +1 -1
  14. data/lib/autoproj/cli/build.rb +8 -3
  15. data/lib/autoproj/cli/cache.rb +79 -7
  16. data/lib/autoproj/cli/inspection_tool.rb +5 -6
  17. data/lib/autoproj/cli/main.rb +33 -9
  18. data/lib/autoproj/cli/show.rb +12 -18
  19. data/lib/autoproj/cli/status.rb +15 -9
  20. data/lib/autoproj/cli/test.rb +1 -1
  21. data/lib/autoproj/cli/update.rb +72 -17
  22. data/lib/autoproj/cli/utility.rb +25 -28
  23. data/lib/autoproj/configuration.rb +15 -4
  24. data/lib/autoproj/default.osdeps +29 -3
  25. data/lib/autoproj/environment.rb +17 -13
  26. data/lib/autoproj/installation_manifest.rb +7 -5
  27. data/lib/autoproj/manifest.rb +14 -6
  28. data/lib/autoproj/ops/build.rb +23 -21
  29. data/lib/autoproj/ops/cache.rb +151 -33
  30. data/lib/autoproj/ops/cached_env.rb +2 -2
  31. data/lib/autoproj/ops/import.rb +23 -4
  32. data/lib/autoproj/ops/install.rb +121 -60
  33. data/lib/autoproj/ops/phase_reporting.rb +49 -0
  34. data/lib/autoproj/ops/snapshot.rb +2 -1
  35. data/lib/autoproj/ops/tools.rb +2 -2
  36. data/lib/autoproj/os_package_installer.rb +19 -11
  37. data/lib/autoproj/package_definition.rb +1 -1
  38. data/lib/autoproj/package_managers/apt_dpkg_manager.rb +49 -28
  39. data/lib/autoproj/package_managers/bundler_manager.rb +102 -19
  40. data/lib/autoproj/package_managers/homebrew_manager.rb +2 -2
  41. data/lib/autoproj/package_managers/pip_manager.rb +34 -22
  42. data/lib/autoproj/package_managers/shell_script_manager.rb +44 -24
  43. data/lib/autoproj/package_manifest.rb +43 -31
  44. data/lib/autoproj/package_set.rb +2 -2
  45. data/lib/autoproj/python.rb +285 -0
  46. data/lib/autoproj/test.rb +26 -10
  47. data/lib/autoproj/variable_expansion.rb +3 -1
  48. data/lib/autoproj/vcs_definition.rb +25 -12
  49. data/lib/autoproj/version.rb +1 -1
  50. data/lib/autoproj/workspace.rb +60 -16
  51. data/lib/autoproj.rb +3 -0
  52. metadata +17 -28
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.11.0"
2
+ VERSION = "2.14.0"
3
3
  end
@@ -243,7 +243,7 @@ module Autoproj
243
243
  File.join(config_dir, OVERRIDES_DIR)
244
244
  end
245
245
 
246
- IMPORT_REPORT_BASENAME = "import_report.json"
246
+ IMPORT_REPORT_BASENAME = "import_report.json".freeze
247
247
 
248
248
  # The full path to the update report
249
249
  #
@@ -252,7 +252,7 @@ module Autoproj
252
252
  File.join(log_dir, IMPORT_REPORT_BASENAME)
253
253
  end
254
254
 
255
- BUILD_REPORT_BASENAME = "build_report.json"
255
+ BUILD_REPORT_BASENAME = "build_report.json".freeze
256
256
 
257
257
  # The full path to the build report
258
258
  #
@@ -282,7 +282,8 @@ module Autoproj
282
282
  if (raw_vcs = config.get('manifest_source', nil))
283
283
  VCSDefinition.from_raw(raw_vcs)
284
284
  else
285
- VCSDefinition.from_raw(type: 'local', url: config_dir)
285
+ local_vcs = { type: 'local', url: config_dir }
286
+ VCSDefinition.from_raw(local_vcs)
286
287
  end
287
288
 
288
289
  if config.source_dir && Pathname.new(config.source_dir).absolute?
@@ -306,14 +307,18 @@ module Autoproj
306
307
  def autodetect_operating_system(force: false)
307
308
  if force || !os_package_resolver.operating_system
308
309
  begin
309
- Autobuild.progress_start :operating_system_autodetection,
310
+ Autobuild.progress_start(
311
+ :operating_system_autodetection,
310
312
  "autodetecting the operating system"
313
+ )
311
314
  names, versions = OSPackageResolver.autodetect_operating_system
312
315
  os_package_resolver.operating_system = [names, versions]
313
316
  os_repository_resolver.operating_system = [names, versions]
314
- Autobuild.progress :operating_system_autodetection,
317
+ Autobuild.progress(
318
+ :operating_system_autodetection,
315
319
  "operating system: #{(names - ['default']).join(',')} -"\
316
320
  " #{(versions - ['default']).join(',')}"
321
+ )
317
322
  ensure
318
323
  Autobuild.progress_done :operating_system_autodetection
319
324
  end
@@ -343,7 +348,11 @@ module Autoproj
343
348
  osdep_suffixes << ruby_version_keyword
344
349
  end
345
350
 
346
- def setup
351
+ # Perform initial configuration load and workspace setup
352
+ #
353
+ # @param [Boolean] load_global_configuration if true, load the global
354
+ # autoprojrc file if it exists. Otherwise, ignore it.
355
+ def setup(load_global_configuration: true)
347
356
  setup_ruby_version_handling
348
357
  migrate_bundler_and_autoproj_gem_layout
349
358
  load_config
@@ -353,7 +362,7 @@ module Autoproj
353
362
  config.validate_ruby_executable
354
363
  Autobuild.programs['ruby'] = config.ruby_executable
355
364
  config.apply_autobuild_configuration
356
- load_autoprojrc
365
+ load_autoprojrc if load_global_configuration
357
366
  load_main_initrb
358
367
  config.each_reused_autoproj_installation do |p|
359
368
  manifest.reuse(p)
@@ -370,6 +379,14 @@ module Autoproj
370
379
  Autobuild.logdir = log_dir
371
380
  if (cache_dir = config.importer_cache_dir)
372
381
  Autobuild::Importer.default_cache_dirs = cache_dir
382
+ os_package_installer.each_manager_with_name do |name, manager|
383
+ next unless manager.respond_to?(:cache_dir=)
384
+
385
+ manager_cache_path = File.join(cache_dir, 'package_managers', name)
386
+ if File.directory?(manager_cache_path)
387
+ manager.cache_dir = manager_cache_path
388
+ end
389
+ end
373
390
  end
374
391
  setup_os_package_installer
375
392
  install_ruby_shims
@@ -408,7 +425,7 @@ module Autoproj
408
425
  gemfile = File.join(dot_autoproj_dir, 'Gemfile')
409
426
  binstubs = File.join(dot_autoproj_dir, 'bin')
410
427
  Ops::Install.rewrite_shims(binstubs, config.ruby_executable,
411
- root_dir, gemfile, config.gems_gem_home)
428
+ root_dir, gemfile, config.gems_gem_home)
412
429
  end
413
430
 
414
431
  def update_bundler
@@ -416,7 +433,11 @@ module Autoproj
416
433
  gem_program = Ops::Install.guess_gem_program
417
434
  install = Ops::Install.new(root_dir)
418
435
  Autoproj.message " updating bundler"
419
- install.install_bundler(gem_program, silent: true)
436
+ install.install_bundler(
437
+ gem_program,
438
+ version: config.bundler_version,
439
+ silent: true
440
+ )
420
441
  end
421
442
 
422
443
  def update_autoproj(restart_on_update: true)
@@ -430,18 +451,21 @@ module Autoproj
430
451
  binstubs = File.join(dot_autoproj_dir, 'bin')
431
452
  if restart_on_update
432
453
  old_autoproj_path = PackageManagers::BundlerManager.bundle_gem_path(
433
- self, 'autoproj', gem_home: config.gems_gem_home, gemfile: gemfile)
454
+ self, 'autoproj', gemfile: gemfile
455
+ )
434
456
  end
435
457
  begin
436
458
  Autoproj.message " updating autoproj"
437
459
  PackageManagers::BundlerManager.run_bundler_install(
438
- self, gemfile, binstubs: binstubs)
460
+ self, gemfile, binstubs: binstubs
461
+ )
439
462
  ensure
440
463
  rewrite_shims
441
464
  end
442
465
  if restart_on_update
443
466
  new_autoproj_path = PackageManagers::BundlerManager.bundle_gem_path(
444
- self, 'autoproj', gem_home: config.gems_gem_home, gemfile: gemfile)
467
+ self, 'autoproj', gemfile: gemfile
468
+ )
445
469
  end
446
470
 
447
471
  # First things first, see if we need to update ourselves
@@ -586,6 +610,10 @@ module Autoproj
586
610
  current_workspaces = Workspace.registered_workspaces
587
611
  existing = current_workspaces.find { |w| w.root_dir == root_dir }
588
612
  if existing
613
+ if existing.prefix_dir == prefix_dir && existing.build_dir == build_dir
614
+ return
615
+ end
616
+
589
617
  existing.prefix_dir = prefix_dir
590
618
  existing.build_dir = build_dir
591
619
  else
@@ -779,6 +807,20 @@ module Autoproj
779
807
  full_env = self.full_env
780
808
  changed = save_cached_env(full_env)
781
809
  full_env.export_env_sh(shell_helpers: shell_helpers)
810
+
811
+ build_dir = Pathname(self.build_dir)
812
+ full_env.each_env_filename do |_, filename|
813
+ basename = File.basename(filename)
814
+ File.open(File.join(prefix_dir, basename), "w") do |io|
815
+ io.puts "source \"#{filename}\""
816
+ end
817
+ if build_dir.absolute?
818
+ build_dir.mkpath
819
+ (build_dir + basename).open("w") do |io|
820
+ io.puts "source \"#{filename}\""
821
+ end
822
+ end
823
+ end
782
824
  changed
783
825
  end
784
826
 
@@ -803,10 +845,12 @@ module Autoproj
803
845
  if import_missing
804
846
  ops = Autoproj::Ops::Import.new(self)
805
847
  _, all_os_packages =
806
- ops.import_packages(manifest.default_packages,
807
- checkout_only: true, only_local: true, reset: false,
808
- recursive: true, keep_going: true, parallel: parallel,
809
- retry_count: 0)
848
+ ops.import_packages(
849
+ manifest.default_packages,
850
+ checkout_only: true, only_local: true, reset: false,
851
+ recursive: true, keep_going: true, parallel: parallel,
852
+ retry_count: 0
853
+ )
810
854
  all_os_packages
811
855
  else
812
856
  manifest.all_selected_osdep_packages
data/lib/autoproj.rb CHANGED
@@ -9,6 +9,8 @@ require 'backports/2.4.0/fixnum/dup'
9
9
  require 'backports/2.4.0/nil_class/dup'
10
10
  require 'backports/2.4.0/false_class/dup'
11
11
  require 'backports/2.4.0/true_class/dup'
12
+ require 'backports/2.4.0/hash/transform_values'
13
+ require 'backports/2.5.0/hash/transform_keys'
12
14
 
13
15
  require 'autobuild'
14
16
  require 'autoproj/autobuild'
@@ -44,6 +46,7 @@ require 'autoproj/query_base'
44
46
  require 'autoproj/source_package_query'
45
47
  require 'autoproj/os_package_query'
46
48
 
49
+ require 'autoproj/ops/phase_reporting'
47
50
  require 'autoproj/ops/install'
48
51
  require 'autoproj/ops/tools'
49
52
  require 'autoproj/ops/loader'
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.11.0
4
+ version: 2.14.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-10-03 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.19.0
33
+ version: 1.21.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.19.0
40
+ version: 1.21.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: backports
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -78,82 +78,70 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 0.20.0
81
+ version: '1.0'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 0.20.0
88
+ version: '1.0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: concurrent-ruby
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 1.0.0
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- version: 1.0.0
95
+ version: '1.1'
99
96
  type: :runtime
100
97
  prerelease: false
101
98
  version_requirements: !ruby/object:Gem::Requirement
102
99
  requirements:
103
100
  - - "~>"
104
101
  - !ruby/object:Gem::Version
105
- version: 1.0.0
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: 1.0.0
102
+ version: '1.1'
109
103
  - !ruby/object:Gem::Dependency
110
104
  name: tty-color
111
105
  requirement: !ruby/object:Gem::Requirement
112
106
  requirements:
113
107
  - - "~>"
114
108
  - !ruby/object:Gem::Version
115
- version: 0.4.0
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: 0.4.0
109
+ version: 0.5.0
119
110
  type: :runtime
120
111
  prerelease: false
121
112
  version_requirements: !ruby/object:Gem::Requirement
122
113
  requirements:
123
114
  - - "~>"
124
115
  - !ruby/object:Gem::Version
125
- version: 0.4.0
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: 0.4.0
116
+ version: 0.5.0
129
117
  - !ruby/object:Gem::Dependency
130
118
  name: tty-prompt
131
119
  requirement: !ruby/object:Gem::Requirement
132
120
  requirements:
133
121
  - - "~>"
134
122
  - !ruby/object:Gem::Version
135
- version: 0.15.0
123
+ version: 0.21.0
136
124
  type: :runtime
137
125
  prerelease: false
138
126
  version_requirements: !ruby/object:Gem::Requirement
139
127
  requirements:
140
128
  - - "~>"
141
129
  - !ruby/object:Gem::Version
142
- version: 0.15.0
130
+ version: 0.21.0
143
131
  - !ruby/object:Gem::Dependency
144
132
  name: tty-spinner
145
133
  requirement: !ruby/object:Gem::Requirement
146
134
  requirements:
147
135
  - - "~>"
148
136
  - !ruby/object:Gem::Version
149
- version: 0.8.0
137
+ version: 0.9.0
150
138
  type: :runtime
151
139
  prerelease: false
152
140
  version_requirements: !ruby/object:Gem::Requirement
153
141
  requirements:
154
142
  - - "~>"
155
143
  - !ruby/object:Gem::Version
156
- version: 0.8.0
144
+ version: 0.9.0
157
145
  - !ruby/object:Gem::Dependency
158
146
  name: rb-inotify
159
147
  requirement: !ruby/object:Gem::Requirement
@@ -376,6 +364,7 @@ files:
376
364
  - lib/autoproj/ops/install.rb
377
365
  - lib/autoproj/ops/loader.rb
378
366
  - lib/autoproj/ops/main_config_switcher.rb
367
+ - lib/autoproj/ops/phase_reporting.rb
379
368
  - lib/autoproj/ops/snapshot.rb
380
369
  - lib/autoproj/ops/tools.rb
381
370
  - lib/autoproj/ops/watch.rb
@@ -405,6 +394,7 @@ files:
405
394
  - lib/autoproj/package_manifest.rb
406
395
  - lib/autoproj/package_selection.rb
407
396
  - lib/autoproj/package_set.rb
397
+ - lib/autoproj/python.rb
408
398
  - lib/autoproj/query_base.rb
409
399
  - lib/autoproj/reporter.rb
410
400
  - lib/autoproj/repository_managers/apt.rb
@@ -465,8 +455,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
465
455
  - !ruby/object:Gem::Version
466
456
  version: '0'
467
457
  requirements: []
468
- rubyforge_project:
469
- rubygems_version: 2.7.6.2
458
+ rubygems_version: 3.1.2
470
459
  signing_key:
471
460
  specification_version: 4
472
461
  summary: Easy installation and management of sets of software packages