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

Test that docs.rs can build our crates #3802

Closed
Michael-F-Bryan opened this issue Apr 20, 2023 · 11 comments
Closed

Test that docs.rs can build our crates #3802

Michael-F-Bryan opened this issue Apr 20, 2023 · 11 comments
Assignees
Labels
💎 Bounty build-system The Wasmer repo's build and CI system 🎉 enhancement New feature! priority-low Low priority issue 💰 Rewarded
Milestone

Comments

@Michael-F-Bryan
Copy link
Contributor

Motivation

We found that docs for the wasmer 3.2.0 crate weren't able to build in docs.rs because of some bugs around conditional compliation. The underlying issue was fixed in #3791, but it'd be nice to make sure CI warns us when this happens.

Proposed solution

We can use the docs.rs CLI to build things locally (instructions).

In theory, it's "just" a case of running the following:

$ cargo install --git 
$ for $crate in $workspace; do docs-rs  build crate --local /path/to/$crate; done

(this should be automatable using the cargo-metadata crate and a cargo xtask helper)

Alternatives

We can always leave things as they were done in #3791 and make sure we keep that Makefile command in sync with our [package.metadata.docs.rs] metadata.

@Michael-F-Bryan Michael-F-Bryan added 🎉 enhancement New feature! priority-low Low priority issue build-system The Wasmer repo's build and CI system labels Apr 20, 2023
@Michael-F-Bryan Michael-F-Bryan added this to the v4.0 milestone Apr 20, 2023
@Michael-F-Bryan Michael-F-Bryan self-assigned this Apr 20, 2023
@syrusakbary
Copy link
Member

/bounty $100

@algora-pbc
Copy link

algora-pbc bot commented Apr 22, 2023

💎 $100.00 bounty created by syrusakbary
🙋‍♂️ If you'd like to solve this issue, comment below to get assigned
👉 To claim this bounty, submit a pull request that includes the text /claim #3802 somewhere in its body
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to wasmerio/wasmer!

@meskill
Copy link
Contributor

meskill commented Apr 23, 2023

Can I work on this?

@syrusakbary
Copy link
Member

@meskill of course!

@meskill
Copy link
Contributor

meskill commented Apr 24, 2023

I've tried to build and run the docs.rs cli but as mentioned here it actually requires the running database and ability to run container. That all sounds a bit like overkill for just the testing purpose.

My suggestion is to automate process of building the right set of features for building doc by implementing bash script that reads Cargo.toml content and if there are docs.rs related features it will build the doc with these features passed. The implemented script is in #3819

@algora-pbc
Copy link

algora-pbc bot commented Apr 25, 2023

💡 meskill submitted a pull request that claims the bounty. You can visit your org dashboard to reward.

@Michael-F-Bryan
Copy link
Contributor Author

Michael-F-Bryan commented Apr 27, 2023

My suggestion is to automate process of building the right set of features for building doc by implementing bash script that reads Cargo.toml content and if there are docs.rs related features it will build the doc with these features passed.

@meskill I don't think #3819 completely solves the problem. That PR only tested packages with [package.metadata.docs.rs] annotations, so CI says things are fine when the docs for crates like wasmer-cache are broken (#3826).

Can you tweak the script to build docs for all crates in the repository, and use the docs.rs metadata to figure out how the --features flag should be modified.

@ptitSeb
Copy link
Contributor

ptitSeb commented Apr 27, 2023

I'll handle this. I want the docs to be publichsed for the 3.3

@meskill
Copy link
Contributor

meskill commented Apr 27, 2023

Oh, well, I expected some other job in pipelines would show the errors in that case, but seems like they are built with different set of features.

Ok, let me try to improve the script. But, looking at the build log output, I can see a lot of errors that I'm not sure I can fix quickly in order to pass the new test pipeline.

@algora-pbc
Copy link

algora-pbc bot commented Apr 27, 2023

🎉🎈 @meskill has been awarded $100.00! 🎈🎊

@meskill
Copy link
Contributor

meskill commented Apr 28, 2023

I see that @ptitSeb has already changed the script to run on all packages. I've also changed the script accordingly. My version might be used as a reference in case you face problems with figuring out workspace members right.

@ptitSeb ptitSeb closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty build-system The Wasmer repo's build and CI system 🎉 enhancement New feature! priority-low Low priority issue 💰 Rewarded
Projects
None yet
Development

No branches or pull requests

4 participants