datrie icon indicating copy to clipboard operation
datrie copied to clipboard

Installing datrie fails with gcc14

Open vandalt opened this issue 1 year ago • 5 comments

Installation fails with gcc14 on Archlinux, it seems #99 fixes the issue, but I wanted to open an issue just in case others encountered the issue.

  error: subprocess-exited-with-error
  
  × Building wheel for datrie (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [75 lines of output]
      running bdist_wheel
      running build
      running build_clib
      building 'datrie' library
      creating build
      creating build/temp.linux-x86_64-cpython-312
      creating build/temp.linux-x86_64-cpython-312/libdatrie
      creating build/temp.linux-x86_64-cpython-312/libdatrie/datrie
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -c libdatrie/datrie/alpha-map.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/alpha-map.o
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -c libdatrie/datrie/darray.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/darray.o
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -c libdatrie/datrie/dstring.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/dstring.o
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -c libdatrie/datrie/fileutils.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/fileutils.o
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -c libdatrie/datrie/tail.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/tail.o
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -c libdatrie/datrie/trie-string.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie-string.o
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -c libdatrie/datrie/trie.c -o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie.o
      ar rcs build/temp.linux-x86_64-cpython-312/libdatrie.a build/temp.linux-x86_64-cpython-312/libdatrie/datrie/alpha-map.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/darray.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/dstring.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/fileutils.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/tail.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie-string.o build/temp.linux-x86_64-cpython-312/libdatrie/datrie/trie.o
      running build_ext
      building 'datrie' extension
      creating build/temp.linux-x86_64-cpython-312/src
      gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -Ilibdatrie -I/home/vandal/repos/learning/showyourwork-learn/venv/include -I/usr/include/python3.12 -c src/datrie.c -o build/temp.linux-x86_64-cpython-312/src/datrie.o
      src/datrie.c: In function ‘__pyx_pf_6datrie_8BaseTrie___init__’:
      src/datrie.c:5673:53: error: passing argument 1 of ‘trie_new’ from incompatible pointer type [-Wincompatible-pointer-types]
       5673 |   __pyx_v_self->_c_trie = trie_new(__pyx_v_alpha_map->_c_alpha_map);
            |                                    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
            |                                                     |
            |                                                     struct AlphaMap *
      In file included from src/datrie.c:1248:
      src/../libdatrie/datrie/trie.h:120:35: note: expected ‘const AlphaMap *’ {aka ‘const struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
        120 | Trie *  trie_new (const AlphaMap *alpha_map);
            |                   ~~~~~~~~~~~~~~~~^~~~~~~~~
      src/datrie.c: In function ‘__pyx_pf_6datrie_8BaseTrie_6clear’:
      src/datrie.c:6351:47: error: passing argument 1 of ‘trie_new’ from incompatible pointer type [-Wincompatible-pointer-types]
       6351 |   __pyx_v__c_trie = trie_new(__pyx_v_alpha_map->_c_alpha_map);
            |                              ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
            |                                               |
            |                                               struct AlphaMap *
      src/../libdatrie/datrie/trie.h:120:35: note: expected ‘const AlphaMap *’ {aka ‘const struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
        120 | Trie *  trie_new (const AlphaMap *alpha_map);
            |                   ~~~~~~~~~~~~~~~~^~~~~~~~~
      src/datrie.c: In function ‘__pyx_pf_6datrie_8AlphaMap___cinit__’:
      src/datrie.c:27404:30: error: assignment to ‘struct AlphaMap *’ from incompatible pointer type ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} [-Wincompatible-pointer-types]
      27404 |   __pyx_v_self->_c_alpha_map = alpha_map_new();
            |                              ^
      src/datrie.c: In function ‘__pyx_pf_6datrie_8AlphaMap_2__dealloc__’:
      src/datrie.c:27460:32: error: passing argument 1 of ‘alpha_map_free’ from incompatible pointer type [-Wincompatible-pointer-types]
      27460 |     alpha_map_free(__pyx_v_self->_c_alpha_map);
            |                    ~~~~~~~~~~~~^~~~~~~~~~~~~~
            |                                |
            |                                struct AlphaMap *
      In file included from src/datrie.c:1247:
      src/../libdatrie/datrie/alpha-map.h:72:39: note: expected ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
         72 | void        alpha_map_free (AlphaMap *alpha_map);
            |                             ~~~~~~~~~~^~~~~~~~~
      src/datrie.c: In function ‘__pyx_f_6datrie_8AlphaMap_copy’:
      src/datrie.c:27875:61: error: passing argument 1 of ‘alpha_map_clone’ from incompatible pointer type [-Wincompatible-pointer-types]
      27875 |   __pyx_v_clone->_c_alpha_map = alpha_map_clone(__pyx_v_self->_c_alpha_map);
            |                                                 ~~~~~~~~~~~~^~~~~~~~~~~~~~
            |                                                             |
            |                                                             struct AlphaMap *
      src/../libdatrie/datrie/alpha-map.h:70:46: note: expected ‘const AlphaMap *’ {aka ‘const struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
         70 | AlphaMap *  alpha_map_clone (const AlphaMap *a_map);
            |                              ~~~~~~~~~~~~~~~~^~~~~
      src/datrie.c:27875:31: error: assignment to ‘struct AlphaMap *’ from incompatible pointer type ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} [-Wincompatible-pointer-types]
      27875 |   __pyx_v_clone->_c_alpha_map = alpha_map_clone(__pyx_v_self->_c_alpha_map);
            |                               ^
      src/datrie.c: In function ‘__pyx_f_6datrie_8AlphaMap__add_range’:
      src/datrie.c:28566:50: error: passing argument 1 of ‘alpha_map_add_range’ from incompatible pointer type [-Wincompatible-pointer-types]
      28566 |   __pyx_v_code = alpha_map_add_range(__pyx_v_self->_c_alpha_map, __pyx_v_begin, __pyx_v_end);
            |                                      ~~~~~~~~~~~~^~~~~~~~~~~~~~
            |                                                  |
            |                                                  struct AlphaMap *
      src/../libdatrie/datrie/alpha-map.h:74:45: note: expected ‘AlphaMap *’ {aka ‘struct _AlphaMap *’} but argument is of type ‘struct AlphaMap *’
         74 | int         alpha_map_add_range (AlphaMap  *alpha_map,
            |                                  ~~~~~~~~~~~^~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for datrie
Failed to build datrie
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (datrie)

vandalt avatar Jul 08 '24 21:07 vandalt

Hello, can someone please merge the notedPR and make a new release? Anything using datrie is now uninstallable on systems with GCC 14 (snakemake is an example).

sanjayankur31 avatar Jul 16 '24 12:07 sanjayankur31

A workaround is to set CFLAGS and CXXFLAGS to downgrade the gcc error:

export CFLAGS="-Wno-error=incompatible-pointer-types" ; export CXXFLAGS="-Wno-error=incompatible-pointer-types" ; pip install datrie

sanjayankur31 avatar Jul 16 '24 12:07 sanjayankur31

This affects me as well on fedora fc40. Would be cool to merge a fix, as it appears to be available with #99

psteinb avatar Nov 01 '24 17:11 psteinb

With the last commit beeing 4 years old this feels a bit dead. Anyone with a good suggestion for a tri library to switch to?

nylocx avatar Nov 22 '24 06:11 nylocx

Just had this, had to use -Wno-incompatible-pointer-types to fix. This is quite arcane and hard to pinpoint. IDK what can be done...

SohamG avatar Jun 12 '25 21:06 SohamG

I use the python:3.12 Docker image in most of my CI builds. Last night I had a build unexpectedly fail when trying to install datrie. I traced it to the fact that Debian 13 was released a few days ago, and the Python 3.12 Docker image was just updated within the last 24 hours to use that version of Debian, which has as its default GCC version—you guessed it!—14. I solved the issue by explicitly installing gcc13 and giving it higher priority than gcc14, but I expect this is going to become an increasingly common issue.

standage avatar Aug 13 '25 13:08 standage

#99 is now merged.

tacaswell avatar Aug 28 '25 12:08 tacaswell

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

tacaswell avatar Aug 28 '25 12:08 tacaswell