Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion util/fetch_cargo_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from spack_repo.builtin.build_systems.python import PythonPackage
from spack.package_base import PackageBase
from spack.util.executable import Executable, which
from llnl.util.filesystem import working_dir
from spack.llnl.util.filesystem import working_dir
from spack.store import find
from spack.util.environment import EnvironmentModifications
from spack.error import SpackError
Expand Down Expand Up @@ -117,6 +117,7 @@
cargo_exe = Executable(cargo_wrapper)

env = EnvironmentModifications()
env.set("CARGO_HOME", cargo_home)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised this is needed, because of lines 44-47 above

cargo_home = os.getenv("CARGO_HOME")
if not cargo_home:
    raise SpackError("CARGO_HOME must be set")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. It seems that maybe there's something about the Executable logic that's not automatically propagating it? 🤷

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed something similar with the wrapper script, #!/usr/bin/env bash doesn't work anymore. I had to change it to just #!/bin/bash in PR #1798

if cargo_bin:
env.prepend_path("PATH", cargo_bin)
for root, dirs, files in os.walk(pkg.stage.source_path):
Expand Down