GNOME Bugzilla – Bug 763739
ccompiler.py: Use temp files when resolving libs on Windows/MSVC
Last modified: 2016-03-16 12:11:11 UTC
Hi, On Windows, during the build of introspection files, we make use of either dlltool (on MSYS/MinGW-based builds) or dumpbin (for Visual Studio builds) to deduce the DLL(s) that are linked to by the Windows lib file that is passed into the g-ir-scanner via --library. As there could very well be the need to use the Visual Studio IDE to run g-ir-scanner, this poses a problem for this case as dumpbin is a component of Visual Studio, so its outputs would be captured first by the Visual Studio output console, which would result in proc.communicate() from subprocess.Popen() that would call dumpbin to break, as the stdout and stderr would be first captured by the Visual Studio output console. So, we need to create a tempfile, and make the calls to dumpbin use the -out:<tempfile> flag, to make the outputs of dumpbin go into that tempfile, and look for the DLL from the contents of that tempfile, so that things will continue to work when we invoke g-ir-scanner from the Visual Studio IDE. I will attach a patch for this shortly. With blessings, thank you!
Created attachment 324082 [details] [review] ccompiler: Use tempfile when resolving libs on Visual Studio builds Hi, Here comes the patch. With blessings, thank you!
Review of attachment 324082 [details] [review]: Generally, i support the idea of using output files instead of stdout, because it is, indeed, easier to port to W32, and it has no weird interactions with handle inheritance and whatnot. I'll leave nitpicking the for nacho (especially since i don't remember what the nit guidelines for Python code are).
Review of attachment 324082 [details] [review]: From a style point of view looks good, and LRN already gave you the ok from a implementation point of view so go ahead
Hi guys, Thanks for the reviews and comments. I pushed the patch as 444648d. With blessings, thank you!