-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix source code packaging #19
Conversation
…as env variable (bad behaviour).
@@ -75,7 +75,7 @@ def run_docker( | |||
docker_mount_args.extend(["--volume", f"{packaged_src_path}:/packaged-src.json"]) | |||
|
|||
if cargo_target_dir: | |||
docker_mount_args += ["--volume", f"{cargo_target_dir}:/cargo-target-dir"] | |||
docker_mount_args += ["--volume", f"{cargo_target_dir}:/rust/cargo-target-dir"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since /rust/cargo-target-dir
is used in the Docker image.
# Clean directory - useful if it contains externally-generated build artifacts | ||
clean_contract(build_directory) | ||
build_contract(build_directory, output_subdirectory, cargo_target_dir, no_wasm_opt) | ||
output_subfolder = parent_output_folder / f"{contract_name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've just moved the check if specific_contract and contract_name != specific_contract
above.
def build_contract(build_folder: Path, output_folder: Path, cargo_target_dir: Path, no_wasm_opt: bool): | ||
cargo_output_folder = build_folder / "output" | ||
meta_folder = build_folder / "meta" | ||
cargo_lock = build_folder / "wasm" / "Cargo.lock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've removed passing CARGO_TARGET_DIR
as env (not necessary).
if return_code != 0: | ||
exit(return_code) | ||
raise ErrKnown(f"Failed to build contract {build_folder}. Return code: {return_code}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raising error instead of exit
-ing.
Removing dev-dependencies, replacing test files
meta/Cargo.lock
from the packaged source code.elrond.json
andmultiversx.json
.context
name in the artifacts (to keep e.g. the Docker image name).