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

stop building crates on all targets #343

Closed
QuietMisdreavus opened this issue Apr 30, 2019 · 9 comments
Closed

stop building crates on all targets #343

QuietMisdreavus opened this issue Apr 30, 2019 · 9 comments
Labels
A-builds Area: Building the documentation for a crate E-easy Effort: Should be easy to implement and would make a good first PR S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.

Comments

@QuietMisdreavus
Copy link
Member

After seeing the build queue get backed up by crates that take a long time to build (#335), i'm starting to wonder about the utility of building crates for all platforms all the time.

Currently, when we build a crate, we build it seven times:

  • Once as the "initial" build, to prove that the crate builds in the first place. This generates the log shown in the builds page. If a crate specifies a default-target in its [package.metadata.docs.rs] it will use that target, otherwise it will build using the system's default of x86_64-unknown-linux-gnu.
  • Six more times, to fill in all the supported targets:
    • i686-apple-darwin
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu

This can cause a crate's build time to stretch out unnecessarily, especially if there are no API/docs differences between 32-/64-bit, or between Windows/Mac/Linux.

I'd like to propose removing the six extra builds, and replacing them with an additional-targets configuration item that would allow crates to choose which targets to build on. In the absence of this field, we would only build once for default-target (or x86_64-unknown-linux-gnu), and not create any additional builds.

This will allow us to build much more crates a lot faster, making it less likely that releasing a bunch of stm32 crates at the same time will clog up the queue again. On the other hand, crates would have to start listing the platforms they want to build with, instead of just depending on docs.rs to build the major platforms without asking.

@GuillaumeGomez
Copy link
Member

I think this is a good idea. Alongside this, we should try to make docs.rs specific options (more) easily available. We're starting to have a few and it'd be a shame that people don't know about them!

@dekellum
Copy link

dekellum commented May 2, 2019

Like in section Metadata for custom builds of https://docs.rs/about ?

Though it could use short descriptions of each item. In this context, I'm not personally sure what default-target does, for example.

@jamesmunns
Copy link
Member

We (embedded-wg) would definitely love a conservative opt-in version of this to prevent our crates from being built for all non-embedded targets, as typically we only build for one or a few thumb* targets.

CC @adamgreig @killercup

@jyn514
Copy link
Member

jyn514 commented Mar 14, 2020

Now that #632 is merged, you should be able to opt-in to only building one target with

[package.metadata.docs.rs]
targets = [] # or targets = ["x86_64-unknown-linux-gnu"] if you think that looks nicer

See https://docs.rs/about#metadata for full documentation.

rubberduck203 added a commit to rubberduck203/stm32f3-discovery that referenced this issue Mar 21, 2020
jyn514 added a commit to jyn514/winapi-rs that referenced this issue May 27, 2020
This makes sure that all Windows platforms will have documentation on
docs.rs even after docs.rs stops building all tier 1 targets by default.
See rust-lang/docs.rs#532 and
rust-lang/docs.rs#343 for more context.

Additionally, this stops building targets on Mac and Linux since those
targets are just empty anyway.
@jyn514 jyn514 added A-builds Area: Building the documentation for a crate E-easy Effort: Should be easy to implement and would make a good first PR S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. labels Jul 14, 2020
@marcospb19
Copy link

Hey @jyn514, do you recall why was this tagged as S-blocked?

@jyn514
Copy link
Member

jyn514 commented Jan 25, 2023

@marcospb19 it needs an RFC and I got private feedback that such an RFC likely wouldn't be accepted. At that point I gave up because I only have so much time to throw away on the rust project.

@syphar
Copy link
Member

syphar commented Sep 2, 2023

@rust-lang/docs-rs what are your thoughts on this?

seeing the last comment by Jyn & the already increased build capacity I would close this issue.

@GuillaumeGomez
Copy link
Member

No opinion.

@Nemo157
Copy link
Member

Nemo157 commented Sep 2, 2023

I would like to do it still, the current default set is going to get more and more out of date (it has i686 targets which are not really relevant anymore, but no aarch64 targets which are), but I agree that unless someone puts in the effort to actually write an RFC and get buy-in that's not going to happen anytime soon and there's no need to have an issue here. (Maybe in a few more years when the default set is more out of date it'll be easier to get buy-in to drop it instead of trying to change it).

@syphar syphar closed this as completed Sep 6, 2023
@syphar syphar closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate E-easy Effort: Should be easy to implement and would make a good first PR S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.
Projects
None yet
8 participants