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

Do not postprocess or generate metadata if contract unchanged #964

Merged
merged 13 commits into from
Feb 13, 2023

Conversation

ascjones
Copy link
Collaborator

@ascjones ascjones commented Feb 9, 2023

Closes #949.

Checks if the original compiled .wasm file in target/ink/wasm32-unknown-unknown/release/ has changed. If it is unchanged after building, then skips the postprocessing and metadata gen iff all of the resulting contract artefacts are already there.

Note: because it must perform the build step first before determining whether the contract has changed, the first step now shows [1/*]

When there are changed to the contract:

image

When there have been no changes to the contract:

image

Copy link
Collaborator

@cmichi cmichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a line to the user output, explaining that metadata was not updated because contract is unchanged?

A log::debug! when deciding to not build further would also be helpful.

@ascjones
Copy link
Collaborator Author

Could you add a line to the user output, explaining that metadata was not updated because contract is unchanged?

A log::debug! when deciding to not build further would also be helpful.

There is already a tracing::info! there for this case (we no longer use log).

Here is the message saying artifacts are unchanged:

image

@ascjones ascjones merged commit a57a5f8 into master Feb 13, 2023
@ascjones ascjones deleted the aj/unchanged branch February 13, 2023 13:19
@ascjones ascjones mentioned this pull request Feb 14, 2023
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.

cargo contract does too much work on unchanged contracts
2 participants