bugmake - Bugs: bug #58529, MAKEOVERRIDES does not change the...

 
 

bug #58529: MAKEOVERRIDES does not change the origin

Submitter:  Masahiro Yamada <masahiroy>
Submitted:  Mon 08 Jun 2020 04:56:27 AM UTC
   
 
Severity:  3 - Normal Item Group:  None
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  None Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 30 Jun 2020 04:28:39 AM UTC, comment #4: 


> "$(MAKE)" appears in a recipe it will be replaced with the equivalent of "make
> $(MAKEOVERRIDES)" or in this case, "make FOO=y".


Make sense.

I agree this is not a bug.

Thanks for explanation.

Masahiro Yamada <masahiroy>
Mon 29 Jun 2020 01:14:49 PM UTC, comment #3: 

Why do you think that the origin of FOO should not be "command line"?

It WAS overridden on the command line in the sub-make.  The value of MAKEOVERRIDES specifies what values are to be passed on the command line to the sub-make.

When you use "MAKEOVERRIDES += FOO=y" what you're saying is that whenever "$(MAKE)" appears in a recipe it will be replaced with the equivalent of "make $(MAKEOVERRIDES)" or in this case, "make FOO=y".

So, I would definitely expect that the origin of FOO in the submake would be "command line".

I'm marking this closed but feel free to add more comments if you have other questions or don't agree with this assessment.

Paul D. Smith <psmith>
Group administrator
Mon 29 Jun 2020 02:14:15 AM UTC, comment #2: 

make manual specifies that the only thing legal to do with MAKEOVERRIDES is to reset it.
Why do you want to set new contents of MAKEOVERRIDES? MAKEOVERRIDES is not intended for this use.
You can override a variable using override.
override FOO=z

Dmitry Goncharov <dgoncharov>
Mon 08 Jun 2020 05:02:55 AM UTC, comment #1: 

MAKEOVERRIDES += FOO=overridden-value

in the test code is:

MAKEOVERRIDES += FOO=y

Masahiro Yamada <masahiroy>
Mon 08 Jun 2020 04:56:27 AM UTC, original submission:  

MAKEOVERRIDES += FOO=y

correctly overrides the value of FOO in
the recursive invocations, but
$(origin FOO) still returns 'command line'.



----------------(test code)------------------
MAKEOVERRIDES += FOO=overridden-value

all:
        @$(MAKE) sub-make

sub-make:
        @echo FOO is $(FOO)
        @echo origin of FOO is $(origin FOO)
----------------(test code end)------------------


$ make FOO=x
make[1]: Entering directory '/home/masahiro/workspace/test/'
FOO is y
origin of FOO is command line
make[1]: Leaving directory '/home/masahiro/workspace/test/'


I think $(origin FOO) should return 'override' in this case.

Masahiro Yamada <masahiroy>

 

(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 dgoncharov (Posted a comment)
  • -email is unavailable- added by masahiroy (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-29 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code