how to handle 'internal' logs for failed builds

Chris Jones jonesc at
Thu Apr 4 14:39:17 UTC 2024


I recently pushed an update to the root6 port. It works fine for me but 
fails on all build bots, e.g.

the only error is this

    './configure' '--prefix' 
'--with-pic' '--disable-shared' '--with-png=no' '--with-bzip2=no' 
'--with-harfbuzz=no' '--with-brotli=no' 'CC=/usr/bin/clang -isysroot 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' 'CFLAGS=-O'

   See also


So what is happening is the build internally packages its own versions 
of some externals, freetype being one of them, and its this that fails 
during configure for some reason.

The problem is the contents of that log are, of course, not in the 
macports build log, so I cannot see what it is that is causing it, and 
as it works for me I cannot look locally myself. I've tried looking at 
my versions of the logs, and just guess what might be wrong, missing new 
deps for instance, but that hasn't worked, so I really need to see whats 
in that log from the build bots...

I tried adding this to the portfile, to basically echo the contents of 
this log (and other ones, there are a few) to ui_debug

post-build {
     ui_debug "Searching ${workpath}/build for third party build logs ..."
     foreach log [ exec find ${workpath}/build -type f -and -name 
"*.log" ] {
         ui_debug "Contents of ${log} :-"
         set f [open ${log}]
         set lines [split [read $f] "\n"]
         foreach line $lines {
             ui_debug "${line}"
         close $f

that works just fine.... as long as the build succeeds... If it fails, 
the post-build block is not run.

So. Is there anything I can do here. Ideally something similar to the 
above perhaps, but which will still run even if the build phase itself 
fails... ?

cheers Chris

p.s. Yes, before anyone says it I hate these internal dep builds the 
port does. Its something the upstream devs started doing a while back 
and it just seems to get worse over time. I turn off the ones I can, 
when there are configure options to do so and use macports deps instead, 
but some of them like freetype just don't allow this..

More information about the macports-dev mailing list