svn commit: r216473 - head/sbin/geom/class/eli

Ulrich Spörlein uqs at FreeBSD.org
Thu Dec 16 20:23:22 UTC 2010


On Thu, 16.12.2010 at 14:22:47 -0500, John Baldwin wrote:
> On Thursday, December 16, 2010 2:04:08 pm Robert Watson wrote:
> > On Thu, 16 Dec 2010, David O'Brien wrote:
> > 
> > >>> Log:
> > >>>   Bump WARNS to 6.
> > >>>
> > >>> Modified:
> > >>>   head/sbin/geom/class/eli/Makefile
> > >>
> > >> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64.
> > >
> > > Errr.  Reverted.  I built it on the architectures I had access to...
> > 
> > For WARNS-related changes, I generally use "make universe" to test across 
> > architectures.  This builds all of our architectures world + all available 
> > kernels, and seems the most effective way to avoid the above situations. (I've 
> > fallen into exactly the same trap...)
> > 
> > The one thing to be cautious about is that make universe won't fail if an 
> > individual build fails, so you need to check the logs to make sure everything 
> > actually succeeded.
> 
> Which is why I prefer 'make tinderbox' since it tells you what fails. :)

Shamless plug: the attached, crude expect(1) script allows you to do
$ cd /usr/src && universe-build sbin/geom WARNS=6

with the minimal amount of compilation (you have to build the toolchain
once, though). I found it invaluable.

Regards,
Uli
-------------- next part --------------
#!/usr/local/bin/expect

# Does the following for variable subdirs and a given set of target archs,
# exits upon first failure.

# % cd /usr/src
# % make toolchain TARGET=powerpc
# % make buildenv TARGET=powerpc
# %% cd usr.sbin/rwhod
# %% make

set timeout -1
set toolchain 0

proc usage {argv0}  {
  send_user "usage: $argv0 -t \[target1 target2 ...\]\n"
  send_user "       $argv0 subdir \[make-args\] \[target1 target2 ...\]\n"
  send_user "available targets: amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v\n"
  exit
}

while {[llength $argv]>0} {
  set flag [lindex $argv 0]
    switch -- $flag \
      "-t" {
        set toolchain 1
        set argv [lrange $argv 1 end]
	set argc [expr ($argc - 1)]
      } default {
        break
      }
}

if {$toolchain!=1} {
  if {$argc<1} {
    usage $argv0
    exit 1
  }
  set subdir [lindex $argv 0]
  set argv [lrange $argv 1 end]
  set argc [expr ($argc - 1)]
  # if something is present, use it as make args
  if {$argc>=1} {
    set margs [lindex $argv 0]
    set argv [lrange $argv 1 end]
    set argc [expr ($argc - 1)]
  } else {
    set margs {}
  }
}

# if there is still something, use it as target list,
# else default to everything
if {$argc>=1} {
  set targets [lrange $argv 0 end]
} else {
  set input [open "|make universe -V TARGETS" r]
  set targets [split [string trimright [read $input]] " "]
  close $input
}

if {$toolchain==1} {
  foreach target $targets {
    spawn /bin/sh
    expect "$ "
    send "env MAKEOBJDIRPREFIX=/usr/obj/$target make toolchain __MAKE_CONF=/dev/null TARGET=$target\n"
    expect "$ "
    send "exit \$?\n"
    expect eof
  }
  puts "\n"
  exit
}

foreach target $targets {
  spawn /bin/sh
  set sid($target) $spawn_id
  expect "$ "
  send "env MAKEOBJDIRPREFIX=/usr/obj/$target make buildenv __MAKE_CONF=/dev/null TARGET=$target\n"
  expect "$ "
  send "make -C $subdir obj clean; make -C $subdir $margs\n"
  expect "$ "
  # 'make buildenv' is doing sh || true, so we cannot propagate by doing exit $rc
  # grab echo output instead
  send "echo rc=\$?; exit \$?\n"
  # this sucks, but we cant do (.*) and also not ([0-9]*) as these are special
  expect -re "rc=(0|1|2|3|4|5|6|7|8|9)\r"
  # TODO: save rc per target, don't exit below but print rcs for all archs on exit
  set rc $expect_out(1,string)
  expect "$ "
  send "exit \$?\n"
  expect eof
  if {$rc!=0} {
    puts "Build failed in ``$subdir'' for arch ``$target'' and flags: ``$margs''"
    exit $rc
  }

  ## if we expect eof, the wait below will not return, wtf?
  ## XXX sid($target) wont work here??
  #catch {close -i $spawn_id}
  ## wait returns PID, TYPE, CODE, grab code
  #set rc [lindex [wait sid($target)] 3]
}

puts "\n"


More information about the svn-src-all mailing list