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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Background

I don't know how much of this is useful. I've kept it very brief. Ask for more details if you need them.

  1. cpan install Perl::Dist::APPerl v0.3.0 (on openSUSE Leap 15.4 with Perl v5.26.1)
  2. $ apperlm install-build-deps $ apperlm init --name initial_build_config --base full $ apperlm checkout initial_build_config $ apperlm configure $ apperlm build
  3. $ ./perl.com -v This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-co +smo (with 6 registered patches, see perl -V for more detail) ... $ ./perl.com -V Summary of my perl5 (revision 5 version 36 subversion 0) configuration +: Commit id: ca87f329eeb075c0fe7ac803eb933f36af45a69b Platform: osname=cosmo ...
  4. Copied perl.com to Win10 platform with Strawberry Perl v5.26.3. Renamed to apperl.com to avoid conflict with (Strawberry) perl.exe.
    C:\Users\ken\tmp>apperl -v This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-co +smo (with 6 registered patches, see perl -V for more detail) ... C:\Users\ken\tmp>apperl -V Summary of my perl5 (revision 5 version 36 subversion 0) configuration +: Commit id: ca87f329eeb075c0fe7ac803eb933f36af45a69b Platform: osname=cosmo ...
  5. Copied perl.com to Cygwin platform with Perlbrew Perl v5.36.0.
    $ ./perl.com -v This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-co +smo (with 6 registered patches, see perl -V for more detail) ... $ ./perl.com -V Summary of my perl5 (revision 5 version 36 subversion 0) configuration +: Commit id: ca87f329eeb075c0fe7ac803eb933f36af45a69b Platform: osname=cosmo ...

Problem

From "Perl::Dist::APPerl - USAGE":

"APPerl doesn't need to be installed, the output perl.com binary can be copied between computers and ran without installation."

This generally seemed to be the case. I ran various checks (on all platforms): 'use v5.36;' enables the strict and warnings pragmata, and features are enabled or disabled in line with :5.36 bundle; an arbitrary selection of core modules had correct versions.

However, $^O reported cosmo (presumably short for Cosmopolitan Libc) on all platforms. This will cause problems with modules which provide different functionality based on $^O. File::Spec gave good examples of this.

Linux:

$ perl -E 'say $^O' linux $ ./perl.com -E 'say $^O' cosmo $ perl -E 'use File::Spec; say for @File::Spec::ISA;' File::Spec::Unix $ ./perl.com -E 'use File::Spec; say for @File::Spec::ISA;' File::Spec::Unix

Win10:

C:\Users\ken\tmp>perl -E "say $^O" MSWin32 C:\Users\ken\tmp>apperl -E "say $^O" cosmo C:\Users\ken\tmp>perl -E "use File::Spec; say for @File::Spec::ISA;" File::Spec::Win32 C:\Users\ken\tmp>apperl -E "use File::Spec; say for @File::Spec::ISA;" File::Spec::Unix

Cygwin:

$ perl -E 'say $^O' cygwin $ ./perl.com -E 'say $^O' cosmo $ perl -E 'use File::Spec; say for @File::Spec::ISA;' File::Spec::Cygwin $ ./perl.com -E 'use File::Spec; say for @File::Spec::ISA;' File::Spec::Unix

In all of those cases, you really want the perl.com -E ... output to match the perl -E ... output; but all defaulted to File::Spec::Unix.

"Perl::Dist::APPerl - USAGE" goes on to say:

"However, in certain cases such as magic (modifying $0, etc.) The binary must be assimilated for it to work properly. ... cp perl.com perl ./perl --assimilate"

In case that was needed, I tried:

# Win10 C:\Users\ken\tmp>apperl --assimilate Unrecognized switch: --assimilate (-h will show valid options). # Cygwin $ ./perl.com --assimilate Unrecognized switch: --assimilate (-h will show valid options).

I haven't worked with APPerl previously; there's a lot of documentation; it's entirely possible that I've missed a step; misread an instruction; or made some other mistake. I've been over what I've done a number of times but I can't see where I might have gone wrong. It could, of course, be bugs or shortcomings in APPerl itself.

If anyone can shed any light on this it would be greatly appreciated. Thankyou.

— Ken


In reply to APPerl: "osname=cosmo" problem by kcott

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2023-12-09 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (37 votes). Check out past polls.

    Notices?