Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue21311

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Fix compiler detection when brew's ccache is installed on Mac OS X
Type:Stage:resolved
Components:DistutilsVersions:Python 3.4, Python 3.5, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: ned.deilyNosy List: dstufft, eric.araujo, jszakmeister, ned.deily, python-dev
Priority:normalKeywords:patch

Created on2014-04-19 13:21 byjszakmeister, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
fix-osx-llvm-detection-with-ccache.patchjszakmeister,2014-04-19 13:21First fix: non-empty check before examining output.review
alt-fix-osx-llvm-detection-with-ccache.patchjszakmeister,2014-04-19 13:21Alternate fix: return empty string from _read_outputreview
Messages (5)
msg216856 -(view)Author: John Szakmeister (jszakmeister)*Date: 2014-04-19 13:21
It's pretty typical for ccache packages to install symlinks for compilers that may not be present on the system, such as Homebrew's ccache package.  Unfortunately, the _osx_support.py file is mislead by the presence of the symlink and ends up backtracing.This issue is present in 2.7 and onwards.  I'm attaching two possible fixes for the problem, both created against 2.7.  The issue is that the symlink in detected, but _read_output() returns None, which then fails when the output is examined (if 'str' in None...).  The first patch does a simple non-empty check.  The alternate version makes _read_output() return an empty string instead of None.
msg216857 -(view)Author: John Szakmeister (jszakmeister)*Date: 2014-04-19 13:21
Here's the alternate fix.
msg216877 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2014-04-19 20:27
New changesete3217efa6edd by Ned Deily in branch '2.7':Issue#21311: Avoid exception in _osx_support with non-standard compilerhttp://hg.python.org/cpython/rev/e3217efa6eddNew changeset3d1578c705c9 by Ned Deily in branch '3.4':Issue#21311: Avoid exception in _osx_support with non-standard compilerhttp://hg.python.org/cpython/rev/3d1578c705c9New changeset2a4401109672 by Ned Deily in branch 'default':Issue#21311: merge with 3.4http://hg.python.org/cpython/rev/2a4401109672
msg216878 -(view)Author: Ned Deily (ned.deily)*(Python committer)Date: 2014-04-19 20:35
Thanks for the report and the patches.  I am not sure exactly what problem using ccache is causing but it is clear that, if for whatever reason the call to _read_output fails and returns None, the 'llvm-gcc' test will fail so that test should be fixed as suggested in your first patch which I've applied for release in 2.7.7, 3.4.1, and 3.5.0.
msg216884 -(view)Author: John Szakmeister (jszakmeister)*Date: 2014-04-19 22:27
Thank you Ned!  The issue is that you can create symlinks to ccache to and put them on your path.  Distros do this for you now, but most create symlinks for a bunch of compilers... including ones that may not be installed.  So the presence of the name ('gcc', for instance) doesn't mean that the compiler is actually installed.  It could be a symlink to the ccache binary and running it could fail.  I hope that makes a little more sense.Thanks again for applying the patch!
History
DateUserActionArgs
2022-04-11 14:58:02adminsetgithub: 65510
2014-04-19 22:27:12jszakmeistersetmessages: +msg216884
2014-04-19 20:35:17ned.deilysetstatus: open -> closed
versions: - Python 3.1, Python 3.2, Python 3.3
messages: +msg216878

resolution: fixed
stage: resolved
2014-04-19 20:27:46python-devsetnosy: +python-dev
messages: +msg216877
2014-04-19 19:02:14ned.deilysetassignee:ned.deily

nosy: +ned.deily
2014-04-19 13:21:40jszakmeistersetfiles: +alt-fix-osx-llvm-detection-with-ccache.patch

messages: +msg216857
2014-04-19 13:21:02jszakmeistercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp