[PATCH 0/3] Waf: Semi-automatic generation of results for cross-answers files
urisimchoni at gmail.com
Sat May 2 22:46:56 MDT 2015
Well, it seems the approach I took with this patch is not the correct one,
because some tests depend on
results of previous tests.
This dependency comes in two flavors:
1. Test B runs only if test A failed - it's in the logic of the test script
(e.g. test for "-D_FILE_OFFSET_BITS=64" only runs if test for native large
file support fails)
2. A more subtle one - test A success sets a compilation flag (e.g. large
file file support), which alters the compilation of test B (e.g. fcntl
The approach of the patch was to run configure to completion and then run
all tests on the target - given the above it cannot work.
The only rigorous approach is either to stop configuration when an unknown
value is detected, or to automatically run the test on the target (e.g. via
a script supplied to configure) and continue.
I'll try coming up with something..
On Fri, May 1, 2015 at 1:50 AM, Jeremy Allison <jra at samba.org> wrote:
> On Thu, Apr 30, 2015 at 11:21:47PM +0300, Uri Simchoni wrote:
> > One of the methods for cross-compiling samba is to provide a
> cross-answers file,
> > which contains the results of configure tests which have to run on the
> > However, there's no automation in getting the correct answer for the
> > This patchset adds an option to save the compiled test binaries in a
> > along with a modified cross-answers file, detailing the binary to run
> for each
> > test with unknown result. A script is also supplied to run on the
> target, run
> > the test binaries, and patch cross-answers file with the test result.
> > Typical workflow:
> > 1. ./configure --cross-compile --cross-answers=<ca_file>
> --cross-test-dir=<some empty dir>
> > - ca_file is name of the partially-filled or non-existant
> cross-answers file.
> > - --cross-test-dir is the new switch
> > - configure updates the cross-answers file as always and also copies
> all binaries
> > of tests with unknown result into the cross-test-dir. It also
> places there a
> > version of the cross-answers file which includes the name of
> binary to run for
> > each test.
> > 2. Copy the supplied run-cross-tests.sh shell script into the
> > 3. Copy all files into the target (or have target mount the
> > 4. On target, cd into the dir where all files reside and run:
> > ./run-cross-tests.sh < <ca_file> > <new_ca_file>
> > - This step scans the cross-answers file, and for each test with
> unknown result,
> > runs the test binary and forms a proper result out of the exit
> status and
> > standard output.
> > Caveats:
> > This is not bullet-proof - two tests relating to shared libraries also
> > copying a built shared library to the target, and hence fail. However,
> it is still
> > an improvement over the current state of having to guess the result of
> 30-odd tests
> > or manually run them.
> > Patch summary:
> > Patch #1 is just a refactoring to make things easier.
> > Patch #2 adds the --cross-test-dir option
> > Patch #3 is the run-cross-tests.sh script
> Oh this looks *great* - thanks. Improved cross compiling support
> has been on my wish list for a long time !
More information about the samba-technical