bugmake - Bugs: bug #48360, Environment variable doesn't loose...

 
 

bug #48360: Environment variable doesn't loose specialness, although redefined

Submitted by:  Stefan Becker <stefanb>
Submitted on:  Fri 01 Jul 2016 11:38:24 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: DuplicatePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 4.2Operating System: None
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 26 Dec 2016 04:46:12 PM UTC, comment #2:

It seems this is a duplicate of bug #46585.

The unique thing about this is perhaps some way to determine from within a makefile whether a make variable is exported or not; currently neither the flavor nor origin functions provide this information. However, I don't know that it's really that useful to query this: if you want the variable to be exported you should export it, and if you want it to be guaranteed to not be exported you should unexport it... I'm not sure testing the value first is a useful thing to do.

I'm closing this as a duplicate for now but feel free to add comments if you disagree.

Paul D. Smith <psmith>
Project Administrator
Fri 01 Jul 2016 05:31:33 PM UTC, comment #1:

By "specialness", I think you mean "whether it's exported". Adding "export CC" turns the first example into a BOOM case for me. Adding "unexport CC" stops the second example BOOMing for me. This seems well-behaved to me.

Martin Dorey <mdorey>
Fri 01 Jul 2016 11:38:24 AM UTC, original submission:

A variable inherited from environment doesn't loose it's specialness, although flavor/origin don't show specialness anymore.

Test makefile:

Test run:

In the error case CC retains its environment flavor but the contents are defined by the makefile. Thus preparing the environment for the command execution will trigger the $(error).

BTW: you can replace CC with SOME_VAR, i.e. a non-default variable, and the test case still fails the same way.

This is probably closely related to the following bugs

Stefan Becker <stefanb>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by mdorey (Posted a comment)
  • -unavailable- added by stefanb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 26 Dec 2016 04:46:12 PM UTCpsmithStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1