Skip to content

Commit b132548

Browse files
committed
Update to cosmocc 3.3.10. Revert building with cosmo's zlib, it
causes make test failures. Fix APPERL_DEFAULT_SCRIPT search by including nul in string. make test result: Failed 5 tests out of 2390, 99.79% okay. ../ext/POSIX/t/sigset.t porting/customized.t porting/globvar.t porting/pod_rules.t porting/podcheck.t
1 parent 8a3f561 commit b132548

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Changes

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Revision history for Perl-Dist-APPerl
2-
v0.6.0 2024-05-XX
3-
Add building with modern Cosmopolitan Libc with cosmocc
2+
v0.6.0 2024-05-27
3+
Add building with modern Cosmopolitan Libc with cosmocc 3.3.10
44
cosmocc automatically installs itself making running
55
`apperlm install-build-deps` unnecessary
66
Add download and building from Perl tarballs.
@@ -15,9 +15,10 @@ v0.6.0 2024-05-XX
1515
Without cosmocc being avaiable on the port, they have to be
1616
maintained essentially seperately.
1717
Remove most of the versioned configs, they were far behind the
18-
rolling release / unnamed builds and often changed with them.
18+
rolling release / unnamed builds and often changed with them.
1919
Make $^X more reliable by using Cosmos's GetProgramExecutableName
2020
Set $Config{perlpath} to $^X (GH#6)
21+
Fix APPERL_DEFAULT_SCRIPT search by including nul in string.
2122

2223
v0.5.0 2024-03-21
2324
Revert `full` and `small` targets with cosmo 3.0.2

lib/Perl/Dist/APPerl.pm

+5-8
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ sub NewConfig {
812812

813813
sub _install_cosmocc {
814814
my ($SiteConfig, $version) = @_;
815-
$version //= '3.3.6';
815+
$version //= '3.3.10';
816816
my $cosmocc = SITE_REPO_DIR."/cosmocc";
817817
print "rm -rf $cosmocc\n";
818818
remove_tree($cosmocc);
@@ -1093,10 +1093,6 @@ sub Build {
10931093
_install_perl_src_files($itemconfig, $perl_build_dir);
10941094
print "cd $perl_build_dir\n";
10951095
chdir($perl_build_dir) or die "Failed to enter perl repo";
1096-
# build using cosmo's zlib to avoid name clashes or including two versions of zlib
1097-
local $ENV{'BUILD_ZLIB'} = 'False' if $itemconfig->{cosmo3};
1098-
local $ENV{'ZLIB_INCLUDE'} = $SiteConfig->{cosmocc} . '/include/third_party/zlib' if $itemconfig->{cosmo3};
1099-
local $ENV{'ZLIB_LIB'} = '' if $itemconfig->{cosmo3};
11001096
_command_or_die('make');
11011097
$PERL_APE = "$perl_build_dir/perl.com";
11021098
@perl_config_cmd = ('./perl', '-Ilib');
@@ -1288,11 +1284,12 @@ sub Build {
12881284
my $fsize = (stat($fh))[7];
12891285
my $bread = read($fh, my $outdata, $fsize);
12901286
$bread && $bread == $fsize or die "failed to read full file $APPPATH";
1291-
my $sentinel = "APPERL_DEFAULT_SCRIPT";
1287+
my $sentinel = "APPERL_DEFAULT_SCRIPT\x00";
12921288
my $sentinelpos = index($outdata, $sentinel);
12931289
$sentinelpos != -1 or die "Failed to find APPERL_DEFAULT_SCRIPT, is this an old APPerl binary?";
1294-
print "patching default script at " . ($sentinelpos+length($sentinel)+1) . "\n";
1295-
seek($fh, $sentinelpos+length($sentinel)+1, SEEK_SET) or die "$!";
1290+
my $patchpos = $sentinelpos+length($sentinel);
1291+
print "patching default script at $patchpos\n";
1292+
seek($fh, $patchpos, SEEK_SET) or die "$!";
12961293
print $fh $itemconfig->{default_script}."\0" or die "$!";
12971294
close($fh);
12981295
}

0 commit comments

Comments
 (0)