Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

C++ files in Strawberry Perl Package

by AkshayDeeti (Initiate)
on Jun 08, 2021 at 10:33 UTC ( #11133651=perlquestion: print w/replies, xml ) Need Help??

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

Hi Perl Monks,

Please help me with this.

When I install strawberry Perl package, I have observed that in c folder there are multiple files such as .exes, C++ and many more. Which is not the case for the Active Perl. When I deleted the c folder, my Perl scripts failed. I retained only bin folder in c and deleted rest of the folders in c, and then my Perl scripts started working. So, I would like to know,

1. Can I have only bin folder in c and deleted all other folders in c ?

2. Can I deleted some other files in c\bin which are not required and any other folders like licenses etc. in package ?

NOTE : I am trying to make this package smaller / liter by deleting unwanted file to reduces the risk of vulnerabilities and ship to a software. I am okay, even if this package doesn't allow me to install the other Perl modules using cpan.

Thanks in advance !!

Replies are listed 'Best First'.
Re: C++ files in Strawberry Perl Package
by syphilis (Bishop) on Jun 08, 2021 at 11:37 UTC
    When I deleted the c folder, my Perl scripts failed.

    I would not have expected that - but it could depend upon what those scripts are wanting to do.
    What are these failures that you are seeing ?

    When I install Strawberry Perl, I always install one of the "portable" builds - and, if I remove the "c" directory, perl still works.
    Maybe things are different if you install Strawberry Perl from the ".msi" distro.

    AFAIK, Strawberry Perl needs only 3 files from c/bin in order to be functional - libgcc_s_seh-1.dll, libstdc++-6.dll and libwinpthread-1.dll.
    If those 3 files are duplicated in perl/bin (as is the case with the "portable" builds) then you should be able to remove the "c" folder entirely.

    Of course, you will then lose some functionality if you do that.
    For example, Inline::C will be unusable and you won't be able to install many modules because you've lost gmake.exe and other handy utilities.

    Cheers,
    Rob
      And I have deleted all the files in c\bin except dll files and everything is working fine. Can I go with this approach ?
        Can I go with this approach ?

        Yes, I think so.
        I think you could delete all of the other directories in "c", too, if you wanted.
        Of course, these are things that would not normally be done, but there's nothing to stop you from doing them.
        As a precaution, I would recommend keeping these removed files somewhere handy, so that you can reinstate them if necessary.

        Cheers,
        Rob
      @syphilis, thank you for your response. I have used .zip for configuring strawberry Perl. Yes it is depends on the scripts. For me, scripts using XML module is failing. I tried with the files libgcc_s_seh-1.dll, libstdc++-6.dll and libwinpthread-1.dll as you have mentioned, but did not work for me. May be because what I have is not portable. Please share if any other possible way.
Re: C++ files in Strawberry Perl Package
by soonix (Canon) on Jun 08, 2021 at 11:10 UTC

    Strawberry Perl and Active Perl have very different concepts. Active Perl does their installation and integration into the system more or less completely "the Windows Way", while Strawberry's way is much more "Unixy", hence the different folders. It's difficult to compare them.

    However, I think what you want to achieve is very similiar to what PAR::Packer and its utility pp does. Even if you dont want to create an EXE (see e.g. EXE from Script (Re: General advice desperately needed)), perhaps it helps you finding out which components you need.
      @ssonix, Thank you for your response. Could you please point me to the articles which explains on how the C++ files are used in the run time ?
Re: C++ files in Strawberry Perl Package
by karlgoethebier (Abbot) on Jun 08, 2021 at 22:50 UTC

    Probably you can use Process Explorer or something similar to explore what happens and what you need. If you like to go this way I wish you well as itís pain in the ass. IMHO this isnít the way to go. You can not install some software and then expect that it works as designed if you decide to change itís layout because you donít like it or what ever.

    ęThe Crux of the Biscuit is the ApostropheĽ

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2021-06-12 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (53 votes). Check out past polls.

    Notices?