bugmake - Bugs: bug #38945, [PATCH] Fix CRLF backslash-newline...

 
 

bug #38945: [PATCH] Fix CRLF backslash-newline handing on non-WINDOWS32 platforms

Submitted by:  Derek Buitenhuis <dwbuiten>
Submitted on:  Wed 08 May 2013 11:36:31 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 4.0Operating System: POSIX-Based
Fixed Release: 4.0Triage Status: Verified

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sun 26 May 2013 06:42:22 PM UTC, comment #5:

Fixed. Thanks for the repro case!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Thu 23 May 2013 06:11:32 AM UTC, comment #4:

Here's a minimal testcase to reproduce this bug.

Put the following in "Makefile" (Unix or DOS linebreaks):

include snippet

define RULES
clean::
$(RM) $(OBJS) $(OBJS:.o=.d)
endef
$(eval $(RULES))

Put the following in "snippet" (DOS linebreaks):

OBJS = x86/cpu.o \

There must not be an empty line after OBJS in "snippet", otherwise the bug will not trigger.

Diego Biurrun <dondiego>
Wed 22 May 2013 05:18:17 PM UTC, comment #3:

I'm actually having a hard time making a small reproducible file...

At the moment, you can easily reproduce this as:

$ git clone git://git.libav.org/libav.git
$ cd libav
$ ./configure
$ todos libavcodec/x86/Makefile
$ make
common.mak:65: *** missing separator. Stop.

Derek Buitenhuis <dwbuiten>
Wed 22 May 2013 03:42:55 PM UTC, comment #2:

I'm trying to create a repro case for this. I've created a file on Linux and forced it to contain CRLF line endings but I can't get it to fail with the errors you've described. I'm not sure what you mean by "a rule/prefix name", and the makefile you point to as an example case doesn't contain any rules: it's simply a long list of variable assignments. The name of that file doesn't match the error message you give, and there aren't 129 lines in that file, so that message is from a different file.

Can you attach a small, simple makefile to the bug that shows the error?

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Thu 09 May 2013 12:13:20 AM UTC, comment #1:

Also I should have added: I agree to GNU's CLA, so I hereby give you the copyright to this change, or however that is supposed to work.

Derek Buitenhuis <dwbuiten>
Wed 08 May 2013 11:36:31 PM UTC, original submission:

Attached is a patch that will fix erroneous parsing for Makefile with CRLF line endings, and a backslash-newline before a rule/prefix name (which POSIX says should is allowed and should be ignored).

Example case:

http://git.libav.org/?p=libav.git;a=blob;f=libavcodec/x86/Makefile;h=f13f3e0ea8f45efb9050ff7439d7e2de108778d0;hb=HEAD#

When cloned on windows with autocrlf set to true, you get the following with MSYS Make:

common.mak:129: *** missing separator. Stop.

Also reproducible on Linux with CRLF endings.

The attached patch fixes the issue on non-WINDOWS32 platforms such as Linux and MSYS. Comments and opinions welcome!

- Derek

Derek Buitenhuis <dwbuiten>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 26 May 2013 06:42:22 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
      Triage StatusNeed Info=>Verified
    Wed 22 May 2013 03:42:55 PM UTCpsmithTriage StatusNone=>Need Info
    Wed 08 May 2013 11:36:31 PM UTCdwbuitenAttached File-=>Added 0001-Fix-CRLF-backslash-newline-handing-on-non-WINDOWS32-.patch, #28051
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup