Skip to content

Always use lib.name for Wasm output file name#277

Merged
cmichi merged 4 commits into
masterfrom
cmichi-fix-build-error-on-lib-package-name-mismatch
May 25, 2021
Merged

Always use lib.name for Wasm output file name#277
cmichi merged 4 commits into
masterfrom
cmichi-fix-build-error-on-lib-package-name-mismatch

Conversation

@cmichi

@cmichi cmichi commented May 21, 2021

Copy link
Copy Markdown
Collaborator

Closes #221.

@cmichi
cmichi requested a review from ascjones May 21, 2021 20:04
Comment thread src/crate_metadata.rs
// {target_dir}/{package_name}.wasm
let mut dest_wasm = target_directory.clone();
dest_wasm.push(package_name.clone());
dest_wasm.push(lib_name.clone());

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.

Note that package_name will still be used for the contract bundle, which could be confusing when viewing the target dir if they are different.

We could just replace the package_name field CrateMetadata with something like contract_artifact_name, and populate with the lib name.

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.

Good point, I updated the PR.

@ascjones ascjones left a comment

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.

LGTM

@cmichi
cmichi merged commit 89ce67c into master May 25, 2021
@cmichi
cmichi deleted the cmichi-fix-build-error-on-lib-package-name-mismatch branch May 25, 2021 08:49
@cmichi cmichi mentioned this pull request May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation fails when lib.name and package.name are different

2 participants