| |
@@ -1,13 +1,17 @@
|
| |
%global basever 7.3
|
| |
- %global pyversion 3.8
|
| |
+ %global micro 8
|
| |
+ #global pre ...
|
| |
+ %global pyversion 3.9
|
| |
Name: pypy%{pyversion}
|
| |
- Version: %{basever}.7
|
| |
- Release: 3%{?dist}
|
| |
+ Version: %{basever}.%{micro}%{?pre:~%{pre}}
|
| |
+ %global version_ %{basever}.%{micro}%{?pre}
|
| |
+ Release: 1%{?dist}
|
| |
Summary: Python %{pyversion} implementation with a Just-In-Time compiler
|
| |
|
| |
# PyPy is MIT
|
| |
# Python standard library is Python
|
| |
# pypy/module/unicodedata is UCD
|
| |
+ # Bundled cffi is is MIT
|
| |
# Bundled pycparser is is BSD
|
| |
# Bundled pycparser.ply is BSD
|
| |
# Bundled bits from cryptography are ASL 2.0 or BSD
|
| |
@@ -34,111 +38,35 @@
|
| |
# Uses upstream bundled prebuilt wheels otherwise
|
| |
%bcond_without rpmwheels
|
| |
|
| |
- # PyPy consists of an implementation of an interpreter (with JIT compilation)
|
| |
- # for the full Python language written in a high-level language, leaving many
|
| |
- # of the implementation details as "pluggable" policies.
|
| |
- #
|
| |
- # The implementation language is then compiled down to .c code, from which we
|
| |
- # obtain a binary.
|
| |
- #
|
| |
- # This allows us to build a near-arbitrary collection of different
|
| |
- # implementations of Python with differing tradeoffs
|
| |
- #
|
| |
- # (As it happens, the implementation language is itself Python, albeit a
|
| |
- # restricted subset "RPython", chosen to making it amenable to being compiled.
|
| |
- # The result implements the full Python language though)
|
| |
-
|
| |
- # We could build many different implementations of Python.
|
| |
- # For now, let's focus on the implementation that appears to be receiving the
|
| |
- # most attention upstream: the JIT-enabled build, with all standard
|
| |
- # optimizations
|
| |
-
|
| |
- # Building a configuration can take significant time:
|
| |
-
|
| |
- # A build of pypy (with jit) on i686 took 77 mins:
|
| |
- # [Timer] Timings:
|
| |
- # [Timer] annotate --- 583.3 s
|
| |
- # [Timer] rtype_lltype --- 760.9 s
|
| |
- # [Timer] pyjitpl_lltype --- 567.3 s
|
| |
- # [Timer] backendopt_lltype --- 375.6 s
|
| |
- # [Timer] stackcheckinsertion_lltype --- 54.1 s
|
| |
- # [Timer] database_c --- 852.2 s
|
| |
- # [Timer] source_c --- 1007.3 s
|
| |
- # [Timer] compile_c --- 419.9 s
|
| |
- # [Timer] ===========================================
|
| |
- # [Timer] Total: --- 4620.5 s
|
| |
- #
|
| |
- # A build of pypy (nojit) on x86_64 took about an hour:
|
| |
- # [Timer] Timings:
|
| |
- # [Timer] annotate --- 537.5 s
|
| |
- # [Timer] rtype_lltype --- 667.3 s
|
| |
- # [Timer] backendopt_lltype --- 385.4 s
|
| |
- # [Timer] stackcheckinsertion_lltype --- 42.5 s
|
| |
- # [Timer] database_c --- 625.3 s
|
| |
- # [Timer] source_c --- 1040.2 s
|
| |
- # [Timer] compile_c --- 273.9 s
|
| |
- # [Timer] ===========================================
|
| |
- # [Timer] Total: --- 3572.0 s
|
| |
-
|
| |
-
|
| |
# We will build a "pypy" binary.
|
| |
#
|
| |
# Unfortunately, the JIT support is only available on some architectures.
|
| |
- #
|
| |
- # rpython/jit/backend/detect_cpu.py:getcpuclassname currently supports the
|
| |
- # following options:
|
| |
- # 'i386', 'x86'
|
| |
- # 'x86-without-sse2':
|
| |
- # 'x86_64'
|
| |
- # 'armv6', 'armv7' (versions 6 and 7, hard- and soft-float ABI)
|
| |
- # 'cli'
|
| |
- # 'llvm'
|
| |
- #
|
| |
# We will only build with JIT support on those architectures, and build without
|
| |
# it on the other archs. The resulting binary will typically be slower than
|
| |
# CPython for the latter case.
|
| |
-
|
| |
%ifarch %{ix86} x86_64 %{arm} %{power64} s390x aarch64
|
| |
- %global with_jit 1
|
| |
+ %bcond_without jit
|
| |
%else
|
| |
- %global with_jit 0
|
| |
+ %bcond_with jit
|
| |
%endif
|
| |
|
| |
# Should we build the emacs JIT-viewing mode?
|
| |
- %if 0%{?rhel} == 6
|
| |
- %global with_emacs 0
|
| |
- %else
|
| |
- %global with_emacs 1
|
| |
- %endif
|
| |
-
|
| |
- # Easy way to enable/disable verbose logging:
|
| |
- %global verbose_logs 0
|
| |
-
|
| |
- # Forcibly use the shadow-stack option for detecting GC roots, rather than
|
| |
- # relying on hacking up generated assembler with regexps:
|
| |
- %global shadow_stack 1
|
| |
+ %bcond_without emacs
|
| |
|
| |
# Easy way to turn off the selftests:
|
| |
- %global run_selftests 1
|
| |
-
|
| |
- %global pypyprefix %{_libdir}/pypy%{pyversion}
|
| |
- %global pylibver 3
|
| |
+ %bcond_without selftests
|
| |
|
| |
# We refer to this subdir of the source tree in a few places during the build:
|
| |
%global goal_dir pypy/goal
|
| |
|
| |
- %if 0%{?fedora} >= 36
|
| |
- %bcond_without main_pypy3
|
| |
- %else
|
| |
%bcond_with main_pypy3
|
| |
- %endif
|
| |
|
| |
%ifarch %{ix86} x86_64 %{arm}
|
| |
%global _package_note_linker gold
|
| |
%endif
|
| |
|
| |
# Source and patches:
|
| |
- Source0: https://downloads.python.org/pypy/pypy%{pyversion}-v%{version}-src.tar.bz2
|
| |
+ Source0: https://downloads.python.org/pypy/pypy%{pyversion}-v%{version_}-src.tar.bz2
|
| |
|
| |
# Supply various useful RPM macros for building python modules against pypy:
|
| |
# __pypy, pypy_sitelib, pypy_sitearch
|
| |
@@ -173,22 +101,20 @@
|
| |
|
| |
# Build-time requirements:
|
| |
|
| |
- # pypy's can be rebuilt using itself, rather than with CPython; doing so
|
| |
+ # pypy's can be rebuilt using pypy2, rather than with CPython 2; doing so
|
| |
# halves the build time.
|
| |
#
|
| |
- # Turn it off with this boolean, to revert back to rebuilding using CPython
|
| |
+ # Turn it off with this bcond, to revert back to rebuilding using CPython
|
| |
# and avoid a cycle in the build-time dependency graph:
|
| |
# Note, pypy3 is built with pypy2, so no dependency cycle
|
| |
|
| |
- %global use_self_when_building 1
|
| |
- %if 0%{use_self_when_building}
|
| |
- # pypy3 can only be build with pypy2
|
| |
+ %bcond_without build_using_pypy2
|
| |
+ %if %{with build_using_pypy2}
|
| |
BuildRequires: pypy2
|
| |
%global bootstrap_python_interp pypy2
|
| |
%else
|
| |
- # pypy3 can only be build with python2
|
| |
# exception to use Python 2: https://pagure.io/fesco/issue/2130
|
| |
- BuildRequires: python27
|
| |
+ BuildRequires: python2.7
|
| |
%global bootstrap_python_interp python2
|
| |
|
| |
%endif
|
| |
@@ -205,32 +131,33 @@
|
| |
BuildRequires: bzip2-devel
|
| |
BuildRequires: ncurses-devel
|
| |
BuildRequires: expat-devel
|
| |
- BuildRequires: openssl1.1-devel
|
| |
+ BuildRequires: openssl-devel
|
| |
BuildRequires: gdbm-devel
|
| |
BuildRequires: xz-devel
|
| |
|
| |
BuildRequires: python-rpm-macros
|
| |
|
| |
- %ifnarch s390
|
| |
+ %ifarch %{valgrind_arches}
|
| |
BuildRequires: valgrind-devel
|
| |
%endif
|
| |
|
| |
- %if %{run_selftests}
|
| |
- # Used by the selftests, though not by the build:
|
| |
- BuildRequires: gc-devel
|
| |
-
|
| |
- # For use in the selftests, for recording stats:
|
| |
+ # For recording stats:
|
| |
BuildRequires: time
|
| |
BuildRequires: /usr/bin/free
|
| |
|
| |
+ %if %{with selftests}
|
| |
+ # Used by the selftests, though not by the build:
|
| |
+ BuildRequires: gc-devel
|
| |
+
|
| |
# For use in the selftests, for imposing a per-test timeout:
|
| |
BuildRequires: perl-interpreter
|
| |
%endif
|
| |
|
| |
BuildRequires: /usr/bin/execstack
|
| |
+ BuildRequires: /usr/bin/patchelf
|
| |
|
| |
# For byte-compiling the JIT-viewing mode:
|
| |
- %if %{with_emacs}
|
| |
+ %if %{with emacs}
|
| |
BuildRequires: emacs
|
| |
%endif
|
| |
|
| |
@@ -254,12 +181,20 @@
|
| |
Conflicts: pypy3 < 7.3.7-1
|
| |
%endif
|
| |
|
| |
+ # This prevents ALL subpackages built from this spec to require
|
| |
+ # /usr/bin/pypy*. Granularity per subpackage is impossible.
|
| |
+ # It's intended for the libs package not to drag in the interpreter, see
|
| |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1547131
|
| |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1862082
|
| |
+ # All other packages require the main package explicitly.
|
| |
+ %global __requires_exclude ^/usr/bin/pypy
|
| |
+
|
| |
%description
|
| |
PyPy's implementation of Python %{pyversion}, featuring a Just-In-Time compiler
|
| |
on some CPU architectures, and various optimized implementations
|
| |
of the standard types (strings, dictionaries, etc.).
|
| |
|
| |
- %if 0%{with_jit}
|
| |
+ %if %{with jit}
|
| |
This build of PyPy has JIT-compilation enabled.
|
| |
%else
|
| |
This build of PyPy has JIT-compilation disabled, as it is not supported on this
|
| |
@@ -272,7 +207,7 @@
|
| |
|
| |
# We supply an emacs mode for the JIT viewer.
|
| |
# (This doesn't bring in all of emacs, just the directory structure)
|
| |
- %if %{with_emacs}
|
| |
+ %if %{with emacs}
|
| |
Requires: emacs-filesystem >= %{_emacs_version}
|
| |
%endif
|
| |
|
| |
@@ -286,8 +221,8 @@
|
| |
Requires: python-setuptools-wheel
|
| |
Requires: python-pip-wheel
|
| |
%else
|
| |
- Provides: bundled(python3dist(pip)) = 21.1.1
|
| |
- Provides: bundled(python3dist(setuptools)) = 56.0.0
|
| |
+ Provides: bundled(python3dist(pip)) = 21.2.4
|
| |
+ Provides: bundled(python3dist(setuptools)) = 58.1.0
|
| |
%endif
|
| |
|
| |
# Provides for the bundled libmpdec
|
| |
@@ -296,8 +231,11 @@
|
| |
Provides: bundled(libmpdec) = %{libmpdec_version}
|
| |
}
|
| |
|
| |
+ # Find the version in lib_pypy/cffi.dist-info/METADATA
|
| |
+ Provides: bundled(python3dist(cffi)) = 1.15.0
|
| |
+
|
| |
# Find the version in lib_pypy/cffi/_pycparser/__init__.py
|
| |
- Provides: bundled(python3dist(pycparser)) = 2.20
|
| |
+ Provides: bundled(python3dist(pycparser)) = 2.21
|
| |
|
| |
# Find the version in lib_pypy/cffi/_pycparser/ply/__init__.py
|
| |
Provides: bundled(python3dist(ply)) = 3.9
|
| |
@@ -312,9 +250,25 @@
|
| |
Libraries required by the various PyPy implementations of Python %{pyversion}.
|
| |
|
| |
|
| |
+ %package test
|
| |
+ Summary: Tests for PyPy%{pyversion}
|
| |
+ Requires: pypy%{pyversion}%{?_isa} = %{version}-%{release}
|
| |
+ Requires: pypy%{pyversion}-libs%{?_isa} = %{version}-%{release}
|
| |
+
|
| |
+ %if %{with main_pypy3}
|
| |
+ Provides: pypy3-test = %{version}-%{release}
|
| |
+ Provides: pypy3-test%{?_isa} = %{version}-%{release}
|
| |
+ %endif
|
| |
+
|
| |
+ %description test
|
| |
+ Various testing modules of PyPy%{pyversion}.
|
| |
+ Useful when you want to run the test suite of PyPy%{pyversion}.
|
| |
+
|
| |
+
|
| |
%package devel
|
| |
Summary: Development tools for working with PyPy%{pyversion}
|
| |
Requires: pypy%{pyversion}%{?_isa} = %{version}-%{release}
|
| |
+ Requires: pypy%{pyversion}-libs%{?_isa} = %{version}-%{release}
|
| |
|
| |
%if %{with main_pypy3}
|
| |
Provides: pypy3-devel = %{version}-%{release}
|
| |
@@ -329,7 +283,7 @@
|
| |
|
| |
|
| |
%prep
|
| |
- %autosetup -n pypy%{pyversion}-v%{version}-src -p1 -S git
|
| |
+ %autosetup -n pypy%{pyversion}-v%{version_}-src -p1 -S git
|
| |
|
| |
# Temporary workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1954999
|
| |
%{?!apply_patch:%define apply_patch(qp:m:) {%__apply_patch %**}}
|
| |
@@ -337,7 +291,6 @@
|
| |
%if %{with rpmwheels}
|
| |
%apply_patch -m %(basename %{SOURCE189}) %{SOURCE189}
|
| |
rm lib-python/3/ensurepip/_bundled/*.whl
|
| |
- rmdir lib-python/3/ensurepip/_bundled
|
| |
%endif
|
| |
|
| |
|
| |
@@ -356,7 +309,7 @@
|
| |
done
|
| |
|
| |
# Replace all lib-python and lib_pypy python shebangs with pypy3 (those will be shipped with pypy3-libs)
|
| |
- find lib-python/%{pylibver} lib_pypy -name "*.py" -exec \
|
| |
+ find lib-python/3 lib_pypy -name "*.py" -exec \
|
| |
sed -r -i '1s@^#!\s*/usr/bin.*(python|pypy).*@#!/usr/bin/%{name}@' \
|
| |
"{}" \
|
| |
\;
|
| |
@@ -368,7 +321,7 @@
|
| |
sed -i -r 's/\$\(LDFLAGSEXTRA\)/& -fuse-ld=gold/' ./rpython/translator/platform/posix.py
|
| |
%endif
|
| |
|
| |
- %if ! 0%{use_self_when_building}
|
| |
+ %if %{without build_using_pypy2}
|
| |
# use the pycparser from PyPy even on CPython
|
| |
ln -s lib_pypy/cffi/_pycparser pycparser
|
| |
%endif
|
| |
@@ -377,11 +330,6 @@
|
| |
rm lib-python/3/distutils/command/*.exe
|
| |
|
| |
%build
|
| |
- %ifarch s390 s390x
|
| |
- # pypy3 requires z10 at least
|
| |
- %global optflags %(echo %{optflags} | sed 's/-march=z9-109 /-march=z10 /')
|
| |
- %endif
|
| |
-
|
| |
# Top memory usage is about 4.5GB on arm7hf
|
| |
free
|
| |
|
| |
@@ -438,35 +386,8 @@
|
| |
# How will we track garbage-collection roots in the generated code?
|
| |
# http://pypy.readthedocs.org/en/latest/config/translation.gcrootfinder.html
|
| |
|
| |
- %if 0%{shadow_stack}
|
| |
- # This is the most portable option, and avoids a reliance on non-guaranteed
|
| |
- # behaviors within GCC's code generator: use an explicitly-maintained stack
|
| |
- # of root pointers:
|
| |
- %global gcrootfinder_options --gcrootfinder=shadowstack
|
| |
-
|
| |
export CFLAGS=$(echo "$RPM_OPT_FLAGS")
|
| |
|
| |
- %else
|
| |
- # Go with the default, which is "asmgcc"
|
| |
-
|
| |
- %global gcrootfinder_options %{nil}
|
| |
-
|
| |
- # https://bugzilla.redhat.com/show_bug.cgi?id=588941#c18
|
| |
- # The generated Makefile compiles the .c files into assembler (.s), rather
|
| |
- # than direct to .o It then post-processes this assembler to locate
|
| |
- # garbage-collection roots (building .lbl.s and .gcmap files, and a
|
| |
- # "gcmaptable.s"). (The modified .lbl.s files have extra code injected
|
| |
- # within them).
|
| |
- # Unfortunately, the code to do this:
|
| |
- # pypy-1.4/pypy/translator/c/gcc/trackgcroot.py
|
| |
- # doesn't interract well with the results of using our standard build flags.
|
| |
- # For now, filter our CFLAGS of everything that could be conflicting with
|
| |
- # pypy. Need to check these and reenable ones that are okay later.
|
| |
- # Filed as https://bugzilla.redhat.com/show_bug.cgi?id=666966
|
| |
- export CFLAGS=$(echo "$RPM_OPT_FLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//' -e 's/-fexceptions//' -e 's/-fstack-protector//' -e 's/--param=ssp-buffer-size=4//' -e 's/-O2//' -e 's/-fasynchronous-unwind-tables//' -e 's/-march=i686//' -e 's/-mtune=atom//')
|
| |
-
|
| |
- %endif
|
| |
-
|
| |
# The generated C code leads to many thousands of warnings of the form:
|
| |
# warning: variable 'l_v26003' set but not used [-Wunused-but-set-variable]
|
| |
# Suppress them:
|
| |
@@ -489,9 +410,10 @@
|
| |
PYPY_USESSION_DIR=$(pwd) \
|
| |
PYPY_USESSION_BASENAME=$ExeName \
|
| |
$INTERP ../../rpython/bin/rpython \
|
| |
- %{gcrootfinder_options} \
|
| |
+ --gcrootfinder=shadowstack \
|
| |
$Options \
|
| |
- targetpypystandalone
|
| |
+ targetpypystandalone \
|
| |
+ --platlibdir=%{_lib}
|
| |
|
| |
echo "--------------------------------------------------------------"
|
| |
echo "--------------------------------------------------------------"
|
| |
@@ -506,25 +428,74 @@
|
| |
|
| |
BuildPyPy \
|
| |
pypy3 \
|
| |
- %if 0%{with_jit}
|
| |
+ %if %{with jit}
|
| |
"-Ojit" \
|
| |
%else
|
| |
"-O2" \
|
| |
%endif
|
| |
%{nil}
|
| |
|
| |
- %if %{with_emacs}
|
| |
+ %if %{with emacs}
|
| |
%{_emacs_bytecompile} rpython/jit/tool/pypytrace-mode.el
|
| |
%endif
|
| |
|
| |
|
| |
%install
|
| |
- mkdir -p %{buildroot}/%{_bindir}
|
| |
- mkdir -p %{buildroot}/%{pypyprefix}
|
| |
-
|
| |
-
|
| |
- # Run installing script, archive-name pypy%{pyversion} in %{buildroot}/%{_libdir} == %{pypyprefix}
|
| |
- %{bootstrap_python_interp} pypy/tool/release/package.py --archive-name pypy%{pyversion} --builddir %{buildroot}/%{_libdir} --no-embedded-dependencies
|
| |
+ %global pypylibdir %{_libdir}/pypy%{pyversion}
|
| |
+
|
| |
+ # First, run packaging script, it will prep the installation tree in builddir
|
| |
+ %global installation_archive_name pypy%{pyversion}-%{version_}
|
| |
+ %global packaging_builddir builddir
|
| |
+ %global packaged_prefix %{packaging_builddir}/%{installation_archive_name}
|
| |
+ # We will set an arbitrary downstream-only soname version, as it is required
|
| |
+ # See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_downstream_so_name_versioning
|
| |
+ %global soname_version 0.1
|
| |
+
|
| |
+ %{bootstrap_python_interp} pypy/tool/release/package.py --archive-name '%{installation_archive_name}' --builddir '%{packaging_builddir}' --no-embedded-dependencies
|
| |
+
|
| |
+ # Mangle some paths to match CPython,
|
| |
+ # see https://mail.python.org/pipermail/pypy-dev/2022-January/016310.html and the replies there
|
| |
+ # 1. remove the "python" executables, we still want CPython as the python command
|
| |
+ rm %{packaged_prefix}/bin/python*
|
| |
+ # 2. remove the "pypy" symbolic link, we still want pypy2 to be that for now
|
| |
+ rm %{packaged_prefix}/bin/pypy
|
| |
+ # 3. remove the "pypy3" symbolic link, if this is not the main pypy3
|
| |
+ %{!?with_main_pypy3:rm %{packaged_prefix}/bin/pypy3}
|
| |
+ # 4. remove the .debug executbale and library
|
| |
+ rm %{packaged_prefix}/bin/*.debug
|
| |
+ # 5. move libpypy3.9-c.so to lib(64) and soname version it
|
| |
+ # https://docs.fedoraproject.org/en-US/packaging-guidelines/#_downstream_so_name_versioning
|
| |
+ mv %{packaged_prefix}/bin/libpypy%{pyversion}-c.so %{packaged_prefix}/%{_lib}/libpypy%{pyversion}-c.so.%{soname_version}
|
| |
+ ln -s libpypy%{pyversion}-c.so.%{soname_version} %{packaged_prefix}/%{_lib}/libpypy%{pyversion}-c.so
|
| |
+ patchelf --set-soname libpypy%{pyversion}-c.so.%{soname_version} %{packaged_prefix}/%{_lib}/libpypy%{pyversion}-c.so.%{soname_version}
|
| |
+ patchelf --replace-needed libpypy%{pyversion}-c.so libpypy%{pyversion}-c.so.%{soname_version} %{packaged_prefix}/bin/pypy%{pyversion}
|
| |
+ # 6. remove stray README
|
| |
+ rm %{packaged_prefix}/include/README
|
| |
+ # 7. copy the main LICENSE file to pypy's libdir, as does CPython
|
| |
+ cp -a LICENSE %{packaged_prefix}/%{_lib}/pypy%{pyversion}
|
| |
+ # 8. remove sources, we don't install them
|
| |
+ # this list was created by inspecting rpmlint output before it was added
|
| |
+ # sources that look like they might be tests are kept and included in the test subpackage
|
| |
+ rm -r %{packaged_prefix}/%{_lib}/pypy%{pyversion}/_blake2/impl
|
| |
+ rm -r %{packaged_prefix}/%{_lib}/pypy%{pyversion}/_libmpdec
|
| |
+ rm -r %{packaged_prefix}/%{_lib}/pypy%{pyversion}/_sha3/kcp
|
| |
+ rm -r %{packaged_prefix}/%{_lib}/pypy%{pyversion}/_cffi_ssl/_cffi_src/openssl/src
|
| |
+ rm %{packaged_prefix}/%{_lib}/pypy%{pyversion}/_pypy_*.c
|
| |
+
|
| |
+ # Create the prefix and move stuff into it
|
| |
+ mkdir -p %{buildroot}%{_prefix}
|
| |
+ mv %{packaged_prefix}/bin %{buildroot}%{_bindir}
|
| |
+ mv %{packaged_prefix}/include %{buildroot}%{_includedir}
|
| |
+ mv %{packaged_prefix}/%{_lib} %{buildroot}%{_libdir}
|
| |
+
|
| |
+ # Create directories we want to own
|
| |
+ install -d -m 0755 %{buildroot}%{pypylibdir}/site-packages/__pycache__
|
| |
+ %if "%{_lib}" == "lib64"
|
| |
+ # The 64-bit version needs to create "site-packages" in /usr/lib/ (for
|
| |
+ # pure-Python modules) as well as in /usr/lib64/ (for packages with extension
|
| |
+ # modules).
|
| |
+ install -d -m 0755 %{buildroot}%{_prefix}/lib/pypy%{pyversion}/site-packages/__pycache__
|
| |
+ %endif
|
| |
|
| |
|
| |
# Remove shebang lines from .py files that aren't executable, and
|
| |
@@ -543,8 +514,6 @@
|
| |
\) \
|
| |
\)
|
| |
|
| |
- mkdir -p %{buildroot}/%{pypyprefix}/site-packages
|
| |
-
|
| |
# The generated machine code doesn't need an executable stack, but
|
| |
# one of the assembler files (gcmaptable.s) doesn't have the necessary
|
| |
# metadata to inform gcc of that, and thus gcc pessimistically assumes
|
| |
@@ -554,92 +523,29 @@
|
| |
#
|
| |
# I tried various approaches involving fixing the build, but the simplest
|
| |
# approach is to postprocess the ELF file:
|
| |
- execstack --clear-execstack %{buildroot}/%{pypyprefix}/bin/pypy3
|
| |
-
|
| |
- ln -s %{pypyprefix}/bin/pypy%{pyversion} %{buildroot}%{_bindir}/pypy%{pyversion}
|
| |
- %if %{with main_pypy3}
|
| |
- ln -s pypy%{pyversion} %{buildroot}%{_bindir}/pypy3
|
| |
- %endif
|
| |
-
|
| |
- # pypy uses .pyc files by default (--objspace-usepycfiles), but has a slightly
|
| |
- # different bytecode format to CPython. It doesn't use .pyo files: the -O flag
|
| |
- # is treated as a "dummy optimization flag for compatibility with C Python"
|
| |
- #
|
| |
- # pypy-1.4/pypy/module/imp/importing.py has this comment:
|
| |
- # XXX picking a magic number is a mess. So far it works because we
|
| |
- # have only two extra opcodes, which bump the magic number by +1 and
|
| |
- # +2 respectively, and CPython leaves a gap of 10 when it increases
|
| |
- # its own magic number. To avoid assigning exactly the same numbers
|
| |
- # as CPython we always add a +2. We'll have to think again when we
|
| |
- # get at the fourth new opcode :-(
|
| |
- #
|
| |
- # * CALL_LIKELY_BUILTIN +1
|
| |
- # * CALL_METHOD +2
|
| |
- #
|
| |
- # In other words:
|
| |
- #
|
| |
- # default_magic -- used by CPython without the -U option
|
| |
- # default_magic + 1 -- used by CPython with the -U option
|
| |
- # default_magic + 2 -- used by PyPy without any extra opcode
|
| |
- # ...
|
| |
- # default_magic + 5 -- used by PyPy with both extra opcodes
|
| |
- #
|
| |
-
|
| |
- # pypy-1.4/pypy/interpreter/pycode.py has:
|
| |
- #
|
| |
- # default_magic = (62141+2) | 0x0a0d0000 # this PyPy's magic
|
| |
- # # (62131=CPython 2.5.1)
|
| |
- # giving a value for "default_magic" for PyPy of 0xa0df2bf.
|
| |
- # Note that this corresponds to the "default_magic + 2" from the comment above
|
| |
-
|
| |
- # In my builds:
|
| |
- # $ ./pypy --info | grep objspace.opcodes
|
| |
- # objspace.opcodes.CALL_LIKELY_BUILTIN: False
|
| |
- # objspace.opcodes.CALL_METHOD: True
|
| |
- # so I'd expect the magic number to be:
|
| |
- # 0x0a0df2bf + 2 (the flag for CALL_METHOD)
|
| |
- # giving
|
| |
- # 0x0a0df2c1
|
| |
- #
|
| |
- # I'm seeing
|
| |
- # c1 f2 0d 0a
|
| |
- # as the first four bytes of the .pyc files, which is consistent with this.
|
| |
-
|
| |
+ execstack --clear-execstack %{buildroot}%{_bindir}/pypy%{pyversion}
|
| |
|
| |
# Bytecompile all of the .py files we ship, using our pypy binary, giving us
|
| |
# .pyc files for pypy.
|
| |
#
|
| |
# Note that some of the test files deliberately contain syntax errors, so
|
| |
# we are running it in subshell, to be able to ignore the failures and not to terminate the build.
|
| |
- (%{py_byte_compile %{buildroot}%{pypyprefix}/bin/pypy3 %{buildroot}%{pypyprefix}}) || :
|
| |
+ export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
|
| |
+ (%{py_byte_compile %{buildroot}%{_bindir}/pypy%{pyversion} %{buildroot}}) || :
|
| |
|
| |
+ %{buildroot}%{_bindir}/pypy%{pyversion} -c 'import _tkinter'
|
| |
+ %{buildroot}%{_bindir}/pypy%{pyversion} -c 'import tkinter'
|
| |
+ %{buildroot}%{_bindir}/pypy%{pyversion} -c 'import _sqlite3'
|
| |
+ %{buildroot}%{_bindir}/pypy%{pyversion} -c 'import _curses'
|
| |
+ %{buildroot}%{_bindir}/pypy%{pyversion} -c 'import curses'
|
| |
+ %{buildroot}%{_bindir}/pypy%{pyversion} -c 'import syslog'
|
| |
+ %{buildroot}%{_bindir}/pypy%{pyversion} -c 'from _sqlite3 import *'
|
| |
|
| |
- %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import _tkinter'
|
| |
- %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import tkinter'
|
| |
- %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import _sqlite3'
|
| |
- %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import _curses'
|
| |
- %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import curses'
|
| |
- %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import syslog'
|
| |
- %{buildroot}%{pypyprefix}/bin/pypy3 -c 'from _sqlite3 import *'
|
| |
-
|
| |
- # Header files for C extension modules.
|
| |
- # Upstream's packaging process (pypy/tool/release/package.py)
|
| |
- # creates an "include" subdir and copies all *.h/*.inl from "include" there
|
| |
- # (it also has an apparently out-of-date comment about copying them from
|
| |
- # pypy/_interfaces, but this directory doesn't seem to exist, and it doesn't
|
| |
- # seem to do this as of 2011-01-13)
|
| |
-
|
| |
- # FIXME: arguably these should be instead put into a subdir below /usr/include,
|
| |
- # it's not yet clear to me how upstream plan to deal with the C extension
|
| |
- # interface going forward, so let's just mimic upstream for now.
|
| |
- %global pypy_include_dir %{pypyprefix}/include
|
| |
- mkdir -p %{buildroot}%{pypy_include_dir}
|
| |
- rm -f %{buildroot}%{pypy_include_dir}/README
|
| |
-
|
| |
+ unset LD_LIBRARY_PATH
|
| |
|
| |
# Capture the RPython source code files from the build within the debuginfo
|
| |
# package (rhbz#666975)
|
| |
- %global pypy_debuginfo_dir /usr/src/debug/pypy-%{version}-src
|
| |
+ %global pypy_debuginfo_dir /usr/src/debug/pypy-%{version_}-src
|
| |
mkdir -p %{buildroot}%{pypy_debuginfo_dir}
|
| |
|
| |
# copy over everything:
|
| |
@@ -682,7 +588,7 @@
|
| |
# are acceptable.
|
| |
|
| |
# Install the JIT trace mode for Emacs:
|
| |
- %if %{with_emacs}
|
| |
+ %if %{with emacs}
|
| |
mkdir -p %{buildroot}/%{_emacs_sitelispdir}
|
| |
cp -a rpython/jit/tool/pypytrace-mode.el %{buildroot}/%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.el
|
| |
cp -a rpython/jit/tool/pypytrace-mode.elc %{buildroot}/%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.elc
|
| |
@@ -693,25 +599,13 @@
|
| |
install -m0644 -p -D -t %{buildroot}/%{_rpmconfigdir}/macros.d %{SOURCE2}
|
| |
%endif
|
| |
|
| |
- # Remove files we don't want:
|
| |
- rm -f %{buildroot}%{_libdir}/%{name}.tar.bz2 \
|
| |
- %{buildroot}%{pypyprefix}/README.rst
|
| |
-
|
| |
- # wtf? This is probably masking some bigger problem, but let's do this for now
|
| |
- mv -v lib-python/3/test/regrtest.py-new lib-python/3/test/regrtest.py || :
|
| |
-
|
| |
- # since 5.10.0, the debug binaries are built and shipped, making the
|
| |
- # pypy3 package ~350 MiB. let's remove them here for now and TODO figure out why
|
| |
- rm -f %{buildroot}%{pypyprefix}/bin/pypy3.debug
|
| |
- rm -f %{buildroot}%{pypyprefix}/bin/libpypy3-c.so.debug
|
| |
-
|
| |
|
| |
%check
|
| |
|
| |
%{?libmpdec_version:
|
| |
# Verify that the bundled libmpdec version python was compiled with, is the same version we have virtual
|
| |
# provides for in the SPEC.
|
| |
- test "$(%{goal_dir}/pypy3-c -c 'import decimal; print(decimal.__libmpdec_version__.decode("ascii"))')" = \
|
| |
+ test "$(%{goal_dir}/pypy%{pyversion}-c -c 'import decimal; print(decimal.__libmpdec_version__.decode("ascii"))')" = \
|
| |
"%{libmpdec_version}"
|
| |
}
|
| |
|
| |
@@ -827,54 +721,103 @@
|
| |
echo "--------------------------------------------------------------"
|
| |
}
|
| |
|
| |
- #python testrunner/runner.py --logfile=pytest-A.log --config=pypy/pytest-A.cfg --config=pypy/pytest-A.py --root=pypy --timeout=3600
|
| |
- #python pypy/test_all.py --pypy=pypy/goal/pypy --timeout=3600 --resultlog=cpython.log lib-python
|
| |
- #python pypy/test_all.py --pypy=pypy/goal/pypy --resultlog=pypyjit.log pypy/module/pypyjit/test
|
| |
- #pypy/goal/pypy pypy/test_all.py --resultlog=pypyjit_new.log
|
| |
-
|
| |
- %if %{run_selftests}
|
| |
- CheckPyPy pypy3-c
|
| |
- %endif # run_selftests
|
| |
+ %if %{with selftests}
|
| |
+ CheckPyPy pypy%{pyversion}-c
|
| |
+ %endif # with selftests
|
| |
|
| |
# Because there's a bunch of binary subpackages and creating
|
| |
# /usr/share/doc/pypy3-this and /usr/share/doc/pypy3-that
|
| |
# is just confusing for the user.
|
| |
%global _docdir_fmt %{name}
|
| |
|
| |
+ %files
|
| |
+ %doc README.rst
|
| |
+ %{?with_main_pypy3:%{_bindir}/pypy3}
|
| |
+ %{_bindir}/pypy%{pyversion}
|
| |
+
|
| |
+
|
| |
%files libs
|
| |
%doc README.rst
|
| |
+ %license %{pypylibdir}/LICENSE
|
| |
+ %license %{pypylibdir}/_cffi_ssl/LICENSE
|
| |
+ %license %{pypylibdir}/cffi.dist-info/LICENSE
|
| |
+ %license %{pypylibdir}/cffi/_pycparser/ply/LICENSE
|
| |
+ %license %{pypylibdir}/hpy.dist-info/LICENSE
|
| |
+ %{pypylibdir}/
|
| |
+ %if %{with rpmwheels}
|
| |
+ %exclude %{pypylibdir}/ensurepip/_bundled
|
| |
+ %endif
|
| |
+ %if "%{_lib}" == "lib64"
|
| |
+ %{_prefix}/lib/pypy%{pyversion}/
|
| |
+ %endif
|
| |
+ %{_libdir}/libpypy%{pyversion}-c.so.%{soname_version}
|
| |
|
| |
- %dir %{pypyprefix}
|
| |
- %license %{pypyprefix}/LICENSE
|
| |
- %license %{pypyprefix}/lib/pypy%{pyversion}/_cffi_ssl/LICENSE
|
| |
- %license %{pypyprefix}/lib/pypy%{pyversion}/cffi/_pycparser/ply/LICENSE
|
| |
- %license %{pypyprefix}/lib/pypy%{pyversion}/hpy.dist-info/LICENSE
|
| |
- %{pypyprefix}/lib/pypy%{pyversion}/
|
| |
- %{pypyprefix}/site-packages/
|
| |
- %if %{with_emacs}
|
| |
+ %if %{with emacs}
|
| |
%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.el
|
| |
%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.elc
|
| |
%endif
|
| |
|
| |
- %files
|
| |
- %doc README.rst
|
| |
- %if %{with main_pypy3}
|
| |
- %{_bindir}/pypy3
|
| |
- %endif
|
| |
- %{_bindir}/pypy%{pyversion}
|
| |
- %{pypyprefix}/bin/
|
| |
+ # Keep this synced with %%files test below
|
| |
+ %exclude %{pypylibdir}/_ctypes_test.*
|
| |
+ %exclude %{pypylibdir}/_pypy_testcapi.*
|
| |
+ %exclude %{pypylibdir}/_test*
|
| |
+ %exclude %{pypylibdir}/__pycache__/_ctypes_test.*
|
| |
+ %exclude %{pypylibdir}/__pycache__/_pypy_testcapi.*
|
| |
+ %exclude %{pypylibdir}/__pycache__/_test*
|
| |
+ %exclude %{pypylibdir}/test/
|
| |
+ %exclude %{pypylibdir}/*/testing/
|
| |
+ %exclude %{pypylibdir}/*/test/
|
| |
+ %exclude %{pypylibdir}/*/tests/
|
| |
+ %exclude %{pypylibdir}/idlelib/idle_test/
|
| |
+ %exclude %{pypylibdir}/testcapi_long.h
|
| |
+
|
| |
+ # Keep this synced with %%files devel below
|
| |
+ %exclude %{pypylibdir}/cffi/*.h
|
| |
+ %exclude %{pypylibdir}/hpy/devel/
|
| |
+
|
| |
+
|
| |
+ %files test
|
| |
+ # Keep this synced with %%excluded %%files in libs
|
| |
+ %{pypylibdir}/_ctypes_test.*
|
| |
+ %{pypylibdir}/_pypy_testcapi.*
|
| |
+ %{pypylibdir}/_test*
|
| |
+ %{pypylibdir}/__pycache__/_ctypes_test.*
|
| |
+ %{pypylibdir}/__pycache__/_pypy_testcapi.*
|
| |
+ %{pypylibdir}/__pycache__/_test*
|
| |
+ %{pypylibdir}/test/
|
| |
+ %{pypylibdir}/*/testing/
|
| |
+ %{pypylibdir}/*/test/
|
| |
+ %{pypylibdir}/*/tests/
|
| |
+ %{pypylibdir}/idlelib/idle_test/
|
| |
+ %{pypylibdir}/testcapi_long.h
|
| |
+
|
| |
|
| |
%files devel
|
| |
- %dir %{pypy_include_dir}
|
| |
- %{pypy_include_dir}/*.h
|
| |
- %dir %{pypy_include_dir}/pypy%{pyversion}
|
| |
- %{pypy_include_dir}/pypy%{pyversion}/*.h
|
| |
+ %dir %{_includedir}/pypy%{pyversion}
|
| |
+ %{_includedir}/pypy%{pyversion}/*.h
|
| |
+ %{_libdir}/libpypy%{pyversion}-c.so
|
| |
%if %{with main_pypy3}
|
| |
%{_rpmconfigdir}/macros.d/macros.pypy3
|
| |
%endif
|
| |
|
| |
+ # Keep this synced with %%excluded %%files in libs
|
| |
+ %{pypylibdir}/cffi/*.h
|
| |
+ %{pypylibdir}/hpy/devel/
|
| |
+
|
| |
|
| |
%changelog
|
| |
+ * Tue Feb 22 2022 Miro Hrončok <mhroncok@redhat.com> - 7.3.8-1
|
| |
+ - Update to 7.3.8 final
|
| |
+
|
| |
+ * Fri Feb 11 2022 Miro Hrončok <mhroncok@redhat.com> - 7.3.8~rc2-1
|
| |
+ - Update to 7.3.8rc2
|
| |
+
|
| |
+ * Wed Jan 26 2022 Miro Hrončok <mhroncok@redhat.com> - 7.3.8~rc1-1
|
| |
+ - Update to 7.3.8rc1
|
| |
+ - Move to a CPython-like installation layout
|
| |
+ - Stop requiring pypy3.9 from pypy3.9-libs
|
| |
+ - Split tests into pypy3.9-test
|
| |
+
|
| |
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 7.3.7-3
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
| |
|
| |
This needs a new component.