Repository: spack/spack

Issue:
Cant install glib 2.56.0 throws error on CentOS 6,
If you want to report a build error for some package, or a bug in core please use the following template as a guideline:

-----

Summary
On Centos 6 HPC node, I would like to get R 3.5.0 installed, but glib seems to break the compile.

### Expected Result
I expect glib 2.5.6 to install.....   glib 2.55.1 installs just fine


### Actual Result
==> Installing glib
==> Using cached archive: /suppscr/csde/spack/spack/var/spack/cache/glib/glib-2.56.0.tar.xz
==> Staging archive: /suppscr/csde/spack/spack/var/spack/stage/glib-2.56.0-qkzow5e5li54lwgmd53r2t2aqhtm2rxz/glib-2.56.0.tar.xz
==> Created stage in /suppscr/csde/spack/spack/var/spack/stage/glib-2.56.0-qkzow5e5li54lwgmd53r2t2aqhtm2rxz
==> Applied patch no-Werror=format-security.patch
==> Building glib [AutotoolsPackage]
==> Executing phase: 'autoreconf'
==> Executing phase: 'configure'
==> Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16'

9 errors found in build log:
     1236      CC       libgio_2_0_la-ginetsocketaddress.lo
     1237      CC       libgio_2_0_la-ginitable.lo
     1238      CC       libgio_2_0_la-ginputstream.lo
     1239      CC       libgio_2_0_la-gioerror.lo
     1240      CC       libgio_2_0_la-giomodule.lo
     1241    gfile.c: In function â€˜splice_stream_with_progressâ€™:
  >> 1242    gfile.c:3017: error: â€˜F_SETPIPE_SZâ€™ undeclared (first use in this function)
  >> 1243    gfile.c:3017: error: (Each undeclared identifier is reported only once
  >> 1244    gfile.c:3017: error: for each function it appears in.)
  >> 1245    gfile.c:3021: error: â€˜F_GETPIPE_SZâ€™ undeclared (first use in this function)
     1246      CC       libgio_2_0_la-giomodule-priv.lo
     1247      CC       libgio_2_0_la-gioscheduler.lo
  >> 1248    make[4]: *** [libgio_2_0_la-gfile.lo] Error 1
     1249    make[4]: *** Waiting for unfinished jobs....
     1250    In file included from ../gobject/gbinding.h:29,
     1251                     from ../glib/glib-object.h:23,
     1252                     from ../gio/gioenums.h:28,
     1253                     from ../gio/giotypes.h:28,
     1254                     from ../gio/ginputstream.h:28,

     ...

     1367                     from giomodule.c:25:
     1368    ../gobject/gobject.h: In function â€˜g_set_objectâ€™:
     1369    ../gobject/gobject.h:725: warning: value computed is not used
     1370    giomodule.c: In function â€˜_g_io_modules_ensure_extension_points_registeredâ€™:
     1371    giomodule.c:1018: warning: â€˜g_desktop_app_info_lookup_get_typeâ€™ is deprecated (declared at gdesktopappinfo.h
             :141)
     1372    make[4]: Leaving directory `/tmp/mbw/spack-stage/spack-stage-CB_z_z/glib-2.56.0/gio'
  >> 1373    make[3]: *** [all-recursive] Error 1
     1374    make[3]: Leaving directory `/tmp/mbw/spack-stage/spack-stage-CB_z_z/glib-2.56.0/gio'
  >> 1375    make[2]: *** [all] Error 2
     1376    make[2]: Leaving directory `/tmp/mbw/spack-stage/spack-stage-CB_z_z/glib-2.56.0/gio'
  >> 1377    make[1]: *** [all-recursive] Error 1
     1378    make[1]: Leaving directory `/tmp/mbw/spack-stage/spack-stage-CB_z_z/glib-2.56.0'
  >> 1379    make: *** [all] Error 2

See build log for details:
  /suppscr/csde/spack/spack/var/spack/stage/glib-2.56.0-qkzow5e5li54lwgmd53r2t2aqhtm2rxz/glib-2.56.0/spack-build.out
[mbw@n0470 spack]$ 


What happened instead

glib 2.56 fails to compile, and so R 3.5.0 fails to compile.


### Steps to reproduce the issue

```console
$ spack install r@3.5.0
or more simply:
$ spack install glib@2.56.0
...
```

### Information on your system

This includes:

 1. which platform you are using

CentOS 6  [
mbw@n0470 spack]$ uname -a
Linux n0470 2.6.32-696.10.3.el6.x86_64 #1 SMP Tue Sep 26 18:14:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

 2. any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.)
no custom anything

-----



Discussion:
A brilliant colleague pointed out that we can force a newer GCC and an older glib in this way to work around this problem:

>
> spack install r %gcc@8.1.0 ^glib@2.55.1
>
> You can remove the first tag if you don’t want to compile with a newer gcc (did you know that gcc 4.4.7 is almost a decade old??).
>
>Cheers,
>Sam

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py
--- a/var/spack/repos/builtin/packages/glib/package.py
+++ b/var/spack/repos/builtin/packages/glib/package.py
@@ -41,6 +41,7 @@ class Glib(AutotoolsPackage):
     homepage = "https://developer.gnome.org/glib/"
     url      = "https://ftp.gnome.org/pub/gnome/sources/glib/2.53/glib-2.53.1.tar.xz"
 
+    version('2.56.1', '40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d')
     version('2.56.0', 'f2b59392f2fb514bbe7791dda0c36da5')
     version('2.55.1', '9cbb6b3c7e75ba75575588497c7707b6')
     version('2.53.1', '3362ef4da713f834ea26904caf3a75f5')


Test patch: