Skip to content

kaldi: fix cmake 4 compatibility#452907

Merged
vcunat merged 1 commit intoNixOS:masterfrom
matthiasdotsh:fix/kaldi-cmake4
Oct 27, 2025
Merged

kaldi: fix cmake 4 compatibility#452907
vcunat merged 1 commit intoNixOS:masterfrom
matthiasdotsh:fix/kaldi-cmake4

Conversation

@matthiasdotsh
Copy link
Contributor

Things done

Fix kaldi build for cmake 4.

See #445447

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@matthiasdotsh
Copy link
Contributor Author

matthiasdotsh commented Oct 17, 2025

Not sure why it was failing in the first place.
As upstream already contains something like cmake_minimum_required(VERSION 3.18).

Edit:
It's failing because the version of openfst used in passthru has no cmake_minimum_required .

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Oct 17, 2025
@nix-owners nix-owners bot requested a review from Mic92 October 17, 2025 12:31
@matthiasdotsh
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 452907
Commit: 4e53002835c222ba85e599b42b694300ee1d9130


x86_64-linux

✅ 2 packages built:
  • kaldi
  • tests.pkgs-lib

@@ -34,6 +34,8 @@ stdenv.mkDerivation (finalAttrs: {
"-DBLAS_LIBRARIES=-lblas"
"-DLAPACK_LIBRARIES=-llapack"
"-DFETCHCONTENT_SOURCE_DIR_OPENFST:PATH=${finalAttrs.passthru.sources.openfst}"
# Fix the build with CMake 4.
"-DCMAKE_POLICY_VERSION_MINIMUM=3.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe kkm000/openfst@f75b382 could be patch on passthru.sources instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the upstream kaldi project did not upgrade the version of openfst, I would be more in favor of keeping the diff to kaldi upstream as small as possible and only adjusting the minimum cmake version.

What would be the advantage of patching this directly in openfst instead of the current solution?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthiasdotsh This is the recommended way to proceed for fixing cmake failures (see the instruction list in the description of #445447). You may ask Grimmauld why this is better, as i cannot answer you with confidence, but i believe that was already =thoroughly discussed

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Oct 17, 2025
@Sigmanificient
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 452907
Commit: 42aeba2244d7580e157a7bec8dc59214f6c80df3 (subsequent changes)
Merge: 6f2f11cb4f4885bf006b78f09acaaad3057d37b0

Logs: https://github.com/Sigmanificient/nixpkgs-review-gha/actions/runs/18762220311


x86_64-linux

✅ 1 package built:
  • kaldi

aarch64-linux

✅ 1 package built:
  • kaldi

x86_64-darwin (sandbox = true)

❌ 1 package failed to build:
  • kaldi

Error logs: `x86_64-darwin`
kaldi
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/fst-types.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/flags.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/compat.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/fst.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/mapped-file.cc.o
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/lib/fst.cc:12:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/matcher-fst.h:14:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/lookahead-matcher.h:20:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/label-reachable.h:16:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/accumulator.h:20:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/replace.h:23:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/state-table.h:15:
/nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/bi-table.h:320:31: error: no member named 's_' in 'VectorHashBiTable<I, T, S, FP, H, HS>'
  320 |       : selector_(new S(table.s_)), fp_(new FP(*table.fp_)),
      |                         ~~~~~ ^
1 error generated.
make[2]: *** [_deps/openfst-build/src/lib/CMakeFiles/fst.dir/build.make:121: _deps/openfst-build/src/lib/CMakeFiles/fst.dir/fst.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:2957: _deps/openfst-build/src/lib/CMakeFiles/fst.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

aarch64-darwin (sandbox = true)

❌ 1 package failed to build:
  • kaldi

Error logs: `aarch64-darwin`
kaldi
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/fst-types.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/flags.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/compat.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/fst.cc.o
[  0%] Building CXX object _deps/openfst-build/src/lib/CMakeFiles/fst.dir/mapped-file.cc.o
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/lib/fst.cc:12:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/matcher-fst.h:14:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/lookahead-matcher.h:20:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/label-reachable.h:16:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/accumulator.h:20:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/replace.h:23:
In file included from /nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/state-table.h:15:
/nix/store/78h4f39zcv9js54af27wys7yba4vzj57-source/src/include/fst/bi-table.h:320:31: error: no member named 's_' in 'VectorHashBiTable<I, T, S, FP, H, HS>'
  320 |       : selector_(new S(table.s_)), fp_(new FP(*table.fp_)),
      |                         ~~~~~ ^
1 error generated.
make[2]: *** [_deps/openfst-build/src/lib/CMakeFiles/fst.dir/build.make:121: _deps/openfst-build/src/lib/CMakeFiles/fst.dir/fst.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:2957: _deps/openfst-build/src/lib/CMakeFiles/fst.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@vcunat vcunat added this pull request to the merge queue Oct 27, 2025
Merged via the queue into NixOS:master with commit 5db46f3 Oct 27, 2025
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants