Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Build Perl win32 with a ' ' in install dir

by fdesar (Beadle)
on Jan 06, 2020 at 11:28 UTC ( #11111047=perlquestion: print w/replies, xml ) Need Help??

fdesar has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monk !

I'm trying to build Perl from source on a win32 system.

Everything goes alright but I encounter a very big problem with the installation PATH as it halas MUST include a space charater as in 'c:\Program File\somedir\lib\perl5 and I also need the @INC content points to c:\Program Files\somedir\lib\perl5\....

So I tried setting :

INST_TOP *= $(INST_DRV)\Program\ Files\somedir\lib\perl5

in the Win32\Makefile.mk but it seems it doesn't to like this space character at all:

It compiles OK, runs tests OK but won't install at all :-(

Anyone having I idea on how to get around this issue ?

Many thank for your time and wisdom,

François

  • Comment on Build Perl win32 with a ' ' in install dir

Replies are listed 'Best First'.
Re: Build Perl win32 with a ' ' in install dir
by Corion (Pope) on Jan 06, 2020 at 12:23 UTC

    As a hacky way of installing your custom Perl, you can also first configure it for (say) C:\TEMP\MyPerl\, install it there and then move it.

    You will have to patch lib/Config.pm, lib/Config_heavy.pl and lib/CPAN/Config.pm and adjust them for your new paths, but that should be it. Alternatively, have a look at what Strawberry Perl does in relocateperl.cmd.

      Thanks, but if I move my new Perl, how will it find its lib/Config.pm lib/Config_heavy.pm and lib/CPAN/Config.pm at their new locations ?

        These paths (well, @INC) get set up relative to the location of perl.exe, as long as you have userelocatableinc set to a true value in your Makefile. This should be the default on Windows anyway.

Re: Build Perl win32 with a ' ' in install dir
by soonix (Canon) on Jan 06, 2020 at 11:40 UTC
    Starting from Win95 until recently (don't know if it works under Win10, but probably yes), you could use C:\PROGRA~1 instead of C:\Program Files - it is certainly worth a try.

    Update: WP on 8.3 filenames

    NTFS, a file system used by the Windows NT family, supports LFNs natively, but 8.3 names are still available for legacy applications. This can optionally be disabled […]

      it seems it doen't work anymore on Windows 10 :

      If I do in a DOS shell a

      dir c:\progra-1

      the only thing I get is a "File not found"!

        Attention: ~ is not a dash, it should be a (squiggly) tilde.
        dir c:\progra-1

        It's a tilde (~), not a dash (-). Try

        dir c:\progra~1
        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

        it seems it doen't work anymore on Windows 10 :

        Hi

        AFAIK, Its a feature you have to choose to turn on, it affects cmd.exe globbing (extra matches)

Re: Build Perl win32 with a ' ' in install dir
by syphilis (Bishop) on Jan 07, 2020 at 00:39 UTC
    It compiles OK, runs tests OK but won't install at all

    I find the same problem - not because of the ' ', but because make install is unable to create new directories in C:\Program Files - even when I'm running as Owner.
    That is, I get "Access is denied" error.
    I don't know how to work around that.

    However, when I switch to attempting to install into a location that does allow me to create new directories (eg C:\_64\Program Files\perl), then the space between 'Program' and 'Files' creates problems.
    The only workaround I came up with (drawing on earlier posts in this thread) was to:
    1) Create C:\_64\Program Files directory (unless it already exists);
    2) set INST_TOP to $(INST_DRV)\_64\PROGRA~1\perl

    But if you're intent on installing perl into C:\Program Files and you're hitting the "Access is denied" error, then I can't really help.

    Cheers,
    Rob

      It may be it will work if you run the install under an administrative command window. Create a command window by right click / Run as Administrator from the Windows 10 search window (Windows key - s, then type cmd).

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
        It may be it will work if you run the install under an administrative command window

        That is indeed all it takes. Good catch !
        Funny ... I was assuming that "Owner" was synonymous with "Administrator" ... but apparently not.

        Cheers,
        Rob
Re: Build Perl win32 with a ' ' in install dir
by harangzsolt33 (Friar) on Jan 07, 2020 at 06:06 UTC
    Why don't you install Perl in C:\bin\perl? It would make things so much easier. I have a Bin folder where I keep a bunch of portable programs. When I install Windows, I just copy my programs to C:\Bin, and I have all my programs up and ready. This includes PHP, Python, and TinyPerl 5.8 as well and many others...
Re: Build Perl win32 with a ' ' in install dir
by Anonymous Monk on Jan 07, 2020 at 05:10 UTC

    Hi

    Why don't you use ActivePerl?

    Why don't you use CitrusPerl?

    Why don't you use StrawberryPerl? Lots of installer to borrow

    Why are you building your own?

    Re^3: Relocatable Perl (use Portable;)

Re: Build Perl win32 with a ' ' in install dir
by Anonymous Monk on Jan 06, 2020 at 12:21 UTC
    What does it do?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11111047]
Approved by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2020-07-13 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?