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 678678 - Build failure if no `cc` available (only `gcc`)
Build failure if no `cc` available (only `gcc`)
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.33.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-06-23 18:45 UTC by ojab
Modified: 2015-02-07 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ojab 2012-06-23 18:45:10 UTC
make[2]: Entering directory `/sources/gobject-introspection-1.33.2'
  GISCAN GLib-2.0.gir
Traceback (most recent call last):
  • File "./g-ir-scanner", line 46 in <module>
    sys.exit(scanner_main(sys.argv))
  • File "./giscanner/scannermain.py", line 413 in scanner_main
    ss = create_source_scanner(options, args)
  • File "./giscanner/scannermain.py", line 335 in create_source_scanner
    ss.parse_files(filenames)
  • File "./giscanner/sourcescanner.py", line 251 in parse_files
    self._parse(headers)
  • File "./giscanner/sourcescanner.py", line 285 in _parse
    stdout=subprocess.PIPE)
  • File "/usr/lib/python2.7/subprocess.py", line 679 in __init__
    errread, errwrite)
  • File "/usr/lib/python2.7/subprocess.py", line 1228 in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
make[2]: *** [GLib-2.0.gir] Error 1

There is `cpp_args = os.environ.get('CC', 'cc').split()` in giscanner/sourcescanner.py, but looks like CC is not set.

gobject-introspection-1.33.2
Comment 1 Dieter Verfaillie 2012-06-24 19:10:48 UTC
(In reply to comment #0)
> There is `cpp_args = os.environ.get('CC', 'cc').split()` in
> giscanner/sourcescanner.py, but looks like CC is not set.

When the "CC" environment variable is not set, the above indeed
ensures g-ir-scanner falls back to the "cc" command. One thing you
can do if "cc" is not available on your system is to set the "CC"
environment variable to "gcc" instead at configure time, for
example run:
    CC=gcc ./configure --prefix=/path/to/prefix
or, if you are building from git:
    CC=gcc ./autogen.sh --prefix=/path/to/prefix
and all should be well.

We might want to present a slightly more friendly error message
when trying to run an executable that doesn't exist though...
Comment 2 ojab 2012-06-24 19:27:32 UTC
Or maybe somehow set CC from Makefile? Because make uses `gcc` without any env vars.

This change fixes the build for me (don't know if it is correct solution):

diff --git a/common.mk b/common.mk
index 052d5b4..724a4d5 100644
--- a/common.mk
+++ b/common.mk
@@ -9,6 +9,7 @@
 INTROSPECTION_SCANNER = \
     env PATH=.libs:$(PATH) \
         LPATH=.libs \
+       CC=$(CC) \
         PYTHONPATH=$(top_builddir):$(top_srcdir) \
         UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
         UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
Comment 3 ojab 2012-08-04 13:02:48 UTC
Still happens with latest git.
Comment 4 André Klapper 2015-02-07 16:49:10 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]