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

Bypass codegen for docs.rs build #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kesyog
Copy link

@kesyog kesyog commented Apr 15, 2021

The codegen performed in the build script returns an error in the
docs.rs build environment, as write permissions seem to be locked down.

This PR skips the codegen steps in the build script if the DOCS_RS
environment variable is set.

I didn't find a simple way in my Googling to bypass codegen for all rustdoc
builds, but it doesn't seem to pose a real problem outside docs.rs anyway.

Testing

I didn't want to pull the 10GB needed to run the Docker images that
docs.rs uses. Instead, as a sanity check, I ran
cargo doc --all-features with and without the DOCS_RS environment
set and verified via strategically placed panic! macros that the
build script was bypassed when the variable was set 😬

References

Fixes #51

The codegen performed in the build script returns an error in the
docs.rs build environment, as write permissions seem to be locked down.

This PR skips the codegen steps in the build script if the `DOCS_RS`
environment variable is set.

 #### Testing

 I didn't want to pull the 10GB needed to run the Docker images that
 docs.rs uses. Instead, as a sanity check, I ran
 `cargo doc --all-features` with and without the `DOCS_RS` environment
 set and verified via strategically placed `panic!` macros that the
 build script was bypassed when the variable was set 😬

 #### References

 * <https://docs.rs/about/builds#detecting-docsrs>
 * docs.rs page: <https://docs.rs/crate/google-cloud/0.2.1>
 * Failed build: <https://docs.rs/crate/google-cloud/0.2.1/builds/366129>
@xmclark
Copy link

xmclark commented May 24, 2021

The build errors suggest there is an issue with the service account. The error reads like an "empty string" error. @Hirevo do you have suggestions? I'd love to see this crate working on docs.rs.

@kesyog
Copy link
Author

kesyog commented Jun 8, 2021

Poking @Byron @mwilliammyers @Hirevo one more time

@Byron
Copy link

Byron commented Jun 8, 2021

Thanks a lot for the fix and sorry for the wait!

Even though a few people would be able to merge this PR including myself that wouldn't help with getting it published to crates.io as this needs @Hirevo.

Would merging it help at all?

For context, I am not maintaining any of these crates but created the organization.

@kesyog
Copy link
Author

kesyog commented Jun 8, 2021

Thanks for getting back. Merging it on its own wouldn't really do much as building the documentation locally already works. We'd need to deploy to crates.io afterward to get the benefit. I guess we do need @Hirevo.

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.

docs.rs fails to build google-cloud crate's documentation
3 participants