Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[Solved ]dev-python/levenshtein does not compile anymore

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
pogwizd
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Sun Mar 26, 2006 7:54 am
Location: Warszawa

[Solved ]dev-python/levenshtein does not compile anymore

  • Quote

Post by pogwizd » Mon Mar 16, 2026 5:46 am

Hi,

During a system update, the dev-python/levenshtein package need to be rebuild.
Unfortunetelly, it won't with indicating that wheel could not compile, and error about the fact that cython does not support C++ - full log available here.

The use flags for this package looks like this:

Code: Select all

emerge -uDNp @world

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 36.55 s (backtrack: 0/20).

[ebuild   R    ] dev-python/levenshtein-0.27.3::gentoo  USE="-debug -test" PYTHON_TARGETS="python3_13 -python3_11 -python3_12* -python3_14" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:

dev-python/protobuf:0

(dev-python/protobuf-7.34.0:0/7.34.0::gentoo, ebuild scheduled for merge) USE="-debug -test" ABI_X86="(64)" PYTHON_TARGETS="python3_13 -python3_11 -python3_12 -python3_14" conflicts with
<dev-python/protobuf-7[python_targets_python3_13(-)] required by (dev-python/proto-plus-1.27.1:0/0::gentoo, installed) USE="-doc -test" ABI_X86="(64)" PYTHON_TARGETS="python3_13 -python3_11 -python3_12 -python3_14"
^                    ^
<dev-python/protobuf-7[python_targets_python3_13(-)] required by (dev-python/googleapis-common-protos-1.73.0:0/0::gentoo, installed) USE="-test -verify-provenance" ABI_X86="(64)" PYTHON_TARGETS="python3_13 -python3_11 -python3_12 -python3_14"
^                    ^
I wated to know if maybe someone has an idea on how to correct this little problem?
Thanks,
Last edited by pogwizd on Tue Mar 17, 2026 4:08 am, edited 1 time in total.
Top
rab0171610
l33t
l33t
Posts: 721
Joined: Sat Dec 24, 2022 1:41 am

  • Quote

Post by rab0171610 » Mon Mar 16, 2026 12:04 pm

You didn't mention that you are using unstable, but I assume from your package versions that you are. Did you file a bug report?

That error comes from the block of cython code:

Code: Select all

 context.setup_errors(options, result)

    if '.' in source.full_module_name and '.' in os.path.splitext(os.path.basename(abs_path))[0]:
        warning((source.source_desc, 1, 0),
                "Dotted filenames ('%s') are deprecated."
                " Please use the normal Python package directory layout." % os.path.basename(abs_path), level=1)
    if re.search("[.]c(pp|[+][+]|xx)$", result.c_file, re.RegexFlag.IGNORECASE) and not context.cpp:
        warning((source.source_desc, 1, 0),
                "Filename implies a c++ file but Cython is not in c++ mode.",
                level=1)
https://github.com/cython/cython/blob/m ... er/Main.py

There was a recent commit to Levenshtein on Jan 24, 2026. It has not made it into any official release yet, as the last release was on Nov 21, 2025.
https://github.com/rapidfuzz/Levenshtei ... d6bdaac852

Code: Select all

Compile extension as C++
This fixes the build with Cython 3.2. Tested against 3.2.4.

Code: Select all

‎ src/Levenshtein/CMakeLists.txt ‎
+1-1Lines changed: 1 addition & 1 deletion
Original file line number	Diff line number	Diff line change
@@ -9,7 +9,7 @@ function(create_cython_target _name)
      MAIN_DEPENDENCY "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
      VERBATIM
      COMMAND
      -  Python::Interpreter -m cython "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
      +  Python::Interpreter -m cython --cplus "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
        --output-file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.cxx")

    set(${_name}
I am assuming from this commit that Levenshtein only supports Cython <3.2 . However the ebuilds for dev-python/levenshtein do not appear to have an upper bound limit on dev-python/cython.

Code: Select all

BDEPEND="
	>=dev-python/cython-3.0.11[${PYTHON_USEDEP}]
My suggestion is, depending on your skill level, is to use the commit to patch your own ebuild of Levenshtein to see if that fixes the issue. If it does, you should file a bug report on gentoo for the Levenshtein ebuild. They may need to add an upper bound limit for the cython version to the ebuild. *

Otherwise, the easiest route would be to try downgrading dev-python/cython to a version <3.2.
If that does not work, you should still file a bug report.

* (NOTE:If you know how to step through ebuilds, as a quick troubleshooting method you could manually modify the src/Levenshtein/CMakeLists.txt ‎ after the prepare phase and make the following change

Code: Select all

 -  Python::Interpreter -m cython "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
      +  Python::Interpreter -m cython --cplus "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
If this compilation no longer fails with the C++ related errors then you know that is the issue. You can stop the build and proceed from there with either patching Leventshtein or downgrading Cython, and then filing a bug report)
Top
pogwizd
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Sun Mar 26, 2006 7:54 am
Location: Warszawa

  • Quote

Post by pogwizd » Mon Mar 16, 2026 12:40 pm

rab0171610, yes indeed, I forgot to mention the ~amd64 architecture. Sorry.

I wanted to quickly try to create the patch, but when I checked the mentioned file I saw in it that there was no mention of the --cplus argument

Code: Select all

function(create_cython_target _name)
  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${_name}.cxx)
    set(${_name}
        ${CMAKE_CURRENT_LIST_DIR}/${_name}.cxx
        PARENT_SCOPE)
  else()
    add_custom_command(
      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_name}.cxx"
      MAIN_DEPENDENCY "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
      VERBATIM
      COMMAND
        Python::Interpreter -m cython "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
        --output-file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.cxx")

    set(${_name}
        ${CMAKE_CURRENT_BINARY_DIR}/${_name}.cxx
        PARENT_SCOPE)
  endif()
endfunction(create_cython_target)
I have to go right now, but in the evening, I will try to manually downgrade the Cython compiler and recompile levenstrein after that.
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Mar 16, 2026 1:14 pm

The diff hunk that rab0171610 posted shows that the file currently does not have --cplus, but will gain that parameter if the patch is applied successfully. Therefore, it is expected that if you look at the unmodified file, you do not see that parameter.
Top
pogwizd
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Sun Mar 26, 2006 7:54 am
Location: Warszawa

  • Quote

Post by pogwizd » Mon Mar 16, 2026 6:28 pm

Thanks Hu,
Indeed, I understood that the other way around,

Thanks rab0171610
The patch did the trick.

I will post a bugzilla tomorrow morning.
Top
grknight
Retired Dev
Retired Dev
Posts: 2557
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Mon Mar 16, 2026 7:35 pm

I believe this is Bug 966947
Last edited by grknight on Thu Apr 02, 2026 1:04 pm, edited 1 time in total.
Top
rab0171610
l33t
l33t
Posts: 721
Joined: Sat Dec 24, 2022 1:41 am

  • Quote

Post by rab0171610 » Tue Mar 17, 2026 2:16 am

pogwizd wrote:Thanks Hu,
Indeed, I understood that the other way around,

Thanks rab0171610
The patch did the trick.

I will post a bugzilla tomorrow morning.
You are welcome, I was having trouble sleeping so I went down the rabbit hole for you.
Top
pogwizd
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Sun Mar 26, 2006 7:54 am
Location: Warszawa

  • Quote

Post by pogwizd » Tue Mar 17, 2026 4:08 am

Added my patch to the bug mentioned by grknight
Top
Post Reply

8 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic