[bug #56446] Make shouldn't be running eval when expanding variables for export

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #56446] Make shouldn't be running eval when expanding variables for export

David Boyce-5
URL:
  <https://savannah.gnu.org/bugs/?56446>

                 Summary: Make shouldn't be running eval when expanding
variables for export
                 Project: make
            Submitted by: mark_galeck0
            Submitted on: Thu 06 Jun 2019 01:47:17 AM UTC
                Severity: 3 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.2.1
        Operating System: None
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

This is a good Makefile (SSCCE example) that nevertheless bombs:


define FUNCTION
target: $1
endef

FUNCTION2 = $(eval $(call FUNCTION,$1))

.EXPORT_ALL_VARIABLES:

all:    
    echo OK


Now when you make this, you get:

Makefile:5: *** prerequisites cannot be defined in recipes.  Stop.

Paul Smith suggested I file this request for enhancement:  Make shouldn't be
running eval when expanding variables for export.  




    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #56446] Make shouldn't be running eval when expanding variables for export

David Boyce-5
Follow-up Comment #1, bug #56446 (project make):

Yes, _.EXPORT_ALL_VARIABLES_ should at least be *documented* for its danger
regarding (forced) early expansion with the very first recipe being executed.
This also breaks most usage of functions like _error_ in variables.

As for this example, at least _unexport FUNCTION2_ helps here.

    _______________________________________________________

Reply to this item at:

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

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