Re: maintainer-makefile: catch uses of $< in non-implicit rules

2019-07-10 Thread Akim Demaille
Hi Tim,

Sorry I dropped the ball...

> Reproducible everywhere (needs gawk being installed, else the
> sc_prohibit_gnu_make_extensions is a no-op).

Which is what I meant.  So are you saying it work as (I) expected?

> Akim, at least with GNU make 4.2.1 the combination of -q and -p doesn't
> do what you expect. From the make man page, I would say that both
> options contradict. -q: don't print anything; -p: print the database

I'm using 4.2.1, and it does what I meant: -p prints the rules,
and -q (which is --question, not --quiet) avoids that we
fired a rule (i.e., "make -q" does not run "make all").

So I'm just clueless here.  I don't know what to do to address
your issue.

Are you running "make syntax-check" on a configured builddir?




Re: maintainer-makefile: catch uses of $< in non-implicit rules

2019-07-10 Thread Tim Rühsen
On 7/10/19 11:38 AM, Tim Rühsen wrote:
> 
> 
> On 7/10/19 11:07 AM, Tim Rühsen wrote:
>> On 6/25/19 3:24 PM, Tim Rühsen wrote:
>>> Hi Akim,
>>>
>>> the command expands to
>>>
>>> if gawk --version | grep GNU >/dev/null 2>&1; then  \
>>>   (cd . && autoconf --trace AC_CONFIG_FILES:'$1') | \
>>> tr ' ' '\n' |   \
>>> /usr/bin/sed -ne '/Makefile/{s/\.in$//;p;}' |   \
>>> while read m; do\
>>>   make -qp -f $m .DUMMY-TARGET 2>/dev/null |\
>>> gawk -v file=$m -e 'BEGIN { RS = "\n\n"; in_rules = 0; } /^#
>>> Files/ { in_rules = 1; } /\$>> \.\w+(\.\w+)?:/ { print "Error: " file ": $< in a non implicit rule\n"
>>> $0; status = 1; } END { exit status; }' || exit 1;\
>>> done;   \
>>> fi
>>>
>>> # make --version
>>> GNU Make 4.2.1
>>> Built for x86_64-redhat-linux-gnu
>>>
>>> # gawk --version
>>> GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2)
>>>
>>> # sed --version
>>> sed (GNU sed) 4.5
>>>
>>> # tr --version
>>> tr (GNU coreutils) 8.31
>>>
>>> # autoconf --version
>>> autoconf (GNU Autoconf) 2.69
>>
>> Testing the above directly in bash works.
>> So after some testing I found a work-around:
>>
>> LC_ALL=en_US.UTF-8 make syntax-check
>>
>> The issue is seen on Fedora 30 and Arch Linux.
>>
>> Arch `locale` output:
>> LANG=en_US.UTF-8
>> LC_CTYPE="en_US.UTF-8"
>> LC_NUMERIC="en_US.UTF-8"
>> LC_TIME="en_US.UTF-8"
>> LC_COLLATE="en_US.UTF-8"
>> LC_MONETARY="en_US.UTF-8"
>> LC_MESSAGES="en_US.UTF-8"
>> LC_PAPER="en_US.UTF-8"
>> LC_NAME="en_US.UTF-8"
>> LC_ADDRESS="en_US.UTF-8"
>> LC_TELEPHONE="en_US.UTF-8"
>> LC_MEASUREMENT="en_US.UTF-8"
>> LC_IDENTIFICATION="en_US.UTF-8"
>> LC_ALL=
>>
>> The difference to a 'working' environment is that LC_ALL isn't set.
>>
>> So the outcome of 'make syntax-check' (concrete:
>> sc_prohibit_gnu_make_extensions rule) is locale dependent.
>>
>> Is that wanted behavior ?
>>
>> Fun fact: Once you run `LC_ALL=en_US.UTF-8 make syntax-check`, all
>> following 'make syntax-check' succeed while LC_ALL still is empty. This
>> is on Arch.
>>
>> I have no idea how to fix this properly.
> 
> Sorry, I have to backpaddle. After more tests with a fresh docker
> container it seems not LC_ALL related. Instead after several 'make
> syntax-check' those suddenly succeed.
> 
> All that changes my project directory is the files in '.deps/'. Removing
> that directory, I am back at failing 'make syntax-check' (after several
> invocations it then succeeds again).
> 
> It looks like the 'make' in the sc_prohibit_gnu_make_extensions rule
> creates .Plo and .Po files. One group of files for each SUBDIR/Makefile
> per 'make check'. If all files for all SUBDIRs have been created, make
> 'syntax-check' succeeds.
> 
> Knowing this, the issue is reproducible on Debian (unstable) as well.
> 
> I report more once tracked down.

Reproducible everywhere (needs gawk being installed, else the
sc_prohibit_gnu_make_extensions is a no-op).

Akim, at least with GNU make 4.2.1 the combination of -q and -p doesn't
do what you expect. From the make man page, I would say that both
options contradict. -q: don't print anything; -p: print the database

For now, I have to disable sc_prohibit_gnu_make_extensions in my projects.

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: maintainer-makefile: catch uses of $< in non-implicit rules

2019-07-10 Thread Tim Rühsen


On 7/10/19 11:07 AM, Tim Rühsen wrote:
> On 6/25/19 3:24 PM, Tim Rühsen wrote:
>> Hi Akim,
>>
>> the command expands to
>>
>> if gawk --version | grep GNU >/dev/null 2>&1; then  \
>>   (cd . && autoconf --trace AC_CONFIG_FILES:'$1') | \
>> tr ' ' '\n' |   \
>> /usr/bin/sed -ne '/Makefile/{s/\.in$//;p;}' |   \
>> while read m; do\
>>   make -qp -f $m .DUMMY-TARGET 2>/dev/null |\
>> gawk -v file=$m -e 'BEGIN { RS = "\n\n"; in_rules = 0; } /^#
>> Files/ { in_rules = 1; } /\$> \.\w+(\.\w+)?:/ { print "Error: " file ": $< in a non implicit rule\n"
>> $0; status = 1; } END { exit status; }' || exit 1;\
>> done;   \
>> fi
>>
>> # make --version
>> GNU Make 4.2.1
>> Built for x86_64-redhat-linux-gnu
>>
>> # gawk --version
>> GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2)
>>
>> # sed --version
>> sed (GNU sed) 4.5
>>
>> # tr --version
>> tr (GNU coreutils) 8.31
>>
>> # autoconf --version
>> autoconf (GNU Autoconf) 2.69
> 
> Testing the above directly in bash works.
> So after some testing I found a work-around:
> 
> LC_ALL=en_US.UTF-8 make syntax-check
> 
> The issue is seen on Fedora 30 and Arch Linux.
> 
> Arch `locale` output:
> LANG=en_US.UTF-8
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY="en_US.UTF-8"
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER="en_US.UTF-8"
> LC_NAME="en_US.UTF-8"
> LC_ADDRESS="en_US.UTF-8"
> LC_TELEPHONE="en_US.UTF-8"
> LC_MEASUREMENT="en_US.UTF-8"
> LC_IDENTIFICATION="en_US.UTF-8"
> LC_ALL=
> 
> The difference to a 'working' environment is that LC_ALL isn't set.
> 
> So the outcome of 'make syntax-check' (concrete:
> sc_prohibit_gnu_make_extensions rule) is locale dependent.
> 
> Is that wanted behavior ?
> 
> Fun fact: Once you run `LC_ALL=en_US.UTF-8 make syntax-check`, all
> following 'make syntax-check' succeed while LC_ALL still is empty. This
> is on Arch.
> 
> I have no idea how to fix this properly.

Sorry, I have to backpaddle. After more tests with a fresh docker
container it seems not LC_ALL related. Instead after several 'make
syntax-check' those suddenly succeed.

All that changes my project directory is the files in '.deps/'. Removing
that directory, I am back at failing 'make syntax-check' (after several
invocations it then succeeds again).

It looks like the 'make' in the sc_prohibit_gnu_make_extensions rule
creates .Plo and .Po files. One group of files for each SUBDIR/Makefile
per 'make check'. If all files for all SUBDIRs have been created, make
'syntax-check' succeeds.

Knowing this, the issue is reproducible on Debian (unstable) as well.

I report more once tracked down.

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: maintainer-makefile: catch uses of $< in non-implicit rules

2019-07-10 Thread Tim Rühsen
On 6/25/19 3:24 PM, Tim Rühsen wrote:
> Hi Akim,
> 
> the command expands to
> 
> if gawk --version | grep GNU >/dev/null 2>&1; then  \
>   (cd . && autoconf --trace AC_CONFIG_FILES:'$1') | \
> tr ' ' '\n' |   \
> /usr/bin/sed -ne '/Makefile/{s/\.in$//;p;}' |   \
> while read m; do\
>   make -qp -f $m .DUMMY-TARGET 2>/dev/null |\
> gawk -v file=$m -e 'BEGIN { RS = "\n\n"; in_rules = 0; } /^#
> Files/ { in_rules = 1; } /\$ \.\w+(\.\w+)?:/ { print "Error: " file ": $< in a non implicit rule\n"
> $0; status = 1; } END { exit status; }' || exit 1;\
> done;   \
> fi
> 
> # make --version
> GNU Make 4.2.1
> Built for x86_64-redhat-linux-gnu
> 
> # gawk --version
> GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2)
> 
> # sed --version
> sed (GNU sed) 4.5
> 
> # tr --version
> tr (GNU coreutils) 8.31
> 
> # autoconf --version
> autoconf (GNU Autoconf) 2.69

Testing the above directly in bash works.
So after some testing I found a work-around:

LC_ALL=en_US.UTF-8 make syntax-check

The issue is seen on Fedora 30 and Arch Linux.

Arch `locale` output:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

The difference to a 'working' environment is that LC_ALL isn't set.

So the outcome of 'make syntax-check' (concrete:
sc_prohibit_gnu_make_extensions rule) is locale dependent.

Is that wanted behavior ?

Fun fact: Once you run `LC_ALL=en_US.UTF-8 make syntax-check`, all
following 'make syntax-check' succeed while LC_ALL still is empty. This
is on Arch.

I have no idea how to fix this properly.

Regards, Tim



signature.asc
Description: OpenPGP digital signature