spack / spack/spack

Buggy behavior with Spack view's "link" option

Open
#45,883 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug triage
Dominant language
Python
Stars
5.1k
Forks
2.5k
Avg merge
3d 4h
Merged PRs (30d)
82

Description

Steps to reproduce

Spack's environment views do not properly include dependencies, and the unit test cases aren't catching this bug. Here's a triggering spack.yaml:

spack:
  view:
    alldeps:
      root: view_alldeps
      select: [hdf5]
      link: all
    nodeps:
      root: view_nodeps
      select: [hdf5]
      link: roots
  specs:
  - hdf5 ~mpi

After building the hdf5 package, then run spack env view regenerate.

Error message

Here's what you get:

ls view*/lib

view_alldeps/lib:
libhdf5.310.3.0.dylib       libhdf5.dylib               libhdf5_tools.310.dylib     pkgconfig/
libhdf5.310.dylib           libhdf5.settings            libhdf5_tools.a
libhdf5.a                   libhdf5_tools.310.0.3.dylib libhdf5_tools.dylib

view_nodeps/lib:
libhdf5.310.3.0.dylib       libhdf5.dylib               libhdf5_tools.310.dylib     pkgconfig/
libhdf5.310.dylib           libhdf5.settings            libhdf5_tools.a
libhdf5.a                   libhdf5_tools.310.0.3.dylib libhdf5_tools.dylib

The views with link: all and link: roots are unexpectedly the same. The dependencies (libz, libpkgconf) are missing.

When I look through the code in lib/spack/spack/environment/environment.py and lib/spack/spack/filesystem_view.py, it looks like those dependencies are never passed into the filesystem view.

Information on your system
  • Spack: 0.23.0.dev0 (8e1bd9a40375196972a03530c01be1302693cb2b)
  • Python: 3.12.5
  • Platform: darwin-sonoma-skylake
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.

Research direction

Start by reproducing the issue with the provided spack.yaml, then run spack env view regenerate and compare the link: all and link: roots views. Trace how dependencies move through lib/spack/spack/environment/environment.py into lib/spack/spack/filesystem_view.py. Done means the link: all view includes dependencies such as libz and libpkgconf while link: roots does not.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.