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

chore: Compile only the package's libraries #25

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

nicolaslara
Copy link
Contributor

https://github.com/CosmWasm/rust-optimizer/pull/91/files introduces the required --lib argument when optimizing with rust-optimizer/workspace-optimizer. This enables the schema generation to live under src/bin instead of examples/.

This PR applies the same change to cw-optimizoor

@webmaster128
Copy link

The reason behind this is the following. In contrast to examples, the bin targets are built as part of the default cargo build. But CosmWasm contracts do not contains any bin which is compiled to Wasm. It is all happening in the lib part. So no matter what schema generators do, using --lib makes sense and is safe for old and new contracts. Recently my collegues concluded we prefer using a bin target instead of an examples target for the new schemas best practice. This turns this previously optional --lib argument into a required one.

@webmaster128
Copy link

@mandrean mandrean changed the title Compiling only the package's libraries Compile only the package's libraries Dec 21, 2022
@mandrean mandrean changed the title Compile only the package's libraries chore: Compile only the package's libraries Dec 21, 2022
@mandrean mandrean merged commit 5e44051 into mandrean:master Dec 21, 2022
@mandrean
Copy link
Owner

Thanks for the PR @nicolaslara and the shout-out @webmaster128!

@webmaster128
Copy link

My pleasure.

The more I think about it, the more I like this project. I now understand that it is fundamentally different to rust-optimizer and both projects have their place. More on that soon as part of CosmWasm/optimizer#101. Cheers!

mandrean added a commit that referenced this pull request Dec 21, 2022
Co-authored-by: Sebastian Mandrean <sebastian.mandrean@gmail.com>
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.

None yet

3 participants