public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jerry James <loganjerry@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/polymake] f45: Add patch for perl 5.44.0 support
Date: Sun, 06 Sep 2026 03:15:43 GMT	[thread overview]
Message-ID: <178866454325.1.7752935622437783133.rpms-polymake-007db3c553a4@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/polymake
Branch : f45
Commit : 007db3c553a45d1ca2bbd3693b7fefe7e7aa1dde
Author : Jerry James <loganjerry@gmail.com>
Date   : 2026-09-05T17:31:33-06:00
Stats  : +345/-4 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/polymake/c/007db3c553a45d1ca2bbd3693b7fefe7e7aa1dde?branch=f45

Log:
Add patch for perl 5.44.0 support

---
diff --git a/polymake-perl-5.44.patch b/polymake-perl-5.44.patch
new file mode 100644
index 0000000..bd6b712
--- /dev/null
+++ b/polymake-perl-5.44.patch
@@ -0,0 +1,339 @@
+Updates for perl 5.44.0
+
+- The Wire.pm change fixes a typo and is unrelated to perl 5.44.0.
+- The keywords.cc change is a sync with the perl 5.44.0 sources so that the new
+  "all" and "any" keywords are recognized.
+- The configure.pl change simply permits building with perl 5.44.0.
+- The RefHash.xxs change is the most intrusive.  Polymake uses a trick to
+  identify SVs that are keywords: it sets the SVf_IVisUV flag.  This trick
+  stopped working with perl 5.44.0, where PVs with that flag set are interpreted
+  as the empty string.  I could find no other available flag bit to use that
+  didn't cause other problems.  I tried using one of the unused bits in the SV
+  type field, but parts of perl's internals don't mask that bit off and become
+  very confused.  The only solution I could come up with is maintaining a set
+  (actually an HV) of SVs that are keywords.  We bump up the refcount of an SV
+  before adding it to the set, to avoid mistakenly identifying recycled SVs as
+  keywords.  Since we have no way of knowing when an SVs refcount is
+  decremented, we periodically check the set for SVs with refcount == 1.  That
+  means that the set holds the only reference to that SV, so we remove it from
+  the set and decrement its refcount to 0.
+
+
+--- apps/common/perllib/Visual/Wire.pm.orig	2025-09-30 07:03:08.000000000 -0600
++++ apps/common/perllib/Visual/Wire.pm	2026-08-31 11:51:46.555357710 -0600
+@@ -81,7 +81,7 @@ use overload
+    '${}' => sub { \($_[0]->index) },
+    '@{}' => sub { my $self=shift; $self->edges->[$self->index] },
+    '=' => sub { bless [ @{(shift)} ] },
+-   falback => 0;
++   fallback => 0;
+ 
+ 
+ package Visual::Wire;
+--- lib/core/src/perl/keywords.cc.orig	2025-09-30 07:03:08.000000000 -0600
++++ lib/core/src/perl/keywords.cc	2026-08-31 11:56:11.113695400 -0600
+@@ -213,7 +213,7 @@ Perl_keyword (pTHX_ const char *name, I3
+           goto unknown;
+       }
+ 
+-    case 3: /* 30 tokens of length 3 */
++    case 3: /* 32 tokens of length 3 */
+       switch (name[0])
+       {
+         case 'E':
+@@ -236,14 +236,31 @@ Perl_keyword (pTHX_ const char *name, I3
+ 
+               goto unknown;
+ 
+-            case 'n':
+-              if (name[2] == 'd')
+-              {                                   /* and              */
+-                return -KEY_and;
++            case 'l':
++              if (name[2] == 'l')
++              {                                   /* all              */
++                return (all_keywords || FEATURE_KEYWORD_ALL_IS_ENABLED ? -KEY_all : 0);
+               }
+ 
+               goto unknown;
+ 
++            case 'n':
++              switch (name[2])
++              {
++                case 'd':
++                  {                               /* and              */
++                    return -KEY_and;
++                  }
++
++                case 'y':
++                  {                               /* any              */
++                    return (all_keywords || FEATURE_KEYWORD_ANY_IS_ENABLED ? -KEY_any : 0);
++                  }
++
++                default:
++                  goto unknown;
++              }
++
+             default:
+               goto unknown;
+           }
+@@ -526,7 +543,7 @@ Perl_keyword (pTHX_ const char *name, I3
+           goto unknown;
+       }
+ 
+-    case 4: /* 39 tokens of length 4 */
++    case 4: /* 40 tokens of length 4 */
+       switch (name[0])
+       {
+         case 'I':
+@@ -970,7 +987,7 @@ Perl_keyword (pTHX_ const char *name, I3
+                 default:
+                   goto unknown;
+               }
+-#if defined(FEATURE_SWITCH_IS_ENABLED)
++
+             case 'h':
+               if (name[2] == 'e' &&
+                   name[3] == 'n')
+@@ -979,7 +996,7 @@ Perl_keyword (pTHX_ const char *name, I3
+               }
+ 
+               goto unknown;
+-#endif
++
+             default:
+               goto unknown;
+           }
+@@ -988,7 +1005,7 @@ Perl_keyword (pTHX_ const char *name, I3
+           goto unknown;
+       }
+ 
+-    case 5: /* 41 tokens of length 5 */
++    case 5: /* 43 tokens of length 5 */
+       switch (name[0])
+       {
+         case 'B':
+@@ -1052,7 +1069,7 @@ Perl_keyword (pTHX_ const char *name, I3
+               }
+ 
+               goto unknown;
+-#if defined(FEATURE_SWITCH_IS_ENABLED)
++
+             case 'r':
+               if (name[2] == 'e' &&
+                   name[3] == 'a' &&
+@@ -1062,7 +1079,7 @@ Perl_keyword (pTHX_ const char *name, I3
+               }
+ 
+               goto unknown;
+-#endif
++
+             default:
+               goto unknown;
+           }
+@@ -1225,7 +1242,7 @@ Perl_keyword (pTHX_ const char *name, I3
+             default:
+               goto unknown;
+           }
+-#if defined(FEATURE_SWITCH_IS_ENABLED)
++
+         case 'g':
+           if (name[1] == 'i' &&
+               name[2] == 'v' &&
+@@ -1236,7 +1253,7 @@ Perl_keyword (pTHX_ const char *name, I3
+           }
+ 
+           goto unknown;
+-#endif
++
+         case 'i':
+           switch (name[1])
+           {
+@@ -1606,7 +1623,7 @@ Perl_keyword (pTHX_ const char *name, I3
+                   name[4] == 'i' &&
+                   name[5] == 'f')
+               {                                   /* elseif           */
+-                Perl_ck_warner_d(aTHX_ packWARN(WARN_SYNTAX), "elseif should be elsif");
++                ck_warner_d(packWARN(WARN_SYNTAX), "elseif should be elsif");
+               }
+ 
+               goto unknown;
+@@ -2016,7 +2033,7 @@ Perl_keyword (pTHX_ const char *name, I3
+           goto unknown;
+       }
+ 
+-    case 7: /* 30 tokens of length 7 */
++    case 7: /* 31 tokens of length 7 */
+       switch (name[0])
+       {
+         case 'D':
+@@ -2112,7 +2129,6 @@ Perl_keyword (pTHX_ const char *name, I3
+               {
+                 switch (name[3])
+                 {
+-#if defined(FEATURE_SWITCH_IS_ENABLED)
+                   case 'a':
+                     if (name[4] == 'u' &&
+                         name[5] == 'l' &&
+@@ -2122,7 +2138,7 @@ Perl_keyword (pTHX_ const char *name, I3
+                     }
+ 
+                     goto unknown;
+-#endif
++
+                   case 'i':
+                     if (name[4] == 'n' &&
+                         name[5] == 'e' &&
+@@ -2907,7 +2923,7 @@ Perl_keyword (pTHX_ const char *name, I3
+           }
+ 
+           goto unknown;
+-#if defined(KEY___CLASS__)
++
+         case '_':
+           if (name[1] == '_' &&
+               name[2] == 'C' &&
+@@ -2922,7 +2938,7 @@ Perl_keyword (pTHX_ const char *name, I3
+           }
+ 
+           goto unknown;
+-#endif
++
+         case 'e':
+           switch (name[1])
+           {
+@@ -3584,8 +3600,8 @@ unknown:
+ }
+ 
+ /* Generated from:
+- * eb67e851da14ede1aad67aec4a387fa250c1345407fad0a02988d2d8d3cc27f2 regen/keywords.pl
+- * ex: set ro: */
++ * bdfd5529dba8257e060f7e4ed712f683cd6a533285abf8ce7ee78c4d0677ff38regen/keywords.pl
++ * ex: set ro ft=c: */
+ 
+ } } }
+ 
+--- lib/core/src/perl/RefHash.xxs.orig	2025-09-30 07:03:08.000000000 -0600
++++ lib/core/src/perl/RefHash.xxs	2026-09-05 16:06:20.049484146 -0600
+@@ -26,6 +26,9 @@ Perl_ppaddr_t def_pp_CONST, def_pp_ENTER
+ 
+ namespace {
+ 
++#if PerlVersion >= 5440
++HV* keyword_set;
++#endif
+ HV* my_pkg;
+ AV* allowed_pkgs;
+ 
+@@ -792,7 +795,14 @@ OP* intercept_pp_const(pTHX)
+ {
+    SV* sv = cSVOP_sv;
+    if ((PL_op->op_private & OPpCONST_BARE)  &&  SvTYPE(sv) == SVt_PV)
++#if PerlVersion < 5440
+       SvIsUV_on(sv);
++#else
++   {
++      SvREFCNT_inc_simple_void_NN(sv);
++      hv_store_ent(keyword_set, sv, &PL_sv_yes, 0);
++   }
++#endif
+    PL_op->op_ppaddr = def_pp_CONST;
+    return def_pp_CONST(aTHX);
+ }
+@@ -858,9 +868,31 @@ HE* refhash_fetch_ent(pTHX_ HV* hv, SV*
+ 
+ constexpr U32 keyword_constant_flags = SVf_POK | SVf_IVisUV;
+ 
+-bool is_keyword_constant(SV* sv)
++bool is_keyword_constant(pTHX_ SV* sv)
+ {
++#if PerlVersion < 5440
+    return (SvFLAGS(sv) & keyword_constant_flags) == keyword_constant_flags;
++#else
++   static size_t check_count = 0U;
++   // Check for garbage every now and then
++   if (++check_count >= 4096)
++   {
++      HE *entry;
++
++      check_count = 0U;
++      hv_iterinit(keyword_set);
++      while ((entry = hv_iternext(keyword_set)) != NULL)
++      {
++         SV *key = (SV *)hv_iterkeysv(entry);
++         if (SvREFCNT(sv) == 1)
++         {
++            hv_delete_ent(keyword_set, key, 0, 0);
++            SvREFCNT_dec_NN(key);
++         }
++      }
++   }
++   return SvPOK(sv) && hv_exists_ent(keyword_set, sv, 0);
++#endif
+ }
+ 
+ } } }
+@@ -874,20 +906,35 @@ PROTOTYPES: DISABLE
+ void is_keyword(SV* sv)
+ PPCODE:
+ {
++#if PerlVersion < 5440
+    if (is_keyword_constant(sv))
+       PUSHs(&PL_sv_yes);
+    else
+       PUSHs(&PL_sv_no);
++#else
++   if (is_keyword_constant(aTHX_ sv))
++      PUSHs(&PL_sv_yes);
++   else
++      PUSHs(&PL_sv_no);
++#endif
+ }
+ 
+ void is_keyword_or_hash(SV* sv)
+ PPCODE:
+ {
++#if PerlVersion < 5440
+    if (SvROK(sv) ? (sv = SvRV(sv), SvTYPE(sv) == SVt_PVHV && !SvSTASH(sv))
+                  : is_keyword_constant(sv))
+       PUSHs(&PL_sv_yes);
+    else
+       PUSHs(&PL_sv_no);
++#else
++   if (SvROK(sv) ? (sv = SvRV(sv), SvTYPE(sv) == SVt_PVHV && !SvSTASH(sv))
++                 : is_keyword_constant(aTHX_ sv))
++      PUSHs(&PL_sv_yes);
++   else
++      PUSHs(&PL_sv_no);
++#endif
+ }
+ 
+ MODULE = Polymake::RefHash              PACKAGE = Polymake::RefHash
+@@ -902,6 +949,9 @@ BOOT:
+ {
+    my_pkg=gv_stashpv("Polymake::RefHash", FALSE);
+    allowed_pkgs=newAV();
++#if PerlVersion >= 5440
++   keyword_set=newHV();
++#endif
+    def_pp_CONST=PL_ppaddr[OP_CONST];
+    def_pp_ENTERSUB=PL_ppaddr[OP_ENTERSUB];
+    def_pp_HELEM=PL_ppaddr[OP_HELEM];
+--- support/configure.pl.orig	2026-08-31 11:45:20.380880879 -0600
++++ support/configure.pl	2026-08-31 11:57:25.617054968 -0600
+@@ -27,13 +27,13 @@ you can specify its location on the comm
+ ./configure PERL=/path/to/my/new/perl [other options ...]
+ .
+       exit(1);
+-   } elsif ($] >= 5.044) {
++   } elsif ($] >= 5.046) {
+       print STDERR <<".";
+ *************
+ *** ERROR ***
+ *************
+ 
+-polymake has not been checked for compatibility with perl 5.44 or newer;
++polymake has not been checked for compatibility with perl 5.46 or newer;
+ your perl interpreter says it is $].
+ 
+ If you already have another (older) perl interpreter somewhere else, you can

diff --git a/polymake.spec b/polymake.spec
index d872ef8..284cdcc 100644
--- a/polymake.spec
+++ b/polymake.spec
@@ -52,6 +52,8 @@ Patch:          %{name}-Singular-4.3.2.patch
 Patch:          %{name}-sympol.patch
 # Use libson/libmongc version 2
 Patch:          %{name}-mongoc2.patch
+# Adapt to perl 5.44
+Patch:          %{name}-perl-5.44.patch
 
 # Polymake 4.7 and later cannot be built on 32 bit platforms due to the
 # limited integer ranges on those platforms.
@@ -260,16 +262,16 @@ sed -e 's|-Wl,-z,now|-Wl,-z,lazy|g' \
     -e 's/-lpthread -shared/-shared/g' \
     -i build.%{_arch}/config.ninja
 
-pushd build.%{_arch}/Opt
+cd build.%{_arch}/Opt
 %ninja_build
-popd
+cd -
 
 
 %install
 export Arch=%{_arch}
-pushd build.%{_arch}/Opt
+cd build.%{_arch}/Opt
 %ninja_install
-popd
+cd -
 
 # The doc building step looks in the wrong place for some files
 mkdir ../xml

                 reply	other threads:[~2026-09-06  3:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178866454325.1.7752935622437783133.rpms-polymake-007db3c553a4@fedoraproject.org \
    --to=loganjerry@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox