Skip to content

fix: deflate-flate2 feature needs to depend on dep:flate2 #340

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

Closed
wants to merge 7 commits into from

Conversation

joshtriplett
Copy link
Contributor

The deflate-flate2 feature did not establish any dependency on
dep:flate2, so depending on that feature would lead to a broken build.

The `deflate-flate2` feature did not establish any dependency on
`dep:flate2`, so depending on that feature would lead to a broken build.
joshtriplett added a commit to joshtriplett/gitoxide that referenced this pull request Apr 21, 2025
As of zlib-rs 0.5.0 (depended on by flate2 1.1.1), zlib-rs no longer
exports C symbols by default, so it doesn't conflict with any other zlib
that might be loaded into the address space.

This removed the primary issue that made zlib selection a challenge
that needed to be exposed to users: users may already have some other
particular preference on zlib implementations, or want to use a system
library, or want to ensure C dependencies use a particular zlib. Since
zlib-rs 0.5.0 no longer conflicts with other zlib implementations, gix
can make this choice independently and not create issues for the user.

Given that, use zlib-rs by default, for performance out of the box with
no C compiler requirement, and deprecate all the feature flags for other
variations. A future major version bump can drop all of these features.

This also means that (for instance) max-performance becomes the same as
max-performance-safe, so such features are deprecated as well.

Depend on flate2 with `default-features = false`, which brings us closer
to eliminating the `miniz_oxide` dependency, which will improve build
time for everyone. Currently, the `gix-archive` dependency on `zip`
still activates the `zip/deflate` feature which enables
`flate2/rust_backend`; this can be fixed to use `deflate-flate2` as soon
as zip-rs/zip2#340 is fixed upstream.

Fixes: GitoxideLabs#1961
joshtriplett added a commit to joshtriplett/gitoxide that referenced this pull request Apr 21, 2025
As of zlib-rs 0.5.0 (depended on by flate2 1.1.1), zlib-rs no longer
exports C symbols by default, so it doesn't conflict with any other zlib
that might be loaded into the address space.

This removed the primary issue that made zlib selection a challenge
that needed to be exposed to users: users may already have some other
particular preference on zlib implementations, or want to use a system
library, or want to ensure C dependencies use a particular zlib. Since
zlib-rs 0.5.0 no longer conflicts with other zlib implementations, gix
can make this choice independently and not create issues for the user.

Given that, use zlib-rs by default, for performance out of the box with
no C compiler requirement, and deprecate all the feature flags for other
variations. A future major version bump can drop all of these features.

This also means that (for instance) max-performance becomes the same as
max-performance-safe, so such features are deprecated as well.

Depend on flate2 with `default-features = false`, which brings us closer
to eliminating the `miniz_oxide` dependency, which will improve build
time for everyone. Currently, the `gix-archive` dependency on `zip`
still activates the `zip/deflate` feature which enables
`flate2/rust_backend`; this can be fixed to use `deflate-flate2` as soon
as zip-rs/zip2#340 is fixed upstream.

Fixes: GitoxideLabs#1961
joshtriplett added a commit to joshtriplett/gitoxide that referenced this pull request Apr 21, 2025
As of zlib-rs 0.5.0 (depended on by flate2 1.1.1), zlib-rs no longer
exports C symbols by default, so it doesn't conflict with any other zlib
that might be loaded into the address space.

This removed the primary issue that made zlib selection a challenge
that needed to be exposed to users: users may already have some other
particular preference on zlib implementations, or want to use a system
library, or want to ensure C dependencies use a particular zlib. Since
zlib-rs 0.5.0 no longer conflicts with other zlib implementations, gix
can make this choice independently and not create issues for the user.

Given that, use zlib-rs by default, for performance out of the box with
no C compiler requirement, and deprecate all the feature flags for other
variations. A future major version bump can drop all of these features.

This also means that (for instance) max-performance becomes the same as
max-performance-safe, so such features are deprecated as well.

Depend on flate2 with `default-features = false`, which brings us closer
to eliminating the `miniz_oxide` dependency, which will improve build
time for everyone. Currently, the `gix-archive` dependency on `zip`
still activates the `zip/deflate` feature which enables
`flate2/rust_backend`; this can be fixed to use `deflate-flate2` as soon
as zip-rs/zip2#340 is fixed upstream.

Fixes: GitoxideLabs#1961
@Pr0methean Pr0methean changed the title Fix the deflate-flate2 feature to depend on dep:flate2 fix: deflate-flate2 feature needs to depend on dep:flate2 Apr 29, 2025
@Pr0methean Pr0methean enabled auto-merge May 12, 2025 22:30
@Pr0methean
Copy link
Member

Rendered obsolete by #352.

@Pr0methean Pr0methean closed this May 13, 2025
auto-merge was automatically disabled May 13, 2025 00:36

Pull request was closed

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