After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763739 - ccompiler.py: Use temp files when resolving libs on Windows/MSVC
ccompiler.py: Use temp files when resolving libs on Windows/MSVC
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-03-16 10:29 UTC by Fan, Chun-wei
Modified: 2016-03-16 12:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ccompiler: Use tempfile when resolving libs on Visual Studio builds (5.10 KB, patch)
2016-03-16 10:32 UTC, Fan, Chun-wei
committed Details | Review

Description Fan, Chun-wei 2016-03-16 10:29:41 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!
Comment 1 Fan, Chun-wei 2016-03-16 10:32:20 UTC
Created attachment 324082 [details] [review]
ccompiler: Use tempfile when resolving libs on Visual Studio builds

Hi,

Here comes the patch.

With blessings, thank you!
Comment 2 LRN 2016-03-16 11:38:24 UTC
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).
Comment 3 Ignacio Casal Quinteiro (nacho) 2016-03-16 11:40:42 UTC
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
Comment 4 Fan, Chun-wei 2016-03-16 12:11:00 UTC
Hi guys,

Thanks for the reviews and comments.  I pushed the patch as 444648d.

With blessings, thank you!