bugmake - Bugs: bug #32498, export within $(eval) within a...

 
 

bug #32498: export within $(eval) within a $(call) broken?

Submitter:  None
Submitted:  Tue 15 Feb 2011 10:05:04 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.82 Operating System:  Any
Fixed Release:  4.0 Triage Status:  Verified
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 12 Sep 2011 05:36:12 AM UTC, comment #4: 

Fixed in CVS.  Thanks for the report.

Paul D. Smith <psmith>
Group administrator
Wed 16 Feb 2011 10:30:04 AM UTC, comment #3: 

Thanks Paul and Olexiy.

I don't agree with you, Olexiy, in that 'export' only exports defined variables. Documentation at least does not mention this, and Paul's test with the 'export AA' shows it.

Otherwise, Paul's code is a much more concise test than mine, and reproduces the exact problem.

Waiting for your investigations :)
Anthony

Anonymous
Tue 15 Feb 2011 10:34:03 PM UTC, comment #2: 

I don't know, something seems wrong here to me.  If you have:

export AA
$(eval export AB)
tst = $(eval export AC)
$(call tst)
all: ; env | grep ^A


Then I see no rational reason offhand why make will correctly export AA and AB as empty, but not export AC.

This needs more investigation.

Paul D. Smith <psmith>
Group administrator
Tue 15 Feb 2011 10:31:17 PM UTC, comment #1: 

http://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion

As I understand it export do really export of defined variables
and has to be

define test1
AA=
$(eval export AA)
endef

Olexiy Buyanskyy <olexiyb>
Tue 15 Feb 2011 10:05:04 PM UTC, original submission:  

Hi,

After a long bug hunting in a set of complex Makefiles, I came up with that simple test that let me think there is a problem in gmake itself:

-- cut here --
define test1
$(eval export AA)
endef

define test2
$(eval export AB=)
endef

define test3
$(eval export AC=x)
endef

$(call test1)
$(call test2)
$(call test3)
$(eval export AD)

all:
env | grep ^A
-- cut here --

The output from gmake is :
env | grep ^A
AB=
AC=x
AD=

Note that 'AA' variable is not exported.
I can reproduce this with gmake-3.81 or 3.82, on different platforms (Linux, NetBSD).

Am I missing something, or is there really a problem here?


Anonymous

 

(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 psmith (Posted a comment)
  • -email is unavailable- added by olexiyb (Posted a comment)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-12 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2011-02-15 psmith Triage StatusNone Verified

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code