Skip to content

Conversation

@wikkyk
Copy link
Contributor

@wikkyk wikkyk commented Mar 27, 2025

Dependency of dev-python/pypy-exe.

5a18d12 treecleaned dev-python/pypy however ::gentoo didn't just drop the package, it moved it to dev-lang/.

The patch is almost unchanged from the last patch, I only changed one line to fix missing COMP_METHOD.

@wikkyk wikkyk marked this pull request as draft March 27, 2025 09:45
Dependency of dev-python/pypy-exe

Signed-off-by: Vic Kerr <[email protected]>
@wikkyk wikkyk changed the title dev-lang/pypy: add 2.7.7.3.18 dev-lang/pypy: add 2.7.7.3.19 Mar 27, 2025
@wikkyk wikkyk marked this pull request as ready for review March 27, 2025 09:49
@orbea
Copy link
Contributor

orbea commented Mar 27, 2025

Doesn't it work without patches? If not can you explain how to reproduce failures?

@wikkyk
Copy link
Contributor Author

wikkyk commented Mar 27, 2025

# emerge -1 dev-lang/pypy:2.7::gentoo
...
 * Generating caches and CFFI modules ...
generating ./_pypy_openssl.c
the current directory is '/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy'
running build_ext
building '_pypy_openssl' extension
clang -pipe -march=native -O3 -glldb -fPIC -I/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/include -c _pypy_openssl.c -o ./_pypy_openssl.o
_pypy_openssl.c:845:8: error: redefinition of 'OPENSSL_cleanup' as different kind of symbol
  845 | void (*OPENSSL_cleanup)(void) = NULL;
      |        ^
/usr/include/openssl/crypto.h:421:6: note: previous definition is here
  421 | void OPENSSL_cleanup(void);
      |      ^
_pypy_openssl.c:910:14: error: typedef redefinition with different types ('void' vs 'struct sct_st')
  910 | typedef void SCT;
      |              ^
/usr/include/openssl/ossl_typ.h:190:23: note: previous definition is here
  190 | typedef struct sct_st SCT;
      |                       ^
_pypy_openssl.c:1051:11: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1051 |     if (dh->q) {
      |         ~~^
...

@orbea
Copy link
Contributor

orbea commented Mar 27, 2025

Can you attach the full build.log? It built just fine for me on my end...

@wikkyk
Copy link
Contributor Author

wikkyk commented Mar 31, 2025

Doesn't seem to have any more useful information but here it goes:

 * Repository: gentoo
 * Maintainer: [email protected]
 * USE:        abi_x86_64 amd64 bzip2 elibc_musl full-stdlib jit kernel_linux sqlite
 * FEATURES:   compressdebug network-sandbox preserve-libs sandbox splitdebug userpriv usersandbox
>>> Unpacking source...
>>> Unpacking pypy2.7-v7.3.19-src.tar.bz2 to /mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work
>>> Unpacking pypy2.7-gentoo-patches-7.3.19.tar.xz to /mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work
>>> Source unpacked in /mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work
>>> Preparing source in /mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src ...
 * Applying patches from /mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-gentoo-patches-7.3.19 ...
 *   0001-Apply-1.9-distutils.unixccompiler.UnixCCompiler.runt.patch ...
[ ok ]
 *   0002-Fancy-patch-for-distutils-C-support-rebased-for-pypy.patch ...
[ ok ]
 *   0003-Skip-test-failures-specific-to-our-build-environment.patch ...
[ ok ]
 *   0004-use_pyxml.patch ...
[ ok ]
>>> Source prepared.
>>> Configuring source in /mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src ...
>>> Source configured.
>>> Compiling source in /mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src ...
 * Generating caches and CFFI modules ...
generating ./_pypy_openssl.c
the current directory is '/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy'
running build_ext
building '_pypy_openssl' extension
clang -pipe -march=native -O3 -glldb -fPIC -I/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/include -c _pypy_openssl.c -o ./_pypy_openssl.o
_pypy_openssl.c:845:8: error: redefinition of 'OPENSSL_cleanup' as different kind of symbol
  845 | void (*OPENSSL_cleanup)(void) = NULL;
      |        ^
/usr/include/openssl/crypto.h:421:6: note: previous definition is here
  421 | void OPENSSL_cleanup(void);
      |      ^
_pypy_openssl.c:910:14: error: typedef redefinition with different types ('void' vs 'struct sct_st')
  910 | typedef void SCT;
      |              ^
/usr/include/openssl/ossl_typ.h:190:23: note: previous definition is here
  190 | typedef struct sct_st SCT;
      |                       ^
_pypy_openssl.c:1051:11: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1051 |     if (dh->q) {
      |         ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1052:22: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1052 |         if (BN_cmp(dh->g, BN_value_one()) <= 0)
      |                    ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1054:27: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1054 |         else if (BN_cmp(dh->g, dh->p) >= 0)
      |                         ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1054:34: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1054 |         else if (BN_cmp(dh->g, dh->p) >= 0)
      |                                ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1058:35: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1058 |             if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
      |                                 ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1058:42: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1058 |             if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
      |                                        ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1058:49: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1058 |             if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
      |                                               ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1063:30: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1063 |         r = BN_is_prime_ex(dh->q, BN_prime_checks, ctx, NULL);
      |                            ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1069:31: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1069 |         if (!BN_div(t1, t2, dh->p, dh->q, ctx))
      |                             ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1069:38: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1069 |         if (!BN_div(t1, t2, dh->p, dh->q, ctx))
      |                                    ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1073:15: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1073 |         if (dh->j && BN_cmp(dh->j, t1))
      |             ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1073:31: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1073 |         if (dh->j && BN_cmp(dh->j, t1))
      |                             ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1076:29: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1076 |     } else if (BN_is_word(dh->g, DH_GENERATOR_2)) {
      |                           ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1077:27: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1077 |         l = BN_mod_word(dh->p, 24);
      |                         ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1082:29: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1082 |     } else if (BN_is_word(dh->g, DH_GENERATOR_5)) {
      |                           ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1083:27: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1083 |         l = BN_mod_word(dh->p, 10);
      |                         ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
_pypy_openssl.c:1091:26: error: incomplete definition of type 'const DH' (aka 'const struct dh_st')
 1091 |     r = BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL);
      |                        ~~^
/usr/include/openssl/ossl_typ.h:127:16: note: forward declaration of 'struct dh_st'
  127 | typedef struct dh_st DH;
      |                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Traceback (most recent call last):
  File "_ssl_build.py", line 58, in <module>
    ffi.compile(verbose=True)
  File "/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/api.py", line 729, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/recompiler.py", line 1582, in recompile
    compiler_verbose, debug)
  File "/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/ffiplatform.py", line 20, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/ffiplatform.py", line 54, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
VerificationError: CompileError: command 'clang' failed with exit status 1
 * ERROR: dev-lang/pypy-2.7.7.3.19::gentoo failed (compile phase):
 *   Failed to build CFFI bindings for ssl
 * 
 * Call stack:
 *     ebuild.sh, line 136:  Called src_compile
 *   environment, line 1038:  Called die
 * The specific snippet of code:
 *               ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}";
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/pypy-2.7.7.3.19::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/pypy-2.7.7.3.19::gentoo'`.
 * The complete build log is located at '/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/temp/build.log'.
 * The ebuild environment file is located at '/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/temp/environment'.
 * Working directory: '/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy'
 * S: '/mnt/scratch/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src'```

@orbea
Copy link
Contributor

orbea commented Mar 31, 2025

Thanks, that was helpful. The issue is exposed with USE=full-stdlib which is disabled by default. Gentoo documents the USE flag:

 - - full-stdlib : Install complete stdlib as necessary to use PyPy for general
                   purpose programs. By default, only a limited subset that is
                   used when building PyPy3 executables is installed. Note that
                   PyPy2.7's stdlib contains multiple known vulnerabilities.

However the patch in this PR doesn't work on my end.

x86_64-pc-linux-musl-gcc -O2 -pipe -Werror=strict-aliasing -frecord-gcc-switches -Werror=implicit-function-declaration -Werror=implicit-int -fPIC -I/var/tmp/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/include -c _pypy_openssl.c -o ./_pypy_openssl.o
_pypy_openssl.c: In function '_cffi_checkfld_typedef_OBJ_NAME':
_pypy_openssl.c:5880:25: error: initialization of 'const char **' from incompatible pointer type 'const void **' [-Wincompatible-pointer-types]
 5880 |   { char const * *tmp = &p->data; (void)tmp; }
      |                         ^
Traceback (most recent call last):
  File "_ssl_build.py", line 58, in <module>
    ffi.compile(verbose=True)
  File "/var/tmp/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/api.py", line 729, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/var/tmp/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/recompiler.py", line 1582, in recompile
    compiler_verbose, debug)
  File "/var/tmp/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/ffiplatform.py", line 20, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/var/tmp/portage/dev-lang/pypy-2.7.7.3.19/work/pypy2.7-v7.3.19-src/lib_pypy/cffi/ffiplatform.py", line 54, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
VerificationError: CompileError: command 'x86_64-pc-linux-musl-gcc' failed with exit status 1

@wikkyk
Copy link
Contributor Author

wikkyk commented Apr 1, 2025

Indeed, maybe it's better (and easier) to just install pypy:2.7[-full-stdlib]. Perhaps a mask in ::libressl with a helpful message would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants