Skip to content

Spec.format: error on old style format strings#41934

Merged
alalazo merged 1 commit intospack:developfrom
haampie:fix/error-old-style-format-strings
Jan 3, 2024
Merged

Spec.format: error on old style format strings#41934
alalazo merged 1 commit intospack:developfrom
haampie:fix/error-old-style-format-strings

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Jan 3, 2024

Closes #41786
Closes #37593

Old style format strings ${PACKAGE}-${VERSION}-${HASH} are still causing
issues that are very hard to decipher, and sometimes persist even when updating
projections to something modern, because a wrong prefix was already registered
in the database and gets picked up again:

spack/lib/spack/spack/spec.py

Lines 1822 to 1829 in 375bc6f

def prefix(self):
if not self._concrete:
raise spack.error.SpecError("Spec is not concrete: " + str(self))
if self._prefix is None:
upstream, record = spack.store.STORE.db.query_by_spec_hash(self.dag_hash())
if record and record.path:
self.prefix = record.path

@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels Jan 3, 2024
@alalazo alalazo merged commit 3e3cd64 into spack:develop Jan 3, 2024
@alalazo alalazo mentioned this pull request Jan 3, 2024
36 tasks
@haampie haampie deleted the fix/error-old-style-format-strings branch January 3, 2024 16:50
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Jan 25, 2024
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Jan 31, 2024
greenc-FNAL pushed a commit to FNALssi/spack that referenced this pull request Mar 21, 2024
kwryankrattiger pushed a commit to kwryankrattiger/spack that referenced this pull request Jul 9, 2024
vjranagit pushed a commit to vjranagit/spack that referenced this pull request Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality tests General test capability(ies)

Projects

None yet

2 participants