This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: build_ext fails on VS8.0
Type: behavior Stage: resolved
Components: Distutils, Distutils2, Windows Versions: Python 3.1, Python 3.2, Python 2.7, 3rd party
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: amaury.forgeotdarc, christian.heimes, eric.araujo, loewis, ocean-city, r.david.murray, tarek
Priority: high Keywords: easy, patch

Created on 2010-08-10 14:35 by ocean-city, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k_distutils_build_ext_on_VS8.patch ocean-city, 2010-08-10 14:35 review
Messages (11)
msg113541 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-08-10 14:35
test_build_ext fails on VS8.0.
 
======================================================================
ERROR: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "e:\python-dev\release26-maint\lib\distutils\tests\test_build_ext.py", li
ne 58, in test_build_ext
    cmd.run()
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
340, in run
    self.build_extensions()
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
449, in build_extensions
    self.build_extension(ext)
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
531, in build_extension
    target_lang=language)
  File "e:\python-dev\release26-maint\lib\distutils\ccompiler.py", line 769, in
link_shared_object
    extra_preargs, extra_postargs, build_temp, target_lang)
  File "e:\python-dev\release26-maint\lib\distutils\msvc9compiler.py", line 648,
 in link
    raise LinkError(msg)
LinkError: command '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.exe"
' failed with exit status 1104
msg113542 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-08-10 14:36
Is *release blocker* too strong?
msg113585 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-11 03:31
Thank you for the report. “release blocker” is a bit strong here, usually it’s set by release managers themselves or by people having their agreement (unless I’m mistaken).

Does “python -m distutils.test.test_build_ext” pass? Do yo have tested your bug with recent 2.7 and 3.2 versions?

I don’t know windows so I don’t really understand the bug. Does this link program have documentation that explains what the exit status mean? I also can’t see how your patch solves the problem. Paths in the traceback don’t match what’s removed in your diff, so I suspect this is a bug with your code (happens to the best! :), or a weird thing like filesystem issues. If test_build_ext doesn’t fail, we’ll see about reproducing the bug.
msg113586 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-08-11 04:40
Yes, I can confirm the same bug on Python3.2 and others. The reason is LIBPATH includes not "PC/VS8.0" but "PC/VS8.0/win32release" which doesn't exist. I hope attached patch will fix this issue.
msg113587 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-11 04:52
Digging into the history of build_ext, I see that you committed a fix for VC 6 two years ago, so I think you’re more knowledgeable than me. I’m adding a Windows expert for confirmation.

Going back to 2007 finds the origin of the line you’re editing:
“[svn r59290] Applied my patch #1455 with some extra fixes for VS 2005
The new msvc9compiler module supports VS 2005 and VS 2008.” The bug log specifies that VS 2008 is tested and works, so I’m not sure your bug is distutils’s fault. Could it be that win32release does not exist in recent releases? (I don’t actually know if VS has multiple releases for one version.)

Does test_build_ext pass?
msg113589 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-08-11 05:13
> Does test_build_ext pass?

Here are results. py26 is calling python_d.exe built with VS8.0.
I installed VS8.0 very recently, so I'm not familier with historical
reason. ;-)

# Translate error message into English...
# LINK : fatal error LNK1104: cannot open 'python26_d.lib'

//////////////////////////////////////////////////////
// Before applying patch

E:\python-dev\release26-maint>py26 -m distutils.tests.test_build_ext
test_build_ext (__main__.BuildExtTestCase) ... xxmodule.c
LINK : fatal error LNK1104: ファイル 'python26_d.lib' を開くことができません。
ERROR
test_build_ext_inplace (__main__.BuildExtTestCase) ... ok
test_build_ext_path_cross_platform (__main__.BuildExtTestCase) ... ok
test_build_ext_path_with_os_sep (__main__.BuildExtTestCase) ... ok
test_check_extensions_list (__main__.BuildExtTestCase) ... ok
test_compiler_option (__main__.BuildExtTestCase) ... ok
test_ext_fullpath (__main__.BuildExtTestCase) ... ok
test_finalize_options (__main__.BuildExtTestCase) ... ok
test_get_outputs (__main__.BuildExtTestCase) ... foo.c
   ライブラリ c:\docume~1\ocean\locals~1\temp\pythontest_mq7y1g\tempt\docume~1\o
cean\locals~1\temp\tmpt9b30o\foo_d.lib とオブジェクト c:\docume~1\ocean\locals~1
\temp\pythontest_mq7y1g\tempt\docume~1\ocean\locals~1\temp\tmpt9b30o\foo_d.exp
を作成中
foo.c
   ライブラリ c:\docume~1\ocean\locals~1\temp\pythontest_mq7y1g\tempt\docume~1\o
cean\locals~1\temp\tmpt9b30o\foo_d.lib とオブジェクト c:\docume~1\ocean\locals~1
\temp\pythontest_mq7y1g\tempt\docume~1\ocean\locals~1\temp\tmpt9b30o\foo_d.exp
を作成中
ok
test_get_source_files (__main__.BuildExtTestCase) ... ok
test_setuptools_compat (__main__.BuildExtTestCase) ... ok
test_solaris_enable_shared (__main__.BuildExtTestCase) ... ok

======================================================================
ERROR: test_build_ext (__main__.BuildExtTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "e:\python-dev\release26-maint\lib\distutils\tests\test_build_ext.py", li
ne 58, in test_build_ext
    cmd.run()
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
340, in run
    self.build_extensions()
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
449, in build_extensions
    self.build_extension(ext)
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
531, in build_extension
    target_lang=language)
  File "e:\python-dev\release26-maint\lib\distutils\ccompiler.py", line 769, in
link_shared_object
    extra_preargs, extra_postargs, build_temp, target_lang)
  File "e:\python-dev\release26-maint\lib\distutils\msvc9compiler.py", line 647,
 in link
    raise LinkError(msg)
LinkError: command '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.exe"
' failed with exit status 1104

----------------------------------------------------------------------
Ran 12 tests in 31.005s

FAILED (errors=1)
Traceback (most recent call last):
  File "e:\python-dev\release26-maint\lib\runpy.py", line 122, in _run_module_as
_main
    "__main__", fname, loader, pkg_name)
  File "e:\python-dev\release26-maint\lib\runpy.py", line 34, in _run_code
    exec code in run_globals
  File "e:\python-dev\release26-maint\lib\distutils\tests\test_build_ext.py", li
ne 407, in <module>
    test_support.run_unittest(test_suite())
  File "e:\python-dev\release26-maint\lib\test\test_support.py", line 820, in ru
n_unittest
    _run_suite(suite)
  File "e:\python-dev\release26-maint\lib\test\test_support.py", line 803, in _r
un_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "e:\python-dev\release26-maint\lib\distutils\tests\test_build_ext.py", li
ne 58, in test_build_ext
    cmd.run()
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
340, in run
    self.build_extensions()
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
449, in build_extensions
    self.build_extension(ext)
  File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line
531, in build_extension
    target_lang=language)
  File "e:\python-dev\release26-maint\lib\distutils\ccompiler.py", line 769, in
link_shared_object
    extra_preargs, extra_postargs, build_temp, target_lang)
  File "e:\python-dev\release26-maint\lib\distutils\msvc9compiler.py", line 647,
 in link
    raise LinkError(msg)
LinkError: command '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.exe"
' failed with exit status 1104

[34753 refs]

//////////////////////////////////////////////////////
// After applying patch

E:\python-dev\release26-maint>py26 -m distutils.tests.test_build_ext
test_build_ext (__main__.BuildExtTestCase) ... xxmodule.c
   ライブラリ c:\docume~1\ocean\locals~1\temp\pythontest_picqhq\Debug\docume~1\o
cean\locals~1\temp\pythontest_picqhq\xx_d.lib とオブジェクト c:\docume~1\ocean\l
ocals~1\temp\pythontest_picqhq\Debug\docume~1\ocean\locals~1\temp\pythontest_pic
qhq\xx_d.exp を作成中
ok
test_build_ext_inplace (__main__.BuildExtTestCase) ... ok
test_build_ext_path_cross_platform (__main__.BuildExtTestCase) ... ok
test_build_ext_path_with_os_sep (__main__.BuildExtTestCase) ... ok
test_check_extensions_list (__main__.BuildExtTestCase) ... ok
test_compiler_option (__main__.BuildExtTestCase) ... ok
test_ext_fullpath (__main__.BuildExtTestCase) ... ok
test_finalize_options (__main__.BuildExtTestCase) ... ok
test_get_outputs (__main__.BuildExtTestCase) ... foo.c
   ライブラリ c:\docume~1\ocean\locals~1\temp\pythontest_rm2eak\tempt\docume~1\o
cean\locals~1\temp\tmpg_ea28\foo_d.lib とオブジェクト c:\docume~1\ocean\locals~1
\temp\pythontest_rm2eak\tempt\docume~1\ocean\locals~1\temp\tmpg_ea28\foo_d.exp
を作成中
foo.c
   ライブラリ c:\docume~1\ocean\locals~1\temp\pythontest_rm2eak\tempt\docume~1\o
cean\locals~1\temp\tmpg_ea28\foo_d.lib とオブジェクト c:\docume~1\ocean\locals~1
\temp\pythontest_rm2eak\tempt\docume~1\ocean\locals~1\temp\tmpg_ea28\foo_d.exp
を作成中
ok
test_get_source_files (__main__.BuildExtTestCase) ... ok
test_setuptools_compat (__main__.BuildExtTestCase) ... ok
test_solaris_enable_shared (__main__.BuildExtTestCase) ... ok

----------------------------------------------------------------------
Ran 12 tests in 38.636s

OK
[34825 refs]
msg113799 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-08-13 17:32
Éric, 'release blocker' policy depends on the release manager :)  Barry, for example, likes people to set release blocker on issues they want him to make sure he looks at before the release.  The release manager can always knock it down.  As can other developers if they judge it isn't really a release blocker (unless the RM set it or it was set specifically to get the RMs attention).

When you reset the priority on this one, though, you didn't give it a new priority.  I'm setting it to normal, since the bug report (at the moment at least) is only about a test failure.  If it represents a bug in the ability to build extensions on Windows with VS8, you could raise the priority.
msg123540 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-12-07 10:32
Won't this go into python3.2?
msg123541 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-12-07 11:13
I happen to have the same change in my workspace. Please apply this patch, it fixes the test suite when compiled with VS8.0.
msg123544 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-07 12:24
Thanks for the ping and the confirmation that it works.  Will check in shortly.
msg124071 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-15 21:17
Fixed in [4f2da1ec00a2] (distutils2), r87280 (3.2), r87201 (3.1), r87282 (2.7).  Thanks to you both.
History
Date User Action Args
2022-04-11 14:57:05adminsetgithub: 53767
2010-12-15 21:17:26eric.araujosetstatus: pending -> closed
nosy: loewis, amaury.forgeotdarc, ocean-city, christian.heimes, tarek, eric.araujo, r.david.murray
messages: + msg124071

resolution: accepted -> fixed
stage: resolved
2010-12-07 12:24:19eric.araujosetstatus: open -> pending

versions: + 3rd party, - Python 2.6
nosy: loewis, amaury.forgeotdarc, ocean-city, christian.heimes, tarek, eric.araujo, r.david.murray
messages: + msg123544
priority: normal -> high
components: + Distutils2
2010-12-07 11:13:40amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg123541
2010-12-07 10:32:36ocean-citysetmessages: + msg123540
2010-08-13 17:32:58r.david.murraysetpriority: normal
nosy: + r.david.murray
messages: + msg113799

2010-08-11 21:48:08eric.araujosetnosy: + christian.heimes
2010-08-11 10:27:08pitrousetassignee: tarek -> eric.araujo
resolution: accepted
2010-08-11 05:13:58ocean-citysetmessages: + msg113589
2010-08-11 04:52:22eric.araujosetnosy: + loewis
messages: + msg113587
2010-08-11 04:40:43ocean-citysetmessages: + msg113586
2010-08-11 03:31:56eric.araujosetpriority: release blocker -> (no value)

nosy: + eric.araujo
messages: + msg113585

type: behavior
stage: patch review -> (no value)
2010-08-10 14:36:23ocean-citysetmessages: + msg113542
2010-08-10 14:35:33ocean-citycreate