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

fix(publish): Don't strip non-dev features #14325

Merged
merged 8 commits into from
Jul 31, 2024
Merged

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    0ece9b9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    691c5a2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9e730ec View commit details
    Browse the repository at this point in the history
  4. refactor(package): Make target filtering optional

    We'll be doing a second `prepare_for_publish` call that doesn't need the
    filtering, we don't have access to the `included`, and we don't want the
    warnings duplicated.
    epage committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    53fe2b6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dc9014d View commit details
    Browse the repository at this point in the history
  6. fix(publish): Don't strip non-dev features

    First, we added support for stripping of local-only dev-dependencies.
    This was dual-implemented for `Cargo.toml` and `Summary`.
    
    This left off stripping of `dep/feature` that reference dev-dependencies
    (enabling features within dev-dependencies).
    When we fixed this, we again dual-implemented it.
    
    The `Cargo.toml` version was correct but the `Summary` version was
    instead stripping too many features,
    particularly features that reference renamed dependencies.
    We didn't have tests for this case and it wasn't caught earlier because
    crates.io re-generates the `Summary` from `Cargo.toml`, ignoring what we
    post.
    That makes this only show up with custom registries that trust what
    Cargo posts.
    
    Rather than fixing the `Summary` generation, I remove the
    dual-implementation and instead generate the `Summary` from the
    published `Cargo.toml`.
    Unfortunately, we don't have access directly to the packaged
    `Cargo.toml`.
    It could be passed around and I originally did so, hoping to remove use
    of the local `Package`.
    However, the local `Package` is needed for things like reading the
    `README`.
    So I scaled back and isolate the change to only what needs it.
    This also makes it easier for `prepare_transmit` callers.
    Fully open to someone exploring removing this extra `prepare_for_publish` in the future.
    
    Fixes rust-lang#14321
    epage committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    eddf7b7 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Configuration menu
    Copy the full SHA
    fb41fc3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7c17862 View commit details
    Browse the repository at this point in the history