From 3b26e40c5cf5d2847691807f2be8f2c8821768d7 Mon Sep 17 00:00:00 2001 From: matthiasdotsh Date: Sat, 31 May 2025 14:30:39 +0200 Subject: [PATCH 1/2] kaldi: add openfst patch for building with gcc14 vcunat kept the git authorship to the author of the openfst patch --- pkgs/by-name/ka/kaldi/gcc14.patch | 24 ++++++++++++++++++++++++ pkgs/by-name/ka/kaldi/package.nix | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/ka/kaldi/gcc14.patch diff --git a/pkgs/by-name/ka/kaldi/gcc14.patch b/pkgs/by-name/ka/kaldi/gcc14.patch new file mode 100644 index 000000000000..0798f7d17c93 --- /dev/null +++ b/pkgs/by-name/ka/kaldi/gcc14.patch @@ -0,0 +1,24 @@ +From 580bd3f0fea7ddc913329537070ab08fd3bf6033 Mon Sep 17 00:00:00 2001 +From: matthiasdotsh +Date: Mon, 26 May 2025 11:22:01 +0200 +Subject: [PATCH] Fix build for gcc >=14 + +--- + src/include/fst/fst.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/include/fst/fst.h b/src/include/fst/fst.h +index 20e6bb3..2cb1364 100644 +--- a/src/include/fst/fst.h ++++ b/src/include/fst/fst.h +@@ -652,8 +652,8 @@ class FstImpl { + FstImpl &operator=(const FstImpl &impl) { + properties_ = impl.properties_; + type_ = impl.type_; +- isymbols_ = impl.isymbols_ ? impl.isymbols_->Copy() : nullptr; +- osymbols_ = impl.osymbols_ ? impl.osymbols_->Copy() : nullptr; ++ isymbols_ = impl.isymbols_ ? std::unique_ptr(impl.isymbols_->Copy()) : nullptr; ++ osymbols_ = impl.osymbols_ ? std::unique_ptr(impl.osymbols_->Copy()) : nullptr; + return *this; + } + diff --git a/pkgs/by-name/ka/kaldi/package.nix b/pkgs/by-name/ka/kaldi/package.nix index a689696c3b6a..235a84dd5338 100644 --- a/pkgs/by-name/ka/kaldi/package.nix +++ b/pkgs/by-name/ka/kaldi/package.nix @@ -69,7 +69,9 @@ stdenv.mkDerivation (finalAttrs: { owner = "kkm000"; repo = "openfst"; rev = "338225416178ac36b8002d70387f5556e44c8d05"; - hash = "sha256-MGEUuw7ex+WcujVdxpO2Bf5sB6Z0edcAeLGqW/Lo1Hs="; + hash = "sha256-y1E6bQgBfYt1Co02UutOyEM2FnETuUl144tHwypiX+M="; + # https://github.com/kkm000/openfst/issues/59 + postFetch = ''(cd "$out"; patch -p1 < '${./gcc14.patch}')''; }; }; From b24c4fd9cfa3f0cc304a796f92791f59c0e5174c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 31 May 2025 14:39:19 +0200 Subject: [PATCH 2/2] kaldi: dontCheckForBrokenSymlinks = true; It builds now. The last successful Hydra build already has broken symlinks inside: https://hydra.nixos.org/build/282311647 And the first failing one breaks because of gcc14: https://hydra.nixos.org/build/282824114/nixlog/2/tail So I see nothing against unblocking the build for now. --- pkgs/by-name/ka/kaldi/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/ka/kaldi/package.nix b/pkgs/by-name/ka/kaldi/package.nix index 235a84dd5338..9b9fd0f78874 100644 --- a/pkgs/by-name/ka/kaldi/package.nix +++ b/pkgs/by-name/ka/kaldi/package.nix @@ -62,6 +62,8 @@ stdenv.mkDerivation (finalAttrs: { cp -r ../egs $out/share/kaldi ''; + dontCheckForBrokenSymlinks = true; #TODO: investigate + passthru = { sources = { # rev from https://github.com/kaldi-asr/kaldi/blob/master/cmake/third_party/openfst.cmake