Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
needs: build-linux
strategy:
matrix:
config: [full, small, full-vista, small-vista, full-536, small-536, full-540, small-540]
config: [full, small, full-vista, small-vista, full-536, small-536, full-540, small-540, full-542, small-542]
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v8
Expand Down Expand Up @@ -202,4 +202,6 @@ jobs:
small-536/*
full-540/*
small-540/*
full-542/*
small-542/*
APPerl-*-all.zip
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Revision history for Perl-Dist-APPerl
v0.8.0 2026-07-XX
Add Perl 5.42 builds.
Add Perl 5.44 RC2 builds.
Cleanup patchlevel patch list.

v0.7.0 2026-07-09
Add Perl 5.40 builds. 5.38 is skipped as static builds were
Expand Down
45 changes: 40 additions & 5 deletions lib/Perl/Dist/APPerl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -769,14 +769,37 @@ my %defconfig = (
dest => 'perl-542-small.com',
install_modules => [],
},
'full-544' => {
desc => 'moving target: full-544',
perl_flags => ['-Dprefix=/zip', '-Uversiononly', '-Dmyhostname=cosmo', '-Dmydomain=invalid'],
perl_extra_flags => ['-Doptimize=-Os', '-de', '-Dprivlib=/zip/lib/perl5', '-Darchlib=/zip/lib/perl5/x86_64-cosmo', '-Dsitelib=/zip/lib/perl5/site_perl', '-Dsitearch=/zip/lib/perl5/site_perl/x86_64-cosmo'],
MANIFEST => ['lib', 'bin'],
'include_Perl-Dist-APPerl' => 1,
perl_repo_files => {},
zip_extra_files => {},
cosmo3 => 1,
dest => 'perl-544.com',
perl_url => 'https://github.com/Perl/perl5/archive/refs/tags/v5.44.0-RC2.tar.gz',
patches => ['__sharedir__/5.44-cosmo3.patch', '__sharedir__/5.44-apperl.patch'],
install_modules => [],
},
'small-544' => {
desc => 'moving target: small-544',
base => 'full-544',
perl_onlyextensions => [qw(Cwd ErrnoRuntime Fcntl File/Glob Hash/Util IO List/Util POSIX Socket attributes re)],
MANIFEST => \@smallmanifest,
'include_Perl-Dist-APPerl' => 0,
dest => 'perl-544-small.com',
install_modules => [],
},
'full' => {
desc => 'moving target: full',
base => 'full-542',
base => 'full-544',
dest => 'perl.com',
},
'small' => {
desc => 'moving target: small',
base => 'small-542',
base => 'small-544',
dest => 'perl-small.com',
},
'nobuild' => {
Expand Down Expand Up @@ -816,9 +839,16 @@ my %defconfig = (
perl_url => undef,
patches => ['__sharedir__/5.40-cosmo3.patch'],
},
perl_cosmo_dev_544 => {
desc => "For developing cosmo platform perl without apperl additions",
base => 'full',
perl_id => 'v5.44.0-RC2',
perl_url => undef,
patches => ['__sharedir__/5.44-cosmo3.patch'],
},
perl_cosmo_dev => {
desc => "For developing cosmo platform perl without apperl additions",
base => 'perl_cosmo_dev_542',
base => 'perl_cosmo_dev_544',
},
perl_apperl_dev_536 => {
desc => "For developing apperl",
Expand All @@ -835,9 +865,14 @@ my %defconfig = (
base => 'perl_cosmo_dev_542',
'+patches' => ['__sharedir__/5.36-cosmo-apperl.patch'],
},
perl_apperl_dev_544 => {
desc => "For developing apperl",
base => 'perl_cosmo_dev_544',
'+patches' => ['__sharedir__/5.44-apperl.patch'],
},
perl_apperl_dev => {
desc => "For developing apperl",
base => 'perl_apperl_dev_542',
base => 'perl_apperl_dev_544',
},
}
);
Expand Down Expand Up @@ -1076,7 +1111,7 @@ sub Checkout {
_command_or_die('tar', '-xf', $tarball_name);
print "rm -rf $perl_build_dir\n";
remove_tree($perl_build_dir);
my ($version) = $tarball_name =~ /^v(\d+\.\d+\.\d+)\.tar/;
my ($version) = $tarball_name =~ /^v(\d+\.\d+\.\d+(?:\-RC\d+)?)\.tar/;
my $perl_build_dir_dir = dirname($perl_build_dir);
print "mkdir -p $perl_build_dir_dir\n";
make_path($perl_build_dir_dir);
Expand Down
69 changes: 69 additions & 0 deletions share/5.44-apperl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
diff --git a/patchlevel.h b/patchlevel.h
index 8073fc0867..041a9fcc19 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -157,6 +157,7 @@ static const char * const local_patches[] = {
NULL
, "RC2"
, "Perl-Dist-APPerl-v0.8.0/5.44-cosmo3.patch - https://github.com/G4Vi/Perl-Dist-APPerl/blob/v0.8.0/share/5.44-cosmo3.patch various changes to support building with the Cosmopolitan Libc"
+ , "Perl-Dist-APPerl-v0.8.0/5.44-apperl.patch - https://github.com/G4Vi/Perl-Dist-APPerl/blob/v0.8.0/share/5.44-apperl.patch argv[0] /zip/bin, APPERL_DEFAULT_SCRIPT, and APPERL_SCRIPTNAME script launching"
#ifdef PERL_GIT_UNCOMMITTED_CHANGES
,"uncommitted-changes"
#endif
diff --git a/perl.c b/perl.c
index 59dd10fe3a..4ab5360159 100644
--- a/perl.c
+++ b/perl.c
@@ -2231,6 +2231,52 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)

init_main_stash();

+ // check for APPERL_SCRIPTNAME or argv[0] or default script execution
+ do {
+ const char *envscriptname = getenv("APPERL_SCRIPTNAME");
+ const char *programname = envscriptname ? envscriptname : argv[0];
+ const char *slash = strrchr(programname, '/');
+ if(slash != NULL)
+ {
+ programname = slash + 1;
+ }
+ const char *dot = strrchr(programname, '.');
+ const unsigned namelen = dot ? dot - programname : strlen(programname);
+
+ // shortcut for normal execution
+ if((namelen == 4) && (memcmp("perl", programname, 4) == 0))
+ {
+ break;
+ }
+
+ // /zip/bin/ script execution
+ #define SCRIPTPATH "/zip/bin/"
+ static char name[256] = SCRIPTPATH;
+ if(sizeof(SCRIPTPATH)+namelen <= sizeof(name))
+ {
+ memcpy(name + sizeof(SCRIPTPATH) - 1, programname, namelen);
+ name[sizeof(SCRIPTPATH)-1+namelen] = '\0';
+ struct stat st;
+ if((stat(name, &st) == 0) && S_ISREG(st.st_mode))
+ {
+ scriptname = name;
+ break;
+ }
+ }
+ #undef SCRIPTPATH
+
+ // default script
+ #define DEFAULT_SCRIPT_SENTINEL "APPERL_DEFAULT_SCRIPT"
+ volatile static const char default_script[sizeof(DEFAULT_SCRIPT_SENTINEL)+256] = DEFAULT_SCRIPT_SENTINEL;
+ if(default_script[sizeof(DEFAULT_SCRIPT_SENTINEL)])
+ {
+ scriptname = &default_script[sizeof(DEFAULT_SCRIPT_SENTINEL)];
+ break;
+ }
+ #undef DEFAULT_SCRIPT_SENTINEL
+ } while(0);
+
+ if(scriptname == NULL)
{
const char *s;
for (argc--,argv++; argc > 0; argc--,argv++) {
Loading
Loading