public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-zstd-sys] rawhide: Update to version 2.1.2; Fixes RHBZ#2528882
@ 2026-11-04 21:31 Fabio Valentini
0 siblings, 0 replies; only message in thread
From: Fabio Valentini @ 2026-11-04 21:31 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rust-zstd-sys
Branch : rawhide
Commit : 91c5e5006ff1985d6970e364511f684cd9857fd6
Author : Fabio Valentini <decathorpe@gmail.com>
Date : 2026-11-04T16:02:43+01:00
Stats : +251/-72 in 7 file(s)
URL : https://src.fedoraproject.org/rpms/rust-zstd-sys/c/91c5e5006ff1985d6970e364511f684cd9857fd6?branch=rawhide
Log:
Update to version 2.1.2; Fixes RHBZ#2528882
---
diff --git a/.gitignore b/.gitignore
index fe228c9..c9d09bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@
/zstd-sys-2.0.13+zstd.1.5.6.crate
/zstd-sys-2.0.15+zstd.1.5.7.crate
/zstd-sys-2.0.16+zstd.1.5.7.crate
+/zstd-sys-2.1.2+zstd.1.5.7.crate
diff --git a/0001-unconditionally-use-bindgen-and-pkg-config-to-link-a.patch b/0001-unconditionally-use-bindgen-and-pkg-config-to-link-a.patch
index 5066bc5..550cda4 100644
--- a/0001-unconditionally-use-bindgen-and-pkg-config-to-link-a.patch
+++ b/0001-unconditionally-use-bindgen-and-pkg-config-to-link-a.patch
@@ -1,29 +1,172 @@
-From 1e86c5123c70d62ac86037d088757db884de95d8 Mon Sep 17 00:00:00 2001
+From 284bb06c1ab077343311d57de1b5c2f8df2e2071 Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Tue, 6 May 2025 15:24:10 +0200
Subject: [PATCH] unconditionally use bindgen and pkg-config to link against
system libzstd
---
- build.rs | 213 +------------------------------------------------------
- 1 file changed, 3 insertions(+), 210 deletions(-)
+ build.rs | 405 +------------------------------------------------------
+ 1 file changed, 3 insertions(+), 402 deletions(-)
diff --git a/build.rs b/build.rs
-index 80c6b9c..d8299d0 100644
+index de04ce5..2e1a6fb 100644
--- a/build.rs
+++ b/build.rs
-@@ -1,8 +1,6 @@
+@@ -1,151 +1,6 @@
+-#[cfg(not(feature = "cmake"))]
-use std::ffi::OsStr;
-use std::path::{Path, PathBuf};
-use std::{env, fmt, fs};
+use std::path::PathBuf;
+use std::{env, fmt};
+-#[cfg(feature = "cmake")]
+-fn compile_zstd_cmake() {
+- let mut config = cmake::Config::new("zstd/build/cmake");
+-
+- // Build only the static library
+- config.define("ZSTD_BUILD_SHARED", "OFF");
+- config.define("ZSTD_BUILD_STATIC", "ON");
+- config.define("ZSTD_BUILD_PROGRAMS", "OFF");
+- config.define("ZSTD_BUILD_TESTS", "OFF");
+- config.define("ZSTD_BUILD_CONTRIB", "OFF");
+-
+- // Legacy support
+- if cfg!(feature = "legacy") {
+- config.define("ZSTD_LEGACY_SUPPORT", "ON");
+- } else {
+- config.define("ZSTD_LEGACY_SUPPORT", "OFF");
+- }
+-
+- // Multi-threading support
+- if cfg!(feature = "zstdmt") {
+- config.define("ZSTD_MULTITHREAD_SUPPORT", "ON");
+- } else {
+- config.define("ZSTD_MULTITHREAD_SUPPORT", "OFF");
+- }
+-
+- // Dictionary builder
+- if cfg!(feature = "zdict_builder") {
+- config.define("ZSTD_BUILD_DICTBUILDER", "ON");
+- } else {
+- config.define("ZSTD_BUILD_DICTBUILDER", "OFF");
+- }
+-
+- // Hide symbols so we can coexist with another zstd-linking lib.
+- // See https://github.com/gyscos/zstd-rs/issues/58
+- //
+- // The ZSTD*_VISIBLE cache variables only cover the symbols annotated with
+- // the public API macros; the visibility preset is what hides everything
+- // else (internal helpers, and the vendored xxhash), matching what the cc
+- // backend gets from -fvisibility=hidden.
+- if hide_symbols() {
+- config.define("ZSTDLIB_VISIBLE", "hidden");
+- config.define("ZSTDERRORLIB_VISIBLE", "hidden");
+- config.define("ZDICTLIB_VISIBLE", "hidden");
+- config.define("CMAKE_C_VISIBILITY_PRESET", "hidden");
+- config.define("CMAKE_VISIBILITY_INLINES_HIDDEN", "ON");
+- }
+-
+- // Feature flags the cc backend applies as plain preprocessor defines.
+- if cfg!(feature = "debug") {
+- config.cflag("-DDEBUGLEVEL=5");
+- }
+- if cfg!(feature = "no_asm") {
+- config.cflag("-DZSTD_DISABLE_ASM");
+- }
+- if cfg!(feature = "thin") {
+- // Same set as the cc backend: build the smallest lib we can.
+- for flag in [
+- "-DHUF_FORCE_DECOMPRESS_X1=1",
+- "-DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT=1",
+- "-DZSTD_NO_INLINE=1",
+- "-DZSTD_STRIP_ERROR_STRINGS=1",
+- "-DDYNAMIC_BMI2=0",
+- "-Os",
+- ] {
+- config.cflag(flag);
+- }
+- }
+- if cfg!(any(feature = "fat-lto", feature = "thin-lto")) {
+- cargo_print(
+- &"warning=the fat-lto/thin-lto features are ignored by the cmake backend",
+- );
+- }
+-
+- let dst = config.build();
+-
+- // zstd's cmake build does not cover the seekable format, which lives in
+- // contrib/. Build it here the way the cc backend does, and emit it before
+- // the zstd library so the linker can resolve it against zstd.
+- #[cfg(feature = "seekable")]
+- {
+- let mut seekable = cc::Build::new();
+- seekable
+- .include("zstd/lib")
+- .include("zstd/lib/common")
+- .include("zstd/contrib/seekable_format")
+- .warnings(false)
+- .cargo_metadata(!cfg!(feature = "non-cargo"));
+-
+- if hide_symbols() && !target_is_msvc() {
+- seekable.flag("-fvisibility=hidden");
+- }
+-
+- let mut entries: Vec<_> = fs::read_dir("zstd/contrib/seekable_format")
+- .unwrap()
+- .map(Result::unwrap)
+- .map(|entry| entry.path())
+- .filter(|path| {
+- path.extension().and_then(|ext| ext.to_str()) == Some("c")
+- })
+- .collect();
+- entries.sort();
+- seekable.files(entries);
+- seekable.compile("zstd_seekable");
+- }
+-
+- // Tell cargo where to find the built library.
+- // CMake may place it in lib/ or lib64/ depending on the platform.
+- let lib_dir = if dst.join("lib64").join("libzstd.a").exists()
+- || dst.join("lib64").join("zstd_static.lib").exists()
+- {
+- dst.join("lib64")
+- } else {
+- dst.join("lib")
+- };
+- cargo_print(&format_args!(
+- "rustc-link-search=native={}",
+- lib_dir.display()
+- ));
+-
+- // On MSVC, the static library is named zstd_static.
+- // This has to follow the target env: build scripts are compiled for the
+- // host, so cfg!(target_env) would be wrong when cross-compiling.
+- let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
+- if target_env == "msvc" {
+- cargo_print(&"rustc-link-lib=static=zstd_static");
+- } else {
+- cargo_print(&"rustc-link-lib=static=zstd");
+- }
+-
+- // Copy headers for downstream consumers
+- let src = env::current_dir().unwrap().join("zstd").join("lib");
+- let include = dst.join("include");
+- fs::create_dir_all(&include).unwrap();
+- fs::copy(src.join("zstd.h"), include.join("zstd.h")).unwrap();
+- fs::copy(src.join("zstd_errors.h"), include.join("zstd_errors.h"))
+- .unwrap();
+- #[cfg(feature = "zdict_builder")]
+- fs::copy(src.join("zdict.h"), include.join("zdict.h")).unwrap();
+- cargo_print(&format_args!("root={}", dst.display()));
+- cargo_print(&format_args!("include={}", include.display()));
+-}
+-
-#[cfg(feature = "bindgen")]
fn generate_bindings(defs: Vec<&str>, headerpaths: Vec<PathBuf>) {
use bindgen::RustTarget;
-@@ -49,9 +47,6 @@ fn generate_bindings(defs: Vec<&str>, headerpaths: Vec<PathBuf>) {
+@@ -220,9 +75,6 @@ fn generate_bindings(defs: Vec<&str>, headerpaths: Vec<PathBuf>) {
.expect("Could not write bindings");
}
@@ -33,42 +176,50 @@ index 80c6b9c..d8299d0 100644
fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
let library = pkg_config::Config::new()
.statik(true)
-@@ -61,31 +56,6 @@ fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
+@@ -232,237 +84,6 @@ fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
(vec!["PKG_CONFIG"], library.include_paths)
}
--#[cfg(not(feature = "legacy"))]
+-#[cfg(all(not(feature = "legacy"), not(feature = "cmake")))]
-fn set_legacy(_config: &mut cc::Build) {}
-
--#[cfg(feature = "legacy")]
+-#[cfg(all(feature = "legacy", not(feature = "cmake")))]
-fn set_legacy(config: &mut cc::Build) {
- config.define("ZSTD_LEGACY_SUPPORT", Some("1"));
- config.include("zstd/lib/legacy");
-}
-
--#[cfg(feature = "zstdmt")]
+-#[cfg(all(feature = "zstdmt", not(feature = "cmake")))]
-fn set_pthread(config: &mut cc::Build) {
- config.flag("-pthread");
-}
-
--#[cfg(not(feature = "zstdmt"))]
+-#[cfg(all(not(feature = "zstdmt"), not(feature = "cmake")))]
-fn set_pthread(_config: &mut cc::Build) {}
-
--#[cfg(feature = "zstdmt")]
+-#[cfg(all(feature = "zstdmt", not(feature = "cmake")))]
-fn enable_threading(config: &mut cc::Build) {
- config.define("ZSTD_MULTITHREAD", Some(""));
-}
-
--#[cfg(not(feature = "zstdmt"))]
+-#[cfg(all(not(feature = "zstdmt"), not(feature = "cmake")))]
-fn enable_threading(_config: &mut cc::Build) {}
-
- /// This function would find the first flag in `flags` that is supported
- /// and add that to `config`.
- #[allow(dead_code)]
-@@ -99,159 +69,6 @@ fn flag_if_supported_with_fallbacks(config: &mut cc::Build, flags: &[&str]) {
- }
- }
-
+-/// This function would find the first flag in `flags` that is supported
+-/// and add that to `config`.
+-#[cfg(not(feature = "cmake"))]
+-#[allow(dead_code)]
+-fn flag_if_supported_with_fallbacks(config: &mut cc::Build, flags: &[&str]) {
+- let option = flags
+- .iter()
+- .find(|flag| config.is_flag_supported(flag).unwrap_or_default());
+-
+- if let Some(flag) = option {
+- config.flag(flag);
+- }
+-}
+-
+-#[cfg(not(feature = "cmake"))]
-fn compile_zstd() {
- let mut config = cc::Build::new();
-
@@ -107,8 +258,21 @@ index 80c6b9c..d8299d0 100644
- }
-
- // Either include ASM files, or disable ASM entirely.
+- //
+- // The only assembly zstd ships is huf_decompress_amd64.S, which upstream
+- // gates on __x86_64__ in portability_macros.h. Anywhere else it can only
+- // ever preprocess to an empty object, while still costing an assembler
+- // invocation - and some toolchains (wasm ones in particular) cannot
+- // process .S input at all, which would make the default features
+- // unbuildable there for no benefit.
+- //
- // Also disable it on windows, apparently it doesn't do well with these .S files at the moment.
-- if cfg!(feature = "no_asm") || std::env::var("CARGO_CFG_WINDOWS").is_ok() {
+- let target_arch =
+- std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
+- if cfg!(feature = "no_asm")
+- || target_arch != "x86_64"
+- || std::env::var("CARGO_CFG_WINDOWS").is_ok()
+- {
- config.define("ZSTD_DISABLE_ASM", Some(""));
- } else {
- config.file("zstd/lib/decompress/huf_decompress_amd64.S");
@@ -180,7 +344,9 @@ index 80c6b9c..d8299d0 100644
- // Hide symbols from resulting library,
- // so we can be used with another zstd-linking lib.
- // See https://github.com/gyscos/zstd-rs/issues/58
-- config.flag("-fvisibility=hidden");
+- if hide_symbols() && !target_is_msvc() {
+- config.flag("-fvisibility=hidden");
+- }
- config.define("XXH_PRIVATE_API", Some(""));
- config.define("ZSTDLIB_VISIBILITY", Some(""));
- #[cfg(feature = "zdict_builder")]
@@ -222,23 +388,38 @@ index 80c6b9c..d8299d0 100644
- cargo_print(&format_args!("root={}", dst.display()));
-}
-
+-/// Is the *target* toolchain MSVC?
+-///
+-/// `cfg!(target_env = ..)` would answer for the host: build scripts are
+-/// compiled for the machine running them. That gets the answer wrong whenever
+-/// the two differ - a windows-gnu host building for a windows-msvc target ends
+-/// up handing gcc-style flags to `cl.exe`, which warns on every file.
+-fn target_is_msvc() -> bool {
+- env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default() == "msvc"
+-}
+-
+-/// Should the C library's symbols be hidden?
+-///
+-/// Hiding them lets us coexist with another libzstd in the same process
+-/// (https://github.com/gyscos/zstd-rs/issues/58). But it also means a system
+-/// library that needs libzstd cannot resolve against our copy, which can fail
+-/// the final link on platforms where such a library ends up in the same binary
+-/// (https://github.com/gyscos/zstd-rs/issues/363). Setting
+-/// ZSTD_SYS_NO_HIDE_SYMBOLS exports them instead - at the cost of that other
+-/// library then using our zstd rather than the system one.
+-fn hide_symbols() -> bool {
+- env::var_os("ZSTD_SYS_NO_HIDE_SYMBOLS").is_none()
+-}
+-
/// Print a line for cargo.
///
/// If non-cargo is set, do not print anything.
-@@ -264,32 +81,8 @@ fn cargo_print(content: &dyn fmt::Display) {
- fn main() {
- cargo_print(&"rerun-if-env-changed=ZSTD_SYS_USE_PKG_CONFIG");
+@@ -485,27 +106,7 @@ fn main() {
+ }
-- let target_arch =
-- std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
-- let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
--
-- if target_arch == "wasm32" || target_os == "hermit" {
-- cargo_print(&"rustc-cfg=feature=\"std\"");
-- }
--
// println!("cargo:rustc-link-lib=zstd");
-- let (defs, headerpaths) = if cfg!(feature = "pkg-config")
+- let (defs, headerpaths) = if (cfg!(feature = "pkg-config")
+- && !cfg!(feature = "vendored"))
- || env::var_os("ZSTD_SYS_USE_PKG_CONFIG").is_some()
- {
- pkg_config()
@@ -252,6 +433,9 @@ index 80c6b9c..d8299d0 100644
- .expect("Manifest dir is always set by cargo"),
- );
-
+- #[cfg(feature = "cmake")]
+- compile_zstd_cmake();
+- #[cfg(not(feature = "cmake"))]
- compile_zstd();
- (vec![], vec![manifest_dir.join("zstd/lib")])
- };
@@ -260,5 +444,5 @@ index 80c6b9c..d8299d0 100644
let includes: Vec<_> = headerpaths
.iter()
--
-2.49.0
+2.56.0
diff --git a/rust-zstd-sys.spec b/rust-zstd-sys.spec
index 157e8d0..b20cb26 100644
--- a/rust-zstd-sys.spec
+++ b/rust-zstd-sys.spec
@@ -1,24 +1,22 @@
-# Generated by rust2rpm 27
+# Generated by rust2rpm 28
%bcond check 1
%global debug_package %{nil}
%global crate zstd-sys
-%global crate_version 2.0.16+zstd.1.5.7
+%global crate_version 2.1.2+zstd.1.5.7
Name: rust-zstd-sys
-Version: 2.0.16
+Version: 2.1.2
Release: %autorelease
Summary: Low-level bindings for the zstd compression library
-# Upstream license specification: MIT/Apache-2.0
-License: MIT OR Apache-2.0
+License: BSD-3-Clause
URL: https://crates.io/crates/zstd-sys
Source: %{crates_source %{crate} %{crate_version}}
# Automatically generated patch to strip dependencies and normalize metadata
Patch: zstd-sys-fix-metadata-auto.diff
# Manually created patch for downstream crate metadata changes
# * make bindgen build-dependency non-optional
-# * fix logic for included / excluded files
# * exclude files that are only useful for upstream development
Patch: zstd-sys-fix-metadata.diff
# * unconditionally use bindgen and pkg-config to link against system libzstd
@@ -44,8 +42,6 @@ use the "%{crate}" crate.
%files devel
%license %{crate_instdir}/LICENSE
-%license %{crate_instdir}/LICENSE.Apache-2.0
-%license %{crate_instdir}/LICENSE.Mit
%doc %{crate_instdir}/Readme.md
%{crate_instdir}/
diff --git a/rust2rpm.toml b/rust2rpm.toml
index eaeb4b6..48a8f3d 100644
--- a/rust2rpm.toml
+++ b/rust2rpm.toml
@@ -1,11 +1,9 @@
[package]
cargo-toml-patch-comments = [
"make bindgen build-dependency non-optional",
- "fix logic for included / excluded files",
"exclude files that are only useful for upstream development",
]
license-files.exclude = [
- "LICENSE.BSD-3-Clause",
"zstd/*",
]
@@ -18,7 +16,9 @@ comments = [
[features]
hide = [
+ "cmake",
"no_wasm_shim",
+ "vendored",
]
[requires]
diff --git a/sources b/sources
index 0abb55b..873c076 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (zstd-sys-2.0.16+zstd.1.5.7.crate) = 4bd56e78003a084a27d916ce845f90ae4657725c0f34d56290a8b0c463309e10d2980d1ee6350d6a913cb7906950271ef3da7f25f56b47d02e4b4a5d902ac7ac
+SHA512 (zstd-sys-2.1.2+zstd.1.5.7.crate) = b604262d2633eaa3bdfd4403715e667232f457298288e666726ec896a4045c0d4b2b0981c24f45889a5ef3fa5a96861f93de670786fcd6701e61dcb3bb5e513d
diff --git a/zstd-sys-fix-metadata-auto.diff b/zstd-sys-fix-metadata-auto.diff
index 082c75b..672addb 100644
--- a/zstd-sys-fix-metadata-auto.diff
+++ b/zstd-sys-fix-metadata-auto.diff
@@ -1,15 +1,15 @@
---- zstd-sys-2.0.16+zstd.1.5.7/Cargo.toml 1970-01-01T00:00:01+00:00
-+++ zstd-sys-2.0.16+zstd.1.5.7/Cargo.toml 2025-10-25T22:54:17.417236+00:00
+--- zstd-sys-2.1.2+zstd.1.5.7/Cargo.toml 2006-07-24T01:21:28+00:00
++++ zstd-sys-2.1.2+zstd.1.5.7/Cargo.toml 2026-11-04T14:46:41.647359+00:00
@@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.64"
name = "zstd-sys"
--version = "2.0.16+zstd.1.5.7"
-+version = "2.0.16"
+-version = "2.1.2+zstd.1.5.7"
++version = "2.1.2"
authors = ["Alexandre Bury <alexandre.bury@gmail.com>"]
build = "build.rs"
links = "zstd"
-@@ -95,3 +95,4 @@
+@@ -106,3 +106,4 @@
[lints.rust]
non_upper_case_globals = "allow"
diff --git a/zstd-sys-fix-metadata.diff b/zstd-sys-fix-metadata.diff
index 96cdfef..b4d2de0 100644
--- a/zstd-sys-fix-metadata.diff
+++ b/zstd-sys-fix-metadata.diff
@@ -1,42 +1,40 @@
---- zstd-sys-2.0.16+zstd.1.5.7/Cargo.toml 1970-01-01T00:00:01+00:00
-+++ zstd-sys-2.0.16+zstd.1.5.7/Cargo.toml 2025-10-25T22:55:23.591583+00:00
-@@ -17,20 +17,11 @@
- authors = ["Alexandre Bury <alexandre.bury@gmail.com>"]
- build = "build.rs"
- links = "zstd"
--include = [
-- "/LICENSE*",
-- "!/*.sh",
-- "/build.rs",
-- "/*.h",
-- "/src/",
+--- zstd-sys-2.1.2+zstd.1.5.7/Cargo.toml 2006-07-24T01:21:28+00:00
++++ zstd-sys-2.1.2+zstd.1.5.7/Cargo.toml 2026-11-04T14:49:04.600811+00:00
+@@ -23,20 +23,6 @@
+ "/build.rs",
+ "/*.h",
+ "/src/",
- "/wasm-shim/**/*.h",
- "/zstd/LICENSE",
- "/zstd/COPYING",
- "/zstd/lib/**/*.c",
- "/zstd/lib/**/*.h",
- "/zstd/lib/**/*.S",
+- "/zstd/lib/libzstd.pc.in",
- "/zstd/contrib/seekable_format/*.c",
- "/zstd/contrib/seekable_format/*.h",
-+exclude = [
-+ "/test_it.sh",
-+ "/update_bindings.sh",
-+ "/update_zstd.sh",
-+ "/wasm-shim/",
+- "/zstd/build/cmake/CMakeLists.txt",
+- "/zstd/build/cmake/zstdConfig.cmake.in",
+- "/zstd/build/cmake/CMakeModules/*.cmake",
+- "/zstd/build/cmake/lib/CMakeLists.txt",
+- "/zstd/build/cmake/lib/*.in",
]
autolib = false
autobins = false
-@@ -55,6 +46,7 @@
+@@ -61,6 +47,7 @@
features = ["experimental"]
[features]
+bindgen = []
+ cmake = ["dep:cmake"]
debug = []
default = [
- "legacy",
-@@ -83,7 +75,6 @@
+@@ -88,9 +75,8 @@
+ doctest = false
+
[build-dependencies.bindgen]
- version = "0.72"
+-version = "0.73.2"
++version = ">=0.72,<0.74"
features = ["runtime"]
-optional = true
default-features = false
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-04 21:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 21:31 [rpms/rust-zstd-sys] rawhide: Update to version 2.1.2; Fixes RHBZ#2528882 Fabio Valentini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox