Skip to content

Overriding specific repos in repos.yaml may not work as intended #105

@CodeGat

Description

@CodeGat

See PR #104

Background

After the merging of the above PR, build-ci is erroneously picking develop as the default ref for builtin - see https://github.com/ACCESS-NRI/access-spack-packages/actions/runs/22743783447/job/65963073688?pr=396#step:12:151. This is a last resort if it can't get any other value from the repos.yaml. See https://github.com/ACCESS-NRI/build-ci/blob/v3/.github/workflows/ci.yml#L336.

I suspect that this is because the :: in repos.builtin:: is being interpreted literally as a key called builtin:, rather than spack interpreting it as it's "override" operator. I say this because when comparing the raw repos.yaml against the scope-merged spack config get repos before the above PR was merged, we get:

# repos.yaml
repos::
  access_spack_packages:
    git: https://github.com/ACCESS-NRI/access-spack-packages.git
    branch: api-v2
    destination: $spack/../access-spack-packages
  builtin:
    git: https://github.com/spack/spack-packages.git
    # gnu packages: bump (#3390)
    commit: 383e969358c951abe17623696083e6f862c4488e
---
# spack config get repos
repos:
  access_spack_packages:
    git: https://github.com/ACCESS-NRI/access-spack-packages.git
    branch: api-v2
    destination: $spack/../access-spack-packages
  builtin:
    git: https://github.com/spack/spack-packages.git
    # gnu packages: bump (#3390)
    commit: 383e969358c951abe17623696083e6f862c4488e

Note that the repos:: key in repos.yaml is correctly converted to repos: in spack config get repos - this means its special syntax was interpreted correctly, and it's scoping rules applied.

Now note the current main:

# repos.yaml
repos:
  access_spack_packages::
    git: https://github.com/ACCESS-NRI/access-spack-packages.git
    branch: api-v2
    destination: $spack/../access-spack-packages
  builtin::
    git: https://github.com/spack/spack-packages.git
    # gnu packages: bump (#3390)
    commit: 383e969358c951abe17623696083e6f862c4488e
---
# spack config get repos
repos:
  'access_spack_packages:':
    git: https://github.com/ACCESS-NRI/access-spack-packages.git
    branch: api-v2
    destination: $spack/../access-spack-packages
  'builtin:':
    git: https://github.com/spack/spack-packages.git
    # gnu packages: bump (#3390)
    commit: 383e969358c951abe17623696083e6f862c4488e

I interpret this to mean that the names of repositories are being interpreted literally as builtin: (and access_spack_packages:, rather than interpreting the special :: syntax.

Therefore I wonder if the :: syntax does not apply to that type of key.

Ways Forward

  • build-ci can handle this bug with an updated yq statement, meaning it won't default to develop.
  • But I am wondering if the :: operator is being applied correctly at all in this case, given the above. In that case, we may need to find a different place to put the ::, if at all.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions