On one system we have the install tree set to /opt/aci/sw, with an environment there. On that system, the install of kim-api would fail. The reason it failed was that it was trying to install a file in /etc, which of course I didn't have permissions for. So looking at the error message, it's this:
1281 -- Installing: /opt/aci/sw/kim-api/2.1.3_gcc-8.3.1-7yp/share/cmake/Modules/FindKIM-API.cmake
1282 -- Installing: /etc/opt/aci/sw/kim-api/2.1.3_gcc-8.3.1-7yp/bash_completion.d/kim-api-collections-management.bash
>> 1283 CMake Error at completions/cmake_install.cmake:49 (file):
1284 file INSTALL cannot copy file
As you can see, it installs fine until it reaches a particular file where /etc is pre-pended to the install tree. If I complete the kim-api install as root...sure enough, it does install a couple things to /etc/<install tree>/<kim-api install dir>/.
I decided to try installing kim-api locally on my PC, where everything is still the default ( no env) That install completed successfully. And there was indeed a directory at <default spack tree><kim-api install dir>/etc/bash_completion.d.
I then changed the install tree location to /opt/spack-test and did the kim-api install again. This time, it had the same error.
So it appears that if I have a non-default spack install tree value, or possibly it's specific to one in /opt/, then for some reason, it takes the /etc/ part of that bash_completion.d path and puts it in FRONT of the install tree value instead of behind it. That's a head scratcher for me, but that's the best I can determine.
I can fill out an issue in the tracker if that's warranted, or perhaps I'm just doing something crazy wrong.
Rob