Computoid

| About | APPerl

NAME

Actually Portable Perl (APPerl)

DESCRIPTION

Actually Portable Perl (APPerl) is a distribution of Perl that runs on several x86_64 operating systems (most Unix-like and Windows) via the same binary. It builds to a single binary with perl modules packed inside of it.

Cross-platform, single binary, standalone Perl applications can be made by building custom versions of APPerl, with and without compiling Perl from scratch, so it can be used an alternative to PAR::Packer. APPerl could also easily be added to development SDKs, carried on your USB drive, or just allow you to run the exact same perl on all your PCs multiple computers.

Information on the creation of APPerl can be found in this blogpost.

Actually Portable Perl was presented at TPRC 2024: Video | Slides

FEATURES

RELEASES

Latest Release Builds

apperlm (APPerl Manager) is available on CPAN: Perl::Dist::APPerl
apperlm is also packaged inside of full builds of APPerl for convenience; see BOOTSTRAPPING.

Releases (on GitHub)

USAGE NOTES

unix-like notes and troubleshooting

You must make the binary executable before it can be ran:
chmod +x perl.com

Actually Portable Executables(APEs) such as APPerl, must be run from a Thompson Shell compatible shell such as bash. On some Linux environments (such as WSL), you may need to fiddle with binfmt_misc. Cosmopolitan Libc README

APEs automatically extract and install the APE Loader if it is not found. Usually, the APE Loader is installed to $HOME/.ape. In order to run an APE, the APE Loader must be executable (not stored on a noexec mount). See APE Loader.

APEs can sidestep the APE loader by converting to the native binary format (e.g. ELF, Mach-O):
cp perl.com perl && ./perl --assimilate . Of course, this makes them no longer APEs.

Running under pledge

If running third-party binaries makes you nervous, APPerl can be ran with pledge under Linux (pledge.com can be built from the source in the Cosmopolitan Libc repo).

cp perl.com perl
./perl --assimilate
./pledge.com -p 'stdio rpath tty' ./perl -e 'print("hello world\n");'
./pledge.com -p 'stdio rpath tty cpath proc exec prot_exec tmppath' ./perl /zip/bin/perldoc Perl::Dist::APPerl

DOCUMENTATION, SOURCE CODE, AND SUPPORT

Support and bug reports should be filed as issues at the Perl::Dist::APPerl repo. Pull Requests are welcome at the repos. The Cosmopolitan Libc is a third-party project, be sure to read the guidelines there if contributing there.

Fixes to the cosmo platform in the perl source should be done on top of the cosmo branch. Improvements to APPerl, but unfit to be merged into official perl should be done on top of the cosmo-apperl branch. Ideally someday we'll get the cosmo platform merged into official perl.

COMMUNITY

APPerl shares the Cosmopolitan Libc discord.

ACKNOWLEDGEMENTS

The Cosmopolitan Libc contributors, especially Justine Tunney and Gautham Venkatasubramanian. APPerl wouldn't be possible without Actually Portable Executables and polyfills of several Linux and POSIX APIs for other platforms. Gautham's Python port inspired this project.

AUTHOR

Gavin Hayes - my email and profiles are in the footer.

This software is copyright (c) 2022 by Gavin Hayes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.