bugmake - Bugs: bug #63040, autoconf-2.69 and 2.71 fail to...

 
 

bug #63040: autoconf-2.69 and 2.71 fail to build after $(shell ...) environment handlign change

Submitter:  Sergei Trofimovich <slyfox>
Submitted:  Fri 09 Sep 2022 10:35:02 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.4 Operating System:  None
Fixed Release:  4.4 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 11 Sep 2022 02:30:50 AM UTC, comment #4: 

My idea below was dumb.

What I ended up doing is that if we detect a recursive expansion in the context of a shell function, we use the value of the variable from the environment make was invoked with, or the empty string if the variable wasn't present in the invoker's environment.

This gives us back the previous behavior.  It's kind of bizarre but no worse than any other choice, IMO.

Paul D. Smith <psmith>
Group administrator
Sat 10 Sep 2022 12:33:49 AM UTC, comment #3: 

Indeed autoconf has fixed it as https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=31f673434ee402258b45e958c88acc8725d82b1a but I don't know whether this change in behaviour was intended or not.

Sam James <thesamesam>
Fri 09 Sep 2022 02:02:02 PM UTC, comment #2: 

Argh.  This export-to-shell-function change is the gift that keeps on giving.

I guess the best thing to do is, rather than expanding a recursive variable to the empty string, we expand it to its contents without trying to further expand it to avoid the recursion.

That could be weird.  Definitely need to think carefully about this, probably after I have my tea.

Paul D. Smith <psmith>
Group administrator
Fri 09 Sep 2022 01:53:54 PM UTC, comment #1: 
Sergei Trofimovich <slyfox>
Fri 09 Sep 2022 10:35:02 AM UTC, original submission:  

Tried to use `make` from today's git (commit 7d484017077089ac2642b89da8984ca46a07323d [SV 63016] Don't fail exporting to $(shell ...)) and observed build failure on autoconf:


build flags: -j16 -l16 SHELL=bash
bash: line 1: env: command not found
make  all-am
bash: line 1: make: command not found
make: *** [Makefile:928: all] Error 127


The build failure happens because (I think) autoconf uses the following trick:


cfg.mk:export PATH = $(shell echo "`pwd`/tests:$$PATH")


Comparing behaviour from `make` a few months ago:


$ make --version
GNU Make 4.3.90.20220619

$ printf 'export PATH = $(shell echo $$PWD:$$PATH)'"\n"'all:; echo $$PATH' | make -f -
echo $PATH
/tmp:/run/current-system/sw/bin


Path is prepended to existing one, ok.

And the today's one:


$ ./make --version
GNU Make 4.3.90.20220909
$ printf 'export PATH = $(shell echo $$PWD:$$PATH)'"\n"'all:; echo $$PATH' | ./make -f -
echo $PATH
make: sh: No such file or directory
make: sh: No such file or directory
make: *** [/tmp/GmYdo0my:2: all] Error 127


If we use `:=` then it works as expected:


$ printf 'export PATH := $(shell echo $$PWD:$$PATH)'"\n"'all:; echo $$PATH' | ./make -f -
echo $PATH
/tmp:/run/current-system/sw/bin


In theory it should be easy to adapt `autoconf`s build system. Filing a bug to make sure it's an intended change and not an unexpected regression.

Sergei Trofimovich <slyfox>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by thesamesam (Posted a comment)
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by slyfox (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-11 psmith Item GroupNone Bug
        StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Component VersionNone 4.4
        Fixed ReleaseNone 4.4
        Triage StatusNone Small Effort

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code