From 96164c5936032b4edb973828178cc55793dd57cc Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Mon, 21 Apr 2025 02:53:12 +0100 Subject: [PATCH 1/2] Switch to zlib-rs by default and drop other zlib backends 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 https://github.com/zip-rs/zip2/pull/340 is fixed upstream. Fixes: https://github.com/GitoxideLabs/gitoxide/issues/1961 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 3 --- Cargo.lock | 25 ++------------------ Cargo.toml | 40 ++++++++++---------------------- README.md | 4 ++-- etc/docker/Dockerfile.alpine | 6 ++--- gix-archive/Cargo.toml | 9 ++++---- gix-features/Cargo.toml | 43 +++++++++++++++-------------------- gix/Cargo.toml | 32 ++++++++++---------------- justfile | 4 ---- tests/journey/gix.sh | 9 +------- 11 files changed, 55 insertions(+), 124 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73d7a4b0d16..38daebcd927 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: continue-on-error: true - name: Check for unrecognized *-sys dependencies run: | - ! grep -qP '(? Date: Mon, 21 Apr 2025 08:46:52 +0200 Subject: [PATCH 2/2] Allow `testing::TestUrlExtension` in release builds for consistency (#1962) The module is still hidden from the documentation, and those who discover it anyway will be informed that it's not for general use. --- gix-url/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gix-url/src/lib.rs b/gix-url/src/lib.rs index caf9ef6a473..bbde5a08295 100644 --- a/gix-url/src/lib.rs +++ b/gix-url/src/lib.rs @@ -370,11 +370,10 @@ impl Url { } /// This module contains extensions to the [Url] struct which are only intended to be used -/// for testing code. Do not use this module in production! For all intends and purposes the APIs of +/// for testing code. Do not use this module in production! For all intents and purposes, the APIs of /// all functions and types exposed by this module are considered unstable and are allowed to break /// even in patch releases! #[doc(hidden)] -#[cfg(debug_assertions)] pub mod testing { use bstr::BString;