Repository: spack/spack

Issue:
Installation issue: gnutls fails to build on macOS
### Steps to reproduce the issue

```console
$ spack install cmake%gcc@9.1.0
...
==> Installing gnutls
==> Searching for binary cache of gnutls
==> Warning: No Spack mirrors are currently configured
==> No binary for gnutls found: installing from source
==> Using cached archive: /Users/ondrej/repos/spack/var/spack/cache/gnutls/gnutls-3.6.8.tar.xz
==> Staging archive: /Users/ondrej/repos/spack/var/spack/stage/gnutls-3.6.8-dvcfoph4a3o4uysmw3a7ol3mdn7qjp7f/gnutls-3.6.8.tar.xz
==> Created stage in /Users/ondrej/repos/spack/var/spack/stage/gnutls-3.6.8-dvcfoph4a3o4uysmw3a7ol3mdn7qjp7f
==> No patches needed for gnutls
==> Building gnutls [AutotoolsPackage]
==> Executing phase: 'autoreconf'
==> Executing phase: 'configure'
==> Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j4'

5 errors found in build log:
     2233               1 (load-extension "/private/var/folders/9_/k74x3vy91qv0
             4?" ?)
     2234    In ice-9/boot-9.scm:
     2235       757:25  0 (dispatch-exception _ _ _)
     2236    
     2237    ice-9/boot-9.scm:757:25: In procedure dispatch-exception:
     2238    ice-9/boot-9.scm:757:25: In procedure dynamic-link: file: "/privat
             e/var/folders/9_/k74x3vy91qv04tm2nfbrl0yh0000gp/T/ondrej/spack-sta
             ge/spack-stage-p_ZqS1/src/spack-build/guile/src/guile-gnutls-v-2",
              message: "file not found"
  >> 2239    make[3]: *** [modules/gnutls.go] Error 1
     2240    make[3]: *** Waiting for unfinished jobs....
     2241    Backtrace:
     2242    In ice-9/psyntax.scm:
     2243      1210:36 19 (expand-top-sequence _ _ _ #f _ _ _)
     2244      1157:24 18 (parse _ (("placeholder" placeholder)) ((top) #(# # ?
             )) ?)
     2245       279:10 17 (parse _ (("placeholder" placeholder)) (()) _ c&e (# 
             #) #)

     ...

     2267               1 (load-extension "/private/var/folders/9_/k74x3vy91qv0
             4?" ?)
     2268    In ice-9/boot-9.scm:
     2269       757:25  0 (dispatch-exception _ _ _)
     2270    
     2271    ice-9/boot-9.scm:757:25: In procedure dispatch-exception:
     2272    ice-9/boot-9.scm:757:25: In procedure dynamic-link: file: "/privat
             e/var/folders/9_/k74x3vy91qv04tm2nfbrl0yh0000gp/T/ondrej/spack-sta
             ge/spack-stage-p_ZqS1/src/spack-build/guile/src/guile-gnutls-v-2",
              message: "file not found"
  >> 2273    make[3]: *** [modules/gnutls/extra.go] Error 1
  >> 2274    make[2]: *** [all-recursive] Error 1
  >> 2275    make[1]: *** [all-recursive] Error 1
  >> 2276    make: *** [all] Error 2

See build log for details:
  /Users/ondrej/repos/spack/var/spack/stage/gnutls-3.6.8-dvcfoph4a3o4uysmw3a7ol3mdn7qjp7f/spack-build.out
```

### Platform and user environment

Please report your OS here:
```commandline
$ uname -a
Darwin MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
``` 


Discussion:
> $ spack install cmake%gcc@9.1.0

If your real interest is cmake as opposed to gnutls, then see PR #11646.
I believe that will fix your problem here.

If your real interest is gnutls, then I don't know.
Indeed, my real interest is cmake. Thanks for fixing it!

On Sun, Jun 9, 2019, at 9:32 PM, Mark W. Krentel wrote:
> > 
> > $ spack install cmake%gcc@9.1.0
> 
> If your real interest is cmake as opposed to gnutls, then see PR #11646 <https://github.com/spack/spack/pull/11646>.
> I believe that will fix your problem here.
> 
> If your real interest is gnutls, then I don't know.
> 
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub <https://github.com/spack/spack/issues/11668?email_source=notifications&email_token=AAAFAWAEFYXTOU7HT5H4KYLPZXDMHA5CNFSM4HWOZGSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXI22DQ#issuecomment-500280590>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAFAWCJU72YWEA5YSIDGZLPZXDMHANCNFSM4HWOZGSA>.
> 

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/gnutls/package.py b/var/spack/repos/builtin/packages/gnutls/package.py
--- a/var/spack/repos/builtin/packages/gnutls/package.py
+++ b/var/spack/repos/builtin/packages/gnutls/package.py
@@ -27,7 +27,10 @@ class Gnutls(AutotoolsPackage):
     version('3.3.9',  'ff61b77e39d09f1140ab5a9cf52c58b6')
 
     variant('zlib', default=True, description='Enable zlib compression support')
-    variant('guile', default=True, description='Enable Guile bindings')
+    variant('guile', default=False, description='Enable Guile bindings')
+
+    # gnutls+guile is currently broken on MacOS.  See Issue #11668
+    conflicts('+guile', when='platform=darwin')
 
     # Note that version 3.3.9 of gnutls doesn't support nettle 3.0.
     depends_on('nettle@3.4.1:', when='@3.6.7.1:')


Test patch: