Skip to content
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

secret-contract-optimizer: only build libraries #1484

Merged
merged 2 commits into from
Aug 6, 2023

Conversation

kent-3
Copy link
Contributor

@kent-3 kent-3 commented Jul 24, 2023

If the contract contains a binary (such as this https://github.com/scrtlabs/secret-template/tree/master/src/bin) it will not work with the optimizer. The --lib flag should be included to only build the package's library.

Example error:

error: can't compile schema generator for the `wasm32` arch
       hint: are you trying to compile a smart contract without specifying `--lib`?
  --> src/bin/schema.rs:6:5

@assafmo
Copy link
Member

assafmo commented Jul 25, 2023

How does this work both ways?

@kent-3
Copy link
Contributor Author

kent-3 commented Jul 27, 2023

How does this work both ways?

I'm not sure what you mean. When using the optimizer you wouldn't want/need to build any binaries. But by specifying the --lib flag you can keep them in your src folder.

Right now if you want to use the optimizer, you need to remove any binaries from your src folder and Cargo.toml.

@assafmo assafmo merged commit c03451e into scrtlabs:master Aug 6, 2023
2 of 3 checks passed
@kent-3 kent-3 deleted the patch-1 branch August 6, 2023 19:49
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.

2 participants