Skip to content

Add a second "DO NOT USE" feature to gix-packetline-blocking #1939

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

EliahKagan
Copy link
Member

@EliahKagan EliahKagan commented Apr 7, 2025

This adds a futures-lite feature to gix-packetline-blocking.

The new feature is undocumented except for the warning not to use it. It does nothing, and its purpose is to support an existing internal use of gix-packetline-blocking through an alias named gix-packetline.

This new feature should never be used except to keep cargo check commands with --workspace that list gix-packetline/futures-lite from failing due to the absent feature. Such cargo check commands are rare and cargo check should not typically be used this way. But RustRover automatically composes and runs such a command. This fixes a RustRover project discovery breakage commented on in #1929.

This "ghost feature" may be removed without warning. Nothing should rely on it in production or otherwise in a significant way. It is a bug for any software to break or change behavior if it is removed.

This addition is similar to the addition in be4de0d (#1123) of the async-io feature of gix-packetline-blocking, which likewise shouldn't be used. However, gix-packetline-blocking/futures-lite is even less elegant than gix-packetline-blocking/async-io, since gix-packetline doesn't explicitly delcare a futures-lite feature. Instead, we currrently don't use dep: for futures-lite because it breaks cargo-auditable (#1929).


This is not ready because there is at least one alternative that I am going to at least describe here and possibly change this to use. See #1929 (comment) for context, especially the part under "Edit 3".

This adds a `futures-lite` feature to `gix-packetline-blocking`.

The new feature is undocumented except for the warning not to use
it. It does nothing, and its purpose is to support an existing
internal use of `gix-packetline-blocking` through an alias named
`gix-packetline`.

This new feature should never be used except to keep `cargo check`
commands with `--workspace` that list `gix-packetline/futures-lite`
from failing due to the absent feature. Such `cargo check` commands
are rare and `cargo check` should not typically be used this way.
But RustRover automatically composes and runs such a command. This
fixes a RustRover project discovery breakage commented on in GitoxideLabs#1929.

This "ghost feature" may be removed without warning. Nothing should
rely on it in production or otherwise in a significant way. It is a
bug for any software to break or change behavior if it is removed.

This addition is similar to the addition in be4de0d (GitoxideLabs#1123) of the
`async-io` feature of `gix-packetline-blocking`, which likewise
shouldn't be used. However, `gix-packetline-blocking/futures-lite`
is even less elegant than `gix-packetline-blocking/async-io`,
since `gix-packetline` doesn't explicitly delcare a `futures-lite`
feature. Instead, we currrently don't use `dep:` for `futures-lite`
because it breaks `cargo-auditable` (GitoxideLabs#1929).
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great - I can confirm that this fixes the RustRover issue. Thanks so much for looking into this!

@EliahKagan EliahKagan marked this pull request as ready for review April 8, 2025 01:33
@EliahKagan
Copy link
Member Author

In that case, I'll merge this, then propose the alternative separately.

@EliahKagan EliahKagan merged commit 62ec0e3 into GitoxideLabs:main Apr 8, 2025
21 of 22 checks passed
@EliahKagan EliahKagan deleted the run-ci/ghost-feature branch April 8, 2025 01:34
EliahKagan added a commit to EliahKagan/gitoxide that referenced this pull request Apr 8, 2025
This removes the `gix-packetline-blocking/futures-lite` "ghost
feature" added in d5dd239 (GitoxideLabs#1939), and instead:

- Changes `gix-filter` to depends on `gix-packetline-blocking`
  without aliasing it `gix-packetline`.

- Replaces uses of `gix_packetline` with `gix_packetline_blocking`
  in the code of `gix-filter`.

Thus, this replaces the solution in GitoxideLabs#1939 for the problem discussed
in GitoxideLabs#1929 (comment)
with a different solution that avoids carrying a "ghost feature."

In contrast, the long-standing `gix-packetline-blocking/async-io`
feature added in be4de0d (GitoxideLabs#1123), though it should not be used,
is *not* removed, because:

- It is referenced in attributes in `gix-packetline-blocking` code
  (because `gix-packetline-blocking/src` is copied from
  `gix-packetline/src` via `etc/copy-packetline.sh`). So removing
  it would cause the `clippy` run in the CI `lint` job to fail, as
  well as likely making various other reasonable operations fail.
EliahKagan added a commit to EliahKagan/gitoxide that referenced this pull request Apr 8, 2025
This removes the `gix-packetline-blocking/futures-lite` "ghost
feature" added in d5dd239 (GitoxideLabs#1939), and instead:

- Changes `gix-filter` to depends on `gix-packetline-blocking`
  without aliasing it `gix-packetline`.

- Replaces uses of `gix_packetline` with `gix_packetline_blocking`
  in the code of `gix-filter`.

Thus, this replaces the solution in GitoxideLabs#1939 for the problem discussed
in GitoxideLabs#1929 (comment)
with a different solution that avoids carrying a "ghost feature."

In contrast, the long-standing `gix-packetline-blocking/async-io`
feature added in be4de0d (GitoxideLabs#1123), though it should not be used,
is *not* removed, because:

- It is referenced in attributes in `gix-packetline-blocking` code
  (because `gix-packetline-blocking/src` is copied from
  `gix-packetline/src` via `etc/copy-packetline.sh`).

- For that reason, removing it would cause the `clippy` run in the
  CI `lint` job to fail, as well as likely making various other
  reasonable operations fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants