pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Surprising make behavior (was: Re: strange trouble building qgis)



On 12.09.2020 13:30, Greg Troxel wrote:
>> On Sat, Sep 12, 2020 at 10:35:09AM +0200, Roland Illig wrote:
>>> NetBSD's make indeed needs 4 dollars to work, which can be seen in
>>> src/usr.bin/make/unit-tests/dep-var.mk. GNU make only needs 2 dollars.
>
> Roland: Can you explain why netbsd make needs 4 $ to resolve to one $ in
> a filename on a RHS of a dependency line?   I thought $foo was a
> variable and $$foo was just literarlly '$foo', but maybe that's gmake
> thinking.

If you want to know the technical cause of this behavior, here's the
description:

https://github.com/NetBSD/src/blob/59a3d6f48af7/usr.bin/make/unit-tests/dep-var.mk#L29
(v1.4)

If you want to know a (good) reason why NetBSD make behaves like this: I
have no idea.

In the last 3 months I added several tests in
src/usr.bin/make/unit-tests, and if you look for "oops" or "XXX" or
"surpris" or "unexpected" in them, you will see how inconsistent and
surprising make behaves in all kinds of places.

The code coverage of the unit tests is currently at 68.76% of 9440
lines, which is only a bit better than the 54.00% of 9431 lines from 3
months ago.  It is still much too low for such a complicated and tricky
program.  Every day I look at the code I find some new and surprising
edge case.

Technically it should be possible to fix many of these inconsistencies,
but there is always the risk of breaking existing code.  Therefore I
prefer that there be no silent change in behavior, as far as possible.
And this is something that I don't know how to do.

Another point is that the code from NetBSD's make is regularly merged
into FreeBSD, and from there further on to other projects.  Therefore
"NetBSD builds fine" does not suffice as an acceptance test.


Home | Main Index | Thread Index | Old Index