#74 Make sure we don't ship any exe files (not needed an prebuilt)
Merged 6 years ago by churchyard. Opened 6 years ago by churchyard.
rpms/ churchyard/python3 noexe  into  master

file modified
+8 -3
@@ -14,7 +14,7 @@ 

  #  WARNING  When rebasing to a new Python version,

  #           remember to update the python3-docs package as well

  Version: %{pybasever}.1

- Release: 4%{?dist}

+ Release: 5%{?dist}

  License: Python

  

  
@@ -627,6 +627,10 @@ 

  

  %prep

  %setup -q -n Python-%{version}%{?prerel}

+ # Remove all exe files to ensure we are not shipping prebuilt binaries

+ # note that those are only used to create Microsoft Windows installers

+ # and that functionality is broken on Linux anyway

+ find -name '*.exe' -print -delete

  

  # Remove bundled libraries to ensure that we're using the system copy.

  rm -r Modules/expat
@@ -1283,7 +1287,6 @@ 

  %{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes}

  %{pylibdir}/distutils/README

  %{pylibdir}/distutils/command

- %exclude %{pylibdir}/distutils/command/wininst-*.exe

  

  %dir %{pylibdir}/email/

  %dir %{pylibdir}/email/__pycache__/
@@ -1353,7 +1356,6 @@ 

  %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile

  %exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}

  %endif

- %{pylibdir}/distutils/command/wininst-*.exe

  %{_includedir}/python%{LDVERSION_optimized}/*.h

  %doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit

  
@@ -1575,6 +1577,9 @@ 

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

  

  %changelog

+ * Fri Dec 07 2018 Miro Hrončok <mhroncok@redhat.com> - 3.7.1-5

+ - Make sure we don't ship any exe files (not needed an prebuilt)

+ 

  * Wed Nov 21 2018 Miro Hrončok <mhroncok@redhat.com> - 3.7.1-4

  - Make sure the entire test.support module is in python3-libs (#1651245)

  

Such files are only used to create Microsoft Windows installers
and that functionality is broken on Linux anyway.

We can keep the exe files in SRPM, as they are free software as
confirmed by the Python Software Foundation:

Hello,

Shipping and distributing these files is ok.

These files are stubs, used as the executable part of a self-unzipping
executable and showing an "installer window" to the user.
They are original to Python and, while they call win32 functions,
they don't have Windows SDK code in them.
The source is at: PC/bdist_wininst/install.c

The binaries are included so that anyone creating a bdist_wininst
distribution (mostly deprecated, actually) can do so, even when
cross-compiling.

Thanks,
Van (Lindberg)

(Untested. Wait for the CI.)

Would it be possible to a reference (URL) to a discussion about the license of these files? Maybe just add the bugzilla number.

LGTM.

"python3 setup.py bdist_wininst" already fails with "LookupError: unknown encoding: mbcs", so it's fine to also remove .exe files.

Have you tested the build? is the error the same or different?

As for license, this quotes Python Software Foundation. As a reference, I consider it OK.

rebased onto db803fd226ef35a068c0d14f462917cd9ff8cdf3

6 years ago

Metadata Update from @churchyard:
- Pull-request tagged with: bugfix

6 years ago

Metadata Update from @churchyard:
- Pull-request tagged with: review needed

6 years ago

@vstinner Have you tested the build? is the error the same or different?

Behavior prior to this patch:

$ python3 setup.py bdist_wininst
...
Traceback (most recent call last):
  File "setup.py", line 32, in <module>
    'Topic :: Software Development :: Testing',
  File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.7/site-packages/setuptools/command/bdist_wininst.py", line 19, in run
    orig.bdist_wininst.run(self)
  File "/usr/lib64/python3.7/distutils/command/bdist_wininst.py", line 179, in run
    self.create_exe(arcname, fullname, self.bitmap)
  File "/usr/lib64/python3.7/distutils/command/bdist_wininst.py", line 262, in create_exe
    cfgdata = cfgdata.encode("mbcs")
LookupError: unknown encoding: mbcs

Behavior with patch:

# python3 setup.py bdist_wininst
...
creating dist
error: [Errno 2] No such file or directory: '/usr/lib64/python3.7/distutils/command/wininst-14.0.exe'

I don't think anyone will care. Ship it.

Metadata Update from @churchyard:
- Pull-request untagged with: review needed
- Pull-request tagged with: rebase and merge

6 years ago

Metadata Update from @churchyard:
- Request assigned

6 years ago

rebased onto 1092d47

6 years ago

Pull-Request has been merged by churchyard

6 years ago

test_bdist_wininst is failing and we should patch it mark skipped.