bug-make
[Top][All Lists]
Advanced

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

[bug #58420] PATH changes are not applied in $(shell) function


From: Manoj Srivastava
Subject: [bug #58420] PATH changes are not applied in $(shell) function
Date: Wed, 20 May 2020 19:21:53 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?58420>

                 Summary: PATH changes are not applied in $(shell) function
                 Project: make
            Submitted by: srivasta
            Submitted on: Wed 20 May 2020 06:21:52 PM CDT
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.3
        Operating System: None
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

This was reported by a debian user. Please retain the CC to
address@hidden to ensure your responses reach the reporter.



Given the following Makefile:

--- BEGIN ---
PATH := /nonexistent:$(PATH)

default:
        @echo "make variable PATH=$(PATH)"
        @echo "in target commands, PATH=$$PATH"
        @echo "in \$$(shell commands), PATH=$(shell echo "$$PATH")"
--- END ---

'make' generates the output for me:

make variable
PATH=/nonexistent:/home/ben/bin:/usr/lib/ccache:/usr/local/sbin:/usr/sbin:/sbin:/home/ben/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
in target commands,
PATH=/nonexistent:/home/ben/bin:/usr/lib/ccache:/usr/local/sbin:/usr/sbin:/sbin:/home/ben/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
in $(shell commands),
PATH=/home/ben/bin:/usr/lib/ccache:/usr/local/sbin:/usr/sbin:/sbin:/home/ben/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

I can't see any documentation that says the PATH variable is special, so I
think this is a bug.  I would guess that make defers evaluating the PATH
variable into the environment, in case it's recursively expanded, but only
re-evaulates it before running target commands.

Ben.





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58420>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]