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

[beta-1.81] fix(publish): Don't strip non-dev features #14328

Merged
merged 7 commits into from
Jul 31, 2024

Commits on Jul 31, 2024

  1. Configuration menu
    Copy the full SHA
    ad7d650 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3eb2986 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    68147de View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a4b1143 View commit details
    Browse the repository at this point in the history
  5. 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 31, 2024
    Configuration menu
    Copy the full SHA
    09eb536 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    aa68ea7 View commit details
    Browse the repository at this point in the history
  7. 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 31, 2024
    Configuration menu
    Copy the full SHA
    25ecfce View commit details
    Browse the repository at this point in the history