Hilko Bengen
2014-Mar-22 13:04 UTC
Re: [Libguestfs] [PATCH] Fix building on architectures where ocamlopt is not available
* Richard W.M. Jones:>> Wouldn't a rule without commands such as >> >> mlguestfs.cmxa: mlguestfs.cma >> >> also prevent make from building the two targets in parallel? > > Doesn't that mean that if mlguestfs.cmxa is out of date, simply > running the mlguestfs.cma rule will build it (which it won't)?Not sure if I understand you. If I cause mlguestfs.cmxa to be out of date by touching guestfs.cmx, only mlguestfs.cmxa will be rebuilt. If I cause mlguestfs.cma to be out of date by touching guestfs.cmo, both mlguestfs.cma and mlguestfs.cmxa will be rebuilt. This could be fixed by using an order-only prerequisite: mlguestfs.cmxa: | mlguestfs.cma Cheers, -Hilko
Richard W.M. Jones
2014-Mar-23 17:10 UTC
Re: [Libguestfs] [PATCH] Fix building on architectures where ocamlopt is not available
On Sat, Mar 22, 2014 at 02:04:36PM +0100, Hilko Bengen wrote:> * Richard W.M. Jones: > > >> Wouldn't a rule without commands such as > >> > >> mlguestfs.cmxa: mlguestfs.cma > >> > >> also prevent make from building the two targets in parallel? > > > > Doesn't that mean that if mlguestfs.cmxa is out of date, simply > > running the mlguestfs.cma rule will build it (which it won't)? > > Not sure if I understand you. > > If I cause mlguestfs.cmxa to be out of date by touching guestfs.cmx, > only mlguestfs.cmxa will be rebuilt. > > If I cause mlguestfs.cma to be out of date by touching guestfs.cmo, both > mlguestfs.cma and mlguestfs.cmxa will be rebuilt. This could be fixed by > using an order-only prerequisite: > > mlguestfs.cmxa: | mlguestfs.cmaI wanted to see what would work in practice, so I set up the following test (note you may have to adjust the MD5 hashes depending on the version of OCaml you have). Save the following as test.sh, and make it executable: ---------------------------------------------------------------------- #!/bin/bash set -e make -C ocaml clean make -C ocaml -j100 test "$(md5sum ocaml/mlguestfs.cm*)" = "e929569af895530898f9a513a9a8c8ff ocaml/mlguestfs.cma 09847aa897b230316ae61d633a151fff ocaml/mlguestfs.cmxa" ---------------------------------------------------------------------- Run: while ./test.sh >& log; do echo -n .; done This will run for some time -- indefinitely if parallel builds work. If it exits, examine the log file to see what went wrong. I tried: (1) Removing .NOTPARALLEL. This fails, as expected. (2) mlguestfs.cmxa: mlguestfs.cma -- fails (3) mlguestfs.cmxa: | mlguestfs.cma -- fails after a longer time (4) The attached patch which is derived from dce94f -- this ran without failing for 120 iterations (and still going). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Richard W.M. Jones
2014-Mar-23 17:11 UTC
Re: [Libguestfs] [PATCH] Fix building on architectures where ocamlopt is not available
BTW I should say I don't understand *why* the simpler approach of adding the order-only dependency doesn't work ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Hilko Bengen
2014-Mar-23 18:22 UTC
Re: [Libguestfs] [PATCH] Fix building on architectures where ocamlopt is not available
* Richard W.M. Jones:> (1) Removing .NOTPARALLEL. This fails, as expected. > > (2) mlguestfs.cmxa: mlguestfs.cma -- fails > > (3) mlguestfs.cmxa: | mlguestfs.cma -- fails after a longer timeI find it strange that (2) and (3) fail.> (4) The attached patch which is derived from dce94f -- this ran > without failing for 120 iterations (and still going).The patch looks good to me. -Hilko
Maybe Matching Threads
- Re: [PATCH] Fix building on architectures where ocamlopt is not available
- Re: [PATCH] Fix building on architectures where ocamlopt is not available
- Re: [PATCH] Fix building on architectures where ocamlopt is not available
- [PATCH] Fix building on architectures where ocamlopt is not available
- Re: The issue about code coverage for libguestfs