Bug 1677797 - Change autoconf to avoid using a hard-coded file descriptor r=glandium

In Bug 1671424 we changed the way we configure firefox and it broke the codeql database
generation job.	This job wraps the entire build	process	in a way similar to
  codeql --command="./mach build"

Specifically, the previous way we executed the configure shell script made codeql
disable itself because it was named configure (codeql disables itself during
configuration.)

codeql injects via LD_PRELOAD, and it opens a configuration file and a logging file
(getting fd 3 and 4 respectively.)

autoconf grabs file descriptor 4 and uses it a temporary redirection point either
to a file or stdout. When it does so, it closes	the original file descriptor 4 and
points it at the new location, which also affects the codeql code, resulting in
undesired logging output going into the configure script.

Because this file descriptor trick is only used to avoid duplicating a few lines of
code, I removed the trick and duplicated the code.

Differential Revision: https://phabricator.services.mozilla.com/D98642
This commit is contained in:
Tom Ritter 2020-12-08 22:04:09 +00:00
Родитель aa94a1b6e4
Коммит 9293bfdb80
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -141,18 +141,17 @@ if grep "^[^#]*${pattern}" $tmpout > /dev/null 2>&1; then
fi
if test $# -eq 0; then
exec 4> configure; chmod +x configure
else
exec 4>&1
echo "This case should not be reached."
exit 1
fi
# Put the real line numbers into configure to make config.log more helpful.
# Put the real line numbers into the output to make config.log more helpful.
$AWK '
/__oline__/ { printf "%d:", NR + 1 }
{ print }
' $tmpout | sed '
/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
' >&4
'
rm -f $tmpout