autobuild 1.25.0 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +4 -0
- data/.gitignore +2 -1
- data/lib/autobuild/build_logfile.rb +0 -2
- data/lib/autobuild/environment.rb +1 -4
- data/lib/autobuild/import/archive.rb +0 -7
- data/lib/autobuild/import/darcs.rb +0 -4
- data/lib/autobuild/import/git.rb +0 -7
- data/lib/autobuild/import/hg.rb +0 -5
- data/lib/autobuild/import/svn.rb +0 -4
- data/lib/autobuild/importer.rb +0 -3
- data/lib/autobuild/packages/autotools.rb +0 -8
- data/lib/autobuild/packages/cmake.rb +0 -3
- data/lib/autobuild/packages/genom.rb +0 -4
- data/lib/autobuild/packages/gnumake.rb +0 -2
- data/lib/autobuild/packages/import.rb +0 -3
- data/lib/autobuild/packages/pkgconfig.rb +0 -2
- data/lib/autobuild/packages/python.rb +1 -4
- data/lib/autobuild/progress_display.rb +0 -3
- data/lib/autobuild/reporting.rb +3 -2
- data/lib/autobuild/{subcommand.rb → subprocess.rb} +225 -182
- data/lib/autobuild/version.rb +1 -1
- data/lib/autobuild.rb +21 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e80fda7259afb401296183494e07a8a08f1ef22c2b8cab1f54577c7527aa72ed
|
4
|
+
data.tar.gz: 89a5471c0b5afb613757dd04ac92eeb2acc0fe3fdf3cb419eb729dc2c8661e98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54d5bbccd77d298c58cc4b8e437fcb0de325252de23d83b73aafa02ad0a4c0476177913fdfc1634022dcc4b4abc90381534f081ff1d96f58a18f400c8985bc84
|
7
|
+
data.tar.gz: fa6f9ae365e2314d1844004924fbab9c6da73d5cebc7a3244bb6092462564d5538342496f85f79d2d54e2e13717dd140341571582b8867976cdfd8d86d3ddbc9
|
data/.github/workflows/test.yml
CHANGED
@@ -9,6 +9,8 @@ jobs:
|
|
9
9
|
strategy:
|
10
10
|
matrix:
|
11
11
|
ruby-version:
|
12
|
+
- "3.2"
|
13
|
+
- "3.1"
|
12
14
|
- "3.0"
|
13
15
|
- "2.7"
|
14
16
|
- "2.5"
|
@@ -24,6 +26,8 @@ jobs:
|
|
24
26
|
ruby-version: ${{ matrix.ruby-version }}
|
25
27
|
- name: Remove vscode gems
|
26
28
|
run: bundle config set --local without vscode
|
29
|
+
- name: Install subversion
|
30
|
+
run: sudo apt update && sudo apt install subversion
|
27
31
|
- name: Install dependencies
|
28
32
|
run: bundle install
|
29
33
|
- name: Enable file transport in git
|
data/.gitignore
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
require 'set'
|
2
|
-
require 'rbconfig'
|
3
|
-
require 'utilrb/hash/map_value'
|
4
|
-
|
5
1
|
module Autobuild
|
6
2
|
@windows = RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw|[Ww]indows)/
|
7
3
|
def self.windows?
|
@@ -260,6 +256,7 @@ module Autobuild
|
|
260
256
|
if flag
|
261
257
|
@inherited_variables |= names
|
262
258
|
names.each do |env_name|
|
259
|
+
@environment[env_name] ||= []
|
263
260
|
init_from_env(env_name)
|
264
261
|
end
|
265
262
|
else
|
data/lib/autobuild/import/git.rb
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'autobuild/subcommand'
|
3
|
-
require 'autobuild/importer'
|
4
|
-
require 'utilrb/kernel/options'
|
5
|
-
require 'open3'
|
6
|
-
require 'English'
|
7
|
-
|
8
1
|
module Autobuild
|
9
2
|
class Git < Importer
|
10
3
|
# Exception raised when a network access is needed while only_local is true
|
data/lib/autobuild/import/hg.rb
CHANGED
data/lib/autobuild/import/svn.rb
CHANGED
data/lib/autobuild/importer.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'autobuild/config'
|
2
|
-
require 'autobuild/exceptions'
|
3
|
-
|
4
1
|
# This class is the base class for objects that are used to get the source from
|
5
2
|
# various RCS into the package source directory. A list of patches to apply
|
6
3
|
# after the import can be given in the +:patches+ option.
|
@@ -1,11 +1,3 @@
|
|
1
|
-
require 'pathname'
|
2
|
-
require 'autobuild/timestamps'
|
3
|
-
require 'autobuild/environment'
|
4
|
-
require 'autobuild/package'
|
5
|
-
require 'autobuild/subcommand'
|
6
|
-
require 'shellwords'
|
7
|
-
require 'fileutils'
|
8
|
-
|
9
1
|
module Autobuild
|
10
2
|
def self.autotools(opts, &proc)
|
11
3
|
Autotools.new(opts, &proc)
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'autobuild/configurable'
|
2
|
-
require 'open3'
|
3
|
-
|
4
1
|
# Main Autobuild module
|
5
2
|
module Autobuild
|
6
3
|
def self.python(opts, &proc)
|
@@ -88,7 +85,7 @@ module Autobuild
|
|
88
85
|
|
89
86
|
# Install the result in prefix
|
90
87
|
def install
|
91
|
-
return unless install_mode?
|
88
|
+
return super unless install_mode?
|
92
89
|
|
93
90
|
command = generate_install_command
|
94
91
|
command << '--force' if @forced
|
data/lib/autobuild/reporting.rb
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
require 'set'
|
2
|
-
require 'autobuild/exceptions'
|
3
|
-
require 'autobuild/reporting'
|
4
|
-
require 'fcntl'
|
5
|
-
require 'English'
|
6
|
-
|
7
1
|
module Autobuild
|
8
2
|
@logfiles = Set.new
|
9
3
|
def self.clear_logfiles
|
@@ -165,10 +159,6 @@ module Autobuild::Subprocess # rubocop:disable Style/ClassAndModuleChildren
|
|
165
159
|
end
|
166
160
|
end
|
167
161
|
|
168
|
-
CONTROL_COMMAND_NOT_FOUND = 1
|
169
|
-
CONTROL_UNEXPECTED = 2
|
170
|
-
CONTROL_INTERRUPT = 3
|
171
|
-
|
172
162
|
@transparent_mode = false
|
173
163
|
|
174
164
|
def self.transparent_mode?
|
@@ -212,7 +202,7 @@ module Autobuild::Subprocess # rubocop:disable Style/ClassAndModuleChildren
|
|
212
202
|
# @option options [String] :input the path to a file whose content should be
|
213
203
|
# fed to the command standard input
|
214
204
|
# @return [String] the command standard output
|
215
|
-
def self.run(target, phase, *command)
|
205
|
+
def self.run(target, phase, *command, &output_filter)
|
216
206
|
STDOUT.sync = true
|
217
207
|
|
218
208
|
input_streams = []
|
@@ -242,13 +232,8 @@ module Autobuild::Subprocess # rubocop:disable Style/ClassAndModuleChildren
|
|
242
232
|
command.reject! { |o| o.nil? || (o.respond_to?(:empty?) && o.empty?) }
|
243
233
|
command.collect!(&:to_s)
|
244
234
|
|
245
|
-
|
246
|
-
|
247
|
-
target_type = target.class
|
248
|
-
else
|
249
|
-
target_name = target.to_str
|
250
|
-
target_type = nil
|
251
|
-
end
|
235
|
+
target_name, target_type = target_argument_to_name_and_type(target)
|
236
|
+
|
252
237
|
logdir = if target.respond_to?(:logdir)
|
253
238
|
target.logdir
|
254
239
|
else
|
@@ -259,27 +244,6 @@ module Autobuild::Subprocess # rubocop:disable Style/ClassAndModuleChildren
|
|
259
244
|
options[:working_directory] ||= target.working_directory
|
260
245
|
end
|
261
246
|
|
262
|
-
logname = File.join(logdir, "#{target_name.gsub(/:/, '_')}-"\
|
263
|
-
"#{phase.to_s.gsub(/:/, '_')}.log")
|
264
|
-
unless File.directory?(File.dirname(logname))
|
265
|
-
FileUtils.mkdir_p File.dirname(logname)
|
266
|
-
end
|
267
|
-
|
268
|
-
if Autobuild.verbose
|
269
|
-
Autobuild.message "#{target_name}: running #{command.join(' ')}\n"\
|
270
|
-
" (output goes to #{logname})"
|
271
|
-
end
|
272
|
-
|
273
|
-
open_flag = if Autobuild.keep_oldlogs then 'a'
|
274
|
-
elsif Autobuild.registered_logfile?(logname) then 'a'
|
275
|
-
else
|
276
|
-
'w'
|
277
|
-
end
|
278
|
-
open_flag << ":BINARY"
|
279
|
-
|
280
|
-
Autobuild.register_logfile(logname)
|
281
|
-
subcommand_output = Array.new
|
282
|
-
|
283
247
|
env = options[:env].dup
|
284
248
|
if options[:env_inherit]
|
285
249
|
ENV.each do |k, v|
|
@@ -287,169 +251,101 @@ module Autobuild::Subprocess # rubocop:disable Style/ClassAndModuleChildren
|
|
287
251
|
end
|
288
252
|
end
|
289
253
|
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
logfile.puts " #{command.join(' ')}"
|
295
|
-
logfile.puts "with environment:"
|
296
|
-
env.keys.sort.each do |key|
|
297
|
-
if (value = env[key])
|
298
|
-
logfile.puts " '#{key}'='#{value}'"
|
299
|
-
end
|
300
|
-
end
|
301
|
-
logfile.puts
|
302
|
-
logfile.puts "#{Time.now}: running"
|
303
|
-
logfile.puts " #{command.join(' ')}"
|
304
|
-
logfile.flush
|
305
|
-
logfile.sync = true
|
306
|
-
|
307
|
-
unless input_streams.empty?
|
308
|
-
pread, pwrite = IO.pipe # to feed subprocess stdin
|
309
|
-
end
|
254
|
+
if Autobuild.windows?
|
255
|
+
windows_support(options, command)
|
256
|
+
return
|
257
|
+
end
|
310
258
|
|
311
|
-
|
312
|
-
outread.sync = true
|
313
|
-
outwrite.sync = true
|
259
|
+
logname = compute_log_path(target_name, phase, logdir)
|
314
260
|
|
315
|
-
|
261
|
+
status, subcommand_output = open_logfile(logname) do |logfile|
|
262
|
+
logfile_header(logfile, command, env)
|
316
263
|
|
317
|
-
if Autobuild.
|
318
|
-
|
319
|
-
|
320
|
-
exit_code = $CHILD_STATUS.exitstatus
|
321
|
-
raise Failed.new(exit_code, nil),
|
322
|
-
"'#{command.join(' ')}' returned status #{exit_code}"
|
323
|
-
end
|
324
|
-
end
|
325
|
-
return # rubocop:disable Lint/NonLocalExitFromIterator
|
264
|
+
if Autobuild.verbose
|
265
|
+
Autobuild.message "#{target_name}: running #{command.join(' ')}\n"\
|
266
|
+
" (output goes to #{logname})"
|
326
267
|
end
|
327
268
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
logfile.puts "in directory #{options[:working_directory] || Dir.pwd}"
|
332
|
-
|
333
|
-
cwrite.sync = true
|
334
|
-
if Autobuild.nice
|
335
|
-
Process.setpriority(Process::PRIO_PROCESS, 0, Autobuild.nice)
|
336
|
-
end
|
337
|
-
|
338
|
-
outread.close
|
339
|
-
$stderr.reopen(outwrite.dup)
|
340
|
-
$stdout.reopen(outwrite.dup)
|
341
|
-
|
342
|
-
unless input_streams.empty?
|
343
|
-
pwrite.close
|
344
|
-
$stdin.reopen(pread)
|
345
|
-
end
|
269
|
+
unless input_streams.empty?
|
270
|
+
stdin_r, stdin_w = IO.pipe # to feed subprocess stdin
|
271
|
+
end
|
346
272
|
|
347
|
-
|
348
|
-
|
349
|
-
|
273
|
+
out_r, out_w = IO.pipe
|
274
|
+
out_r.sync = true
|
275
|
+
out_w.sync = true
|
276
|
+
|
277
|
+
logfile.puts "Spawning"
|
278
|
+
stdin_redir = { :in => stdin_r } if stdin_r
|
279
|
+
begin
|
280
|
+
pid = spawn(
|
281
|
+
env, *command,
|
282
|
+
{
|
283
|
+
:chdir => options[:working_directory] || Dir.pwd,
|
284
|
+
:close_others => false,
|
285
|
+
%I[err out] => out_w
|
286
|
+
}.merge(stdin_redir || {})
|
287
|
+
)
|
288
|
+
logfile.puts "Spawned, PID=#{pid}"
|
350
289
|
rescue Errno::ENOENT
|
351
|
-
|
352
|
-
exit(100)
|
353
|
-
rescue Interrupt
|
354
|
-
cwrite.write([CONTROL_INTERRUPT].pack('I'))
|
355
|
-
exit(100)
|
356
|
-
rescue ::Exception => e
|
357
|
-
STDERR.puts e
|
358
|
-
STDERR.puts e.backtrace.join("\n ")
|
359
|
-
cwrite.write([CONTROL_UNEXPECTED].pack('I'))
|
360
|
-
exit(100)
|
290
|
+
raise Failed.new(nil, false), "command '#{command.first}' not found"
|
361
291
|
end
|
362
292
|
|
363
|
-
|
293
|
+
if Autobuild.nice
|
294
|
+
Process.setpriority(Process::PRIO_PROCESS, pid, Autobuild.nice)
|
295
|
+
end
|
364
296
|
|
365
297
|
# Feed the input
|
366
298
|
unless input_streams.empty?
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
while IO.select([outread], nil, nil, 0)
|
372
|
-
readbuffer.write(outread.readpartial(128))
|
373
|
-
end
|
374
|
-
pwrite.write(line)
|
375
|
-
end
|
376
|
-
end
|
377
|
-
rescue Errno::ENOENT => e
|
378
|
-
raise Failed.new(nil, false),
|
379
|
-
"cannot open input files: #{e.message}", retry: false
|
380
|
-
end
|
381
|
-
pwrite.close
|
299
|
+
logfile.puts "Feeding STDIN"
|
300
|
+
stdin_r.close
|
301
|
+
readbuffer = feed_input(input_streams, out_r, stdin_w)
|
302
|
+
stdin_w.close
|
382
303
|
end
|
383
304
|
|
384
|
-
# Get control status
|
385
|
-
cwrite.close
|
386
|
-
value = cread.read(4)
|
387
|
-
if value
|
388
|
-
# An error occured
|
389
|
-
value = value.unpack1('I')
|
390
|
-
case value
|
391
|
-
when CONTROL_COMMAND_NOT_FOUND
|
392
|
-
raise Failed.new(nil, false), "command '#{command.first}' not found"
|
393
|
-
when CONTROL_INTERRUPT
|
394
|
-
raise Interrupt, "command '#{command.first}': interrupted by user"
|
395
|
-
else
|
396
|
-
raise Failed.new(nil, false), "something unexpected happened"
|
397
|
-
end
|
398
|
-
end
|
399
|
-
|
400
|
-
transparent_prefix = "#{target_name}:#{phase}: "
|
401
|
-
transparent_prefix = "#{target_type}:#{transparent_prefix}" if target_type
|
402
|
-
|
403
305
|
# If the caller asked for process output, provide it to him
|
404
306
|
# line-by-line.
|
405
|
-
|
307
|
+
out_w.close
|
406
308
|
|
407
309
|
unless input_streams.empty?
|
408
|
-
readbuffer.write(
|
310
|
+
readbuffer.write(out_r.read)
|
409
311
|
readbuffer.seek(0)
|
410
|
-
|
411
|
-
|
312
|
+
out_r.close
|
313
|
+
out_r = readbuffer
|
412
314
|
end
|
413
315
|
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
if Autobuild.verbose || transparent_mode?
|
422
|
-
STDOUT.puts "#{transparent_prefix}#{line}"
|
423
|
-
elsif block_given?
|
424
|
-
# Do not yield
|
425
|
-
# would mix the progress output with the actual command
|
426
|
-
# output. Assume that if the user wants the command output,
|
427
|
-
# the autobuild progress output is unnecessary
|
428
|
-
yield(line)
|
429
|
-
end
|
430
|
-
end
|
431
|
-
outread.close
|
316
|
+
transparent_prefix =
|
317
|
+
transparent_output_prefix(target_name, phase, target_type)
|
318
|
+
logfile.puts "Processing command output"
|
319
|
+
subcommand_output = process_output(
|
320
|
+
out_r, logfile, transparent_prefix, options[:encoding], &output_filter
|
321
|
+
)
|
322
|
+
out_r.close
|
432
323
|
|
324
|
+
logfile.puts "Waiting for #{pid} to finish"
|
433
325
|
_, childstatus = Process.wait2(pid)
|
434
326
|
logfile.puts "Exit: #{childstatus}"
|
435
|
-
childstatus
|
327
|
+
[childstatus, subcommand_output]
|
436
328
|
end
|
437
329
|
|
438
|
-
|
439
|
-
|
440
|
-
raise Interrupt, "subcommand #{command.join(' ')} interrupted"
|
441
|
-
end
|
330
|
+
handle_exit_status(status, command)
|
331
|
+
update_stats(target, phase, start_time)
|
442
332
|
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
333
|
+
subcommand_output
|
334
|
+
rescue Failed => e
|
335
|
+
error = Autobuild::SubcommandFailed.new(
|
336
|
+
target, command.join(" "), logname, e.status, subcommand_output || []
|
337
|
+
)
|
338
|
+
error.retry = if e.retry?.nil? then options[:retry]
|
339
|
+
else
|
340
|
+
e.retry?
|
341
|
+
end
|
342
|
+
error.phase = phase
|
343
|
+
raise error, e.message
|
344
|
+
end
|
451
345
|
|
346
|
+
def self.update_stats(target, phase, start_time)
|
452
347
|
duration = Time.now - start_time
|
348
|
+
target_name, = target_argument_to_name_and_type(target)
|
453
349
|
Autobuild.add_stat(target, phase, duration)
|
454
350
|
FileUtils.mkdir_p(Autobuild.logdir)
|
455
351
|
File.open(File.join(Autobuild.logdir, "stats.log"), 'a') do |io|
|
@@ -458,15 +354,162 @@ module Autobuild::Subprocess # rubocop:disable Style/ClassAndModuleChildren
|
|
458
354
|
io.puts "#{formatted_time} #{target_name} #{phase} #{duration}"
|
459
355
|
end
|
460
356
|
target.add_stat(phase, duration) if target.respond_to?(:add_stat)
|
357
|
+
end
|
358
|
+
|
359
|
+
def self.target_argument_to_name_and_type(target)
|
360
|
+
if target.respond_to?(:name)
|
361
|
+
[target.name, target.class]
|
362
|
+
else
|
363
|
+
[target.to_str, nil]
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
def self.target_argument_to_name(target)
|
368
|
+
if target.respond_to?(:name)
|
369
|
+
target.name
|
370
|
+
else
|
371
|
+
target.to_str
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
def self.target_argument_to_type(target, type)
|
376
|
+
return type if type
|
377
|
+
|
378
|
+
target.class if target.respond_to?(:name)
|
379
|
+
end
|
380
|
+
|
381
|
+
def self.handle_exit_status(status, command)
|
382
|
+
return if status.exitstatus == 0
|
383
|
+
|
384
|
+
if status.termsig == 2 # SIGINT == 2
|
385
|
+
raise Interrupt, "subcommand #{command.join(' ')} interrupted"
|
386
|
+
end
|
387
|
+
|
388
|
+
if status.termsig
|
389
|
+
raise Failed.new(status.exitstatus, nil),
|
390
|
+
"'#{command.join(' ')}' terminated by signal #{status.termsig}"
|
391
|
+
else
|
392
|
+
raise Failed.new(status.exitstatus, nil),
|
393
|
+
"'#{command.join(' ')}' returned status #{status.exitstatus}"
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
def self.windows_support(options, command)
|
398
|
+
Dir.chdir(options[:working_directory]) do
|
399
|
+
unless system(*command)
|
400
|
+
exit_code = $CHILD_STATUS.exitstatus
|
401
|
+
raise Failed.new(exit_code, nil),
|
402
|
+
"'#{command.join(' ')}' returned status #{exit_code}"
|
403
|
+
end
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
def self.compute_log_path(target_name, phase, logdir)
|
408
|
+
File.join(logdir, "#{target_name.gsub(/:/, '_')}-"\
|
409
|
+
"#{phase.to_s.gsub(/:/, '_')}.log")
|
410
|
+
end
|
411
|
+
|
412
|
+
def self.open_logfile(logname, &block)
|
413
|
+
open_flag = if Autobuild.keep_oldlogs then 'a'
|
414
|
+
elsif Autobuild.registered_logfile?(logname) then 'a'
|
415
|
+
else
|
416
|
+
'w'
|
417
|
+
end
|
418
|
+
open_flag << ":BINARY"
|
419
|
+
|
420
|
+
unless File.directory?(File.dirname(logname))
|
421
|
+
FileUtils.mkdir_p File.dirname(logname)
|
422
|
+
end
|
423
|
+
|
424
|
+
Autobuild.register_logfile(logname)
|
425
|
+
File.open(logname, open_flag, &block)
|
426
|
+
end
|
427
|
+
|
428
|
+
def self.logfile_header(logfile, command, env)
|
429
|
+
logfile.puts if Autobuild.keep_oldlogs
|
430
|
+
logfile.puts
|
431
|
+
logfile.puts "#{Time.now}: running"
|
432
|
+
logfile.puts " #{command.join(' ')}"
|
433
|
+
logfile.puts "with environment:"
|
434
|
+
env.keys.sort.each do |key|
|
435
|
+
if (value = env[key])
|
436
|
+
logfile.puts " '#{key}'='#{value}'"
|
437
|
+
end
|
438
|
+
end
|
439
|
+
logfile.puts
|
440
|
+
logfile.puts "#{Time.now}: running"
|
441
|
+
logfile.puts " #{command.join(' ')}"
|
442
|
+
logfile.flush
|
443
|
+
logfile.sync = true
|
444
|
+
end
|
445
|
+
|
446
|
+
def self.outpipe_each_line(out_r)
|
447
|
+
buffer = +""
|
448
|
+
while (data = out_r.readpartial(1024))
|
449
|
+
buffer << data
|
450
|
+
scanner = StringScanner.new(buffer)
|
451
|
+
while (line = scanner.scan_until(/\n/))
|
452
|
+
yield line
|
453
|
+
end
|
454
|
+
buffer = scanner.rest.dup
|
455
|
+
end
|
456
|
+
rescue EOFError
|
457
|
+
scanner = StringScanner.new(buffer)
|
458
|
+
while (line = scanner.scan_until(/\n/))
|
459
|
+
yield line
|
460
|
+
end
|
461
|
+
yield scanner.rest unless scanner.rest.empty?
|
462
|
+
end
|
463
|
+
|
464
|
+
def self.process_output(
|
465
|
+
out_r, logfile, transparent_prefix, encoding, &filter
|
466
|
+
)
|
467
|
+
subcommand_output = []
|
468
|
+
outpipe_each_line(out_r) do |line|
|
469
|
+
line.force_encoding(encoding)
|
470
|
+
line = line.chomp
|
471
|
+
subcommand_output << line
|
472
|
+
|
473
|
+
logfile.puts line
|
474
|
+
|
475
|
+
if Autobuild.verbose || transparent_mode?
|
476
|
+
STDOUT.puts "#{transparent_prefix}#{line}"
|
477
|
+
elsif filter
|
478
|
+
# Do not yield
|
479
|
+
# would mix the progress output with the actual command
|
480
|
+
# output. Assume that if the user wants the command output,
|
481
|
+
# the autobuild progress output is unnecessary
|
482
|
+
filter.call(line)
|
483
|
+
end
|
484
|
+
end
|
461
485
|
subcommand_output
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
486
|
+
end
|
487
|
+
|
488
|
+
def self.transparent_output_prefix(target_name, phase, target_type)
|
489
|
+
prefix = "#{target_name}:#{phase}: "
|
490
|
+
return prefix unless target_type
|
491
|
+
|
492
|
+
"#{target_type}:#{prefix}"
|
493
|
+
end
|
494
|
+
|
495
|
+
def self.feed_input(input_streams, out_r, stdin_w)
|
496
|
+
readbuffer = StringIO.new
|
497
|
+
input_streams.each do |instream|
|
498
|
+
instream.each_line do |line|
|
499
|
+
# Read the process output to avoid having it block on a full pipe
|
500
|
+
begin
|
501
|
+
loop do
|
502
|
+
readbuffer.write(out_r.read_nonblock(1024))
|
503
|
+
end
|
504
|
+
rescue IO::WaitReadable # rubocop:disable Lint/SuppressedException
|
505
|
+
end
|
506
|
+
|
507
|
+
stdin_w.write(line)
|
508
|
+
end
|
509
|
+
end
|
510
|
+
readbuffer
|
511
|
+
rescue Errno::ENOENT => e
|
512
|
+
raise Failed.new(nil, false),
|
513
|
+
"cannot open input files: #{e.message}", retry: false
|
471
514
|
end
|
472
515
|
end
|
data/lib/autobuild/version.rb
CHANGED
data/lib/autobuild.rb
CHANGED
@@ -11,7 +11,6 @@ module Autobuild
|
|
11
11
|
extend Logger::Root('Autobuild', Logger::INFO)
|
12
12
|
end
|
13
13
|
|
14
|
-
require 'net/smtp'
|
15
14
|
require 'socket'
|
16
15
|
require 'etc'
|
17
16
|
require 'find'
|
@@ -21,8 +20,27 @@ require 'rake/tasklib'
|
|
21
20
|
require 'fileutils'
|
22
21
|
require 'optparse'
|
23
22
|
require 'singleton'
|
23
|
+
require 'open3'
|
24
|
+
require 'English'
|
24
25
|
require 'pastel'
|
26
|
+
require 'fcntl'
|
27
|
+
require 'rexml'
|
25
28
|
require 'tty-prompt'
|
29
|
+
require 'time'
|
30
|
+
require 'set'
|
31
|
+
require 'rbconfig'
|
32
|
+
require 'digest/sha1'
|
33
|
+
require 'open-uri'
|
34
|
+
require 'net/http'
|
35
|
+
require 'net/https'
|
36
|
+
require 'net/smtp'
|
37
|
+
require 'rubygems/version'
|
38
|
+
|
39
|
+
require "concurrent/atomic/atomic_boolean"
|
40
|
+
require "concurrent/array"
|
41
|
+
|
42
|
+
require 'utilrb/hash/map_value'
|
43
|
+
require 'utilrb/kernel/options'
|
26
44
|
require 'autobuild/tools'
|
27
45
|
|
28
46
|
require 'autobuild/version'
|
@@ -31,7 +49,7 @@ require 'autobuild/exceptions'
|
|
31
49
|
require 'autobuild/pkgconfig'
|
32
50
|
require 'autobuild/reporting'
|
33
51
|
require 'autobuild/mail_reporter'
|
34
|
-
require 'autobuild/
|
52
|
+
require 'autobuild/subprocess'
|
35
53
|
require 'autobuild/timestamps'
|
36
54
|
require 'autobuild/parallel'
|
37
55
|
require 'autobuild/utility'
|
@@ -50,6 +68,7 @@ require 'autobuild/import/tar'
|
|
50
68
|
require 'autobuild/package'
|
51
69
|
require 'autobuild/configurable'
|
52
70
|
require 'autobuild/packages/autotools'
|
71
|
+
require 'autobuild/packages/gnumake'
|
53
72
|
require 'autobuild/packages/cmake'
|
54
73
|
require 'autobuild/packages/genom'
|
55
74
|
require 'autobuild/packages/import'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.25.
|
4
|
+
version: 1.25.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -272,7 +272,7 @@ files:
|
|
272
272
|
- lib/autobuild/progress_display.rb
|
273
273
|
- lib/autobuild/rake_task_extension.rb
|
274
274
|
- lib/autobuild/reporting.rb
|
275
|
-
- lib/autobuild/
|
275
|
+
- lib/autobuild/subprocess.rb
|
276
276
|
- lib/autobuild/test.rb
|
277
277
|
- lib/autobuild/test_utility.rb
|
278
278
|
- lib/autobuild/timestamps.rb
|