sergey-dryabzhinsky / python-zstd

Simple python bindings to Yann Collet ZSTD compression library
BSD 2-Clause "Simplified" License
165 stars 27 forks source link

'pip install zstd' fails in travisci with python nightly with error: PyThreadState has no member cframe #74

Closed rouilj closed 2 years ago

rouilj commented 2 years ago

zstd is used by Roundup for web compression.

When building against the python from: https://storage.googleapis.com/travis-ci-language-archives/python/binaries/ubuntu/20.04/x86_64/python-nightly.tar.bz2

the build fails with the error:

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/home/travis/virtualenv/python3.10-dev/include -I/opt/python/3.10-dev/include/python3.10 -c src/python-zstd.c -o build/temp.linux-x86_64-3.10/src/python-zstd.o -O2 -DVERSION=1.5.1.0 -DDYNAMIC_BMI2=0 -DZSTD_MULTITHREAD=1 -Izstd/lib -Izstd/lib/common -Izstd/lib/compress -Izstd/lib/decompress -DZSTD_TRACE=0
  In file included from src/python-zstd.c:41:
  src/pythoncapi_compat.h: In function ‘PyThreadState_EnterTracing’:
  src/pythoncapi_compat.h:260:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘cframe’; did you mean ‘frame’?
    260 |     tstate->cframe->use_tracing = 0;
        |             ^~~~~~
        |             frame
  src/pythoncapi_compat.h: In function ‘PyThreadState_LeaveTracing’:
  src/pythoncapi_compat.h:275:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘cframe’; did you mean ‘frame’?
    275 |     tstate->cframe->use_tracing = use_tracing;
        |             ^~~~~~
        |             frame
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for zstd
  Running setup.py clean for zstd
Failed to build zstd
Installing collected packages: zstd, brotli
    Running setup.py install for zstd ... error
    ERROR: Command errored out with exit status 1:

The full log can be seen at: https://app.travis-ci.com/github/roundup-tracker/roundup/jobs/557152008 It has been broken for a while. Any ideas on why it's failing and how it can be fixed?

It builds on 2.7, 3.10 and others just fine.

Thanks.

-- rouilj

rouilj commented 2 years ago

I haven't seen any activity on this, do you need more info or is there somewhere else I should report this problem?

sergey-dryabzhinsky commented 2 years ago

They changed python internals again. I'll lookup for that.

sergey-dryabzhinsky commented 2 years ago

Well, I tested build with python3.11~a7 from deadsnakes ppa. And there is no errors. And via python3.10 too.

Pythons was not nightly ones, stable.

sergey-dryabzhinsky commented 2 years ago

It should build with:

rouilj commented 2 years ago

Thanks for looking into this.

I did some more investigation and it looks like they updated the nightly build to 3.10.4 from the woefully old 3.10.0a5 build that they were using for nightly. So zstd now builds properly. Sorry I missed that they were using a very old alpha release for nightly. If I had realized that I would have brought it up with them first.

-- rouilj