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

feat(solc): add Reporter type #883

Merged
merged 2 commits into from Feb 8, 2022
Merged

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Feb 8, 2022

Motivation

Ref foundry-rs/foundry#628
Povide a way to emit custom output at certain points in the compiler pipeline

Solution

use a global Reporter that gets invoked in the code, the Reporter can the invoked exactly once ethers_solc::report::init(BasicStdoutReporter::default());

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

lgtm - we need to use init(Report::new(BasicStdoutReporter::default())) on foundry right?

let output = solc.compile(&input)?;

report::solc_spawn(&solc, &version, &input);
let output = solc.compile_exact(&input)?;
Copy link
Owner

Choose a reason for hiding this comment

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

why compile -> compile_exact?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

drive by fix to make it the same as in the parallel version, since the input already includes the sources and all its imports we want to limit the output to exactly those.

@mattsse
Copy link
Collaborator Author

mattsse commented Feb 8, 2022

lgtm - we need to use init(Report::new(BasicStdoutReporter::default())) on foundry right?

exactly, if we need more verbosity we can simply implement another reporter

@mattsse
Copy link
Collaborator Author

mattsse commented Feb 8, 2022

will fix all cargo warnings in a follow up, there are a bunch of those

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.

None yet

2 participants