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

Perl 5.41.8 appears to cause compile failures in Sereal::Encoder #22941

Closed
trwyant opened this issue Jan 23, 2025 · 2 comments
Closed

Perl 5.41.8 appears to cause compile failures in Sereal::Encoder #22941

trwyant opened this issue Jan 23, 2025 · 2 comments
Labels
BBC Blead Breaks CPAN - changes in blead broke a cpan module(s)

Comments

@trwyant
Copy link

trwyant commented Jan 23, 2025

Module:

Description

An attempt to build Sereal::Encoder under a non-threaded Perl 5.41.8 under macOS fails with the errors:

cc -c  -I. -fno-common -DPERL_DARWIN -mmacosx-version-min=13.7 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -DHAS_BROKEN_LANGINFO_CODESET -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/opt/local/include -Wno-error=implicit-function-declaration -O3 -Wno-compound-token-split-by-macro   -DVERSION=\"5.004\" -DXS_VERSION=\"5.004\"  "-I/trw/local/perl/5.41.8/lib/5.41.8/darwin-2level/CORE"  -DNDEBUG -DMINIZ_NO_STDIO -DMINIZ_USE_UNALIGNED_LOAD_AND_STORE=1 -DMINIZ_UNALIGNED_USE_MEMCOPY -DHAVE_ZSTD -DHAVE_BUILTIN_CTZ srl_encoder.c
srl_encoder.c:1571:69: error: too few arguments provided to function-like macro invocation
        char* utf8= (char *)Perl_bytes_to_utf8(aTHX_ (U8 *)str, &len);
                                                                    ^
/trw/local/perl/5.41.8/lib/5.41.8/darwin-2level/CORE/utf8.h:1333:9: note: macro 'Perl_bytes_to_utf8' defined here
#define Perl_bytes_to_utf8(mTHX, s, lenp)  Perl_bytes_to_utf8_free_me(aTHX_ s, lenp, NULL)
        ^
srl_encoder.c:1571:29: error: use of undeclared identifier 'Perl_bytes_to_utf8'
        char* utf8= (char *)Perl_bytes_to_utf8(aTHX_ (U8 *)str, &len);
                            ^
2 errors generated.
make: *** [srl_encoder.o] Error 1

Some trawling through perlapi and perlguts suggested to me that I could replace Perl_bytes_to_utf8( aTHX_ ... ) with bytes_to_utf8( ... ). I did so, and the module compiled and passed its tests. I note that 5.41.8 changed Perl_bytes_to_utf8( ... ) from a subroutine in utf8.c to a macro in utf8.h. But perlapi says that bytes_to_utf8() is experimental.

My XS-fu is not strong enough to say positively that this is a bug in Perl rather than a bug in the subject module. If the latter, I will file a ticket against the Sereal repository, but I would appreciate direction on what the correct implementation is.

Steps to Reproduce

perl Makefile.PL
make

Expected behavior

The module should compile without error.

Perl configuration

Summary of my perl5 (revision 5 version 41 subversion 8) configuration:
   
  Platform:
    osname=darwin
    osvers=22.6.0
    archname=darwin-2level
    uname='darwin samwise.local 22.6.0 darwin kernel version 22.6.0: fri nov 15 17:21:49 pst 2024; root:xnu-8796.141.3.709.7~2release_x86_64 x86_64 '
    config_args='-Dprefix=/trw/local/perl/5.41.8 -Dcf_email=wyant@cpan.org -Uinstallusrbinperl -e -d -Dusedevel -Uversiononly'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='cc'
    ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.7 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -DHAS_BROKEN_LANGINFO_CODESET -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/opt/local/include'
    optimize='-O3'
    cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.7 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -DHAS_BROKEN_LANGINFO_CODESET -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/opt/local/include'
    ccversion=''
    gccversion='Apple LLVM 15.0.0 (clang-1500.1.0.2.5)'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -mmacosx-version-min=13.7 -fstack-protector-strong -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /opt/local/lib /usr/lib
    libs=-lgdbm
    perllibs=
    libc=
    so=dylib
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=bundle
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' -mmacosx-version-min=13.7 -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_LONG_DOUBLE
    HAS_STRTOLD
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_HASH_FUNC_SIPHASH13
    PERL_HASH_USE_SBOX32
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_DEVEL
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Built under darwin
  Compiled at Jan 22 2025 08:53:09
  @INC:
    /trw/local/perl/5.41.8/lib/site_perl/5.41.8/darwin-2level
    /trw/local/perl/5.41.8/lib/site_perl/5.41.8
    /trw/local/perl/5.41.8/lib/5.41.8/darwin-2level
    /trw/local/perl/5.41.8/lib/5.41.8

# perl -V output goes here

$ uname -a
Darwin <censored>.local 22.6.0 Darwin Kernel Version 22.6.0: Fri Nov 15 17:21:49 PST 2024; root:xnu-8796.141.3.709.7~2/RELEASE_X86_64 x86_64

@tonycoz
Copy link
Contributor

tonycoz commented Jan 23, 2025

This was fixed immediately after 5.41.8 in 9de1a49

@jkeenan
Copy link
Contributor

jkeenan commented Jan 23, 2025

This was fixed immediately after 5.41.8 in 9de1a49

Indeed! Handled in #22902. Closing this ticket.

@jkeenan jkeenan closed this as completed Jan 23, 2025
@jkeenan jkeenan added BBC Blead Breaks CPAN - changes in blead broke a cpan module(s) and removed Needs Triage labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BBC Blead Breaks CPAN - changes in blead broke a cpan module(s)
Projects
None yet
Development

No branches or pull requests

3 participants