Skip to content

Conversation

@chapman39
Copy link
Collaborator

@chapman39 chapman39 commented Oct 14, 2025

the builtin repo's destination was being ignored due to the ordering of spack commands. this pr fixes that, so the destination is kept.

also does these changes in spack environment, so you can see the changes in the spack.yaml. for example

  repos:
    serac: /usr/WS2/meemee/serac/repo/scripts/spack
    llnl_radiuss: /usr/WS2/meemee/serac/repo/scripts/spack/radiuss-spack-configs/spack_repo/llnl_radiuss
    builtin:
      git: https://github.com/spack/spack-packages.git
      destination: /usr/WS2/meemee/serac/serac_tpls/toss_4_x86_64_ib_cray/2025_10_14_17_32_44/builtin_spack_packages_repo
      commit: a75a7f75182ffc7a51c6ca7f0fec4bf9b2705be8

also removes this section since i think it only worked because the destination was set in the wrong order

spack_repo_remove_cmd = f"{self.spack_exe(use_spack_env=False)} repo remove builtin"
res = sexe(spack_repo_remove_cmd, echo=True)
if res != 0:
  print("[ERROR: Failed to remove builtin package repository so it could be re-added with given URL]")
  sys.exit(-1)

@chapman39 chapman39 requested a review from white238 October 14, 2025 23:12
@chapman39 chapman39 self-assigned this Oct 14, 2025
@chapman39 chapman39 added the bug Something isn't working label Oct 14, 2025
@chapman39 chapman39 marked this pull request as draft October 14, 2025 23:25
@chapman39 chapman39 marked this pull request as ready for review October 14, 2025 23:58
@chapman39 chapman39 marked this pull request as draft October 15, 2025 00:13
@chapman39 chapman39 marked this pull request as ready for review October 15, 2025 00:52
# Optionally, check out Spack's builtin package repo to a specific commit/branch/tag
if "spack_packages_url" in self.project_args:
url = self.project_args["spack_packages_url"]
spack_repo_add_cmd = f"{self.spack_exe()} repo add --name builtin {url}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it required to remove the existing builtin before we add it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would be curious to know as well. when i tried to remove it, i was getting an error that it doesn't exist. i tried both in the environment (-D spack_env) and without.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chapman39 what's the output of the following for you in the environment where you're getting the error that builtin doesn't exist?

$ spack debug report
$ spack config get repos

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does appear to be there but won't let me delete it unless i set its destination.

[exe: git -c http.sslVerify=false  clone --single-branch --depth=1 -b develop https://github.com/spack/spack.git spack]
Cloning into 'spack'...
Updating files: 100% (1734/1734), done.
[info: using spack commit 734c5db2121b01c373eed6538e452f18887e9e44]
[exe: git stash]
No local changes to save
[exe: git fetch --depth=1 origin 734c5db2121b01c373eed6538e452f18887e9e44]
From https://github.com/spack/spack
 * branch            734c5db2121b01c373eed6538e452f18887e9e44 -> FETCH_HEAD
[exe: git checkout 734c5db2121b01c373eed6538e452f18887e9e44]
Note: switching to '734c5db2121b01c373eed6538e452f18887e9e44'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 734c5db Set the version to v1.0.2
[exe: /usr/WS2/meemee/serac/serac_tpls/toss_4_x86_64_ib_cray/2025_10_15_13_22_49/spack/bin/spack repo remove builtin]
==> Error: No repository with path or namespace: builtin
[ERROR: Failed to remove builtin package repository so it could be re-added with given URL]
[exe: /usr/WS2/meemee/serac/serac_tpls/toss_4_x86_64_ib_cray/2025_10_15_13_22_49/spack/bin/spack debug report]
* **Spack:** 1.0.2 (https://github.com/spack/spack/commit/734c5db2121b01c373eed6538e452f18887e9e44)
* **Builtin repo:** https://github.com/spack/spack-packages/commit/a75a7f75182ffc7a51c6ca7f0fec4bf9b2705be8
* **Python:** 3.9.12
* **Platform:** linux-rhel8-zen4
[exe: /usr/WS2/meemee/serac/serac_tpls/toss_4_x86_64_ib_cray/2025_10_15_13_22_49/spack/bin/spack config get repos]
repos:
  builtin:
    git: https://github.com/spack/spack-packages.git
    branch: releases/v2025.07

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alecbcs let me know if there's anything else i should try

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@becker33 since you are back... we have been having a hard time getting this right and keep hitting odd behavior between people. Could you give advice on this?

@white238 white238 merged commit bec05e2 into main Nov 13, 2025
8 checks passed
@white238 white238 deleted the bugfix/chapman39/builtin-destination branch November 13, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants