spack / spack/spack

Incorrect line number for YAML error

Open
#51,963 1 comment 0 reactions 2 assignees View on GitHub

@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 report and 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.