-
Notifications
You must be signed in to change notification settings - Fork 796
Conversation
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'm a bit skeptical that messing with module alias just to get docs working is the right way to fix this.
#[doc(hidden)] | ||
#[allow(unused_extern_crates)] | ||
extern crate self as ethers; | ||
|
||
#[doc(hidden)] | ||
pub use ethers_contract as contract; | ||
|
||
#[doc(hidden)] | ||
pub use ethers_core as core; | ||
|
||
#[doc(hidden)] | ||
pub use ethers_providers as providers; |
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.
hmm, I'm not sure I like that these are now always there.
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.
if you have a better way to find ethers crate names then go ahead, this is a patch for builds when that is not possible, and only for our internal crates
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 don't have a better solution for this, and seems like this is a proper fix.
But let's document why we're doing this
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.
agree with Matt that it sucks we need to do this, but let's roll with it
Motivation
For some reason (I believe because the build process isn't normal and maybe our resolution doesn't work with the given environment) the docs.rs builds always return
ethers
as the crate name (default). Tested multiple times on a local docs.rs instance and I can 99.9999999% confirm that this PR solves it by doing the following:ethers
#[cfg(docsrs)]
on the re-exports)cfg
s, just to be safethis needs to be done in every (release) crate that uses a macro that uses
ethers_core::macros::*
, which right now includes contract and middleware.Solution
PR Checklist