Repository: spack/spack

Issue:
Installation issue: py-tensorboard-plugin-wit
### Steps to reproduce the issue

```console
$ spack install py-tensorboard-plugin-wit
...
Segmentation fault (core dumped)
/tmp/spackfykr1z5g/dbe23794a6948018e3519954f7cd2e6d/execroot/ai_google_pair_wit/bazel-out/k8-fastbuild/bin/tensorboard_plugin_wit/pip_package/build_pip_package: 1: /tmp/spackfykr1z5g/dbe23794a6948018e3519954f7cd2e6d/execroot/ai_google_pair_wit/bazel-out/k8-fastbuild/bin/tensorboard_plugin_wit/pip_package/build_pip_package: Bad substitution
/tmp/spackfykr1z5g/dbe23794a6948018e3519954f7cd2e6d/execroot/ai_google_pair_wit/bazel-out/k8-fastbuild/bin/tensorboard_plugin_wit/pip_package/build_pip_package: 1: /tmp/spackfykr1z5g/dbe23794a6948018e3519954f7cd2e6d/execroot/ai_google_pair_wit/bazel-out/k8-fastbuild/bin/tensorboard_plugin_wit/pip_package/build_pip_package: Bad substitution
...
```

### Information on your system

* **Spack:** 0.16.2-3546-88aa8299d8
* **Python:** 3.8.1
* **Platform:** linux-ubuntu18.04-haswell
* **Concretizer:** original

### Additional information

* [spack-build-out.txt](https://github.com/spack/spack/files/6835086/spack-build-out.txt)
* [spack-build-env.txt](https://github.com/spack/spack/files/6835087/spack-build-env.txt)

@aweits

### General information

- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
Do you know what binary is dumping core?
How would I determine that?
you can run the "file" command on the corefile (if there is one) in the builddir/cwd when the build failed...

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py b/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py
--- a/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py
+++ b/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py
@@ -25,7 +25,9 @@ class PyTensorboardPluginWit(Package):
     version('1.8.0', sha256='1e4de1bbf6ae61c4d27b114ec2e1093bc4765b8c2bbb2cc5d43e2075b08a5fea')
     version('1.7.0', sha256='30dcab9065b02c3f1476f4fb92b27f6feb6c00cdb281699c44d8e69c86745247')
 
-    depends_on('bazel@:2.1.0', type='build')
+    # Bazel 3.7+ does not work
+    # https://github.com/PAIR-code/what-if-tool/issues/140
+    depends_on('bazel@0.26.1:3.6', type='build')
     depends_on('py-setuptools@36.2.0:', type='build')
     depends_on('python@2.7:2.8,3.2:', type=('build', 'run'))
     depends_on('py-wheel', type='build')
@@ -34,6 +36,11 @@ class PyTensorboardPluginWit(Package):
 
     patch('tboard_shellenv.patch')
 
+    # On Ubuntu, sh -> dash, and the script contains tools like pushd that require bash
+    patch('https://patch-diff.githubusercontent.com/raw/PAIR-code/what-if-tool/pull/154.patch',
+          sha256='b40fbc73fb07ed933f9d845b65fdbf7a94644f7ec7ca8637eda002171e71bbb6',
+          when='@:1.8.0')
+
     phases = ['setup', 'build', 'install']
 
     def setup_build_environment(self, env):


Test patch: