Skip to content

Commit

Permalink
Merge pull request #3491 from branfosj/generate-lockfile
Browse files Browse the repository at this point in the history
enhance Cargo easyblock to printmessage for generating Cargo.lock if it's missing
  • Loading branch information
boegel authored Oct 16, 2024
2 parents 5718bdf + ee22b65 commit d26d7b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion easybuild/easyblocks/generic/cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,12 @@ def generate_crate_list(sourcedir):
import toml

cargo_toml = toml.load(os.path.join(sourcedir, 'Cargo.toml'))
cargo_lock = toml.load(os.path.join(sourcedir, 'Cargo.lock'))

try:
cargo_lock = toml.load(os.path.join(sourcedir, 'Cargo.lock'))
except FileNotFoundError as err:
print("\nNo Cargo.lock file found. Generate one with 'cargo generate-lockfile'\n")
raise err

try:
app_name = cargo_toml['package']['name']
Expand Down

0 comments on commit d26d7b7

Please sign in to comment.