autoproj 2.14.0 → 2.15.0
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 +22 -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 +185 -182
- data/bin/autoproj_bootstrap.in +7 -8
- data/bin/autoproj_install +184 -181
- data/bin/autoproj_install.in +6 -7
- data/lib/autoproj/aruba_minitest.rb +6 -11
- data/lib/autoproj/autobuild.rb +5 -6
- data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
- data/lib/autoproj/autobuild_extensions/dsl.rb +38 -34
- data/lib/autoproj/autobuild_extensions/git.rb +27 -26
- data/lib/autoproj/autobuild_extensions/package.rb +23 -22
- 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 -84
- data/lib/autoproj/environment.rb +28 -13
- 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 +132 -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 +511 -506
- data/lib/autoproj/ops/import.rb +73 -63
- data/lib/autoproj/ops/install.rb +178 -174
- 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 +10 -10
- data/lib/autoproj/package_managers/bundler_manager.rb +147 -111
- 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 +20 -22
- 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 +32 -22
- 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 +27 -26
- data/lib/autoproj/package_selection.rb +187 -187
- data/lib/autoproj/package_set.rb +127 -113
- data/lib/autoproj/python.rb +55 -55
- data/lib/autoproj/query_base.rb +20 -14
- data/lib/autoproj/reporter.rb +19 -19
- data/lib/autoproj/repository_managers/apt.rb +101 -67
- data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
- 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 +123 -107
- data/lib/autoproj/zsh_completion.rb +8 -9
- data/lib/autoproj.rb +53 -55
- data/samples/autoproj/init.rb +1 -2
- metadata +53 -51
- data/.travis.yml +0 -24
data/lib/autoproj/ops/build.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "erb"
|
2
2
|
module Autoproj
|
3
3
|
module Ops
|
4
4
|
# Operations related to building packages
|
@@ -77,7 +77,6 @@ module Autoproj
|
|
77
77
|
build_packages(all_enabled_packages)
|
78
78
|
end
|
79
79
|
|
80
|
-
|
81
80
|
# Builds the listed packages
|
82
81
|
#
|
83
82
|
# Only build steps that are actually needed will be performed. See
|
@@ -89,7 +88,7 @@ module Autoproj
|
|
89
88
|
def build_packages(all_enabled_packages, options = Hash.new)
|
90
89
|
if @report_path
|
91
90
|
reporting = Ops::PhaseReporting.new(
|
92
|
-
|
91
|
+
"build", @report_path, method(:package_metadata)
|
93
92
|
)
|
94
93
|
end
|
95
94
|
|
@@ -99,11 +98,10 @@ module Autoproj
|
|
99
98
|
begin
|
100
99
|
Autobuild.apply(
|
101
100
|
all_enabled_packages,
|
102
|
-
"autoproj-build", [
|
101
|
+
"autoproj-build", ["build"], options
|
103
102
|
) do |pkg, phase|
|
104
|
-
reporting&.report_incremental(pkg) if phase ==
|
103
|
+
reporting&.report_incremental(pkg) if phase == "build"
|
105
104
|
end
|
106
|
-
|
107
105
|
ensure
|
108
106
|
packages = all_enabled_packages.map do |name|
|
109
107
|
@manifest.find_autobuild_package(name)
|
data/lib/autoproj/ops/cache.rb
CHANGED
@@ -12,20 +12,18 @@ module Autoproj
|
|
12
12
|
|
13
13
|
def with_retry(count)
|
14
14
|
(count + 1).times do |i|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
Autobuild.message " failed, retrying (#{i}/#{count})"
|
22
|
-
end
|
15
|
+
break yield
|
16
|
+
rescue Autobuild::SubcommandFailed
|
17
|
+
if i == count
|
18
|
+
raise
|
19
|
+
else
|
20
|
+
Autobuild.message " failed, retrying (#{i}/#{count})"
|
23
21
|
end
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
27
25
|
def git_cache_dir
|
28
|
-
File.join(cache_dir,
|
26
|
+
File.join(cache_dir, "git")
|
29
27
|
end
|
30
28
|
|
31
29
|
def cache_git(pkg, checkout_only: false)
|
@@ -34,37 +32,37 @@ module Autoproj
|
|
34
32
|
|
35
33
|
pkg.importer.local_branch = nil
|
36
34
|
pkg.importer.remote_branch = nil
|
37
|
-
pkg.importer.remote_name =
|
35
|
+
pkg.importer.remote_name = "autobuild"
|
38
36
|
|
39
37
|
unless File.directory?(pkg.importdir)
|
40
38
|
FileUtils.mkdir_p File.dirname(pkg.importdir)
|
41
39
|
Autobuild::Subprocess.run(
|
42
40
|
"autoproj-cache", "import", Autobuild.tool(:git),
|
43
|
-
"--git-dir", pkg.importdir,
|
41
|
+
"--git-dir", pkg.importdir, "init", "--bare"
|
44
42
|
)
|
45
43
|
end
|
46
|
-
pkg.importer.update_remotes_configuration(pkg)
|
44
|
+
pkg.importer.update_remotes_configuration(pkg, only_local: false)
|
47
45
|
|
48
46
|
with_retry(10) do
|
49
47
|
Autobuild::Subprocess.run(
|
50
|
-
|
51
|
-
|
48
|
+
"autoproj-cache", :import, Autobuild.tool("git"),
|
49
|
+
"--git-dir", pkg.importdir, "remote", "update", "autobuild"
|
52
50
|
)
|
53
51
|
end
|
54
52
|
with_retry(10) do
|
55
53
|
Autobuild::Subprocess.run(
|
56
|
-
|
57
|
-
|
54
|
+
"autoproj-cache", :import, Autobuild.tool("git"),
|
55
|
+
"--git-dir", pkg.importdir, "fetch", "autobuild", "--tags"
|
58
56
|
)
|
59
57
|
end
|
60
58
|
Autobuild::Subprocess.run(
|
61
|
-
|
62
|
-
|
59
|
+
"autoproj-cache", :import, Autobuild.tool("git"),
|
60
|
+
"--git-dir", pkg.importdir, "gc", "--prune=all"
|
63
61
|
)
|
64
62
|
end
|
65
63
|
|
66
64
|
def archive_cache_dir
|
67
|
-
File.join(cache_dir,
|
65
|
+
File.join(cache_dir, "archives")
|
68
66
|
end
|
69
67
|
|
70
68
|
def cache_archive(pkg)
|
@@ -75,25 +73,25 @@ module Autoproj
|
|
75
73
|
end
|
76
74
|
|
77
75
|
def create_or_update(*package_names, all: true, keep_going: false,
|
78
|
-
|
76
|
+
checkout_only: false)
|
79
77
|
FileUtils.mkdir_p cache_dir
|
80
78
|
|
81
|
-
|
82
|
-
|
79
|
+
packages =
|
80
|
+
if package_names.empty?
|
83
81
|
if all
|
84
82
|
manifest.each_autobuild_package
|
85
83
|
else
|
86
84
|
manifest.all_selected_source_packages.map(&:autobuild)
|
87
85
|
end
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
86
|
+
else
|
87
|
+
package_names.map do |name|
|
88
|
+
if (pkg = manifest.find_autobuild_package(name))
|
89
|
+
pkg
|
90
|
+
else
|
91
|
+
raise PackageNotFound, "no package named #{name}"
|
92
|
+
end
|
94
93
|
end
|
95
94
|
end
|
96
|
-
end
|
97
95
|
|
98
96
|
packages = packages.sort_by(&:name)
|
99
97
|
|
@@ -128,10 +126,10 @@ module Autoproj
|
|
128
126
|
raise unless keep_going
|
129
127
|
|
130
128
|
pkg.error " failed to cache #{pkg.name}, "\
|
131
|
-
|
129
|
+
"but going on as requested"
|
132
130
|
lines = e.to_s.split('\n')
|
133
131
|
lines = e.message.split('\n') if lines.empty?
|
134
|
-
lines = [
|
132
|
+
lines = ["unknown error"] if lines.empty?
|
135
133
|
pkg.message(lines.shift, :red, :bold)
|
136
134
|
lines.each do |line|
|
137
135
|
pkg.message(line)
|
@@ -142,15 +140,15 @@ module Autoproj
|
|
142
140
|
end
|
143
141
|
|
144
142
|
def gems_cache_dir
|
145
|
-
File.join(cache_dir,
|
143
|
+
File.join(cache_dir, "package_managers", "gem")
|
146
144
|
end
|
147
145
|
|
148
146
|
def create_or_update_gems(keep_going: true, compile_force: false, compile: [])
|
149
147
|
# Note: this might directly copy into the cache directoy, and
|
150
148
|
# we support it later
|
151
|
-
cache_dir = File.join(@ws.prefix_dir,
|
149
|
+
cache_dir = File.join(@ws.prefix_dir, "gems", "vendor", "cache")
|
152
150
|
PackageManagers::BundlerManager.run_bundler(
|
153
|
-
@ws,
|
151
|
+
@ws, "cache"
|
154
152
|
)
|
155
153
|
|
156
154
|
FileUtils.mkdir_p(gems_cache_dir) unless File.exist?(gems_cache_dir)
|
@@ -209,23 +207,23 @@ module Autoproj
|
|
209
207
|
end
|
210
208
|
|
211
209
|
def guess_gem_program
|
212
|
-
return Autobuild.programs[
|
210
|
+
return Autobuild.programs["gem"] if Autobuild.programs["gem"]
|
213
211
|
|
214
|
-
ruby_bin = RbConfig::CONFIG[
|
215
|
-
ruby_bindir = RbConfig::CONFIG[
|
212
|
+
ruby_bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"]
|
213
|
+
ruby_bindir = RbConfig::CONFIG["bindir"]
|
216
214
|
|
217
|
-
candidates = [
|
215
|
+
candidates = ["gem"]
|
218
216
|
candidates << "gem#{$1}" if ruby_bin =~ /^ruby(.+)$/
|
219
217
|
|
220
218
|
candidates.each do |gem_name|
|
221
219
|
if File.file?(gem_full_path = File.join(ruby_bindir, gem_name))
|
222
|
-
Autobuild.programs[
|
223
|
-
return Autobuild.programs[
|
220
|
+
Autobuild.programs["gem"] = gem_full_path
|
221
|
+
return Autobuild.programs["gem"]
|
224
222
|
end
|
225
223
|
end
|
226
224
|
|
227
225
|
raise ArgumentError,
|
228
|
-
|
226
|
+
"cannot find a gem program (tried "\
|
229
227
|
"#{candidates.sort.join(', ')} in #{ruby_bindir})"
|
230
228
|
end
|
231
229
|
|
@@ -237,8 +235,8 @@ module Autoproj
|
|
237
235
|
["--exclude", n]
|
238
236
|
end
|
239
237
|
end
|
240
|
-
unless system(Autobuild.tool(
|
241
|
-
|
238
|
+
unless system(Autobuild.tool("ruby"), "-S", guess_gem_program,
|
239
|
+
"compile", "--output", output, *artifacts, gem_path)
|
242
240
|
raise CompilationFailed, "#{gem_path} failed to compile"
|
243
241
|
end
|
244
242
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
1
|
+
require "autobuild/environment"
|
2
2
|
|
3
3
|
module Autoproj
|
4
4
|
module Ops
|
5
5
|
def self.cached_env_path(root_dir)
|
6
|
-
File.join(root_dir,
|
6
|
+
File.join(root_dir, ".autoproj", "env.yml")
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.load_cached_env(root_dir)
|
@@ -11,7 +11,8 @@ module Autoproj
|
|
11
11
|
if File.file?(path)
|
12
12
|
env = YAML.safe_load(File.read(path))
|
13
13
|
Autobuild::Environment::ExportedEnvironment.new(
|
14
|
-
env[
|
14
|
+
env["set"], env["unset"], env["update"]
|
15
|
+
)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
@@ -24,7 +25,7 @@ module Autoproj
|
|
24
25
|
rescue Exception
|
25
26
|
end
|
26
27
|
|
27
|
-
env = Hash[
|
28
|
+
env = Hash["set" => env.set, "unset" => env.unset, "update" => env.update]
|
28
29
|
if env != existing
|
29
30
|
Ops.atomic_write(path) do |io|
|
30
31
|
io.write YAML.dump(env)
|