Fwd: [Module::Build] Does ./Build work on Windows?
Status: Beta
Brought to you by:
kwilliams
|
From: demerphq <dem...@gm...> - 2006-01-30 09:11:39
|
Whoops, accidental reply instead of reply-to-all... ---------- Forwarded message ---------- On 1/30/06, Randy W. Sims <ml...@th...> wrote: > Ken Williams wrote: > > > > On Jan 29, 2006, at 2:19 AM, Andreas J. Koenig wrote: > > > >>>>>>> On Sat, 28 Jan 2006 23:13:25 -0600, Chris Dolan > >>>>>>> <ch...@cl...> said: > >> > >> > >>> On Jan 28, 2006, at 11:00 PM, Andreas J. Koenig wrote: > >>> > >>>> I got a bugreport for CPAN.pm that claims that ./Build does not work > >>>> on Windows. If this is true, the whole support for Module::Build in > >>>> CPAN.pm is broken. > >>>> > >>>> Please advise. > >> > >> > >>> It should be "perl Build" (for appropriate values of "perl") instead > >>> of ./Build. > >> > >> > >> Is this really everything Module::Build has to offer? No Build.bat > >> file? Has Build.bat been ever considered? > > > > > > We already do the script->.bat conversion for scripts that get > > installed, I think we could figure out an appropriate way to do the sam= e > > for the Build script too. > > Actually, IIRC, I special cased it in the Windows code to convert > everything but "Build". At the time I there were some problems having > the generated Build.bat delete itself during "perl Build realclean". I > think Yves found a solution to this (ref "Help with a Cwd.pm build > error" thread on p5p). I haven't done well following up on any of this > as I've been rather busy with first of year stuff, but I hope to start > getting caught up this week. The change required to MB to handle this is minimal and is implemented in a provisional form in the attached patch. When the Build script is created it needs to add the line close *DATA unless eof(*DATA); when being used on win32. Then the exception line in pl2script needs to be removed. Additionally when scripts are pl2bat'ed their bat names need to be added to the cleanup list. This currently doesnt happen at all so MB cant/doesnt clean up pl2batted files properly. (It may do so indirectly as a directory cleanup but this doesnt help the build script itself.) Also, my preference (and i think the preference of many in the windows world) is to avoid ".bat" files on NT and latter Win32 OS'es. It should use the .cmd extension when on NT, W2K and XP or later. I hazzily recall there is a good reason for this, but i have to admit I dont remember what it is. Maybe its just cargo cultism and doesnt matter at all. Anyway, the point is the attached patch includes such logic. :-) I based it the behaviour change on the presence of .CMD in the PATHEXT enviornment var so on machines without either it will default to .bat Im sorry i havent gotten further on this, i was distracted by other things. BTW, there is one annoying thing about self deletion of the .cmd/.bat Build file. When control returns to the shell it raises a warning about the batch file unexpected ending. Its not an issue, but it is inelegant so figuring out how to make it go away would be nice. Er, also, it might be worth just replacing the pl2bat behaviour with the creation of a generic Build.cmd that just contained the logic to launch perl Build. Then it wouldnt need to be cleaned up, and avoid the other little issues involved. Cheers, yves -- perl -Mre=3Ddebug -e "/just|another|perl|hacker/" |