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 724880 - GI does not run under MSYS+W32-CPython correctly
GI does not run under MSYS+W32-CPython correctly
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-02-21 12:54 UTC by LRN
Modified: 2015-02-07 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Support running under MSYS (2.79 KB, patch)
2014-02-21 12:54 UTC, LRN
committed Details | Review

Description LRN 2014-02-21 12:54:33 UTC
W32 CPython can only run .exe files via subprocess.
To run other things (like scripts) an interpreter must be specified
explicitly.

A generic workaround is to create a shell script, put the command in there,
then run the script with a shell. This way GI can run anything that shell
can.

MSYS is detected by a presence of the MSYSTEM environment variable, shell
is taken from the SHELL environment variable (subprocess needs an absolute
path, so a which() implementation is used to find the shell).
Comment 1 LRN 2014-02-21 12:54:39 UTC
Created attachment 269906 [details] [review]
Support running under MSYS
Comment 2 Colin Walters 2014-02-22 23:23:27 UTC
Review of attachment 269906 [details] [review]:

Coding style is inconsistent with the rest of the code - no spaces between identifier and paren.  I fixed that up.

::: giscanner/dumper.py
@@ +303,3 @@
+            tf, tf_name = tempfile.mkstemp ()
+            f = os.fdopen (tf, 'wb')
+            fcontents = '#!/bin/sh\nunset PWD\n{}\n'.format (' '.join ([x.replace ('\\','/') for x in args]))

This is kind of hacky it feels like we could just ship this script as an internal helper rather than generate it each run.  But...eh, it's OK.

@@ +316,3 @@
+        else:
+            if msys:
+                os.remove (tf_name)

This can be deduplicated inside a "finally:" block.  I did so.
Comment 3 André Klapper 2015-02-07 16:53:17 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]