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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f19fbfaac6c8a45aa67dc3f494e646620b109400dc52576d799e833c97f2073
4
- data.tar.gz: 405c2943784b8247d9b14bf943ae336cd480bdee5faf1eb720cdddabed5934ee
3
+ metadata.gz: e80fda7259afb401296183494e07a8a08f1ef22c2b8cab1f54577c7527aa72ed
4
+ data.tar.gz: 89a5471c0b5afb613757dd04ac92eeb2acc0fe3fdf3cb419eb729dc2c8661e98
5
5
  SHA512:
6
- metadata.gz: 955461e9afe4750ba82115a26fd93133b408e257451dd33d86b6469b5c0f283a2e54c4d6e614153788ecefddb0286a8f70cdbfd326c5f294ffc0692dd55584db
7
- data.tar.gz: 9237fd0300c8edf42905c03687fdc407030f204e745ac24aad66659909046759554517477735bb4b567874df13f2287819de86f0355d450b99fafcc0b0fc9182
6
+ metadata.gz: 54d5bbccd77d298c58cc4b8e437fcb0de325252de23d83b73aafa02ad0a4c0476177913fdfc1634022dcc4b4abc90381534f081ff1d96f58a18f400c8985bc84
7
+ data.tar.gz: fa6f9ae365e2314d1844004924fbab9c6da73d5cebc7a3244bb6092462564d5538342496f85f79d2d54e2e13717dd140341571582b8867976cdfd8d86d3ddbc9
@@ -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
@@ -5,4 +5,5 @@ vendor/
5
5
  .bundle
6
6
  coverage/
7
7
 
8
- .yardoc/
8
+ .yardoc/
9
+ Gemfile.lock
@@ -1,5 +1,3 @@
1
- require 'time'
2
-
3
1
  module Autobuild
4
2
  # Parse and manipulate the information stored in a build log file (usually
5
3
  # in prefix/log/stats.log)
@@ -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
@@ -1,10 +1,3 @@
1
- require 'autobuild/importer'
2
- require 'digest/sha1'
3
- require 'open-uri'
4
- require 'fileutils'
5
- require 'net/http'
6
- require 'net/https'
7
-
8
1
  module Autobuild
9
2
  class ArchiveImporter < Importer
10
3
  # rubocop:disable Naming/ConstantName
@@ -1,7 +1,3 @@
1
- require 'autobuild/config'
2
- require 'autobuild/subcommand'
3
- require 'autobuild/importer'
4
-
5
1
  module Autobuild
6
2
  class DarcsImporter < Importer
7
3
  # Creates a new importer which gets the source from the Darcs
@@ -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
@@ -1,8 +1,3 @@
1
- require 'fileutils'
2
- require 'autobuild/subcommand'
3
- require 'autobuild/importer'
4
- require 'utilrb/kernel/options'
5
-
6
1
  module Autobuild
7
2
  class Hg < Importer
8
3
  # Creates an importer which tracks the given repository
@@ -1,7 +1,3 @@
1
- require 'autobuild/subcommand'
2
- require 'autobuild/importer'
3
- require 'rexml/document'
4
-
5
1
  module Autobuild
6
2
  class SVN < Importer
7
3
  # Creates an importer which gets the source for the Subversion URL +source+.
@@ -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 'autobuild/packages/gnumake'
3
-
4
1
  module Autobuild
5
2
  def self.cmake(options, &block)
6
3
  CMake.new(options, &block)
@@ -1,7 +1,3 @@
1
- require 'autobuild/packages/autotools'
2
- require 'open3'
3
- require 'autobuild/pkgconfig'
4
-
5
1
  module Autobuild
6
2
  def self.genom(opts, &proc)
7
3
  GenomModule.new(opts, &proc)
@@ -1,5 +1,3 @@
1
- require 'rubygems/version'
2
-
3
1
  module Autobuild
4
2
  def self.reset_gnumake_detection
5
3
  @make_is_gnumake = Hash.new
@@ -1,6 +1,3 @@
1
- require 'autobuild/timestamps'
2
- require 'autobuild/package'
3
-
4
1
  module Autobuild
5
2
  def self.import(spec, &proc)
6
3
  ImporterPackage.new(spec, &proc)
@@ -1,5 +1,3 @@
1
- require 'autobuild/pkgconfig'
2
-
3
1
  module Autobuild
4
2
  class InstalledPkgConfig < Package
5
3
  attr_reader :pkgconfig, :prefix
@@ -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
@@ -1,6 +1,3 @@
1
- require "concurrent/atomic/atomic_boolean"
2
- require "concurrent/array"
3
-
4
1
  module Autobuild
5
2
  # Management of the progress display
6
3
  class ProgressDisplay
@@ -1,5 +1,6 @@
1
- require 'autobuild/exceptions'
2
- require 'pastel'
1
+ require "pastel"
2
+ require "concurrent/atomic/atomic_boolean"
3
+ require "concurrent/array"
3
4
 
4
5
  module Autobuild
5
6
  @colorizer = Pastel.new
@@ -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
- if target.respond_to?(:name)
246
- target_name = target.name
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
- status = File.open(logname, open_flag) do |logfile|
291
- logfile.puts if Autobuild.keep_oldlogs
292
- logfile.puts
293
- logfile.puts "#{Time.now}: running"
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
- outread, outwrite = IO.pipe
312
- outread.sync = true
313
- outwrite.sync = true
259
+ logname = compute_log_path(target_name, phase, logdir)
314
260
 
315
- cread, cwrite = IO.pipe # to control that exec goes well
261
+ status, subcommand_output = open_logfile(logname) do |logfile|
262
+ logfile_header(logfile, command, env)
316
263
 
317
- if Autobuild.windows?
318
- Dir.chdir(options[:working_directory]) do
319
- unless system(*command)
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
- cwrite.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
329
-
330
- pid = fork do
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
- exec(env, *command,
348
- chdir: options[:working_directory] || Dir.pwd,
349
- close_others: false)
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
- cwrite.write([CONTROL_COMMAND_NOT_FOUND].pack('I'))
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
- readbuffer = StringIO.new
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
- pread.close
368
- begin
369
- input_streams.each do |instream|
370
- instream.each_line do |line|
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
- outwrite.close
307
+ out_w.close
406
308
 
407
309
  unless input_streams.empty?
408
- readbuffer.write(outread.read)
310
+ readbuffer.write(out_r.read)
409
311
  readbuffer.seek(0)
410
- outread.close
411
- outread = readbuffer
312
+ out_r.close
313
+ out_r = readbuffer
412
314
  end
413
315
 
414
- outread.each_line do |line|
415
- line.force_encoding(options[:encoding])
416
- line = line.chomp
417
- subcommand_output << line
418
-
419
- logfile.puts line
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
- if !status.exitstatus || status.exitstatus > 0
439
- if status.termsig == 2 # SIGINT == 2
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
- if status.termsig
444
- raise Failed.new(status.exitstatus, nil),
445
- "'#{command.join(' ')}' terminated by signal #{status.termsig}"
446
- else
447
- raise Failed.new(status.exitstatus, nil),
448
- "'#{command.join(' ')}' returned status #{status.exitstatus}"
449
- end
450
- end
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
- rescue Failed => e
463
- error = Autobuild::SubcommandFailed.new(target, command.join(" "),
464
- logname, e.status, subcommand_output)
465
- error.retry = if e.retry?.nil? then options[:retry]
466
- else
467
- e.retry?
468
- end
469
- error.phase = phase
470
- raise error, e.message
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
@@ -1,3 +1,3 @@
1
1
  module Autobuild
2
- VERSION = "1.25.0".freeze unless defined? Autobuild::VERSION
2
+ VERSION = "1.25.1".freeze unless defined? Autobuild::VERSION
3
3
  end
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/subcommand'
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.0
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-03-21 00:00:00.000000000 Z
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/subcommand.rb
275
+ - lib/autobuild/subprocess.rb
276
276
  - lib/autobuild/test.rb
277
277
  - lib/autobuild/test_utility.rb
278
278
  - lib/autobuild/timestamps.rb