diff --git a/lib/ramble/ramble/spack_runner.py b/lib/ramble/ramble/spack_runner.py index 68e45ee0f..d6780860d 100644 --- a/lib/ramble/ramble/spack_runner.py +++ b/lib/ramble/ramble/spack_runner.py @@ -602,7 +602,7 @@ def inventory_hash(self, require_exist=False): contents_to_hash = None if not self.dry_run: - if not lock_exists and require_exist: + if not lock_exists and (require_exist or len(self.env_contents) == 0): logger.die( 'spack.lock file does not exist in environment ' f'{self.env_path}\n' diff --git a/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py b/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py index d64f8a9b7..a6cff946a 100644 --- a/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py +++ b/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py @@ -49,8 +49,13 @@ def test_unsetup_workspace_cannot_analyze(mutable_config, MY_VAR: 'TEST' spack: concretized: true - packages: {} - environments: {} + packages: + zlib: + spack_spec: zlib + environments: + zlib: + packages: + - zlib """ workspace_name = 'test_unsetup_workspace_cannot_analyze' with ramble.workspace.create(workspace_name) as ws: