bugmake - Bugs: bug #43378, $(guile ...) must be coaxed to...

 
 

bug #43378: $(guile ...) must be coaxed to accept (or does not accept) valid guile code.

Submitted by:  Taahir Ahmed <ahmedtd>
Submitted on:  Wed 08 Oct 2014 12:27:13 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: DuplicatePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 4.0Operating System: Any
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 02:36:18 PM UTC, comment #5:

The issue about # not being handled correctly is Savannah bug #20513

Paul D. Smith <psmith>
Project Administrator
Fri 10 Oct 2014 05:54:48 PM UTC, comment #4:

Yes there are many things you can use instead of #nil: you can use an empty string, an empty list, and #f, at least. You can see http://www.gnu.org/software/make/manual/html_node/Guile-Types.html for a discussion of how Guile types are converted back into make strings.

Paul D. Smith <psmith>
Project Administrator
Fri 10 Oct 2014 05:22:27 PM UTC, comment #3:

Ah, I see. The #nil trick is a decent enough workaround, although it will be mystifying to anyone reading the code at first glance. I wonder if a just plain empty string would work?

Anyway, I'll need to look over my code to see if there are any other places where I'm emitting random stuff into the makefile that just happens to work.

Thanks for the explanation.

Taahir Ahmed <ahmedtd>
Fri 10 Oct 2014 05:10:25 PM UTC, comment #2:

I agree that make's handling of # is busted: there's actually a bug open elsewhere for similar issues in the $(shell ...) function. This needs to be fixed... unfortunately it's a bit problematic since by now people are adding backslashes to escape the #, which we don't want, so this will be a backward-incompatible change. Maybe for a time we can accept both. Or something.

For your second example, this is intended (and necessary) behavior. The problem you're having is not that ! is an illegal character (it's not; ! is in no way special to make). The problem is that the $(guile ...) function expands to the results of the Guile code. In your case the function you invoked was append!, and that function expands to the new list after the append is done. So after make runs this:

make sees (and tries to parse) this:

and that gives you the "missing separator" error.

You can avoid this by having the final term in your Guile code be #nil; as per the documentation make converts #nil to the empty string:

Note backslash is not needed for # here, for some reason (ugh!)

Paul D. Smith <psmith>
Project Administrator
Wed 08 Oct 2014 03:41:26 AM UTC, comment #1:

I just realized that the sharps can be escaped with backslash (not sure why that didn't occur to me before).

However, the other problematic characters can't be handled this way: if I enter a \! in $(guile), both characters get passed through to the guile layer, not just the !.

Taahir Ahmed <ahmedtd>
Wed 08 Oct 2014 12:27:13 AM UTC, original submission:

The $(guile) function does not accept all valid guile code.

For example, the sharps here are unconditionally interpreted as comments:

----make code snip----
libelektros_CFLAGS := $(guile (augmk/pkg-config/cflags "eigen3" #:sedsystem #t))
----make code snap----

Sharps are fairly important syntactic components of guile --- they are the syntax both for several literal types and for keyword arguments. The snippet illustrates both usages.

Other characters cause problems as well. For example, adding to the load path:

----make code snip----
$(guile (append! %load-path (list "./")))
----make code snap----

For this snippet, I get "***missing separator. Stop.". I have to explicitly show make that this is an assignment in order for it to be accepted:

----make code snip----
DUMMY:=$(guile (append! %load-path (list "./")))
----make code snap----

Looking at the parse function, it seems like all function calls are handled as a variable assignment (possibly to nothing). However, the manual shows several non-assignment uses of the $(guile) function, so I assume that this is meant to be supported behavior.

Taahir Ahmed <ahmedtd>

 

(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 ahmedtd (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 26 Dec 2016 02:36:18 PM UTCpsmithStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
    Fri 10 Oct 2014 05:10:25 PM UTCpsmithComponent VersionNone=>4.0

    Back to the top


    Powered by Savane 3.1-cleanup1