Skip Menu |
 

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 5670
Status: open
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: toby [...] ovod-everett.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.24
Fixed in: 0.24



Subject: Support for Unix line-endings in file creation under Windows
I'm a Win32 developer, but some of the modules I've (co-)?developed (Class::Prototyped, Data::BitMask) are platform independent. In general, I try to be very careful to use the Unix line-termination sequence in all the files for those modules because I consider that to be the standard. For modules that can only be run under Win32 I do use the DOS line-termination sequence. It would be nice if there were an option to Module-Build that would cause things like META.yml, MANIFEST, Makefile.PL, README, etc. to be outputted using the Unix line-termination sequence (i.e. using binmode on the file handle). Even nicer would be if it looked at Build.PL and took it's cue from there - if Build.PL uses Unix line-terminations, than the created files should as well. The ultimate in nice would be if it checked all of the files in the distribution to see that they used the appropriate line-terminations (since my preferred editor auto-senses, I frequently end up with a file or two that doesn't match the rest of the module). --Toby Ovod-Everett
Download (untitled) / with headers
text/plain 726b
On Sun Mar 14 19:39:11 2004, guest wrote: Show quoted text
> I'm a Win32 developer, but some of the modules I've (co-)?developed > (Class::Prototyped, Data::BitMask) are platform independent. In > general, I try to be very careful to use the Unix line-termination > sequence in all the files for those modules because I consider that > to be the standard. For modules that can only be run under Win32 I > do use the DOS line-termination sequence.
Perl has been able to deal with Windows vs Unix line endings for years now. So do most editors and browsers. Given that, is this sort of fastidiousness is necessary anymore? I don't think there's anything wrong with shipping a Windows newline terminated Build.PL or MANIFEST.
CC: toby [...] ovod-everett.org
Subject: Re: [rt.cpan.org #5670] Support for Unix line-endings in file creation under Windows
Date: Thu, 6 Mar 2008 05:45:28 -0900
To: Michael G Schwern via RT <bug-Module-Build [...] rt.cpan.org>
From: Toby Ovod-Everett <toby [...] ovod-everett.org>
Download (untitled) / with headers
text/plain 2.2k
On Mon, Mar 03, 2008 at 04:49:06PM -0500, Michael G Schwern via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=5670 > > > On Sun Mar 14 19:39:11 2004, guest wrote:
> > I'm a Win32 developer, but some of the modules I've (co-)?developed > > (Class::Prototyped, Data::BitMask) are platform independent. In > > general, I try to be very careful to use the Unix line-termination > > sequence in all the files for those modules because I consider that > > to be the standard. For modules that can only be run under Win32 I > > do use the DOS line-termination sequence.
> > Perl has been able to deal with Windows vs Unix line endings for years > now. So do most editors and browsers. Given that, is this sort of > fastidiousness is necessary anymore? I don't think there's anything > wrong with shipping a Windows newline terminated Build.PL or MANIFEST.
Unfortunately, however, the only guaranteed available text editor on a Win32 box is Notepad, which doesn't handle Unix line endings. If someone is working on a machine on which they do not have local Admin rights, or on which they do not want to install unnecessary software (and a freeware text editor may fall into that category - every piece of software installed is yet another piece of software that must be tracked for possible security updates, and so adds to the administrative headache), the only editor they can be sure of having is Notepad, and so I try to be kind where I know it won't screw up anything. It is true that WordPad will handle Unix line endings, but WordPad is not a text editor - it's a weak word processor, and using it to edit text files always makes me a tad leary. The Win32 side executes Perl code with Unix terminations perfectly well, however, and it reads Unix line termination sequences in files transparently. As for the Unix side, I know in the past that I've seen issues with DOS line-termination sequences when executing Perl on Unix boxes, so I've tended to be conservative. Finally, Unix Perl doesn't transparently strip DOS line-termination sequences. Run the following code against a DOS line-terminated file under both Unix and Win32: while (<STDIN>) { chomp; print "'$_'\n"; } Thus my conservativism. ;) --Toby Ovod-Everett
Subject: Re: [rt.cpan.org #5670] Support for Unix line-endings in file creation under Windows
Date: Thu, 06 Mar 2008 17:22:50 +0100
To: bug-Module-Build [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
toby@ovod-everett.org via RT wrote: Show quoted text
>> Perl has been able to deal with Windows vs Unix line endings for years >> now. So do most editors and browsers. Given that, is this sort of >> fastidiousness is necessary anymore? I don't think there's anything >> wrong with shipping a Windows newline terminated Build.PL or MANIFEST.
> > Unfortunately, however, the only guaranteed available text editor on a Win32 > box is Notepad, which doesn't handle Unix line endings. If someone is working > on a machine on which they do not have local Admin rights, or on which they do > not want to install unnecessary software (and a freeware text editor may fall > into that category - every piece of software installed is yet another piece of > software that must be tracked for possible security updates, and so adds to > the administrative headache), the only editor they can be sure of having is > Notepad, and so I try to be kind where I know it won't screw up anything. It > is true that WordPad will handle Unix line endings, but WordPad is not a text > editor - it's a weak word processor, and using it to edit text files always > makes me a tad leary. The Win32 side executes Perl code with Unix > terminations perfectly well, however, and it reads Unix line termination > sequences in files transparently.
I'm sorry to say, but this sounds like Module::Build bending over backwards to support an anemic development environment. Someone trying to work on that machine is going to be going insane 90 different ways anyway, a Unix terminated file is going to be the least of their worries if all they have is Notepad. And hey, they have perl. Fix the newlines: perl -i -pe 's{\015\012?}{\n}g;' Also, one does not edit the META.yml, MANIFEST, Makefile.PL or README -- any of the Module::Build generated files -- by hand. There's little reason you're going to be looking at or altering them on a locked-down, stripped-down Windows machine. Finally, worrying about newlines is only useful for unportable modules... Win32 or Unix-specific code. A cross-platform module should not care. If the module only runs on Windows then under what conditions will you roll a distribution on Unix? So I remain unconvinced that the effort will produce anything useful. Have you run into this problem in the real world or is this a hypothesis? Show quoted text
> As for the Unix side, I know in the past that I've seen issues with DOS > line-termination sequences when executing Perl on Unix boxes, so I've tended > to be conservative.
If you have examples of this, please report it to perlbug. There should be no issues. Show quoted text
> Finally, Unix Perl doesn't transparently strip DOS > line-termination sequences. Run the following code against a DOS > line-terminated file under both Unix and Win32: > while (<STDIN>) { > chomp; > print "'$_'\n"; > } > Thus my conservativism. ;)
While that may be true, this issue doesn't effect any of the Module::Build generated files. -- We do what we must because we can. For the good of all of us, Except the ones who are dead. -- Jonathan Coulton, "Still Alive"


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.