#9 Use configuration macro instead of workaround to disable byte-compilation
Merged 6 years ago by churchyard. Opened 6 years ago by churchyard.
rpms/ churchyard/python35 proper-brp-exclude  into  master

file modified
+7 -22
@@ -71,26 +71,10 @@ 

  # Turn this to 0 to turn off the "check" phase:

  %global run_selftest_suite 1

  

- # We want to byte-compile the .py files within the packages using the new

- # python3 binary.

- #

- # Unfortunately, rpmbuild's infrastructure requires us to jump through some

- # hoops to avoid byte-compiling with the system python 2 version:

- #   /usr/lib/rpm/redhat/macros sets up build policy that (amongst other things)

- # defines __os_install_post.  In particular, "brp-python-bytecompile" is

- # invoked without an argument thus using the wrong version of python

- # (/usr/bin/python, rather than the freshly built python), thus leading to

- # numerous syntax errors, and incorrect magic numbers in the .pyc files.  We

- # thus override __os_install_post to avoid invoking this script:

- %global __os_install_post /usr/lib/rpm/brp-compress \

-   %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \

-   /usr/lib/rpm/brp-strip-static-archive %{__strip} \

-   /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \

-   /usr/lib/rpm/brp-python-hardlink

- # to remove the invocation of brp-python-bytecompile, whilst keeping the

- # invocation of brp-python-hardlink (since this should still work for python3

- # pyc/pyo files)

- 

+ # Disable automatic bytecompilation. The python3 binary is not yet be

+ # available in /usr/bin when Python is built. Also, the bytecompilation fails

+ # on files that test invalid syntax.

+ %undefine py_auto_byte_compile

  

  # ==================

  # Top-level metadata
@@ -764,8 +748,9 @@ 

  # Switch all shebangs to refer to the specific Python version.

  LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \

    Tools/scripts/pathfix.py \

-   -i "%{_bindir}/python%{pybasever}" \

-   %{buildroot}

+   -i "%{_bindir}/python%{pybasever}" -p \

+   %{buildroot} \

+   %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py}

  

  # Remove shebang lines from .py files that aren't executable, and

  # remove executability from .py files that don't have a shebang line:

I want to see if the shebang mangling scripts finds something before I merge this, hence WIP.

+ /usr/lib/rpm/redhat/brp-mangle-shebangs '' ''
*** WARNING: mangling shebang in /usr/lib/debug/usr/lib64/libpython3.5m.so.1.0.debug-gdb.py from #!/usr/bin/python to #!/usr/bin/python2. This will become an ERROR, fix it manually!

1 new commit added

  • Fix shebangs of the GDB hooks
6 years ago

The CI failure on s390x is unrelated and nondeterministic: https://koji.fedoraproject.org/koji/taskinfo?taskID=26606982

Pull-Request has been merged by churchyard

6 years ago