Closed Bug 371359 Opened 18 years ago Closed 17 years ago

MozillaBuild XULRunner + python with MSVC8 Express missing msvcr80.dll and msvcp80.dll

Categories

(Firefox Build System :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: steve, Unassigned)

References

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1 Build Identifier: When building XULRunner with the python extension under MSVC8 Express dist/bin/xpcom.dll has dependencies on MSVCR80.dll, MSVCP80.dll and DWMAPI.dll. These are not included in MSVC8 Express or PSDK bin folders but on the path by MozillaBuild (very strange in the case of MSVCR80.dll, the main runtime) Even if you grab these DLLS from bin/win64 or WinSxS into system32 there are delay-load import errors, e.g. _malloc_crt or R6034 indicating an mismatch or side-by-side manifest issue somewhere. I also tried the versions from winSxS and dll_files.com. Reproducible: Always Steps to Reproduce: 1.build with MozillaBuild and .mozconfig mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-xulrunner mk_add_options MOZ_CO_PROJECT=xulrunner ac_add_options --enable-application=xulrunner ac_add_options --disable-javaxpcom ac_add_options --enable-extensions=python,default ac_add_options --disable-activex ac_add_options --disable-activex-scripting ac_add_options --disable-tests ac_add_options --disable-installer 2. Install python and put python.exe on path 3. run this .bat in a cmd @echo off set moz_bin=C:\projects\mozilla\obj-xulrunner\dist\BIN set path=%path%;%moz_bin% set pythonpath=%moz_bin%\python python -c "from xpcom import components; print components.classes['@mozilla.org/file/local;1']" Actual Results: Get missing DLL errors or import errors Expected Results: no errors http://msdn2.microsoft.com/en-us/library/ms235299(VS.80).aspx
It might be worth adding that python 2.5 as supplied with MozillaBuilder depends on and comes with MSCVR71.dll. Perhaps the build of xpcom just needs to be modified to agree but can that be done easily with MSVC80? Is the dependency of XPCOM.dll on 80 just a side effect of the build process as it currently stands or a forced requirement?
You will probably need a python compiled against VC8 to use XPCOM compiled against VC8. Kinda sucks, but that's the way it is. As for your other comments, don't go moving the VC8 CRT dlls out of their SxS homes, it's not the right way to do things. VC8 Express doesn't come with the CRT dlls in a redist folder, in case you were wondering why they weren't anywhere else.
OK Thanks Ted. Don't really want to build python but if that's the only way (assuming it can be)... Perhaps I can get hold of MSVC 7.1 free some place? Moving the dlls was just a temp hack to scope the problem with depends.exe. I'm not really familar with SxS if that's the issue with MSVC8. Is it possible to ensure that python and a 3rd party component like XPCOM all agree on the dll version (manifest).
Here's my analysis so far Option 1 - build XPCOM and thus all Mozilla with MSVC7.1. Option 2 - build Python with MSVC8 express so it matches. Also add mt.exe –manifest xpcom.dll.manifest -outputresource:xpcom.dll;2 to the xpcom makefile to put the manifest in the dll. What else? 1) must be the easiest as there are no nasty manifest issues and MSVCR71.dll is already around for many developers an user. 2) Opens a can of SxS worms and also the end user must have MSI 3.1 to install the resdistribs see (http://public.kitware.com/pipermail/vtkusers/2006-June/085494.html). Plus seems there is no way to get the non manifest MSVCR80.DLL if you have MSVC8 Express. I tried vc_redistrib.exe. I also tried the mt and it still failed so I guess it might require Python to also have a manifest as Ted says. Ho hum. OK so who knows where I can get MSVC7.1 (AKA .NET 2003) at no cost in order to build XULRunner with python?
There used to be "Visual C++ 2003 Toolkit" available for free from Microsoft, but I don't know if it's available for download any more. And yes, VC8 is a pain in the ass. If you're just trying to get something working for yourself, you may be able to borrow the redist files from a Firefox or Xulrunner trunk build and stick them next to xpcom.dll. You might still need to embed a manifest in xpcom.dll. I'm interested in hearing what would make this work, since we still haven't fixed all VC8 CRT related issues (namely bug 350616). If there's something we can do to make this situation work it may be worthwhile.
Thanks I investigated that an unfortunately it looks like the 2003 Toolkit is no longer available in the time honoured proprietary way. Worse, I'm unable to build Python 2.5 with MSVC8 Express even though 8 is explicitly supported. I've not spent much time on it but it looks like unsupported 'solution folders' in this version leading to an incomplete dependency tree. At least I get unresolved symbols. So it looks like we're in the position of not being able to build a usable XULRunner with pyXPCOM using free tools. OK I'm resigned with not being able to use FOSS tools but having to buy the tools to build a FOSS project is rather a 'poor show'. At this point I'm not sure how I'm going to progress with the accessibility grant till I find a way to build it or it arrives ready made in a release.
OK so I can build Python with MSVC8 Express. The latest tarball has an error in the project. I applied the following patch manually and noted the line #s seem a little out. I uninstalled the python 25 release and now get a lot further as python is basically working. Now getting pyXPCOM error nsIObserver not found for the shutdown Observer. Oh well more work to do. I guess we may want to distribute a MSVC8 version of python with MozillaBuild. Index: pythoncore.vcproj =================================================================== --- pythoncore.vcproj (revision 1020) +++ pythoncore.vcproj (working copy) <at> <at> -1,7 +1,7 <at> <at> <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="8,00" + Version="8.00" Name="pythoncore" ProjectGUID="{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" RootNamespace="pythoncore" <at> <at> -558,6 +558,10 <at> <at> > </File> <File + RelativePath="..\Modules\_typesmodule.c" + > + </File> + <File RelativePath="..\Modules\_weakref.c" > </File> Test.bat -------- set python_bin=C:\projects\python\PCbuild8 set moz_bin=C:\projects\mozilla\obj-xulrunner\dist\BIN set path=%path%;%python_bin%;%moz_bin% set pythonpath=%moz_bin%\python python -c "from xpcom import components;" Error ----- Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\projects\mozilla\obj-xulrunner\dist\bin\python\xpcom\components.py", line 231, in <module> import shutdown File "C:\projects\mozilla\obj-xulrunner\dist\BIN\python\xpcom\shutdown.py", li ne 51, in <module> class _ShutdownObserver: File "C:\projects\mozilla\obj-xulrunner\dist\BIN\python\xpcom\shutdown.py", li ne 52, in _ShutdownObserver _com_interfaces_ = interfaces.nsIObserver File "C:\projects\mozilla\obj-xulrunner\dist\bin\python\xpcom\components.py", line 103, in __getattr__ return self._get_one(attr) File "C:\projects\mozilla\obj-xulrunner\dist\bin\python\xpcom\components.py", line 153, in _get_one raise xpcom.COMException(nsError.NS_ERROR_NO_INTERFACE, "The interface '%s' does not exist" % (name,)) xpcom.Exception: -2147467262 (-2147467262)
OK so having built XULRunner with MSVC71 all is well. The import of xpcom.components direct from python still fails but you know I have a hunch it might be because the context doesn't exist unless you're in XULRunner. A bit like trying to access the DOM document object when not in a browser JS context. That's at odds with the building pyXPCOM docs though. So in order to fully support XULRunner + python we'll need a python distributions made with both MSVC71 and 8 in MozillaBuilder. Even if you build with 80 it's not obvious how to make an 'installer' that can be used to get the registry updates. plus you need to ensure the config + build and runtime all use the same version. Perhaps an official Python MSVC8 release will become available soon? Plus should the release of XULRunner with python include full python rather than expect the user to install it (e.g using setup.py or pyinstaller). If not you hit the MSVCR dll version issue again.
So, since bug 350616 landed, this will probably work now, even with a VC71 Python. I haven't tried it, but I'd expect it to work properly.
Thx Ted, it's going to be a while till I can check it again as I switched to Linux for now.
Mass re-assign of MozillaBuild bugs into mozilla.org:MozillaBuild
Component: Build Config → MozillaBuild
Product: Core → mozilla.org
Version: Trunk → other
QA Contact: build-config → mozillabuild
(In reply to comment #10) > Thx Ted, it's going to be a while till I can check it again as I switched to > Linux for now. > Have you got a chance to try this again, Steve?
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Component: MozillaBuild → Build Config
Product: mozilla.org → Core
Resolution: WORKSFORME → FIXED
Version: other → unspecified
No Ben, i can't seem to get msvc 8 to install with 7 so i'll close it
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.