New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distutils MSVC doesn't create manifest file #48681
Comments
This is my first time submitting an issue; sorry if I am doing this The reason why is that distutils only passes link.exe the My solution was to add this line to distutils/msvc9compiler.py: ld_args.append('/MANIFEST') Right beneath the existing line: ld_args.append('/MANIFESTFILE:' + temp_manifest) Hope that helps |
Since bpo-4120, the compilation tools precisely chose to *not* embed |
On 2008-11-25 21:16, David Schnur wrote:
I'm not sure whether that's necessary. We are building pyOpenSSL
and even though the command line does not include the /MANIFEST OTOH, it probably doesn't hurt adding the switch :-) |
This is why we don't see the problem: http://msdn.microsoft.com/en-us/library/f2c0w594.aspx """ So it appears that you must have disabled this default somehow. |
I looked at this some more (I'm not super familiar with the use of So I suppose the issue is that distutils is trying to embed the manifest |
Closing it as "invalid" then. |
I'd like to point out that on some configurations (at least mine), you |
On 2009-02-17 20:22, Pavel Repin wrote:
Are you sure ? We've had such a request before and the reason for MSVC not generating FWIW: distutils generates those files just fine for me. Then again, it probably doesn't hurt just adding the option. |
Hi Marc,I am pretty sure it helped on my particular configuration. Besides, if you just ignore the obscure blurb about /MANIFEST option being I'm going to do one more experiment with a different machine, this time it On Tue, Feb 17, 2009 at 2:08 PM, Marc-Andre Lemburg
|
Marc-Andre, The error goes away when I hack msvc9compiler.py to have: See patch attached to the bug. On Tue, Feb 17, 2009 at 2:34 PM, Pavel Repin <report@bugs.python.org> wrote:
|
Hi All, I just built mysql-python against CPython2.7 MSVC2008 Express Edition and Server 2003 R2. All were freshly built on a clean Server 2003 install. This exact issue occurred building with pip 0.8.1 on top of distribute 0.6.14: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe -nologo -manifest build\temp.win32-2.7\Release\_mysql.pyd.manifest -outputresource:build\lib.win32-2.7\_mysql.pyd;2 build\temp.win32-2.7\Release\_mysql.pyd.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. error: command 'mt.exe' failed with exit status 31 ---------------------------------------- Pavel's patch fixes my build. Does this patch break something else? I can reproduce this on 2.7 and 2.6.6. |
Hi David, since both you and Pavel are building mysql-python and using Adding the switch per default will probably not cause much harm, Thanks,Marc-Andre Lemburg ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 |
Hi Marc, Well, I fried my original server install trying to trace this. My new fresh install can still reproduce the problem with mysql-python, but I can't recreate the issue with PyOpenSSL anymore. Grabbing packages at random from PyPi hasn't given me a single issue so far, so I'm going to say this is an issue with mysql-python only and redirect my efforts there. Thanks for your help, |
Also happening with python2.6 and building pyzmq-2.0.10 using easy_install. dschnur's suggestion fixes it. |
And also with an extension module I'm trying to build with Python-2.7.1 AMD64. Schnur's suggestion fixes it. |
Another workaround is by adding the linker argument to Extension() as extra_link_args: extra_link_args=['/MANIFEST'] |
I encountered the same problem while compiling the psutil package. I used Python 3.2.2 that I compiled myself using Visual Studio 2010 SP1 in Debug mode by following the PCBuild/readme.txt documentation. I could not compile psutil until I added in setup.py: I have not tried to compile any other C extension yet, but this is not mysql-python and I am not using setuptools either. |
I got this problem again this morning while compiling pywin32. This problem is not specific to me, anyone using Visual Studio 2010 to compile Python is experiencing the same issue: http://nukeit.org/compile-python-2-7-packages-with-visual-studio-2010-express/ Could you please reopen the issue or should I open a new one? |
I haven't commented since opening this issue, but I've been following along. Regarding Marc-Andre's latest comment, I think whether to embed a manifest or not is a separate issue. The current behavior is to embed a manifest, and so it should ensure that the file is created. As others have said, given that distutils expects /MANIFEST implicitly, there seems no harm in adding it explicitly. I agree that this issue should be re-opened, since it's apparently not restricted just to my case of using /MT. |
Building py2exe with VS2010 I had this same issue and the /MANIFEST fix mentioned here fixed the problem. I also think that this issue should be re-opened. |
My experience is that for VS2008 at least, the /MANIFESTFILE: option seems to be ignored if there is nothing to put in the manifest, and this tends to be true if you use a static CRT instead of the DLL based one (ie, if you use /MT) bpo-7833 has a patch designed to both (a) remove the manifest entirely if the only assembly reference is to the CRT and (b) give the setup.py author finer control over this behaviour. |
Corey, Sebastian: VS 2010 is not supported. So failure to work correctly is not a bug in Python. |
I need Python compiled with Visual Studio 2010 because I use it embedded in an application compiled with Visual Studio 2010. I am pretty sure there are quite a lot of people who would like to compile Python with this compiler. I have compiled Python 2.7.2 with this version of the compiler as well as many extensions, but this required to patch quite a few things. I also intend to setup a buildbot running Python tests using this compiler. If I can provide the patch to support Visual Studio 2010 and setup a builtbot that will pass most of the tests, could we get Python supported on this platform? I intended to announce all of that on python-dev soon, but the buildbot is not quite ready yet. |
Yes. Even if VS2008 remains the preferred compiler to build Python, and the only one used for official binary distributions, there are already project files for VS8 and even VC6 (in PC/VS8.0 and PC/VC6). They are not guaranteed to always work, but are updated from time to time by volunteers. |
I don't think a buildbot will be necessary - like the earlier compilers, they may have basic support but they don't all get buildbot support. The "problem" isn't the lack of ability/will to get things working with VS2010 - it is more the lack of incentive to add another compiler to the mix. OTOH, seeing it is nearly 2012, a case could certainly be made to move 3.3 to that compiler :) I'm interested to see the patch required to get it working - almost every other upgrade has been almost handled completely by the VS upgrade process so it would be good to see how different this one is - so please CC me on any new issue you create. I'm also interested to know how mixing the CRTs is causing problems - are you using the very few Python APIs impacted by such mixing, or is the issue more about needing to redistribute both, or something else entirely? |
Amaury: Mark: I added you to bpo-13210 and I will post the patches there soon. |
FYI. Windows 8.1, Visual Studio 2010 SP1 Pro just installed, Python 3.3.3; a random extension did this as a 'test' in its setup.py: compiler = distutils.ccompiler.new_compiler()
if not compiler.has_function('rand', includes = ['stdlib.h']):
... And this failed. Further investigation turned brought me here, and adding /MANIFEST to my ld_args as this patch does fixed it. |
Using Visual C++ 10.0 SP1 Express to build extensions for python 3.4 (64bit) I also had to modify distutils/msvc9compiler.py in the described way |
There are a lot of messages on this issue considering it was closed as invalid on 25th November 2008 :) |
I think this is a frank bug for Pythons that use MSVC 10+ by default (3.3, 3.4 for example). The lack of the /MANIFEST flag breaks the distutils.ccompiler.CCompiler.link_executable command - see attached setup.py example. The example gives the error "main.exe.exe.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified." We (http://nipy.org/dipy) ran into this because we were innocently using compilation of a 'main.c' file to an executable to check link flags. |
Should this issue be reopened or not? |
It shouldn't be necessary for VS 2010 and later, and the |
And I suspect Matthew Brett's issue is that link_executable() does not expect an extension ('.exe') to be provided. |
Just to be clear, I ran into this exact issue recently in VS2010 professional as I indicated earlier. I don't know about what should or should not be needed, but the solution in the original comment fixed it exactly for me. |
Steve - did you try my 'setup.py' example; it's standalone, as in This is specifically VS 2010. It doesn't make any difference for me if I specify an extension or not, so I don't think that is the problem. |
Sorry, I was focused on the fact that you don't need a manifest with VS 2010 and not that distutils was forcing you to have one when building an executable. Either adding '/MANIFEST' as in paxan's patch (according to http://msdn.microsoft.com/en-us/library/fft52235.aspx, you need to specify it if you specify '/MANIFESTNAME') or removing the MANIFESTNAME specification entirely should be fine for 3.4 and later. I assume since nobody has complained about 2.7 that everything works fine there? |
I think the argument previously was that VS 2010 was not the default compiler for Python 2.7, and so this problem was not important, but I'm happy to be corrected. I haven't tried building extensions for Python 2.7 with VS 2010 but I guess the problem will be the same. Can you see a problem with adding the /MANIFEST flag to distutils/msvc9compiler.py as a fix for this problem? |
/MANIFEST is probably assumed on VC9 since the CRT required it, but that was probably changed for VC10 without updating the documentation fully. Frankly I'd rather remove the MANIFESTFILE property added by distutils, since it doesn't add anything of value (on my test machine, it only requests an execution level of asInvoker, which is the default). That way people can include useful manifests with their source if necessary and provide both the /MANIFEST and /MANIFESTFILE flags themselves, and we reduce the amount of code in the stdlib. |
Here with python 2.7.13 and Visual Studio 2013, I get hit by the problem and it looks like link.exe needs the /MANIFEST keyword. Voting to get it fixed! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: