[issue15184] Test failure in test_sysconfig_module

Ned Deily report at bugs.python.org
Tue Jun 26 08:19:34 CEST 2012


Ned Deily <nad at acm.org> added the comment:

This test failure points at a few issues:

 - The CFLAGS modification should only be taking place on OS X systems.  AFAICT, all of that code is protected by sys.platform checks.  One possible culprit, though, might be distutils test test_unixccompiler which attempts to test various platforms by mocking sys.platform.  It so happens that "darwin" is the first platform it tests and, while the test setup and teardown does preserve and restore the get_config_var function in distutils.sysconfig, it doesn't preserve the module global _config_vars which distutils.sysconfig uses to cache the results of parsing the Makefile.  I wonder what happens if test_unixccompiler happens to be the first caller of distutils.sys_config_vars().  I think it will get invoked with sys.platform = 'darwin' and trigger the customization code on what becomes the cached copy for remaining tests.  I'm attaching a patch to preserve and restore the cached values as well.  Georg, I'd appreciate it if you could try this on your system.

 - More importantly, the test failure shows that the code we added for Xcode 4 support in Issue13590 only addressed distutils.sysconfig and not the identical code in standalone sysconfig.  With the removal of packaging in 3.3, AFAIK there now is nothing in the standard library that should depend on this at the moment but it will undoubtedly be an issue for distutil2 and future packaging features.  We had discussed dealing with this by factoring out the common customization code into a separate module to avoid DRY but I didn't get that done.  I'm attaching a first rough patch that does that; it is only very lightly tested and so should not be a candidate for 3.3.0b1.

I recommend the following steps:
  1. For 3.3.0b1, either ignore the test failure or add a skip for 3.3.0b1.  (This failure will also likely show up if OS X installer users attempt to run the tests.)
  2. Resolve the test failure on non-OS X platforms.
  3. Test and review the refactoring patch and plan to push it for 3.3.0rc1.
  4. Post 3.3.0, regardless of the outcome of the proposed packaging PEPs, finally replace distutils.sysconfig with sysconfig.  Attempting to continue to maintain both of them is just asking for more trouble.

----------
assignee:  -> ned.deily
components: +Distutils, Macintosh -Tests
keywords: +patch
nosy: +ronaldoussoren, tarek
priority: high -> deferred blocker
stage:  -> patch review
Added file: http://bugs.python.org/file26163/issue15184_preserve_config_vars.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15184>
_______________________________________


More information about the Python-bugs-list mailing list