Skip to content

spack develop build_stage directory #43393

@simonpintarelli

Description

@simonpintarelli

Steps to reproduce

The build directory doesn't persist or is deleted randomly for developed specs in an anonymous environment.

Here is a minimal reproducer:

wget https://prdownloads.sourceforge.net/lzmautils/files/xz-5.4.6.tar.bz2
tar xf xz-5.4.6.tar.bz2
spack env create xz
spack -e xz add xz
spack -e xz develop -p $(realpath xz-5.4.6) [email protected]
spack -e xz install
# obtain the build directory
spack -e xz location -b

Error message

Previously this would have created a build directory in the source directory spack-build-<hash>. If I understood correctly, #41373 changed this, now the build directory is created in config:build_stage and a symlink is created in the source tree instead.

When adding:

config:
    build_stage: ./stage

to spack.yaml in the environment, the build directory is deleted immediately after installation.

In case I don't change config:build_stage, the build directory sometimes persists in /tmp, although it's not clear under which conditions/why, it seems to get deleted randomly at some later point (e.g. when running an arbitrary spack command).

The current behavior isn't very useful for a developer workflow:

  1. building from scratch is slow
  2. it's difficult to obtain compile_commands.json or similar to use with an IDE

Information on your system

  • Spack: 0.22.0.dev0 (e5fdb90)
  • Python: 3.11.8
  • Platform: linux-arch-skylake
  • Concretizer: clingo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThe issue needs to be prioritized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions