Sun 14 Sep 2014 07:38:49 AM UTC, original submission:
I am working on a build system that extensively uses GNU Make's new guile integration. One of my goals is to simplify the creation and use of non-recursive makefiles (in the Recursive Make Considered Harmful sense).
I created a guile function (augmk/enter) that sets up some automatic bookkeeping and then executes 'include <subdir>/Rules.mk' using gmk-eval. This seems to mostly work, but under certain conditions causes random corruption.
I have attached an example project that shows random string corruption on two different systems. If you run 'make clean' from the top-level project directory, the expected output is something like:
$ make clean
rm -rf aaaaaaaaaaaaaaaaa
rm -rf bbbbbbbbbbbbbbbbb
...
rm -rf hhhhhhhhhhhhhhhhh
However, most of the time, one of the output lines will be something like this:
rm -rf <blank>
or
rm -rf <utf-8 nonsense>
or
rm -rf r/share/.... <some actual path from /usr on my system, but with the leading "/us" cut off>
Removing any of these factors from the example project causes the corruption to go away:
1) Making the targets in question 16 characters or less.
2) Not emitting the code for the 'clean' target from guile, but instead putting it directly in ./Rules.mk.
3) Not including each Rules.mk file from guile (via augmk/enter), but rather directly writing 'include <subdir>/Rules.mk.
I can reproduce this corruption using both Make 4.0 (from the Gentoo repositories) and with the latest master checkin from git.
I suspect that the "real" part of the problem comes from calling 'include' from within guile.
I've tried one mitigation strategy already, to no effect: in guile.c, use scm_without_guile() to ensure that eval() is never called in guile mode.
|