blender 2.91.2 fails to build with python 3.10a5 (upcoming python 3.10) #85573

Closed
opened 2021-02-12 07:55:07 +01:00 by Mamoru TASAKA · 9 comments

With coming python 3.10 (currently python 3.10a5), blender 2.91.2 fails to compile:

gmake[2]: Entering directory '/builddir/build/BUILD/blender-2.91.2/x86_64-redhat-linux-gnu'
[ 74%] Building C object source/blender/python/intern/CMakeFiles/bf_python.dir/bpy.c.o
cd /builddir/build/BUILD/blender-2.91.2/x86_64-redhat-linux-gnu/source/blender/python/intern && /usr/bin/gcc -DBUILD_DATE -DNDEBUG -DWITH_ALEMBIC -DWITH_ASSERT_ABORT -DWITH_AUDASPACE -DWITH_AVI -DWITH_BULLET -DWITH_CINEON -DWITH_COLLADA -DWITH_COMPOSITOR -DWITH_CYCLES -DWITH_CYCLES_EMBREE -DWITH_DDS -DWITH_FLUID -DWITH_FREESTYLE -DWITH_HDR -DWITH_INPUT_NDOF -DWITH_INTERNATIONAL -DWITH_JACK -DWITH_LIBMV -DWITH_MOD_REMESH -DWITH_OCEANSIM -DWITH_OCIO -DWITH_OPENAL -DWITH_OPENEXR -DWITH_OPENGL -DWITH_OPENIMAGEIO -DWITH_OPENJPEG -DWITH_OPENSUBDIV -DWITH_OPENVDB -DWITH_POTRACE -DWITH_SDL -DWITH_SNDFILE -DWITH_TIFF -DWITH_XR_OPENXR -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D__LITTLE_ENDIAN__ -D__MMX__ -D__SSE2__ -D__SSE__ -I/builddir/build/BUILD/blender-2.91.2/source/blender/python -I/builddir/build/BUILD/blender-2.91.2/source/blender/blenkernel -I/builddir/build/BUILD/blender-2.91.2/source/blender/blenlib -I/builddir/build/BUILD/blender-2.91.2/source/blender/blenloader -I/builddir/build/BUILD/blender-2.91.2/source/blender/blentranslation -I/builddir/build/BUILD/blender-2.91.2/source/blender/depsgraph -I/builddir/build/BUILD/blender-2.91.2/source/blender/editors/include -I/builddir/build/BUILD/blender-2.91.2/source/blender/gpu -I/builddir/build/BUILD/blender-2.91.2/source/blender/imbuf -I/builddir/build/BUILD/blender-2.91.2/source/blender/makesdna -I/builddir/build/BUILD/blender-2.91.2/source/blender/makesrna -I/builddir/build/BUILD/blender-2.91.2/source/blender/windowmanager -I/builddir/build/BUILD/blender-2.91.2/intern/clog -I/builddir/build/BUILD/blender-2.91.2/intern/guardedalloc -I/builddir/build/BUILD/blender-2.91.2/intern/mantaflow/extern -I/builddir/build/BUILD/blender-2.91.2/intern/opencolorio -I/builddir/build/BUILD/blender-2.91.2/intern/cycles/blender -I/builddir/build/BUILD/blender-2.91.2/source/blender/freestyle/intern/python -I/builddir/build/BUILD/blender-2.91.2/intern/openvdb -I/builddir/build/BUILD/blender-2.91.2/source/blender/io/alembic -I/builddir/build/BUILD/blender-2.91.2/source/blender/imbuf/intern/oiio -I/builddir/build/BUILD/blender-2.91.2/intern/opensubdiv -isystem /usr/include/python3.10 -isystem /usr/include/SDL2 -Wall -Wcast-align -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -Wimplicit-fallthrough=5 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,--as-needed -fuse-ld=gold -fopenmp -std=gnu11   -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -msse2 -Wno-maybe-uninitialized -DNDEBUG -o CMakeFiles/bf_python.dir/bpy.c.o -c /builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c
/builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c: In function 'bpy_escape_identifier':
/builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c:271:15: error: implicit declaration of function '_PyUnicode_AsStringAndSize'; did you mean 'PyUnicode_FromStringAndSize'? [-Werror=implicit-function-declaration]
  271 |   value_str = _PyUnicode_AsStringAndSize(value, &value_str_len);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |               PyUnicode_FromStringAndSize
/builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c:271:13: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  271 |   value_str = _PyUnicode_AsStringAndSize(value, &value_str_len);
      |             ^
cc1: some warnings being treated as errors

System Information
Operating system:
Fedora 34 x86_64
gcc-11.0.0-0.18.fc34.x86_64
python3-3.10.0~a5-1.fc34.x86_64

Graphics card:

Blender Version
Broken: at least 2.91.2

Note
_PyUnicode_AsStringAndSize is removed from Include/cpython/unicodeobject.h with this commit:
3a8fdb2879 (diff-6be7f081fe6c5e9cbc89323a00399b291d1cda855bcb4c6eeaee0fac89c2f8dd)

As _PyUnicode_AsStringAndSize had been just the alias of PyUnicode_AsUTF8AndSize and PyUnicode_AsUTF8AndSize will be available even on python3.10 and later, I think replacing as such is enough.

With coming python 3.10 (currently python 3.10a5), blender 2.91.2 fails to compile: ``` gmake[2]: Entering directory '/builddir/build/BUILD/blender-2.91.2/x86_64-redhat-linux-gnu' [ 74%] Building C object source/blender/python/intern/CMakeFiles/bf_python.dir/bpy.c.o cd /builddir/build/BUILD/blender-2.91.2/x86_64-redhat-linux-gnu/source/blender/python/intern && /usr/bin/gcc -DBUILD_DATE -DNDEBUG -DWITH_ALEMBIC -DWITH_ASSERT_ABORT -DWITH_AUDASPACE -DWITH_AVI -DWITH_BULLET -DWITH_CINEON -DWITH_COLLADA -DWITH_COMPOSITOR -DWITH_CYCLES -DWITH_CYCLES_EMBREE -DWITH_DDS -DWITH_FLUID -DWITH_FREESTYLE -DWITH_HDR -DWITH_INPUT_NDOF -DWITH_INTERNATIONAL -DWITH_JACK -DWITH_LIBMV -DWITH_MOD_REMESH -DWITH_OCEANSIM -DWITH_OCIO -DWITH_OPENAL -DWITH_OPENEXR -DWITH_OPENGL -DWITH_OPENIMAGEIO -DWITH_OPENJPEG -DWITH_OPENSUBDIV -DWITH_OPENVDB -DWITH_POTRACE -DWITH_SDL -DWITH_SNDFILE -DWITH_TIFF -DWITH_XR_OPENXR -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D__LITTLE_ENDIAN__ -D__MMX__ -D__SSE2__ -D__SSE__ -I/builddir/build/BUILD/blender-2.91.2/source/blender/python -I/builddir/build/BUILD/blender-2.91.2/source/blender/blenkernel -I/builddir/build/BUILD/blender-2.91.2/source/blender/blenlib -I/builddir/build/BUILD/blender-2.91.2/source/blender/blenloader -I/builddir/build/BUILD/blender-2.91.2/source/blender/blentranslation -I/builddir/build/BUILD/blender-2.91.2/source/blender/depsgraph -I/builddir/build/BUILD/blender-2.91.2/source/blender/editors/include -I/builddir/build/BUILD/blender-2.91.2/source/blender/gpu -I/builddir/build/BUILD/blender-2.91.2/source/blender/imbuf -I/builddir/build/BUILD/blender-2.91.2/source/blender/makesdna -I/builddir/build/BUILD/blender-2.91.2/source/blender/makesrna -I/builddir/build/BUILD/blender-2.91.2/source/blender/windowmanager -I/builddir/build/BUILD/blender-2.91.2/intern/clog -I/builddir/build/BUILD/blender-2.91.2/intern/guardedalloc -I/builddir/build/BUILD/blender-2.91.2/intern/mantaflow/extern -I/builddir/build/BUILD/blender-2.91.2/intern/opencolorio -I/builddir/build/BUILD/blender-2.91.2/intern/cycles/blender -I/builddir/build/BUILD/blender-2.91.2/source/blender/freestyle/intern/python -I/builddir/build/BUILD/blender-2.91.2/intern/openvdb -I/builddir/build/BUILD/blender-2.91.2/source/blender/io/alembic -I/builddir/build/BUILD/blender-2.91.2/source/blender/imbuf/intern/oiio -I/builddir/build/BUILD/blender-2.91.2/intern/opensubdiv -isystem /usr/include/python3.10 -isystem /usr/include/SDL2 -Wall -Wcast-align -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -Wimplicit-fallthrough=5 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,--as-needed -fuse-ld=gold -fopenmp -std=gnu11 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -msse2 -Wno-maybe-uninitialized -DNDEBUG -o CMakeFiles/bf_python.dir/bpy.c.o -c /builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c /builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c: In function 'bpy_escape_identifier': /builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c:271:15: error: implicit declaration of function '_PyUnicode_AsStringAndSize'; did you mean 'PyUnicode_FromStringAndSize'? [-Werror=implicit-function-declaration] 271 | value_str = _PyUnicode_AsStringAndSize(value, &value_str_len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | PyUnicode_FromStringAndSize /builddir/build/BUILD/blender-2.91.2/source/blender/python/intern/bpy.c:271:13: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 271 | value_str = _PyUnicode_AsStringAndSize(value, &value_str_len); | ^ cc1: some warnings being treated as errors ``` **System Information** Operating system: Fedora 34 x86_64 gcc-11.0.0-0.18.fc34.x86_64 python3-3.10.0~a5-1.fc34.x86_64 Graphics card: **Blender Version** Broken: at least 2.91.2 **Note** `_PyUnicode_AsStringAndSize` is removed from `Include/cpython/unicodeobject.h` with this commit: https://github.com/python/cpython/commit/3a8fdb28794b2f19f6c8464378fb8b46bce1f5f4#diff-6be7f081fe6c5e9cbc89323a00399b291d1cda855bcb4c6eeaee0fac89c2f8dd As `_PyUnicode_AsStringAndSize` had been just the alias of `PyUnicode_AsUTF8AndSize` and `PyUnicode_AsUTF8AndSize` will be available even on python3.10 and later, I think replacing as such is enough.
Author

Added subscriber: @mtasaka

Added subscriber: @mtasaka
Author

Note that _PyUnicode_AsStringAndSize appears on:

$ grep -rl _PyUnicode_AsStringAndSize blender-2.91.2/
blender-2.91.2/source/blender/python/generic/py_capi_utils.c
blender-2.91.2/source/blender/python/generic/idprop_py_api.c
blender-2.91.2/source/blender/python/generic/imbuf_py_api.c
blender-2.91.2/source/blender/python/gpu/gpu_py_vertex_format.c
blender-2.91.2/source/blender/python/gpu/gpu_py_shader.c
blender-2.91.2/source/blender/python/gpu/gpu_py_api.c
blender-2.91.2/source/blender/python/intern/bpy_props.c
blender-2.91.2/source/blender/python/intern/bpy.c
blender-2.91.2/source/blender/python/intern/bpy_rna.c
blender-2.91.2/source/blender/python/mathutils/mathutils_Matrix.c
Note that `_PyUnicode_AsStringAndSize` appears on: ``` $ grep -rl _PyUnicode_AsStringAndSize blender-2.91.2/ blender-2.91.2/source/blender/python/generic/py_capi_utils.c blender-2.91.2/source/blender/python/generic/idprop_py_api.c blender-2.91.2/source/blender/python/generic/imbuf_py_api.c blender-2.91.2/source/blender/python/gpu/gpu_py_vertex_format.c blender-2.91.2/source/blender/python/gpu/gpu_py_shader.c blender-2.91.2/source/blender/python/gpu/gpu_py_api.c blender-2.91.2/source/blender/python/intern/bpy_props.c blender-2.91.2/source/blender/python/intern/bpy.c blender-2.91.2/source/blender/python/intern/bpy_rna.c blender-2.91.2/source/blender/python/mathutils/mathutils_Matrix.c ```

Added subscriber: @Harvester

Added subscriber: @Harvester

Hello, just for my curiosity, isn't Blender 2.92 as well as 2.93 based on Python 3.7.7? Why are you compiling for Python 10, not yet officially supported for the Blender development? I read there are plans to move to Python 3.9 but that's all I know about. I repeat it, just for my curiosity. Thank you.

Hello, just for my curiosity, isn't Blender 2.92 as well as 2.93 based on Python 3.7.7? Why are you compiling for Python 10, not yet officially supported for the Blender development? I read there are plans to move to Python 3.9 but that's all I know about. I repeat it, just for my curiosity. Thank you.
Author

It is because Fedora 33 already uses python 3.9, Fedora 34 will use python 3.9, and Fedora 35 (to be released on 2021/Oct) will use python 3.10 (also to be released on 2021/Oct) . Then we and python maintainers on Fedora Project are preparing for python 3.10 beforehand to ensure that we can switch to python 3.10 smoothly:

https://fedoraproject.org/wiki/Changes/Python3.10

It is because Fedora 33 already uses python 3.9, Fedora 34 will use python 3.9, and Fedora 35 (to be released on 2021/Oct) will use python 3.10 (also to be released on 2021/Oct) . Then we and python maintainers on Fedora Project are preparing for python 3.10 beforehand to ensure that we can switch to python 3.10 smoothly: https://fedoraproject.org/wiki/Changes/Python3.10

Thank you for the explanation.

Thank you for the explanation.

This issue was referenced by dae445d94a

This issue was referenced by dae445d94a7a5e1ad38719ea05e5bb0bc76ede84
Campbell Barton self-assigned this 2021-02-13 12:58:18 +01:00

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'

Update, Blender now runs with Python 3.10 (previously it compiled but started with errors: ref 08dbc4f996)

Update, Blender now runs with Python 3.10 (previously it compiled but started with errors: ref 08dbc4f996)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#85573
No description provided.