Skip to content

Fix AlphaMap definition in cdatrie.pxd#99

Merged
tacaswell merged 1 commit intopytries:masterfrom
musicinmybrain:incompatible-pointers
Aug 28, 2025
Merged

Fix AlphaMap definition in cdatrie.pxd#99
tacaswell merged 1 commit intopytries:masterfrom
musicinmybrain:incompatible-pointers

Conversation

@musicinmybrain
Copy link
Copy Markdown
Contributor

Fixes failure to compile on GCC with -Werror=incompatible-pointer-types.

Fixes failure to compile on GCC with `-Werror=incompatible-pointer-types`.
@glaubitz
Copy link
Copy Markdown

This fixes the build with GCC 14 for me.

@johanneskoester
Copy link
Copy Markdown

johanneskoester commented Aug 8, 2024

Maintainers, could you please review and merge? Or let us know how to proceed? Do you want to transfer the ownership of datrie?

@Stack7
Copy link
Copy Markdown

Stack7 commented Sep 18, 2024

Good evening!
This fix is very helpful, thanks a lot! However I still have a issue.
I have already patched the file as it has shown above and then, I tried to compile with -Werror incompatible-pointer-types .I guessed I need to edit the file update_c.sh and add that flag in the cython line. I tried so, but the compiler gave me back this:
cython: error: argument -Werror/--warning-errors: ignored explicit argument 'incompatible-pointer-types'
Can you help me to find out what is wrong?
Thank you very much!

@musicinmybrain
Copy link
Copy Markdown
Contributor Author

[…] Can you help me to find out what is wrong? Thank you very much!

It looks like you are passing -Werror incompatible-pointer-types to cython, not to your C++ compiler. (Also, I’m not sure if -Werror incompatible-pointer-types would be parsed as equivalent to -Werror=incompatible-pointer-types in this case or not.) But why do you need to pass that option, anyway? This patch is intended primarily to deal with GCC versions or distribution environments where incompatible pointer types are errors by default.

@Stack7
Copy link
Copy Markdown

Stack7 commented Sep 19, 2024

ok thanks! I followed your advice and I compiled
gcc ./src/datrie.c -W -O3 -Werror=incompatible-pointer-types -I $HOME/miniconda3/envs/scenicplus/include/python3.11/
however, I have got this error, which is attached.
The -I flag helps me to find the Python.h
error.txt

@musicinmybrain
Copy link
Copy Markdown
Contributor Author

./src/datrie.c: In function ‘__pyx_pf_6datrie_8BaseTrie___init__’:
./src/datrie.c:5669:53: error: passing argument 1 of ‘trie_new’ from incompatible pointer type [-Wincompatible-pointer-types]
 5669 |   __pyx_v_self->_c_trie = trie_new(__pyx_v_alpha_map->_c_alpha_map);
      |                                    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
      |                                                     |
      |                                                     struct AlphaMap *

It looks like you are probably compiling a copy of datrie.c that was generated (with update_c.sh) before patching datrie.pyx.

@Stack7
Copy link
Copy Markdown

Stack7 commented Sep 19, 2024

Thanks! You were right! then, I updated and compiled it! That error has disappeared! However I have got a lot of undefined reference; the error file is attached. Many thanks for helping me.
error_compiling.txt

@musicinmybrain
Copy link
Copy Markdown
Contributor Author

Most of those errors indicate you’re not linking the CPython libraries. The first error that’s trying to find a main routine suggests you may be just blindly running something like gcc -I/usr/include/python3.12 datrie.c and expecting to get a Python extension module.

All of the following work fine for me in a git checkout of this branch:

$ python3 -m build
$ python3 setup.py build
$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install .

@Stack7
Copy link
Copy Markdown

Stack7 commented Sep 20, 2024

Thnk you very much for the help! In the end, I tried a workaround from here : #101:

export CFLAGS="-Wno-error=incompatible-pointer-types" ; export CXXFLAGS="-Wno-error=incompatible-pointer-types" ; pip install datrie and I succeded! Anyway, very very thanks

daxrpm added a commit to daxrpm/reana-commons that referenced this pull request Jun 2, 2025
…in-xrootd to 0.4.1 for Python >=3.11

- Update Snakemake to 9.1.0 for Python >=3.11 to remove the unmaintained datrie dependency, fixing installation issues with modern GCC.
- Update snakemake-storage-plugin-xrootd to 0.4.1 for compatibility with Snakemake 9.x.
- Keep Snakemake 7.32.4 and pulp for Python <3.11 for backward compatibility.
- All tests pass locally (`186 passed, 4 xfailed`), matching CI results.

References:
- pytries/datrie#101
- pytries/datrie#99
- snakemake/snakemake#3176
- snakemake/snakemake#3105
- snakemake/snakemake#2970
- https://github.com/snakemake/snakemake/releases/tag/v8.29.1

Closes reanahub#494
@tacaswell tacaswell merged commit f43c39b into pytries:master Aug 28, 2025
@tacaswell
Copy link
Copy Markdown
Contributor

Can all of you in this thread please see #104 as you are clearly users of this package?

@musicinmybrain
Copy link
Copy Markdown
Contributor Author

Can all of you in this thread please see #104 as you are clearly users of this package?

Thank you for opening that issue! From my perspective: Snakemake removed the datrie dependencie in snakemake/snakemake#3176, and the python-datrie package in Fedora was retired, so I personally no longer have a stake in this package.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants