Skip to content

Comments

SDK-791 Better error message for failing custom build#911

Closed
luc-mercier wants to merge 1 commit intomasterfrom
better-error-message
Closed

SDK-791 Better error message for failing custom build#911
luc-mercier wants to merge 1 commit intomasterfrom
better-error-message

Conversation

@luc-mercier
Copy link

Fixes SDK-791: prints the failing custom build command when it fails.


let output = cmd.output().expect("Could not run custom tool.");
let output = cmd.output().unwrap_or_else(|_| {
panic!(
Copy link
Contributor

Choose a reason for hiding this comment

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

unwrap_or_else() means to return a value, but in this case it doesn't so you can use expect.

In any case, we normally return error types that result into error messages. We try to avoid panic here because there could be other custom tools and we want to surface all errors.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks Hans. I actually closed https://dfinity.atlassian.net/browse/SDK-791 because the command line was there --- not in the error message, but directly above. See Jira. Since
(a) the info is already there
(b) the debug string form std::process::Cmd is actually not very nice

I think it's fine the way it is, which is why I closed the ticket.

@hansl hansl closed this Jan 6, 2021
@hansl
Copy link
Contributor

hansl commented Jan 6, 2021

Closing this as this new feature isn't needed (see above).

@hansl hansl deleted the better-error-message branch January 6, 2021 19:01
dfinity-bot added a commit that referenced this pull request Jun 10, 2021
## Changelog for advisory-db:
Branch: master
Commits: [rustsec/advisory-db@bd8a0f67...86ed5681](rustsec/advisory-db@bd8a0f6...86ed568)

* [`a7ffa73f`](rustsec/advisory-db@a7ffa73) Add security advisory for evm crate related to memory over-allocation ([RustSec/advisory-db⁠#909](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/909))
* [`26467a96`](rustsec/advisory-db@26467a9) Assigned RUSTSEC-2021-0066 to evm ([RustSec/advisory-db⁠#910](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/910))
* [`7e4cbf61`](rustsec/advisory-db@7e4cbf6) evm-core: fix crate name ([RustSec/advisory-db⁠#911](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/911))
* [`60b9a9e9`](rustsec/advisory-db@60b9a9e) Bump rustsec-admin to v0.4.3 ([RustSec/advisory-db⁠#919](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/919))
* [`c8a2c774`](rustsec/advisory-db@c8a2c77) Add RUSTSEC notice for CVE-2021-32629, a Cranelift miscompilation bug. ([RustSec/advisory-db⁠#918](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/918))
* [`1c038433`](rustsec/advisory-db@1c03843) fixes [RustSec/advisory-db⁠#915](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/915) - remove duplicate word ([RustSec/advisory-db⁠#916](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/916))
* [`256e923a`](rustsec/advisory-db@256e923) Assigned RUSTSEC-2021-0067 to cranelift-codegen ([RustSec/advisory-db⁠#921](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/921))
* [`23334c68`](rustsec/advisory-db@23334c6) Add advisory for iced-x86 soundness bug ([RustSec/advisory-db⁠#914](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/914))
* [`36bf272a`](rustsec/advisory-db@36bf272) iced-x86: fix lint ([RustSec/advisory-db⁠#922](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/922))
* [`a845d0a9`](rustsec/advisory-db@a845d0a) Assigned RUSTSEC-2021-0068 to iced-x86 ([RustSec/advisory-db⁠#923](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/923))
* [`86e2c664`](rustsec/advisory-db@86e2c66) Add lettre smtp vulnerability ([RustSec/advisory-db⁠#924](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/924))
* [`aa04921a`](rustsec/advisory-db@aa04921) Assigned RUSTSEC-2021-0069 to lettre ([RustSec/advisory-db⁠#925](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/925))
* [`3e51834f`](rustsec/advisory-db@3e51834) Make ranges in trust-dns-proto advisory non-overlapping ([RustSec/advisory-db⁠#929](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/929))
* [`40afced5`](rustsec/advisory-db@40afced) Remove range overlaps, fix some range specifications ([RustSec/advisory-db⁠#930](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/930))
* [`46e657b2`](rustsec/advisory-db@46e657b) Add advisory for nalgebra VecStorage/MatrixVec ([RustSec/advisory-db⁠#931](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/931))
* [`9984f61e`](rustsec/advisory-db@9984f61) Assigned RUSTSEC-2021-0070 to nalgebra ([RustSec/advisory-db⁠#932](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/932))
* [`958120be`](rustsec/advisory-db@958120b) Update RUSTSEC-2020-0043.md ([RustSec/advisory-db⁠#934](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/934))
* [`86ed5681`](rustsec/advisory-db@86ed568) Add GHSA mentions to `aliases` field. This is becoming more important with OSV enabling interop between databases ([RustSec/advisory-db⁠#937](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/937))
mergify bot pushed a commit that referenced this pull request Jun 10, 2021
## Changelog for advisory-db:
Branch: master
Commits: [rustsec/advisory-db@bd8a0f67...86ed5681](rustsec/advisory-db@bd8a0f6...86ed568)

* [`a7ffa73f`](rustsec/advisory-db@a7ffa73) Add security advisory for evm crate related to memory over-allocation ([RustSec/advisory-db⁠#909](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/909))
* [`26467a96`](rustsec/advisory-db@26467a9) Assigned RUSTSEC-2021-0066 to evm ([RustSec/advisory-db⁠#910](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/910))
* [`7e4cbf61`](rustsec/advisory-db@7e4cbf6) evm-core: fix crate name ([RustSec/advisory-db⁠#911](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/911))
* [`60b9a9e9`](rustsec/advisory-db@60b9a9e) Bump rustsec-admin to v0.4.3 ([RustSec/advisory-db⁠#919](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/919))
* [`c8a2c774`](rustsec/advisory-db@c8a2c77) Add RUSTSEC notice for CVE-2021-32629, a Cranelift miscompilation bug. ([RustSec/advisory-db⁠#918](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/918))
* [`1c038433`](rustsec/advisory-db@1c03843) fixes [RustSec/advisory-db⁠#915](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/915) - remove duplicate word ([RustSec/advisory-db⁠#916](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/916))
* [`256e923a`](rustsec/advisory-db@256e923) Assigned RUSTSEC-2021-0067 to cranelift-codegen ([RustSec/advisory-db⁠#921](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/921))
* [`23334c68`](rustsec/advisory-db@23334c6) Add advisory for iced-x86 soundness bug ([RustSec/advisory-db⁠#914](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/914))
* [`36bf272a`](rustsec/advisory-db@36bf272) iced-x86: fix lint ([RustSec/advisory-db⁠#922](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/922))
* [`a845d0a9`](rustsec/advisory-db@a845d0a) Assigned RUSTSEC-2021-0068 to iced-x86 ([RustSec/advisory-db⁠#923](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/923))
* [`86e2c664`](rustsec/advisory-db@86e2c66) Add lettre smtp vulnerability ([RustSec/advisory-db⁠#924](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/924))
* [`aa04921a`](rustsec/advisory-db@aa04921) Assigned RUSTSEC-2021-0069 to lettre ([RustSec/advisory-db⁠#925](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/925))
* [`3e51834f`](rustsec/advisory-db@3e51834) Make ranges in trust-dns-proto advisory non-overlapping ([RustSec/advisory-db⁠#929](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/929))
* [`40afced5`](rustsec/advisory-db@40afced) Remove range overlaps, fix some range specifications ([RustSec/advisory-db⁠#930](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/930))
* [`46e657b2`](rustsec/advisory-db@46e657b) Add advisory for nalgebra VecStorage/MatrixVec ([RustSec/advisory-db⁠#931](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/931))
* [`9984f61e`](rustsec/advisory-db@9984f61) Assigned RUSTSEC-2021-0070 to nalgebra ([RustSec/advisory-db⁠#932](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/932))
* [`958120be`](rustsec/advisory-db@958120b) Update RUSTSEC-2020-0043.md ([RustSec/advisory-db⁠#934](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/934))
* [`86ed5681`](rustsec/advisory-db@86ed568) Add GHSA mentions to `aliases` field. This is becoming more important with OSV enabling interop between databases ([RustSec/advisory-db⁠#937](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/937))
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