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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.