summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-06-29 23:44:56 +0200
committerGitHub <noreply@github.com>2021-06-29 14:44:56 -0700
commit304249604ab465dbfc3ee560884bf4a1460f1e34 (patch)
treed46ff02da323ee6a7dbe96100a8fa41c77cb1c76 /var
parent1eb2798c430e221ab945334014a60e0254d80f67 (diff)
downloadspack-304249604ab465dbfc3ee560884bf4a1460f1e34.tar.gz
spack-304249604ab465dbfc3ee560884bf4a1460f1e34.tar.bz2
spack-304249604ab465dbfc3ee560884bf4a1460f1e34.tar.xz
spack-304249604ab465dbfc3ee560884bf4a1460f1e34.zip
Fix prefix-collision detection for projections (#24049)
If two Specs have the same hash (and prefix) but are not equal, Spack originally had logic to detect this and raise an error (since both cannot be installed in the same place). Recently this has eroded and the check no-longer works; moreover, when defining projections (which may truncate the hash or other distinguishing properties from the prefix) Spack was also failing to detect collisions (in both of these cases, Spack would overwrite the old prefix with the new Spec). This PR maintains a list of all "taken" prefixes: if a hash is not registered (i.e. recorded as installed in the database) but the prefix is occupied, that is a collision. This can detect collisions created by defining projections (specifically when they omit the hash). The PR does not detect collisions where specs have the same hash (and prefix) but are not equal.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/gdb/package.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/gdb/package.py b/var/spack/repos/builtin/packages/gdb/package.py
index b14b3e7c1c..ee40c6ce8a 100644
--- a/var/spack/repos/builtin/packages/gdb/package.py
+++ b/var/spack/repos/builtin/packages/gdb/package.py
@@ -3,9 +3,10 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-from spack import *
import os
+from spack import *
+
class Gdb(AutotoolsPackage, GNUMirrorPackage):
"""GDB, the GNU Project debugger, allows you to see what is going on