Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Use Error trait in API #31

Open
epage opened this issue Aug 16, 2021 · 3 comments
Open

Use Error trait in API #31

epage opened this issue Aug 16, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@epage
Copy link

epage commented Aug 16, 2021

cargo-release and cargo-smart-release are interested in integrating this into their process (see crate-ci/cargo-release#62). anyhow works well for bins but doesn't integrate well with libs which would be the ideal way to integrate so we don't have to worry about what other software end-users have installed.

@cbonaudo cbonaudo added the enhancement New feature or request label Aug 16, 2021
@o0Ignition0o
Copy link
Member

Hey there, thanks for hopping in!

It is very true, while we first thought of cargo-breaking as a cli tool, it would actually make sense for us to eventually expose a nice library and API, probably using thiserror instead of anyhow!

I think we could make this move pretty soon, I however cannot promise we can commit to a working stable api that soon ^^'

This looks like an issue i can tackle, let's, see!

@epage
Copy link
Author

epage commented Aug 16, 2021

I'm fine dealing with breakages. Things that would help through them

  • An API following semver (might be good to break the API from the CLI since their versioning might need to be independent)
  • Document breaking changes

@scrabsha
Copy link
Contributor

scrabsha commented Sep 2, 2021

An implementation detail that just popped on my head:
Due to how we interact with the Rust API and Cargo, we need to transmit the diagnostics (or any error) generated while performing analysis in the glue crate back to the library entry point. A simple way to achieve it would be to write the invocation result to a temporary file and read it back from the entry point. I'm not sure that every error object we use implements Serialize/Deserialize, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants