Repository: spack/spack

Issue:
Installation issue: llvm on AppleClang
This bug report is part of getting the scientific python stack compiled on macOS with system tools (AppleClang). See #16215

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install py-jupyter
```

fails on building llvm:
- https://github.com/spack/macos-nightly/runs/609170529?check_suite_focus=true
- https://pipelines.actions.githubusercontent.com/eQDTv3YUcLPOslJXwlkH6QP3HGx2vWLDSmYwdOLvSvJ2UNlz5i/_apis/pipelines/1/runs/15/signedlogcontent/8?urlExpires=2020-04-22T20%3A55%3A45.0161738Z&urlSigningMethod=HMACV1&urlSignature=NgwWOKDEIC3NouubXj9DzrCxQYEW6cDzms9qgEM2UQs%3D

Snippet:
```
lib/lib
2020-04-22T19:21:18.6768820Z               LLVMDemangle.a -lz -ltinfo -lm
2020-04-22T19:21:18.6769120Z   >> 25661    Undefined symbols for architecture x86_64:
2020-04-22T19:21:18.6769270Z      25662      "_libintl_bind_textdomain_codeset", referenced from:
2020-04-22T19:21:18.6769370Z      25663          _PyIntl_bind_textdomain_codeset in libpython3.7m.a(_localem
2020-04-22T19:21:18.6769460Z               odule.o)
2020-04-22T19:21:18.6769530Z      25664      "_libintl_bindtextdomain", referenced from:
2020-04-22T19:21:18.6769660Z      25665          _PyIntl_bindtextdomain in libpython3.7m.a(_localemodule.o)
2020-04-22T19:21:18.6769760Z      25666      "_libintl_textdomain", referenced from:
2020-04-22T19:21:18.6769850Z      25667          _PyIntl_textdomain in libpython3.7m.a(_localemodule.o)
2020-04-22T19:21:18.6769900Z 
2020-04-22T19:21:18.6769970Z      ...
2020-04-22T19:21:18.6770010Z 
2020-04-22T19:21:18.6770100Z      25672          _PyLocale_localeconv in libpython3.7m.a(_localemodule.o)
2020-04-22T19:21:18.6770180Z      25673      "_libintl_dgettext", referenced from:
2020-04-22T19:21:18.6770510Z      25674          _PyIntl_dgettext in libpython3.7m.a(_localemodule.o)
2020-04-22T19:21:18.6770620Z      25675      "_libintl_gettext", referenced from:
2020-04-22T19:21:18.6770720Z      25676          _PyIntl_gettext in libpython3.7m.a(_localemodule.o)
2020-04-22T19:21:18.6770810Z      25677    ld: symbol(s) not found for architecture x86_64
2020-04-22T19:21:18.6771310Z   >> 25678    clang: error: linker command failed with exit code 1 (use -v to s
2020-04-22T19:21:18.6771410Z               ee invocation)
2020-04-22T19:21:18.6771480Z   >> 25679    make[2]: *** [lib/liblldb.10.0.0.dylib] Error 1
2020-04-22T19:21:18.6771570Z   >> 25680    make[1]: *** [tools/lldb/source/API/CMakeFiles/liblldb.dir/all] E
2020-04-22T19:21:18.6771660Z               rror 2
2020-04-22T19:21:18.6771740Z   >> 25681    make: *** [all] Error 2
```

### Information on your system

- GitHub Action macOS 10.15
- AppleClang clang-11.0.0-apple
- vanilla Spack from develop as of 46e90692e829457b133521f7dc5c6d7c1f7502da



### Additional information

cc package maintainers @trws @naromero77



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -287,8 +287,12 @@ def cmake_args(self):
         if "+python" in spec and "+lldb" in spec and spec.satisfies("@5.0.0:"):
             cmake_args.append("-DLLDB_USE_SYSTEM_SIX:Bool=TRUE")
 
-        if "~python" in spec and "+lldb" in spec:
-            cmake_args.append("-DLLDB_DISABLE_PYTHON:Bool=TRUE")
+        if "+lldb" in spec and spec.satisfies("@:9.9.9"):
+            cmake_args.append("-DLLDB_DISABLE_PYTHON:Bool={0}".format(
+                'ON' if '~python' in spec else 'OFF'))
+        if "+lldb" in spec and spec.satisfies("@10.0.0:"):
+            cmake_args.append("-DLLDB_ENABLE_PYTHON:Bool={0}".format(
+                'ON' if '+python' in spec else 'OFF'))
 
         if "+gold" in spec:
             cmake_args.append(


Test patch: