From e55add40870ba96de162edf6480f7fb91736f243 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Sun, 9 Nov 2025 17:33:18 +0100 Subject: [PATCH] update to version 4.1.2 Signed-off-by: Toshaan Bharvani --- ...cre2-cargo-Drop-workspace-definition.patch | 27 +++ ...he-default-timeout-for-pexpect-tests.patch | 28 +++ ...al-copy-of-rust-pcre2-instead-of-fet.patch | 36 ++++ ...e-Use-rpm-profile-for-RelWithDebInfo.patch | 40 ++++ ...rop-unneeded-dependency-on-unix_path.patch | 27 +++ SPECS/fish.spec | 181 +++++++++++++----- 6 files changed, 296 insertions(+), 43 deletions(-) create mode 100644 SOURCES/10001-rust-pcre2-cargo-Drop-workspace-definition.patch create mode 100644 SOURCES/10002-tests-Raise-the-default-timeout-for-pexpect-tests.patch create mode 100644 SOURCES/1001-cargo-Use-internal-copy-of-rust-pcre2-instead-of-fet.patch create mode 100644 SOURCES/1002-cmake-Use-rpm-profile-for-RelWithDebInfo.patch create mode 100644 SOURCES/1003-cargo-Drop-unneeded-dependency-on-unix_path.patch diff --git a/SOURCES/10001-rust-pcre2-cargo-Drop-workspace-definition.patch b/SOURCES/10001-rust-pcre2-cargo-Drop-workspace-definition.patch new file mode 100644 index 0000000..29caf49 --- /dev/null +++ b/SOURCES/10001-rust-pcre2-cargo-Drop-workspace-definition.patch @@ -0,0 +1,27 @@ +From 1e9f38b5825e684f1b8df6a7dbefe1bca77ac8f7 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 26 Feb 2025 09:31:22 -0500 +Subject: [PATCH] cargo: Drop workspace definition + +We cannot have this when we are nesting inside another workspace. +--- + third-party-forks/rust-pcre2/Cargo.toml | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/third-party-forks/rust-pcre2/Cargo.toml b/third-party-forks/rust-pcre2/Cargo.toml +index cc35675..f5245be 100644 +--- a/third-party-forks/rust-pcre2/Cargo.toml ++++ b/third-party-forks/rust-pcre2/Cargo.toml +@@ -12,9 +12,6 @@ license = "Unlicense OR MIT" + categories = ["text-processing"] + edition = "2021" + +-[workspace] +-members = ["pcre2-sys"] +- + [dependencies] + libc = "0.2.146" + log = "0.4.19" +-- +2.48.1 + diff --git a/SOURCES/10002-tests-Raise-the-default-timeout-for-pexpect-tests.patch b/SOURCES/10002-tests-Raise-the-default-timeout-for-pexpect-tests.patch new file mode 100644 index 0000000..0c48486 --- /dev/null +++ b/SOURCES/10002-tests-Raise-the-default-timeout-for-pexpect-tests.patch @@ -0,0 +1,28 @@ +From eda20d48658333f0667893bd1203ff9ccaf70265 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Sat, 8 Nov 2025 05:13:19 -0500 +Subject: [PATCH] tests: Raise the default timeout for pexpect tests + +The pexpect tests are randomly timing out on some architectures +for Fedora package builds. Raising the timeout will hopefully +avoid the issue. +--- + tests/pexpect_helper.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/pexpect_helper.py b/tests/pexpect_helper.py +index fe9f30b9a..45bc702c6 100644 +--- a/tests/pexpect_helper.py ++++ b/tests/pexpect_helper.py +@@ -25,7 +25,7 @@ import pexpect + from signal import Signals + + # Default timeout for failing to match. +-TIMEOUT_SECS = 5 ++TIMEOUT_SECS = 20 + + UNEXPECTED_SUCCESS = object() + +-- +2.51.1 + diff --git a/SOURCES/1001-cargo-Use-internal-copy-of-rust-pcre2-instead-of-fet.patch b/SOURCES/1001-cargo-Use-internal-copy-of-rust-pcre2-instead-of-fet.patch new file mode 100644 index 0000000..4889c15 --- /dev/null +++ b/SOURCES/1001-cargo-Use-internal-copy-of-rust-pcre2-instead-of-fet.patch @@ -0,0 +1,36 @@ +From dc7c402227540af3dcb50f1a8317a3409a119df2 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Thu, 9 Oct 2025 10:33:03 -0400 +Subject: [PATCH 1001/1003] cargo: Use internal copy of rust-pcre2 instead of + fetching from git + +We separately download and incorporate the forked crate as a +workspace member to allow us to use packaged crates everywhere else. +--- + Cargo.toml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 46d429742..ebceba771 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -1,6 +1,6 @@ + [workspace] + resolver = "2" +-members = ["crates/*"] ++members = ["crates/*", "third-party-forks/rust-pcre2", "third-party-forks/rust-pcre2/pcre2-sys"] + + [workspace.package] + # To build revisions that use Corrosion (those before 2024-01), use CMake 3.19, Rustc 1.78 and Rustup 1.27. +@@ -31,7 +31,7 @@ nix = { version = "0.30.1", default-features = false, features = [ + ] } + num-traits = "0.2.19" + once_cell = "1.19.0" +-pcre2 = { git = "https://github.com/fish-shell/rust-pcre2", tag = "0.2.9-utf32", default-features = false, features = [ ++pcre2 = { path = "./third-party-forks/rust-pcre2", default-features = false, features = [ + "utf32", + ] } + phf = { version = "0.12", default-features = false } +-- +2.51.0 + diff --git a/SOURCES/1002-cmake-Use-rpm-profile-for-RelWithDebInfo.patch b/SOURCES/1002-cmake-Use-rpm-profile-for-RelWithDebInfo.patch new file mode 100644 index 0000000..7a34f7d --- /dev/null +++ b/SOURCES/1002-cmake-Use-rpm-profile-for-RelWithDebInfo.patch @@ -0,0 +1,40 @@ +From febf09f356644bbcbc98088ae1fdf156f3b6a43f Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 26 Feb 2025 12:24:39 -0500 +Subject: [PATCH 1002/1003] cmake: Use rpm profile for RelWithDebInfo + +This matches what we expect for packaging Rust software. +--- + CMakeLists.txt | 2 +- + cmake/Rust.cmake | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 15f32f846..a28693f95 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -49,7 +49,7 @@ function(CREATE_TARGET target) + ${Rust_CARGO} + build --bin ${target} + $<$:--release> +- $<$:--profile=release-with-debug> ++ $<$:--profile=rpm> + --target ${Rust_CARGO_TARGET} + --no-default-features + --features=${FISH_CARGO_FEATURES} +diff --git a/cmake/Rust.cmake b/cmake/Rust.cmake +index 00ddf9055..020b236b5 100644 +--- a/cmake/Rust.cmake ++++ b/cmake/Rust.cmake +@@ -18,7 +18,7 @@ else() + set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_HOST_TARGET}") + endif() + +-set(rust_profile $,debug,$,release-with-debug,release>>) ++set(rust_profile $,debug,$,rpm,release>>) + set(rust_debugflags "$<$:-g>$<$:-g>") + + option(WITH_GETTEXT "Build with gettext localization support. Requires `msgfmt` to work." ON) +-- +2.51.0 + diff --git a/SOURCES/1003-cargo-Drop-unneeded-dependency-on-unix_path.patch b/SOURCES/1003-cargo-Drop-unneeded-dependency-on-unix_path.patch new file mode 100644 index 0000000..77c75c4 --- /dev/null +++ b/SOURCES/1003-cargo-Drop-unneeded-dependency-on-unix_path.patch @@ -0,0 +1,27 @@ +From 425a8308570695659deb41d64cb71e867d582e0f Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Fri, 7 Nov 2025 16:02:20 -0500 +Subject: [PATCH 1003/1003] cargo: Drop unneeded dependency on unix_path + +This is only used for Windows, which we are not building for. +--- + Cargo.toml | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/Cargo.toml b/Cargo.toml +index ebceba771..caf820278 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -111,9 +111,6 @@ fish-gettext-mo-file-parser.workspace = true + phf_codegen = { workspace = true, optional = true } + rsconf.workspace = true + +-[target.'cfg(windows)'.build-dependencies] +-unix_path.workspace = true +- + [lib] + crate-type = ["rlib"] + path = "src/lib.rs" +-- +2.51.1 + diff --git a/SPECS/fish.spec b/SPECS/fish.spec index 5d7483d..1db68d8 100644 --- a/SPECS/fish.spec +++ b/SPECS/fish.spec @@ -1,38 +1,27 @@ ## START: Set by rpmautospec -## (rpmautospec version 0.7.3) +## (rpmautospec version 0.8.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: - release_number = 1; + release_number = 5; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec -%global version_base 3.7.1 -%dnl %global gitnum 120 -%dnl %global githash 1a0b1ae238e1deb132a0ae4a8d0c589d583cc5b0 +%global version_base 4.1.2 +%dnl %global version_pre beta.1 +%dnl %global gitnum 1 +%dnl %global githash b82d0fcbcc44eb259cf2209b04f7a41c1f324e27 %dnl %global githashshort %{lua:print(string.sub(rpm.expand('%{githash}'), 1, 11))} +# For forked pcre2 crate that includes https://github.com/BurntSushi/rust-pcre2/pull/38 +%global rust_pcre2_fish_tag 0.2.9-utf32 + Name: fish -Version: %{version_base}%{?gitnum:^%{gitnum}g%{githashshort}} +Version: %{version_base}%{?version_pre:~%{version_pre}}%{?gitnum:^git%{gitnum}.%{githashshort}} Release: %autorelease Summary: Friendly interactive shell -# see also doc_src/license.rst -# GPLv2 -# - src/fish.cpp -# and rest… -# GPLv2+ -# - src/builtins/printf.cpp -# BSD -# - src/fallback.cpp -# - share/tools/create_manpage_completions.py -# ISC -# - src/env.cpp -# - src/utf8.cpp -# - src/utf8.h -# LGPLv2+ -# - src/wgetopt.cpp -# - src/wgetopt.h +# Non-code licenses, see also doc_src/license.rst # MIT # - share/completions/grunt.fish # - share/tools/web_config/js/angular-route.js @@ -40,38 +29,72 @@ Summary: Friendly interactive shell # - share/tools/web_config/js/angular.js # PSF-2.0 # - doc_src/python_docs_theme/, -License: GPL-2.0-only AND BSD-3-Clause AND ISC AND LGPL-2.0-or-later AND MIT AND PSF-2.0 +# Code licenses, see LICENSE.dependencies for a full license breakdown +# Apache-2.0 OR MIT +# GPL-2.0-only AND LGPL-2.0-or-later AND MIT AND PSF-2.0 +# MIT +# MIT OR Apache-2.0 +# Unlicense OR MIT +# WTFPL +# Zlib +License: Apache-2.0 OR MIT and GPL-2.0-only AND LGPL-2.0-or-later AND MIT AND PSF-2.0 and Unlicense OR MIT and WTFPL and Zlib URL: https://fishshell.com %if %{undefined gitnum} Source0: https://github.com/fish-shell/fish-shell/releases/download/%{version}/%{name}-%{version}.tar.xz -Source1: https://github.com/fish-shell/fish-shell/releases/download/%{version}/%{name}-%{version}.tar.xz.asc -Source2: gpgkey-003837986104878835FA516D7A67D962D88A709A.gpg %else Source0: https://github.com/fish-shell/fish-shell/archive/%{githash}/%{name}-%{githash}.tar.gz %endif +# For forked pcre2 crate that includes https://github.com/BurntSushi/rust-pcre2/pull/38 +Source10: https://github.com/fish-shell/rust-pcre2/archive/%{rust_pcre2_fish_tag}/rust-pcre2-%{rust_pcre2_fish_tag}.tar.gz + +# Backports from upstream (0001~500) + +# Proposed upstream (501~1000) + +# Downstream-only (1001+) +Patch1001: 1001-cargo-Use-internal-copy-of-rust-pcre2-instead-of-fet.patch +Patch1002: 1002-cmake-Use-rpm-profile-for-RelWithDebInfo.patch +Patch1003: 1003-cargo-Drop-unneeded-dependency-on-unix_path.patch + +# Patches for bundled dependencies (10000+) +## For forked pcre2 crate that includes https://github.com/BurntSushi/rust-pcre2/pull/38 +Patch10001: 10001-rust-pcre2-cargo-Drop-workspace-definition.patch +## For hopefully avoiding timeouts for tests on ppc64le and s390x +Patch10002: 10002-tests-Raise-the-default-timeout-for-pexpect-tests.patch + + +BuildRequires: cargo +BuildRequires: cargo-rpm-macros BuildRequires: cmake >= 3.5 BuildRequires: ninja-build BuildRequires: gcc -BuildRequires: gcc-c++ BuildRequires: gettext +BuildRequires: git-core BuildRequires: ncurses-devel BuildRequires: pcre2-devel BuildRequires: gnupg2 BuildRequires: python3-devel BuildRequires: python3-pexpect BuildRequires: procps-ng +BuildRequires: rust BuildRequires: glibc-langpack-en %global __python %{__python3} BuildRequires: /usr/bin/sphinx-build -BuildRequires: /usr/bin/desktop-file-validate + +# Needed to get terminfo +Requires: ncurses-term # tab completion wants man-db Recommends: man-db Recommends: man-pages Recommends: groff-base -Provides: bundled(js-angular) = 1.8.2 +# For the webconfig interface +Provides: bundled(js-alpine) + +# For forked pcre2 crate that includes https://github.com/BurntSushi/rust-pcre2/pull/38 +Provides: bundled(crate(pcre2)) = %{rust_pcre2_fish_tag} %description fish is a fully-equipped command line shell (like bash or zsh) that is @@ -80,33 +103,55 @@ highlighting, autosuggestions, and tab completions that just work, with nothing to learn or configure. %prep -%if %{undefined gitnum} -%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -%endif -%autosetup -p1 %{?gitnum:-n fish-shell-%{githash}} +%autosetup -N %{?gitnum:-n fish-shell-%{githash}} + +# For forked pcre2 crate that includes https://github.com/BurntSushi/rust-pcre2/pull/38 +mkdir -p ./third-party-forks/rust-pcre2 +tar -C ./third-party-forks/rust-pcre2 --strip-components=1 -xf %{SOURCE10} + +%autopatch -p1 + %if %{defined gitnum} -echo "%{version_base}-%{gitnum}g%{githashshort}" > version +echo "%{version}" > version %endif # Change the bundled scripts to invoke the python binary directly. for f in $(find share/tools -type f -name '*.py'); do sed -i -e '1{s@^#!.*@#!%{__python3}@}' "$f" done +%cargo_prep -%build -%cmake -GNinja \ + +%generate_buildrequires +%cargo_generate_buildrequires -t + + +%conf +%cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_DOCS=ON \ -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \ -Dextra_completionsdir=%{_datadir}/%{name}/vendor_completions.d \ -Dextra_functionsdir=%{_datadir}/%{name}/vendor_functions.d \ -Dextra_confdir=%{_datadir}/%{name}/vendor_conf.d -%cmake_build -t all doc fish_tests + +%build +export CARGO_NET_OFFLINE=true + +# Cargo doesn't create this directory +mkdir -p %{_vpath_builddir} + +%cmake_build -t all doc # We still need to slightly manually adapt the pkgconfig file and remove # some /usr/local/ references (RHBZ#1869376) sed -i 's^/usr/local/^/usr/^g' %{_vpath_builddir}/*.pc +# Get Rust licensing data +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies + + %install %cmake_install @@ -118,12 +163,12 @@ sed -i 's^/usr/local/^/usr/^g' %{_vpath_builddir}/*.pc cp -a README.rst %{buildroot}%{_pkgdocdir} cp -a CONTRIBUTING.rst %{buildroot}%{_pkgdocdir} -%find_lang %{name} %check -# Sadly, ctest is broken -%ninja_build -C %{_vpath_builddir} test -desktop-file-validate %{buildroot}%{_datadir}/applications/fish.desktop +# Skip all super-flaky tests because I have no patience anymore... +export CI=1 +%cmake_build --target fish_run_tests + %post if [ "$1" = 1 ]; then @@ -142,19 +187,69 @@ if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then sed -i '\!^/bin/fish$!d' %{_sysconfdir}/shells fi -%files -f %{name}.lang + +%files %license COPYING +%license LICENSE.dependencies %{_mandir}/man1/fish*.1* %{_bindir}/fish* %config(noreplace) %{_sysconfdir}/fish/ %{_datadir}/fish/ %{_datadir}/pkgconfig/fish.pc %{_pkgdocdir} -%{_datadir}/applications/fish.desktop -%{_datadir}/pixmaps/fish.png + %changelog ## START: Generated by rpmautospec +* Sun Nov 09 2025 Neal Gompa - 4.1.2-5 +- Revert bump of timeout and export variable to disable flaky tests + +* Sun Nov 09 2025 Neal Gompa - 4.1.2-4 +- Refresh pexpect timeout tests patch to increase the timeout again + +* Sat Nov 08 2025 Neal Gompa - 4.1.2-3 +- Refresh pexpect timeout tests patch to increase timeout for ppc64le + +* Sat Nov 08 2025 Neal Gompa - 4.1.2-2 +- Add patch to raise timeout for pexpect tests to avoid failures + +* Fri Nov 07 2025 Neal Gompa - 4.1.2-1 +- Update to version 4.1.2 + +* Fri Sep 19 2025 Python Maint - 4.0.2-5 +- Rebuilt for Python 3.14.0rc3 bytecode + +* Tue Sep 02 2025 Neal Gompa - 4.0.2-4 +- Allow building on 32-bit architectures + +* Fri Aug 15 2025 Python Maint - 4.0.2-3 +- Rebuilt for Python 3.14.0rc2 bytecode + +* Wed Jul 23 2025 Fedora Release Engineering - 4.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Mon Apr 21 2025 Neal Gompa - 4.0.2-1 +- Update to 4.0.2 upstream release +- Resolves: rhbz#2361232 + +* Fri Mar 21 2025 Benjamin A. Beasley - 4.0.1-2 +- Update lru to 0.13.0 (proposed upstream) + +* Wed Mar 19 2025 Neal Gompa - 4.0.1-1 +- Update to 4.0.1 upstream release + +* Thu Feb 27 2025 Neal Gompa - 4.0.0-3 +- Disable building on 32-bit architectures + +* Thu Feb 27 2025 Neal Gompa - 4.0.0-2 +- Fix bundled js dep provides + +* Thu Feb 27 2025 Neal Gompa - 4.0.0-1 +- Rebase to new upstream release 4.0.0 + +* Thu Jan 16 2025 Fedora Release Engineering - 3.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sat Jul 27 2024 ErrorNoInternet - 3.7.1-1 - New upstream release 3.7.1 (fixes rhbz#2270247)