New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bisect runner tweaks #20016
Bisect runner tweaks #20016
Commits on Feb 11, 2023
-
bisect-runner.pl should patch Errno 1.22 and earlier for gcc 5 and later
Without this fix, the generated Errno.pm will contain no entries, which whilst syntactically valid causes much confusion later on when the bisect run gives bogus results due to non-buggy module code unrelated to the test case failing because %! is wrong.
-
bisect-runner.pl should patch Errno 1.111 and earlier for gcc
Without this fix, Errno.pm fails to build.
-
bisect-runner.pl must ensure that safemalloc etc have prototypes
Else they are implicitly assumed to return int, which can truncate addresses on systems where pointers are larger than ints (such as 64 bit systems).
-
bisect-runner.pl needs to disable Configure's use of nm before 5.004
Strictly we only need this for glibc systems, but it doesn't seem terrible to do it everywhere.
-
bisect-runner.pl should "fail" if config.sh is missing with --test-build
Previously it would skip, which meant you couldn't bisect the cause of some ./Configure failures, which rather defeats the intent of --test-build.
-
bisect-runner.pl must patch darwin hints to handle macOS 11, 12 etc
The version number moved beyond 10, and older hints files were not ready for this.
-
bisect-runner.pl must patch Configure to avoid myread looping infinitely
Configure can get stuck and ask questions for which it needs a valid answer before it can continue. As-is, if you redirect stdin from /dev/null (or close the file descriptor) it will (effectively) loop infinitely repeating the same question, because it doesn't like empty string as an answer. Worse - it keeps repeating the question to stdout - eg 'Where is your C library?' Rather than attempting to patch the shell script to detect errors on read (because they only matter the *second* time round the loop, *and* wouldn't handle the /dev/null case), it's easier to patch the relevant loop so that it will abort after too many loop iterations.
-
bisect-runner.pl must stop Configure looping on "does not exit"
This only affects a small range of commits in development releases, but without this change they can loop infinitely, rather than correctly skipping (or failing a build test). An infinite loop (with terminal output) is extremely unhelpful.
-
bisect-runner.pl must expose a prototype for was_lvalue_sub to List::…
…Util This problem was rapidly diagnosed and fixed at the time, but we need to fix the few commits where the problem exists, else we can't bisect other build failures.
-
bisect-runner.pl needs to patch a build bug in Digest::MD5
This failure gets in the way of bisecting other problems.
-
bisect-runner.pl needs to avoid using nm on darwin
Earlier versions of the hints defaulted to using nm, because on older versions of OS X (as was) it worked. It also needs to patch the hints file to force d_stdstdio to "undef". Without this, a build with "d_faststdio" defined (or implicit) will fail badly on current macOS, such as the perl-5.8.0 tag.
-
bisect-runner.pl needs to use the current approach for symbol probing
The older version assumed an explicit prototype for printf(), which doesn't fly on arm64 macOS. It might not be robust on some other platforms too, whereas the "current" (ie 2003 onward) approach still works everywhere. Change edit_file() to only localise $/ to undef during the read, so that it's restored to its default ("\n") when the callback is invoked. Without this, `chomp` "doesn't work" (as expected) in the callback.
-
bisect-runner.pl must include more headers in Configure probes
Without these various probes rely on implicit function declarations, typically for exit() or printf(). macOS now forbids implicit function declarations, which causes these probes to become compile time errors and hence "fail". This results in Configure assuming that many symbols are missing, and the build fails where it should pass.
-
bisect-runner.pl needs a probe for setpgrp with function prototypes
Else it can't build 5.003 or 5.002 on macOS.
-
bisect-runner.pl needs to force a -flat_namespace before v5.10.0
The hints for macOS set -flat_namespace conditionally based on darwin version, so that newer OSes would default to the native two level namespace. However, the build of miniperl was relying on a flat namespace prior to a refactoring during the 5.9.x series. Hence we need to force this linker flag when building versions before this on current macOS versions.
-
bisect-runner.pl needs to set DYLD_LIBRARY_PATH on macOS
El Capitan (OS X 10.11) (and later) strip DYLD_LIBRARY_PATH from the environment of /bin/sh, hence setting the existing code that sets this in %ENV assuming that it is visible to the invoked process no longer works. We have to be explicit in every invocation, as part of the command that the shell itself is processing. This hurts us because in 5.8.0 and earlier the hints default macOS to build a shared perl library.
-
bisect-runner.pl needs to ensure a prototype for __getBerkeleyDBInfo()
Without this some early versions of DB_File won't build on current macOS, and any other platform where the C compiler is agressive about prototypes. This commit refactors code for an existing DB_File patch to split a compound if statement into two ifs.
-
bisect-runner.pl needs to fix a shell heredoc error in Makefile.SH
Else some development versions of 5.003 mysteriously won't build. These versions aren't important in themselves, but their failure makes it hard to bisect real problems.
-
bisect-runner.pl must ensure prototypes exist for htovs() etc
These fallback functions are defined in util.c, but initially did not have any prototypes in a header.
-
bisect-runner.pl must ensure that perl.h includes fcntl.h and sys/file.h
The C code needs prototypes from these headers.
-
-
bisect-runner.pl shouldn't generate undef warnings from internal patches
The regex wasn't handling context diffs, and two of the unified diffs were generated with differing filenames and trailing timestamp text that it wasn't robust against.
-
bisect-runner.pl must patch dl_dyld.xs to eliminate the PREINIT section
*Really* early xsubpp doesn't understand this, and it turns out to be trivial to eliminate it.
-
bisect-runner.pl should supply a prototype for Gv_AMupdate
This was missing prior to perl-5.001