-
Notifications
You must be signed in to change notification settings - Fork 4
feat: display output of failed builds #125
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
Changes from 4 commits
cf406fc
c538413
3adff89
9d619a7
2ba49c6
d34388d
697fa56
f3be5f8
d05efd4
8a284f7
3481c70
4ae1e02
a408d24
30e672d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,17 +22,18 @@ impl Build for Prebuilt { | |
| &self, | ||
| step: &Step, | ||
| params: &Params, | ||
| _: Option<Sender<String>>, | ||
| stdio: Sender<String>, | ||
| ) -> Result<(), BuildError> { | ||
| // Adapter | ||
| let adapter = match step { | ||
| Step::Prebuilt(v) => v, | ||
| _ => panic!("expected prebuilt adapter"), | ||
| let Step::Prebuilt(adapter) = step else { | ||
| panic!("expected prebuilt adapter"); | ||
| }; | ||
|
|
||
| let wasm = match &adapter.source { | ||
| // Local path | ||
| SourceField::Local(s) => { | ||
| stdio | ||
| .send(format!("Reading local file: {}", s.path)) | ||
| .await?; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will never actually be displayed to the user, right? Because it will (likely) finish almost instantly.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will not be visible if everything works out fine, but if there is an error it will show up in the full error output |
||
| read(¶ms.path.join(&s.path)).context("failed to read prebuilt canister file")? | ||
| } | ||
|
|
||
|
|
@@ -43,6 +44,7 @@ impl Build for Prebuilt { | |
|
|
||
| // Parse Url | ||
| let u = Url::from_str(&s.url).context("failed to parse prebuilt canister url")?; | ||
| stdio.send(format!("Fetching remote file: {}", u)).await?; | ||
|
|
||
| // Construct request | ||
| let req = Request::new( | ||
|
|
@@ -73,6 +75,7 @@ impl Build for Prebuilt { | |
|
|
||
| // Verify the checksum if it's provided | ||
| if let Some(expected) = &adapter.sha256 { | ||
| stdio.send("Verifying checksum".to_string()).await?; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above - will it actually get shown, if it completes almost instantly? |
||
| // Calculate checksum | ||
| let actual = hex::encode({ | ||
| let mut h = Sha256::new(); | ||
|
|
@@ -89,6 +92,9 @@ impl Build for Prebuilt { | |
| } | ||
|
|
||
| // Set WASM file | ||
| stdio | ||
| .send(format!("Writing WASM file: {}", params.output)) | ||
| .await?; | ||
| write( | ||
| ¶ms.output, // path | ||
| &wasm, // contents | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have this
script_handlerandsetup_output_handlerif you are now handling output in the command itself? Can the script handler not be made to support outputting failure information as well? The point was to remove the burden of handling these details from the command (I believe this applies tobuildandsyncboth).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworked output display significantly. It's now all handled by the progress bar