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

Add build summary to output of build command #1891

Merged
merged 7 commits into from
Mar 11, 2025

Conversation

leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented Feb 24, 2025

What

Add build summary displaying file location, hash, and exported functions, to the stellar contract build command.

$ stellar contract build
ℹ️ CARGO_BUILD_RUSTFLAGS=--remap-path-prefix=/Users/leighmcculloch/.cargo/registry/src= cargo rustc --manifest-path=Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
    Finished `release` profile [optimized] target(s) in 0.08s
ℹ️ Build Summary:
   Wasm File: target/wasm32-unknown-unknown/release/soroban_increment_contract.wasm
   Wasm Hash: 8153ca452b10ed4edaefeb5235145b9938786c8c6a626e060e3dce85752c0cc3
   Exported Functions: 2 found
     • _
     • increment
✅ Build Complete

Why

I think it could be helpful to output the wasm hash in the logs of builds.

It also outputs the exported functions because I was recently thinking more about the following issue, and pondering ways we could make it more obvious to folks when a build contains unexpected functions. This doesn't adequately solve that problem though, I wouldn't consider it a solution for that problem, so we should hold it as a why very loosely.

@fnando This was something that was more me experimenting with. I think it looks good, but I am not attached to it and can close it if you don't.

@leighmcculloch leighmcculloch marked this pull request as ready for review February 24, 2025 02:26
@leighmcculloch leighmcculloch requested a review from a team as a code owner February 24, 2025 02:26
@leighmcculloch leighmcculloch enabled auto-merge (squash) February 24, 2025 05:31
@leighmcculloch
Copy link
Member Author

I'd like to make a tweak to this, to hide the function list unless verbose is passed.

@fnando
Copy link
Member

fnando commented Mar 11, 2025

I'd like to make a tweak to this, to hide the function list unless verbose is passed.

@leighmcculloch you don't think showing the list every time is useful?

@leighmcculloch leighmcculloch requested a review from Ifropc March 11, 2025 21:59
@leighmcculloch
Copy link
Member Author

@Ifropc I've changed how the command output works slightly, could you take another look?

@leighmcculloch
Copy link
Member Author

@leighmcculloch you don't think showing the list every time is useful?

Hmm, maybe it is. I'm happy to wind back the verbose change. Winding it back now.

@leighmcculloch
Copy link
Member Author

Reverted. Merging as is without verbose.

@leighmcculloch
Copy link
Member Author

@Ifropc I think it needs reapproving.

@Ifropc
Copy link
Contributor

Ifropc commented Mar 11, 2025

@leighmcculloch can we hold merging it before the 22.5.0 release? I'd like to release before the EOD ideally

@leighmcculloch leighmcculloch merged commit 03fa3f9 into main Mar 11, 2025
31 of 32 checks passed
@leighmcculloch leighmcculloch deleted the contract-build-summary-output branch March 11, 2025 23:08
@leighmcculloch
Copy link
Member Author

@leighmcculloch can we hold merging it before the 22.5.0 release?

Apologies, it auto merged. If necessary we can revert, but this is a small change so it's probably fine to go as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants