Skip to content

[staging-next] python311Packages.levenshtein: fetch submodules#283726

Merged
vcunat merged 1 commit intoNixOS:staging-nextfrom
bryango:py-levenshtein-fix-dep
Jan 25, 2024
Merged

[staging-next] python311Packages.levenshtein: fetch submodules#283726
vcunat merged 1 commit intoNixOS:staging-nextfrom
bryango:py-levenshtein-fix-dep

Conversation

@bryango
Copy link
Copy Markdown
Member

@bryango bryango commented Jan 25, 2024

Description of changes

Fix currently broken build @vcunat @fabaff

This allows access to the vendored dependency rapidfuzz-cpp, which is older (2.0.0) than the nixpkgs version (3.0.0).

The nixpkgs rapidfuzz-cpp is kept in buildInputs, which enables us to seamlessly switch back to it when levenshtein catches up in the future.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This allows access to the vendored dependency `rapidfuzz-cpp`, which is
older (2.0.0) than the nixpkgs version (3.0.0).

The nixpkgs `rapidfuzz-cpp` is kept in buildInputs, which enables us to
seamlessly switch back to it when levenshtein catches up in the future.
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jan 25, 2024
@bryango bryango requested review from fabaff and vcunat January 25, 2024 09:58
@vcunat
Copy link
Copy Markdown
Member

vcunat commented Jan 25, 2024

The nixpkgs rapidfuzz-cpp is kept in buildInputs, which enables us to seamlessly switch back to it when levenshtein catches up in the future.

I probably wouldn't do that, at least not this way. But let's hear feedback from others.

@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jan 25, 2024
@bryango
Copy link
Copy Markdown
Member Author

bryango commented Jan 25, 2024

The nixpkgs rapidfuzz-cpp is kept in buildInputs, which enables us to seamlessly switch back to it when levenshtein catches up in the future.

I probably wouldn't do that, at least not this way. But let's hear feedback from others.

Indeed, this seems a bit flaky (no pun intended), but upstream has a nice logic to detect system supplied dependencies and only uses vendored ones if they are not found:

https://github.com/rapidfuzz/Levenshtein/blob/main/CMakeLists.txt

find_package(rapidfuzz 2.0.0 QUIET)
if (rapidfuzz_FOUND)
    message(STATUS "Using system supplied version of rapidfuzz-cpp")
else()
    message(STATUS "Using packaged version of rapidfuzz-cpp")
    add_subdirectory(extern/rapidfuzz-cpp)
endif()

So I guess it would be okay, this time? I'll also wait for feedbacks and change accordingly.

@vcunat
Copy link
Copy Markdown
Member

vcunat commented Jan 25, 2024

Let me merge this PR as is, so that the build is fixed at least. Further improvements can be done later.

@vcunat vcunat merged commit e70c6e6 into NixOS:staging-next Jan 25, 2024
@dotlambda
Copy link
Copy Markdown
Member

Please add python3.pkgs.levenshtein to rapidfuzz-cpp's passthru.tests .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants