Incorrect line number for YAML error
Open
@tldahlgren is already working on this.
Since Feb 18, 2026.
bug
impact-low
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.5k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 82
Description
Steps to reproduce
In CI I got:
RuntimeError: .../spack-packages/stacks/ml-darwin-aarch64-mps/spack.yaml:34: expected a named spec, but got 'target=m1' instead
It talks about spack.yaml:34, but the issue is on line 17:
spack:
view: false
include:
- ../../.ci/gitlab/
packages:
all:
require:
- +mps
- ~cuda
- ~rocm
- target=m1
mpi:
require:
- mpich
- target=m1 # <-here
openblas:
require:
- ~fortran
- target=m1
python:
require:
- "@3.13:"
- target=m1
...
I suspect includes are messing the line numbers up?
Error message
No response
Information on your system
General information
- I have run
spack debug reportand reported the version of Spack/Python/Platform - I have searched the issues of this repo and believe this is not a duplicate
- I have run the failing commands in debug mode and reported the output
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.