From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m0.truegem.net (m0.truegem.net [69.55.228.47]) by sourceware.org (Postfix) with ESMTPS id 7B67E3857827 for ; Sat, 12 Dec 2020 06:33:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7B67E3857827 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maxrnd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=mark@maxrnd.com Received: from localhost (mark@localhost) by m0.truegem.net (8.12.11/8.12.11) with ESMTP id 0BC6XZkt097462 for ; Fri, 11 Dec 2020 22:33:35 -0800 (PST) (envelope-from mark@maxrnd.com) X-Authentication-Warning: m0.truegem.net: mark owned process doing -bs Date: Fri, 11 Dec 2020 22:33:35 -0800 (PST) From: Mark Geisert X-X-Sender: mark@m0.truegem.net To: Cygwin-Apps Subject: Re: Failure during build of Python 3.8 via cygport In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2020 06:33:42 -0000 [replying to myself again...] A similar problem happens when building 3.6 and 3.7 too. Details at end. On Wed, 9 Dec 2020, Mark Geisert wrote: > Hi Marco, > I was building Python locally so I can later submit a patch against it. It > appears the local python.exe was built successfully, but a later step failed > with: > >> ./python.exe -E -S -m sysconfig --generate-posix-vars ;\ >> if test $? -ne 0 ; then \ >> echo "generate-posix-vars failed" ; \ >> rm -f ./pybuilddir.txt ; \ >> exit 1 ; \ >> fi >> Traceback (most recent call last): >> File >> "/usr/src/python38-3.8.3-1.src/python38-3.8.3-1.x86_64/src/Python-3.8.3/Lib/runpy.py", >> line 194, in _run_module_as_main >> return _run_code(code, main_globals, None, >> File >> "/usr/src/python38-3.8.3-1.src/python38-3.8.3-1.x86_64/src/Python-3.8.3/Lib/runpy.py", >> line 87, in _run_code >> exec(code, run_globals) >> File >> "/usr/src/python38-3.8.3-1.src/python38-3.8.3-1.x86_64/src/Python-3.8.3/Lib/sysconfig.py", >> line 711, in >> _main() >> File >> "/usr/src/python38-3.8.3-1.src/python38-3.8.3-1.x86_64/src/Python-3.8.3/Lib/sysconfig.py", >> line 699, in _main >> _generate_posix_vars() >> File >> "/usr/src/python38-3.8.3-1.src/python38-3.8.3-1.x86_64/src/Python-3.8.3/Lib/sysconfig.py", >> line 416, in _generate_posix_vars >> f.write(pybuilddir) >> UnicodeEncodeError: 'utf-8' codec can't encode characters in position >> 17-19: surrogates not allowed >> generate-posix-vars failed >> make: *** [Makefile:592: pybuilddir.txt] Error 1 >> *** ERROR: make failed > > I've seen UnicodeEncodeError before and searched and found how to fix it.. > but hitting the issue while building Python itself seems more fraught. Is > this a known issue with known fix? This seems to be a problem setting up a platform-specific build directory. The sysconfig.py script wants to use "lib." + platform + pythonversion but the platform string somehow gets corrupted into non-utf8 bytes. For instance, building Python 3.8 comes up with: lib.cygwin-\365\377\377o-\377o-3.8 as the directory name. Broken, but could work. The build failure happens because the script tries to write this directory name into a file but it's not a valid utf8 string. The directory name should have been: lib.cygwin-3.2.0-x86_64-3.8 I'm trying to debug further, learning Python as I go. Whee.... ..mark