Bug 252294 - devel/py-colorama: build broken with python36
Summary: devel/py-colorama: build broken with python36
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Kai Knoblich
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-12-30 22:36 UTC by Guangyuan Yang
Modified: 2020-12-31 16:38 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
py-colorama-fix-with-python36.patch (374 bytes, patch)
2020-12-31 00:34 UTC, Kai Knoblich
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guangyuan Yang freebsd_committer 2020-12-30 22:36:08 UTC
The Update breaks the build with python36:

===>   Returning to build of py36-colorama-0.4.4
===========================================================================
=======================<phase: lib-depends    >============================
===========================================================================
=======================<phase: configure      >============================
===>  Configuring for py36-colorama-0.4.4
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 36, in <module>
    long_description=read_file('README.rst'),
  File "setup.py", line 19, in read_file
    return fp.read()
  File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 852: ordinal not in range(128)
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/py-colorama
=>> Cleaning up wrkdir
===>  Cleaning for py36-colorama-0.4.4
build of devel/py-colorama@py36 | py36-colorama-0.4.4 ended at Mon Nov 23 01:04:02 CET 2020
build time: 00:00:03
!!! build failure encountered !!!

This is due to an upstream (encoding) bug in the setup.py. A PR is open: https://github.com/tartley/colorama/issues/291 and the issue will be fixed by the next version.
Comment 1 Guangyuan Yang freebsd_committer 2020-12-30 22:36:52 UTC
Reported by Dany on PR #251240.
Comment 2 Kai Knoblich freebsd_committer 2020-12-31 00:34:26 UTC
Created attachment 221117 [details]
py-colorama-fix-with-python36.patch

(In reply to Guangyuan Yang from comment #0)

Those errors appears on some Python ports when they're built with Python 3.6 and the locale isn't UTF-8.

Attached is a patch that remedies the build issues with Python 3.6.

QA:
~~~
- poudriere -> OK (13.0-CURRENT@r368820 for py36, py37, py38 and py39)
Comment 3 Guangyuan Yang freebsd_committer 2020-12-31 02:15:44 UTC
(In reply to Kai Knoblich from comment #2)

I would personally prefer to patch setup.py than patching Makefile, since this is an issue that should be handled by the application, not us. Please see: https://github.com/tartley/colorama/pull/294/files that haven't been merged yet.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2020-12-31 04:46:19 UTC
Comment on attachment 221117 [details]
py-colorama-fix-with-python36.patch

@Kai This change is:

Approved by: portmgr (blanket: build/run bugfix, just-fix-it)

And doesn't require maintainer approval

Having said that, I'd recomment backporting the upstream change, which is the correct and permanent resolution, not dependent on the end user environment
Comment 5 Guangyuan Yang freebsd_committer 2020-12-31 04:59:41 UTC
(In reply to Kubilay Kocak from comment #4)

What I am simply suggesting here is that, patching the setup.py might be a better fix here, and it is as simple as the proposed patch. But hey, I am not yet a ports committer, so if patching the Makefile is a batch fix for multiple ports, please by all means go ahead. :)
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2020-12-31 06:43:15 UTC
(In reply to Guangyuan Yang from comment #5)

The end of comment 4 suggested the same. The blanket approval applies to any change that fixes a build/run bug, whether Makefile or setup.py
Comment 7 commit-hook freebsd_committer 2020-12-31 12:03:49 UTC
A commit references this bug:

Author: kai
Date: Thu Dec 31 12:03:03 UTC 2020
New revision: 559722
URL: https://svnweb.freebsd.org/changeset/ports/559722

Log:
  devel/py-colorama: Fix build with Python 3.6

  * Backport PR #294 [1] from upstream repository to enable default UTF-8
    encoding in setup.py which fixes the build issue with Python 3.6.

  PR:		252294, 251240 [2]
  Submitted by:	John W. O'Brien [1]
  Reported by:	Dani <i.dani@outlook.com> [2]
  Reviewed by:	koobs, ygy
  Approved by:	portmgr (blanket: build fix)

Changes:
  head/devel/py-colorama/files/
  head/devel/py-colorama/files/patch-setup.py
Comment 8 Kai Knoblich freebsd_committer 2020-12-31 12:19:21 UTC
Committed, thank you koobs@ and ygy@ for your feedback.

I backported PR #294 as workaround for the build issue with Python 3.6 as suggested in comment #3 and comment #4. The patch can then probably be deleted with the next release of devel/py-colorama.

@ygy: I'll leave this bug open for you for in case if you want to wait until upstream has merged PR #294.
Comment 9 Guangyuan Yang freebsd_committer 2020-12-31 16:38:28 UTC
(In reply to Kai Knoblich from comment #8)

Kai, thanks for committing the fix.

I think I will close this now since the described issue has already been fixed. I will make sure to remove the patch on the next update if the upstream has merged that PR.

Happy new year!