{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreifwkzijrdhgirahpnwrijryzhslwbp3k4hmozj7rzj2ksrhssroou",
    "uri": "at://did:plc:lujatorbzcq2chhxnvjgc464/app.bsky.feed.post/3mikmdl4arqn2"
  },
  "path": "/2026/04/04/docsrs-only-default-targets/",
  "publishedAt": "2026-04-04T00:00:00.000Z",
  "site": "https://blog.rust-lang.org",
  "tags": [
    "docs.rs metadata"
  ],
  "textContent": "#  Building fewer targets by default\n\nOn **2026-05-01** , docs.rs will make a **breaking** change to its build behavior.\n\nToday, if a crate does not define a `targets` list in its docs.rs metadata, docs.rs builds documentation for a default list of five targets.\n\nStarting on **2026-05-01** , docs.rs will instead build documentation for only the default target unless additional targets are requested explicitly.\n\nThis is the next step in a change we first introduced in 2020, when docs.rs added support for opting into fewer build targets. Most crates do not compile different code for different targets, so building fewer targets by default is a better fit for most releases. It also reduces build times and saves resources on docs.rs.\n\nThis change only affects:\n\n  1. new releases\n  2. rebuilds of old releases\n\n\n\n##  How is the default target chosen?\n\nIf you do not set `default-target`, docs.rs uses the target of its build servers: `x86_64-unknown-linux-gnu`.\n\nYou can override that by setting `default-target` in your docs.rs metadata:\n\n\n    [package.metadata.docs.rs] default-target = \"x86_64-apple-darwin\"\n\n##  How do I build documentation for additional targets?\n\nIf your crate needs documentation to be built for more than the default target, define the full list explicitly in your `Cargo.toml`:\n\n\n    [package.metadata.docs.rs] targets = [  \"x86_64-unknown-linux-gnu\",  \"x86_64-apple-darwin\",  \"x86_64-pc-windows-msvc\",  \"i686-unknown-linux-gnu\",  \"i686-pc-windows-msvc\" ]\n\nWhen `targets` is set, docs.rs will build documentation for exactly those targets.\n\ndocs.rs still supports any target available in the Rust toolchain. Only the default behavior is changing.",
  "title": "docs.rs: building fewer targets by default",
  "updatedAt": "2026-04-04T00:00:00.000Z"
}