autoproj 2.15.1 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autoproj/configuration.rb +34 -0
- data/lib/autoproj/ops/configuration.rb +24 -3
- data/lib/autoproj/package_set.rb +0 -17
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb77cb6d5c3c156ae3d665933ec7380f5b0ae491767b87c6e6f25c9c96966885
|
4
|
+
data.tar.gz: 1474ca4f6e00f46dc70631f25c70e0cf0340d85f62101053117faf79ed65bd21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1fb865f1ecdfa9d290c9dbb6048e601ca99f8e691643a36ada2528137c47819a30172e7abf9bd3d5cd91c44148fa0b8a8793b4a6783fb9bee52661cad960777
|
7
|
+
data.tar.gz: 6c9b821c1158e70bdb9a98536998dafe6270f4bb778646171d4691cc82fe0ce9828e263fda268ebaeced020cc7dcdfd30a33b9e5ea5593774f1ffe39eb0326c7
|
@@ -606,5 +606,39 @@ module Autoproj
|
|
606
606
|
end
|
607
607
|
result
|
608
608
|
end
|
609
|
+
|
610
|
+
# Allows to load a seed-config.yml file (also from a buildconf repository)
|
611
|
+
# rather than providing it before checkout using the --seed-config paramater
|
612
|
+
# of the autoproj_bootstrap script
|
613
|
+
# this allows to bootstrap with --no-interactive and still apply a custom config e.g. in CI/CD
|
614
|
+
# The call to this function has to be in the init.rb of the buildconf BEFORE any other
|
615
|
+
# config option, e.g. the git server configuration settings
|
616
|
+
# The filename parameter is the name of the config seed yml file in the repository
|
617
|
+
def load_config_once(filename, config_dir: Autoproj.workspace.config_dir)
|
618
|
+
seed_config = File.expand_path(filename, config_dir)
|
619
|
+
|
620
|
+
return if get("default_config_applied_#{seed_config}", false)
|
621
|
+
|
622
|
+
Autoproj.message "loading seed config #{seed_config}"
|
623
|
+
load path: seed_config
|
624
|
+
set "default_config_applied_#{seed_config}", true, true
|
625
|
+
end
|
626
|
+
|
627
|
+
# Similar to load_config_once but asks the user if the default config should be applied
|
628
|
+
def load_config_once_with_permission(filename, default: "yes", config_dir: Autoproj.workspace.config_dir)
|
629
|
+
seed_config = File.expand_path(filename, config_dir)
|
630
|
+
# only run this code if config has not beed applied already (don't run when reconfiguring)
|
631
|
+
return if has_value_for?("use_default_config_#{seed_config}")
|
632
|
+
|
633
|
+
declare "use_default_config_#{seed_config}",
|
634
|
+
"boolean",
|
635
|
+
default: default,
|
636
|
+
doc: ["Should the default workspace config be used?",
|
637
|
+
"This buildconf denines a default configuration in the buildconf (#{seed_config})",
|
638
|
+
"Should it be applied?"]
|
639
|
+
if get("use_default_config_#{seed_config}")
|
640
|
+
load_config_once(filename, config_dir: config_dir)
|
641
|
+
end
|
642
|
+
end
|
609
643
|
end
|
610
644
|
end
|
@@ -32,10 +32,24 @@ module Autoproj
|
|
32
32
|
@dag.add_edge p, root_pkg_set
|
33
33
|
end
|
34
34
|
end
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
37
|
+
def verify_acyclic
|
38
|
+
return if @dag.acyclic?
|
39
|
+
|
40
|
+
Autoproj.fatal "The package sets form (a) cycle(s)"
|
41
|
+
@dag.cycles.each_with_index do |cycle, index|
|
42
|
+
Autoproj.fatal "== Cycle #{index}"
|
43
|
+
(cycle + cycle[0, 1]).each_cons(2) do |a, b|
|
44
|
+
if b.imports.include?(a)
|
45
|
+
Autoproj.fatal " #{b.name} depends on #{a.name} in its source.yml"
|
46
|
+
else
|
47
|
+
Autoproj.fatal " #{b.name} is after #{a.name} in the package_sets section of the manifest"
|
48
|
+
end
|
49
|
+
end
|
38
50
|
end
|
51
|
+
|
52
|
+
raise ConfigError.new "cycles in package set dependencies"
|
39
53
|
end
|
40
54
|
|
41
55
|
# Flatten the hierarchy, a establish a sorting
|
@@ -363,6 +377,7 @@ module Autoproj
|
|
363
377
|
# the local package set (by main configuration) last
|
364
378
|
def sort_package_sets_by_import_order(package_sets, root_pkg_set)
|
365
379
|
c = PackageSetHierarchy.new(package_sets, root_pkg_set)
|
380
|
+
c.verify_acyclic
|
366
381
|
sorted_pkg_sets = c.flatten
|
367
382
|
|
368
383
|
if sorted_pkg_sets.last != root_pkg_set
|
@@ -626,12 +641,18 @@ module Autoproj
|
|
626
641
|
root_pkg_set.imports.each do |pkg_set|
|
627
642
|
pkg_set.explicit = true
|
628
643
|
end
|
644
|
+
|
645
|
+
# sort packages, main package is the last
|
629
646
|
package_sets = sort_package_sets_by_import_order(package_sets, root_pkg_set)
|
630
647
|
ws.manifest.reset_package_sets
|
631
648
|
package_sets.each do |pkg_set|
|
632
|
-
ws.load_if_present(pkg_set, pkg_set.local_dir, "init.rb")
|
633
649
|
ws.manifest.register_package_set(pkg_set)
|
634
650
|
end
|
651
|
+
|
652
|
+
ws.manifest.each_package_set do |pkg_set|
|
653
|
+
ws.load_if_present(pkg_set, pkg_set.local_dir, "init.rb")
|
654
|
+
end
|
655
|
+
|
635
656
|
failures
|
636
657
|
end
|
637
658
|
end
|
data/lib/autoproj/package_set.rb
CHANGED
@@ -793,23 +793,6 @@ module Autoproj
|
|
793
793
|
vcs
|
794
794
|
end
|
795
795
|
|
796
|
-
# Recursively resolve imports for a given package set
|
797
|
-
def self.resolve_imports(pkg_set, parents = Set.new)
|
798
|
-
return Set.new if pkg_set.imports.empty?
|
799
|
-
|
800
|
-
updated_parents = parents | [pkg_set]
|
801
|
-
|
802
|
-
imports = pkg_set.imports.dup
|
803
|
-
pkg_set.imports.each do |p|
|
804
|
-
if parents.include?(p)
|
805
|
-
raise "Cycling dependency between package sets encountered:" \
|
806
|
-
"#{p.name} <--> #{pkg_set.name}"
|
807
|
-
end
|
808
|
-
imports.merge(resolve_imports(p, updated_parents))
|
809
|
-
end
|
810
|
-
imports
|
811
|
-
end
|
812
|
-
|
813
796
|
# Enumerates the Autobuild::Package instances that are defined in this
|
814
797
|
# source
|
815
798
|
def each_package
|
data/lib/autoproj/version.rb
CHANGED
data/lib/autoproj.rb
CHANGED
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.
|
4
|
+
version: 2.16.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: 2022-
|
11
|
+
date: 2022-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: autobuild
|