Skip to content

Commit

Permalink
add message for generating Cargo.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
branfosj authored Oct 16, 2024
1 parent 5718bdf commit ee22b65
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 ee22b65

Please sign in to comment.