google-apis-rs / google-cloud-rs

Asynchronous Rust bindings for Google Cloud Platform APIs.
176 stars 48 forks source link

Bypass codegen for docs.rs build #52

Open kesyog opened 3 years ago

kesyog commented 3 years ago

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

xmclark commented 3 years ago

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 commented 3 years ago

Poking @Byron @mwilliammyers @Hirevo one more time

Byron commented 3 years ago

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 commented 3 years ago

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.