Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[staging] perl: 5.38.2 -> 5.40.0 #333286

Merged
merged 24 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
384f9f8
perl: 5.38.2 -> 5.40.0
marcusramberg Jul 29, 2024
95434d5
top-level/release-perl.nix: init Hydra job set for perlPackages
stigtsp Jul 31, 2024
fb4a186
perlPackages.BKeywords: 1.26 -> 1.27
marcusramberg Aug 2, 2024
d6d704d
perlPackages.GetoptLongDescriptive: 0.111 -> 0.114
marcusramberg Aug 2, 2024
b5f4b26
perlPackages.po4a: 0.71 -> 0.73
marcusramberg Aug 2, 2024
35efbc9
perlPackages.AppMusicChordPro: 6.030 -> 6.050.7
marcusramberg Aug 2, 2024
2d5ed90
perlPackages.CodeTidyAll: 0.83 -> 0.84
marcusramberg Aug 2, 2024
204ef75
perlPackages.DevelSize: 0.83 -> 0.84
marcusramberg Aug 2, 2024
aec989a
perlPackages.MooseXGetopt: 0.75 -> 0.76
marcusramberg Aug 2, 2024
78ec617
perlPackages.FileLoadLines: 1.021 -> 1.046
marcusramberg Aug 2, 2024
66c5dc3
perlPackages.TextLayout: 0.031 -> 0.037
marcusramberg Aug 2, 2024
9e51c8e
perlPackages.ObjectPad: 0.804 -> 0.809
marcusramberg Aug 2, 2024
0671159
perlPackages.XSParseKeyword: 0.38 -> 0.44
marcusramberg Aug 2, 2024
2a1179c
perlPackages.EncodeIMAPUTF7: patch to fix build with 540
marcusramberg Aug 3, 2024
7f567ed
perlPackages.MouseXGetOpt: remove failing tests to fix build
marcusramberg Aug 4, 2024
8df266d
pkgsStatic.perl: fix build
tobim Sep 7, 2024
f6c80f8
perl536: remove
marcusramberg Aug 22, 2024
097e28b
unit: perl536 -> perl540
marcusramberg Aug 22, 2024
0724f3c
macvim: 178 -> 179, perl536 -> perl540
marcusramberg Aug 22, 2024
c01953d
perlPackages.ApacheDB: mark as broken
stigtsp Sep 7, 2024
f5413cd
perlPackages.CGICompile: disable unstable test
stigtsp Sep 7, 2024
816958c
perlPackages.AuthenModAuthPubTkt: disable unstable test
stigtsp Sep 7, 2024
762d2c1
unit: clean up withPerl arguments
stigtsp Sep 8, 2024
67ecdcb
unit: add nixos tests for perl
stigtsp Sep 8, 2024
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
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,7 @@ in {
unbound = handleTest ./unbound.nix {};
unifi = handleTest ./unifi.nix {};
unit-php = handleTest ./web-servers/unit-php.nix {};
unit-perl = handleTest ./web-servers/unit-perl.nix {};
upnp.iptables = handleTest ./upnp.nix { useNftables = false; };
upnp.nftables = handleTest ./upnp.nix { useNftables = true; };
uptermd = handleTest ./uptermd.nix {};
Expand Down
46 changes: 46 additions & 0 deletions nixos/tests/web-servers/unit-perl.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import ../make-test-python.nix (
{ pkgs, ... }:
let
testdir = pkgs.writeTextDir "www/app.psgi" ''
my $app = sub {
return [
"200",
[ "Content-Type" => "text/plain" ],
[ "Hello, Perl on Unit!" ],
];
};
'';

in
{
name = "unit-perl-test";
meta.maintainers = with pkgs.lib.maintainers; [ sgo ];

nodes.machine =
{
config,
lib,
pkgs,
...
}:
{
services.unit = {
enable = true;
config = pkgs.lib.strings.toJSON {
listeners."*:8080".application = "perl";
applications.perl = {
type = "perl";
script = "${testdir}/www/app.psgi";
};
};
};
};
testScript = ''
machine.wait_for_unit("unit.service")
machine.wait_for_open_port(8080)

response = machine.succeed("curl -f -vvv -s http://127.0.0.1:8080/")
assert "Hello, Perl on Unit!" in response, "Hello world"
'';
}
)
9 changes: 4 additions & 5 deletions pkgs/applications/editors/vim/macvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
, cscope
, ruby_3_2
, tcl
, perl536
, perl540
, luajit
, darwin
, libiconv
Expand All @@ -17,8 +17,7 @@

# Try to match MacVim's documented script interface compatibility
let
# Perl 5.30 - closest we get is 5.36. 5.38 is currently failing
perl = perl536;
perl = perl540;
# Ruby 3.2
ruby = ruby_3_2;

Expand All @@ -35,13 +34,13 @@ in
stdenv.mkDerivation (finalAttrs: {
pname = "macvim";

version = "178";
version = "179";

src = fetchFromGitHub {
owner = "macvim-dev";
repo = "macvim";
rev = "release-${finalAttrs.version}";
hash = "sha256-JYh5fyaYuME/Lk67vrf1hYOIcAkEbwtslcnI9KRzHa8=";
hash = "sha256-L9LVXyeA09aMtNf+b/Oo+eLpeVEKTD1/oNWCiFn5FbU=";
};

enableParallelBuilding = true;
Expand Down
224 changes: 224 additions & 0 deletions pkgs/development/interpreters/perl/cross540.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
From: =?UTF-8?q?Christian=20K=C3=B6gler?= <[email protected]>
Date: Mon, 10 Apr 2023 22:12:24 +0200
Subject: [PATCH] miniperl compatible modules

CPAN::Meta
ExtUtils::MakeMaker
JSON::PP
Data::Dumper

Updated for perl v5.40.0 by [email protected]

---

# safe if given an unblessed reference
diff --git a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm b/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm
index 746abd63bc..c55d7cd2d0 100644
--- a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm
+++ b/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm
@@ -1,6 +1,7 @@
use 5.008001; # sane UTF-8 support
use strict;
use warnings;
+no warnings 'experimental::builtin';
package CPAN::Meta::YAML; # git description: v1.68-2-gcc5324e
# XXX-INGY is 5.8.1 too old/broken for utf8?
# XXX-XDG Lancaster consensus was that it was sufficient until
@@ -650,27 +651,29 @@ sub _dump_string {
join '', map { "$_\n" } @lines;
}

-sub _has_internal_string_value {
+# taken from cpan/JSON-PP/lib/JSON/PP.pm
+sub _looks_like_number {
my $value = shift;
- my $b_obj = B::svref_2object(\$value); # for round trip problem
- return $b_obj->FLAGS & B::SVf_POK();
+ no warnings 'numeric';
+ # if the utf8 flag is on, it almost certainly started as a string
+ return if utf8::is_utf8($value);
+ # detect numbers
+ # string & "" -> ""
+ # number & "" -> 0 (with warning)
+ # nan and inf can detect as numbers, so check with * 0
+ return unless length((my $dummy = "") & $value);
+ return unless 0 + $value eq $value;
+ return 1 if $value * 0 == 0;
+ return -1; # inf/nan
}

sub _dump_scalar {
my $string = $_[1];
my $is_key = $_[2];
- # Check this before checking length or it winds up looking like a string!
- my $has_string_flag = _has_internal_string_value($string);
return '~' unless defined $string;
return "''" unless length $string;
- if (Scalar::Util::looks_like_number($string)) {
- # keys and values that have been used as strings get quoted
- if ( $is_key || $has_string_flag ) {
- return qq['$string'];
- }
- else {
- return $string;
- }
+ if (_looks_like_number($string)) {
+ return qq['$string'];
}
if ( $string =~ /[\x00-\x09\x0b-\x0d\x0e-\x1f\x7f-\x9f\'\n]/ ) {
$string =~ s/\\/\\\\/g;
@@ -800,9 +803,6 @@ sub errstr {
# Helper functions. Possibly not needed.


-# Use to detect nv or iv
-use B;
-
# XXX-INGY Is flock CPAN::Meta::YAML's responsibility?
# Some platforms can't flock :-(
# XXX-XDG I think it is. When reading and writing files, we ought
@@ -822,35 +822,8 @@ sub _can_flock {
}
}

-
-# XXX-INGY Is this core in 5.8.1? Can we remove this?
-# XXX-XDG Scalar::Util 1.18 didn't land until 5.8.8, so we need this
-#####################################################################
-# Use Scalar::Util if possible, otherwise emulate it
-
-use Scalar::Util ();
BEGIN {
- local $@;
- if ( eval { Scalar::Util->VERSION(1.18); } ) {
- *refaddr = *Scalar::Util::refaddr;
- }
- else {
- eval <<'END_PERL';
-# Scalar::Util failed to load or too old
-sub refaddr {
- my $pkg = ref($_[0]) or return undef;
- if ( !! UNIVERSAL::can($_[0], 'can') ) {
- bless $_[0], 'Scalar::Util::Fake';
- } else {
- $pkg = undef;
- }
- "$_[0]" =~ /0x(\w+)/;
- my $i = do { no warnings 'portable'; hex $1 };
- bless $_[0], $pkg if defined $pkg;
- $i;
-}
-END_PERL
- }
+ *refaddr = *builtin::refaddr;
}

delete $CPAN::Meta::YAML::{refaddr};
diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
index 3604eae402..991f69d275 100644
--- a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
+++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
@@ -1,12 +1,13 @@
use strict;
use warnings;
+no warnings 'experimental::builtin';

package CPAN::Meta::Merge;

our $VERSION = '2.150010';

use Carp qw/croak/;
-use Scalar::Util qw/blessed/;
+use builtin qw/blessed/;
use CPAN::Meta::Converter 2.141170;

sub _is_identical {
diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
index d4e93fd8a5..809da68d02 100644
--- a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
+++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
@@ -1,6 +1,7 @@
use 5.006;
use strict;
use warnings;
+no warnings 'experimental::builtin';
package CPAN::Meta::Prereqs;

our $VERSION = '2.150010';
@@ -14,7 +15,6 @@ our $VERSION = '2.150010';
#pod =cut

use Carp qw(confess);
-use Scalar::Util qw(blessed);
use CPAN::Meta::Requirements 2.121;

#pod =method new
@@ -168,7 +168,12 @@ sub types_in {
sub with_merged_prereqs {
my ($self, $other) = @_;

- my @other = blessed($other) ? $other : @$other;
+ eval 'require Scalar::Util';
+ my @other = unless($@){
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcusramberg Hm, just came across this part - which seems broken? It's also in the original cross.patch tho..

+ Scalar::Util::blessed($other) ? $other : @$other;
+ }else{
+ builtin::blessed($other) ? $other : @$other;
+ }

my @prereq_objs = ($self, @other);

diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm
index fc8fcbc8f0..cda7b90c65 100644
--- a/cpan/JSON-PP/lib/JSON/PP.pm
+++ b/cpan/JSON-PP/lib/JSON/PP.pm
@@ -4,6 +4,7 @@ package JSON::PP;

use 5.008;
use strict;
+no warnings 'experimental::builtin';

use Exporter ();
BEGIN { our @ISA = ('Exporter') }
diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
index bb6d3caedb..0c2fde4743 100644
--- a/dist/Data-Dumper/Dumper.pm
+++ b/dist/Data-Dumper/Dumper.pm
@@ -11,6 +11,7 @@ package Data::Dumper;

use strict;
use warnings;
+no warnings 'experimental::builtin';

#$| = 1;

@@ -125,8 +126,7 @@ sub new {
# Packed numeric addresses take less memory. Plus pack is faster than sprintf

sub format_refaddr {
- require Scalar::Util;
- pack "J", Scalar::Util::refaddr(shift);
+ pack "J", builtin::refaddr(shift);
};

#
@@ -282,9 +282,8 @@ sub _dump {
warn "WARNING(Freezer method call failed): $@" if $@;
}

- require Scalar::Util;
- my $realpack = Scalar::Util::blessed($val);
- my $realtype = $realpack ? Scalar::Util::reftype($val) : ref $val;
+ my $realpack = builtin::blessed($val);
+ my $realtype = $realpack ? builtin::reftype($val) : ref $val;
$id = format_refaddr($val);

# Note: By this point $name is always defined and of non-zero length.
@@ -576,7 +575,7 @@ sub _dump {
# here generates a different result. So there are actually "three" different
# implementations of Data::Dumper (kind of sort of) but we only test two.
elsif (!defined &_vstring
- and ref $ref eq 'VSTRING' || eval{Scalar::Util::isvstring($val)}) {
+ and ref $ref eq 'VSTRING') {
$out .= sprintf "v%vd", $val;
}
# \d here would treat "1\x{660}" as a safe decimal number
8 changes: 8 additions & 0 deletions pkgs/development/interpreters/perl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,12 @@ in rec {
sha256 = "sha256-oKMVNEUet7g8fWWUpJdUOlTUiLyQygD140diV39AZV4=";
inherit passthruFun;
};

# Maint version
perl540 = callPackage ./interpreter.nix {
self = perl540;
version = "5.40.0";
sha256 = "sha256-x0A0jzVzljJ6l5XT6DI7r9D+ilx4NfwcuroMyN/nFh8=";
inherit passthruFun;
};
}
Loading