Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider setting a fixed minimum Rust version #1176

Closed
arnaudsjs opened this issue Jan 31, 2024 · 21 comments
Closed

Consider setting a fixed minimum Rust version #1176

arnaudsjs opened this issue Jan 31, 2024 · 21 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@arnaudsjs
Copy link

When I use the procedure in the README to build pydantic-core, the build fails. The issue can be reproduced in the following way:

git clone -b v2.16.1 https://github.com/pydantic/pydantic-core.git
cd pydantic-core
python3.11 -m venv env
source env/bin/activate
make install
It results in this output
+ git clone -b v2.16.1 https://github.com/pydantic/pydantic-core.git
Cloning into 'pydantic-core'...
Note: switching to '4538190f0e7a47a99ca44351f744007b016511d4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

+ cd pydantic-core
+ python3.11 -m venv env
+ source env/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /usr/bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ unset VIRTUAL_ENV_PROMPT
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/tmp/pydantic-core/env
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
++ PATH=/tmp/pydantic-core/env/bin:/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ PS1='(env) '
++ export PS1
++ VIRTUAL_ENV_PROMPT='(env) '
++ export VIRTUAL_ENV_PROMPT
++ '[' -n /usr/bin/bash -o -n '' ']'
++ hash -r
+ make install
/usr/bin/which: no maturin in (/tmp/pydantic-core/env/bin:/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
/usr/bin/which: no maturin in (/tmp/pydantic-core/env/bin:/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
/usr/bin/which: no maturin in (/tmp/pydantic-core/env/bin:/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
/usr/bin/which: no maturin in (/tmp/pydantic-core/env/bin:/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
/usr/bin/which: no maturin in (/tmp/pydantic-core/env/bin:/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
/usr/bin/which: no maturin in (/tmp/pydantic-core/env/bin:/home/arnaud/.local/bin:/home/arnaud/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
pip install -U pip wheel pre-commit
Looking in indexes: https://artifacts.internal.inmanta.com/inmanta/dev
Requirement already satisfied: pip in ./env/lib64/python3.11/site-packages (22.3.1)
Collecting pip
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/505/2d7889c1f9d05/pip-23.3.2-py3-none-any.whl (2.1 MB)
Collecting wheel
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/177/f9c9b0d45c478/wheel-0.42.0-py3-none-any.whl (65 kB)
Collecting pre-commit
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/c25/5039ef399049a/pre_commit-3.6.0-py2.py3-none-any.whl (204 kB)
Collecting cfgv>=2.0.0
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/b72/65b1f29fd3316/cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)
Collecting identify>=1.0.0
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/d40/ce5fcd7628176/identify-2.5.33-py2.py3-none-any.whl (98 kB)
Collecting nodeenv>=0.11.1
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/df8/65724bb3c3adc/nodeenv-1.8.0-py2.py3-none-any.whl (22 kB)
Collecting pyyaml>=5.1
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/d2b/04aac4d386b17/PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
Collecting virtualenv>=20.10.0
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/423/8949c5ffe6876/virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
Requirement already satisfied: setuptools in ./env/lib64/python3.11/site-packages (from nodeenv>=0.11.1->pre-commit) (65.5.1)
Collecting distlib<1,>=0.3.7
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/034/db59a0b96f8ca/distlib-0.3.8-py2.py3-none-any.whl (468 kB)
Collecting filelock<4,>=3.12.2
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/57d/bda9b35157b05/filelock-3.13.1-py3-none-any.whl (11 kB)
Collecting platformdirs<5,>=3.9.1
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/061/4df2a2f37e1a6/platformdirs-4.2.0-py3-none-any.whl (17 kB)
Installing collected packages: distlib, wheel, pyyaml, platformdirs, pip, nodeenv, identify, filelock, cfgv, virtualenv, pre-commit
Attempting uninstall: pip
Found existing installation: pip 22.3.1
Uninstalling pip-22.3.1:
Successfully uninstalled pip-22.3.1
Successfully installed cfgv-3.4.0 distlib-0.3.8 filelock-3.13.1 identify-2.5.33 nodeenv-1.8.0 pip-23.3.2 platformdirs-4.2.0 pre-commit-3.6.0 pyyaml-6.0.1 virtualenv-20.25.0 wheel-0.42.0
pip install -r tests/requirements.txt
Looking in indexes: https://artifacts.internal.inmanta.com/inmanta/dev
Collecting git+https://github.com/dateutil/dateutil.git@f2293200747fb03d56c6c5997bfebeabe703576f (from -r tests/requirements.txt (line 6))
Cloning https://github.com/dateutil/dateutil.git (to revision f2293200747fb03d56c6c5997bfebeabe703576f) to /tmp/pip-req-build-q77eh6k6
Running command git clone --filter=blob:none --quiet https://github.com/dateutil/dateutil.git /tmp/pip-req-build-q77eh6k6
Running command git rev-parse -q --verify 'sha^f2293200747fb03d56c6c5997bfebeabe703576f'
Running command git fetch -q https://github.com/dateutil/dateutil.git f2293200747fb03d56c6c5997bfebeabe703576f
Running command git checkout -q f2293200747fb03d56c6c5997bfebeabe703576f
Resolved https://github.com/dateutil/dateutil.git to commit f2293200747fb03d56c6c5997bfebeabe703576f
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Ignoring exceptiongroup: markers 'python_version < "3.11"' don't match your environment
Collecting coverage==7.4.0 (from -r tests/requirements.txt (line 1))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/485/e9f897cf4856a/coverage-7.4.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (237 kB)
Collecting dirty-equals==0.7.1.post0 (from -r tests/requirements.txt (line 2))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/7fb/9217ea7cd04c0/dirty_equals-0.7.1.post0-py3-none-any.whl (27 kB)
Collecting hypothesis==6.92.9 (from -r tests/requirements.txt (line 3))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/8c1/ab9f3c883fe63/hypothesis-6.92.9-py3-none-any.whl (431 kB)
Collecting pandas==2.1.3 (from -r tests/requirements.txt (line 8))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/d5d/ed6ff28abbf0e/pandas-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB)
Collecting pytest==7.4.4 (from -r tests/requirements.txt (line 9))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/b09/0cdf5ed60bf4c/pytest-7.4.4-py3-none-any.whl (325 kB)
Collecting pytest-codspeed~=2.2.0 (from -r tests/requirements.txt (line 11))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/5da/48b842fc46592/pytest_codspeed-2.2.0-py3-none-any.whl (10 kB)
Collecting pytest-examples==0.0.10 (from -r tests/requirements.txt (line 14))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/3d0/b52424e454846/pytest_examples-0.0.10-py3-none-any.whl (17 kB)
Collecting pytest-speed==0.3.5 (from -r tests/requirements.txt (line 15))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/ef9/f17d6800b158e/pytest_speed-0.3.5-py3-none-any.whl (9.7 kB)
Collecting pytest-mock==3.11.1 (from -r tests/requirements.txt (line 16))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/21c/279fff83d7076/pytest_mock-3.11.1-py3-none-any.whl (9.6 kB)
Collecting pytest-pretty==1.2.0 (from -r tests/requirements.txt (line 17))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/6f7/9122bf53864ae/pytest_pretty-1.2.0-py3-none-any.whl (6.2 kB)
Collecting pytest-timeout==2.2.0 (from -r tests/requirements.txt (line 18))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/bde/531e096466f49/pytest_timeout-2.2.0-py3-none-any.whl (13 kB)
Collecting pytz==2023.3.post1 (from -r tests/requirements.txt (line 19))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/ce4/2d816b81b6850/pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)
Collecting numpy==1.26.2 (from -r tests/requirements.txt (line 21))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/96c/a5482c3dbdd05/numpy-1.26.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
Collecting attrs>=22.2.0 (from hypothesis==6.92.9->-r tests/requirements.txt (line 3))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/99b/87a485a5820b2/attrs-23.2.0-py3-none-any.whl (60 kB)
Collecting sortedcontainers<3.0.0,>=2.1.0 (from hypothesis==6.92.9->-r tests/requirements.txt (line 3))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/a16/3dcaede0f1c02/sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting tzdata>=2022.1 (from pandas==2.1.3->-r tests/requirements.txt (line 8))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/aa3/ace4329eeacda/tzdata-2023.4-py2.py3-none-any.whl (346 kB)
Collecting iniconfig (from pytest==7.4.4->-r tests/requirements.txt (line 9))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/b6a/85871a79d2e3b/iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting packaging (from pytest==7.4.4->-r tests/requirements.txt (line 9))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/8c4/91190033a9af7/packaging-23.2-py3-none-any.whl (53 kB)
Collecting pluggy<2.0,>=0.12 (from pytest==7.4.4->-r tests/requirements.txt (line 9))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/7db/9f7b503d67d1c/pluggy-1.4.0-py3-none-any.whl (20 kB)
Collecting black>=23 (from pytest-examples==0.0.10->-r tests/requirements.txt (line 14))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/b3d/64db762eae4a5/black-24.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB)
Collecting ruff>=0.0.258 (from pytest-examples==0.0.10->-r tests/requirements.txt (line 14))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/b17/b93c02cdb6aeb/ruff-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB)
Collecting click>=7 (from pytest-speed==0.3.5->-r tests/requirements.txt (line 15))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/ae7/4fb96c20a0277/click-8.1.7-py3-none-any.whl (97 kB)
Collecting rich>=12 (from pytest-speed==0.3.5->-r tests/requirements.txt (line 15))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/6da/14c108c4866ee/rich-13.7.0-py3-none-any.whl (240 kB)
Collecting six>=1.5 (from python-dateutil==2.8.3.dev33+gf229320->-r tests/requirements.txt (line 6))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/8ab/b2f1d86890a2d/six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting cffi~=1.15.1 (from pytest-codspeed~=2.2.0->-r tests/requirements.txt (line 11))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/944/11f22c3985aca/cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (462 kB)
Collecting filelock~=3.12.2 (from pytest-codspeed~=2.2.0->-r tests/requirements.txt (line 11))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/08c/21d87ded6e2b9/filelock-3.12.4-py3-none-any.whl (11 kB)
Collecting mypy-extensions>=0.4.3 (from black>=23->pytest-examples==0.0.10->-r tests/requirements.txt (line 14))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/439/2f6c0eb8a5668/mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Collecting pathspec>=0.9.0 (from black>=23->pytest-examples==0.0.10->-r tests/requirements.txt (line 14))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/a0d/503e138a4c123/pathspec-0.12.1-py3-none-any.whl (31 kB)
Requirement already satisfied: platformdirs>=2 in ./env/lib64/python3.11/site-packages (from black>=23->pytest-examples==0.0.10->-r tests/requirements.txt (line 14)) (4.2.0)
Collecting pycparser (from cffi~=1.15.1->pytest-codspeed~=2.2.0->-r tests/requirements.txt (line 11))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/8ee/45429555515e1/pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting markdown-it-py>=2.2.0 (from rich>=12->pytest-speed==0.3.5->-r tests/requirements.txt (line 15))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/355/216845c60bd96/markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich>=12->pytest-speed==0.3.5->-r tests/requirements.txt (line 15))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/b27/c2826c47d0f32/pygments-2.17.2-py3-none-any.whl (1.2 MB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=12->pytest-speed==0.3.5->-r tests/requirements.txt (line 15))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/840/08a41e51615a4/mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Building wheels for collected packages: python-dateutil
Building wheel for python-dateutil (pyproject.toml): started
Building wheel for python-dateutil (pyproject.toml): finished with status 'done'
Created wheel for python-dateutil: filename=python_dateutil-2.8.3.dev33+gf229320-py2.py3-none-any.whl size=78541 sha256=d7e0b776f15454f56276ca921cc5d8d5e1fb95456eaf891b59906d007a55b118
Stored in directory: /home/arnaud/.cache/pip/wheels/c8/bf/d9/05659cade1e93b6b2474d6824f963c0dfd9a402e3561b5686d
Successfully built python-dateutil
Installing collected packages: sortedcontainers, pytz, tzdata, six, ruff, pygments, pycparser, pluggy, pathspec, packaging, numpy, mypy-extensions, mdurl, iniconfig, filelock, dirty-equals, coverage, click, attrs, python-dateutil, pytest, markdown-it-py, hypothesis, cffi, black, rich, pytest-timeout, pytest-mock, pytest-examples, pytest-codspeed, pandas, pytest-speed, pytest-pretty
Attempting uninstall: filelock
Found existing installation: filelock 3.13.1
Uninstalling filelock-3.13.1:
Successfully uninstalled filelock-3.13.1
Successfully installed attrs-23.2.0 black-24.1.1 cffi-1.15.1 click-8.1.7 coverage-7.4.0 dirty-equals-0.7.1.post0 filelock-3.12.4 hypothesis-6.92.9 iniconfig-2.0.0 markdown-it-py-3.0.0 mdurl-0.1.2 mypy-extensions-1.0.0 numpy-1.26.2 packaging-23.2 pandas-2.1.3 pathspec-0.12.1 pluggy-1.4.0 pycparser-2.21 pygments-2.17.2 pytest-7.4.4 pytest-codspeed-2.2.0 pytest-examples-0.0.10 pytest-mock-3.11.1 pytest-pretty-1.2.0 pytest-speed-0.3.5 pytest-timeout-2.2.0 python-dateutil-2.8.3.dev33+gf229320 pytz-2023.3.post1 rich-13.7.0 ruff-0.1.15 six-1.16.0 sortedcontainers-2.4.0 tzdata-2023.4
pip install -r tests/requirements-linting.txt
Looking in indexes: https://artifacts.internal.inmanta.com/inmanta/dev
Collecting griffe==0.38.1 (from -r tests/requirements-linting.txt (line 1))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/334/c79d3b5964ade/griffe-0.38.1-py3-none-any.whl (1.0 MB)
Collecting pyright==1.1.345 (from -r tests/requirements-linting.txt (line 2))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/008/91361baf58698/pyright-1.1.345-py3-none-any.whl (18 kB)
Collecting ruff==0.1.13 (from -r tests/requirements-linting.txt (line 3))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/9a1/600942485c6e6/ruff-0.1.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB)
Collecting mypy==1.8.0 (from -r tests/requirements-linting.txt (line 4))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/d19/c413b3c07cbec/mypy-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB)
Collecting colorama>=0.4 (from griffe==0.38.1->-r tests/requirements-linting.txt (line 1))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/4f1/d9991f5acc0ca/colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: nodeenv>=1.6.0 in ./env/lib64/python3.11/site-packages (from pyright==1.1.345->-r tests/requirements-linting.txt (line 2)) (1.8.0)
Collecting typing-extensions>=4.1.0 (from mypy==1.8.0->-r tests/requirements-linting.txt (line 4))
Using cached https://artifacts.internal.inmanta.com/root/pypi/%2Bf/af7/2aea155e91adf/typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Requirement already satisfied: mypy-extensions>=1.0.0 in ./env/lib64/python3.11/site-packages (from mypy==1.8.0->-r tests/requirements-linting.txt (line 4)) (1.0.0)
Requirement already satisfied: setuptools in ./env/lib64/python3.11/site-packages (from nodeenv>=1.6.0->pyright==1.1.345->-r tests/requirements-linting.txt (line 2)) (65.5.1)
Installing collected packages: typing-extensions, ruff, colorama, pyright, mypy, griffe
Attempting uninstall: ruff
Found existing installation: ruff 0.1.15
Uninstalling ruff-0.1.15:
Successfully uninstalled ruff-0.1.15
Successfully installed colorama-0.4.6 griffe-0.38.1 mypy-1.8.0 pyright-1.1.345 ruff-0.1.13 typing-extensions-4.9.0
pip install -e .
Looking in indexes: https://artifacts.internal.inmanta.com/inmanta/dev
Obtaining file:///tmp/pydantic-core
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Checking if build backend supports build_editable: started
Checking if build backend supports build_editable: finished with status 'done'
Getting requirements to build editable: started
Getting requirements to build editable: finished with status 'done'
Preparing editable metadata (pyproject.toml): started
Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: typing-extensions!=4.7.0,>=4.6.0 in ./env/lib64/python3.11/site-packages (from pydantic_core==2.16.1) (4.9.0)
Building wheels for collected packages: pydantic_core
Building editable for pydantic_core (pyproject.toml): started
Building editable for pydantic_core (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

× Building editable for pydantic_core (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [154 lines of output]
Running maturin pep517 build-wheel -i /tmp/pydantic-core/env/bin/python3.11 --compatibility off --editable
📦 Including license file "/tmp/pydantic-core/LICENSE"
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings
🐍 Found CPython 3.11 at /tmp/pydantic-core/env/bin/python3.11
📡 Using build options features, bindings from pyproject.toml
warning: unused manifest key lints (may be supported in a future version)

  this Cargo does not support nightly features, but if you
  switch to nightly channel you can pass
  `-Zlints` to enable this feature.
     Compiling autocfg v1.1.0
     Compiling proc-macro2 v1.0.76
     Compiling target-lexicon v0.12.9
     Compiling unicode-ident v1.0.10
     Compiling python3-dll-a v0.2.9
     Compiling libc v0.2.147
     Compiling once_cell v1.18.0
     Compiling version_check v0.9.4
     Compiling cfg-if v1.0.0
     Compiling heck v0.4.1
     Compiling static_assertions v1.1.0
     Compiling lexical-util v0.8.5
     Compiling num-traits v0.2.16
     Compiling ahash v0.8.7
     Compiling quote v1.0.35
     Compiling pyo3-build-config v0.20.2
     Compiling syn v2.0.48
     Compiling getrandom v0.2.10
     Compiling lock_api v0.4.10
     Compiling num-integer v0.1.45
     Compiling parking_lot_core v0.9.8
     Compiling zerocopy v0.7.32
     Compiling rustversion v1.0.13
     Compiling memoffset v0.9.0
     Compiling num-bigint v0.4.4
     Compiling scopeguard v1.1.0
     Compiling smallvec v1.11.2
     Compiling allocator-api2 v0.2.16
     Compiling tinyvec_macros v0.1.1
     Compiling tinyvec v1.6.0
     Compiling hashbrown v0.14.3
     Compiling pyo3-ffi v0.20.2
     Compiling pyo3 v0.20.2
     Compiling lexical-write-integer v0.8.5
     Compiling lexical-parse-integer v0.8.6
     Compiling serde v1.0.195
     Compiling memchr v2.6.3
     Compiling lexical-parse-float v0.8.5
     Compiling lexical-write-float v0.8.5
     Compiling unicode-normalization v0.1.22
     Compiling aho-corasick v1.0.2
     Compiling parking_lot v0.12.1
     Compiling pyo3-macros-backend v0.20.2
     Compiling unicode-bidi v0.3.13
     Compiling indoc v2.0.4
     Compiling equivalent v1.0.1
     Compiling serde_json v1.0.109
     Compiling percent-encoding v2.3.1
     Compiling regex-syntax v0.8.2
     Compiling unindent v0.2.3
     Compiling form_urlencoded v1.2.1
     Compiling indexmap v2.0.0
     Compiling idna v0.5.0
     Compiling lexical-core v0.8.5
     Compiling pydantic-core v2.16.1 (/tmp/pydantic-core)
     Compiling ryu v1.0.14
     Compiling serde_derive v1.0.195
     Compiling strum_macros v0.25.3
     Compiling regex-automata v0.4.3
     Compiling pyo3-macros v0.20.2
     Compiling itoa v1.0.8
     Compiling enum_dispatch v0.3.12
     Compiling url v2.5.0
     Compiling strum v0.25.0
     Compiling speedate v0.13.0
     Compiling regex v1.10.2
     Compiling uuid v1.6.1
     Compiling base64 v0.21.7
     Compiling jiter v0.0.6
  error[E0446]: crate-private type `extra::Extra<'_>` in public interface
     --> src/serializers/fields.rs:149:5
      |
  149 | /     pub fn main_to_python<'py>(
  150 | |         &self,
  151 | |         py: Python<'py>,
  152 | |         main_iter: impl Iterator<Item = PyResult<(&'py PyAny, &'py PyAny)>>,
  ...   |
  155 | |         extra: Extra,
  156 | |     ) -> PyResult<&'py PyDict> {
      | |______________________________^ can't leak crate-private type
      |
     ::: src/serializers/extra.rs:73:1
      |
  73  |   pub(crate) struct Extra<'a> {
      |   --------------------------- `extra::Extra<'_>` declared as crate-private
  
  error[E0446]: crate-private type `extra::Extra<'_>` in public interface
     --> src/serializers/fields.rs:214:5
      |
  214 | /     pub fn main_serde_serialize<'py, S: serde::ser::Serializer>(
  215 | |         &self,
  216 | |         main_iter: impl Iterator<Item = PyResult<(&'py PyAny, &'py PyAny)>>,
  217 | |         expected_len: usize,
  ...   |
  221 | |         extra: Extra,
  222 | |     ) -> Result<S::SerializeMap, S::Error> {
      | |__________________________________________^ can't leak crate-private type
      |
     ::: src/serializers/extra.rs:73:1
      |
  73  |   pub(crate) struct Extra<'a> {
      |   --------------------------- `extra::Extra<'_>` declared as crate-private
  
  error[E0446]: crate-private type `extra::Extra<'_>` in public interface
     --> src/serializers/fields.rs:260:5
      |
  260 | /     pub fn add_computed_fields_python(
  261 | |         &self,
  262 | |         model: Option<&PyAny>,
  263 | |         output_dict: &PyDict,
  ...   |
  266 | |         extra: &Extra,
  267 | |     ) -> PyResult<()> {
      | |_____________________^ can't leak crate-private type
      |
     ::: src/serializers/extra.rs:73:1
      |
  73  |   pub(crate) struct Extra<'a> {
      |   --------------------------- `extra::Extra<'_>` declared as crate-private
  
  error[E0446]: crate-private type `extra::Extra<'_>` in public interface
     --> src/serializers/fields.rs:277:5
      |
  277 | /     pub fn add_computed_fields_json<S: serde::ser::Serializer>(
  278 | |         &self,
  279 | |         model: Option<&PyAny>,
  280 | |         map: &mut S::SerializeMap,
  ...   |
  283 | |         extra: &Extra,
  284 | |     ) -> Result<(), S::Error> {
      | |_____________________________^ can't leak crate-private type
      |
     ::: src/serializers/extra.rs:73:1
      |
  73  |   pub(crate) struct Extra<'a> {
      |   --------------------------- `extra::Extra<'_>` declared as crate-private
  
  For more information about this error, try `rustc --explain E0446`.
  error: could not compile `pydantic-core` (lib) due to 4 previous errors
  💥 maturin failed
    Caused by: Failed to build a native library through cargo
    Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/tmp/pydantic-core/env/bin/python3.11" PYTHON_SYS_EXECUTABLE="/tmp/pydantic-core/env/bin/python3.11" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pydantic-core/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib"`
  Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/pydantic-core/env/bin/python3.11', '--compatibility', 'off', '--editable'] returned non-zero exit status 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building editable for pydantic_core
Failed to build pydantic_core
ERROR: Could not build wheels for pydantic_core, which is required to install pyproject.toml-based projects
make: *** [Makefile:18: install] Error 1

Could someone provide me more insight into what is going wrong here?

System details:

  • Python version: 3.11.5
  • Rust version: 1.71.1
@davidhewitt
Copy link
Contributor

@arnaudsjs are you able to try building with latest Rust stable? (Rust 1.75.0 at present.)

@arnaudsjs
Copy link
Author

I tried building the package with Rust version 1.75.0 and like that the build does work.

@arnaudsjs
Copy link
Author

I think this change in the rust compiler introduced in v1.74.0 (See also: RFC) is causing the issue.

@locobastos
Copy link

locobastos commented Feb 8, 2024

Hello, same issue with:

  • python 3.11.5
  • rustc 1.71.1 (eb26296b5 2023-08-03) (Red Hat 1.71.1-1.module_el8.9.0+3639+04ae6405)
  • pydantic-core 2.16.2

EDIT1: I'm looking for the most recent version that is compatible with rust 1.71.1 on AlmaLinux 8 and I will give the result here
EDIT2: I've not seen that I've the same environment than @arnaudsjs
EDIT3: pydantic-core 2.15.0 is building with our environment. But I've not found any pydantic version that requires this exact version.

From what I've found, at the moment, Pydantic 2.5.3 + Pydantic-Core 2.14.6 are the latest versions working with Rust 1.71.1.

@samuelcolvin
Copy link
Member

What's the reason you need to build with older rust?

@locobastos
Copy link

Because neither AlmaLinux 8 nor AlmaLinux 9 has a newer version of Rust available in the official repositories.

@davidhewitt
Copy link
Contributor

I think we should add an official minimum supported rust-version to our Cargo.toml and also test it in CI. Based on the features that we heavily use in this repository, I suspect that we could make something in the range 1.65 - 1.71 work, with a little effort.

It would likely not be a breaking change so we should be able to ship this as a patch release.

@arnaudsjs @locobastos would either of you be interested in helping create a PR to extend our rust support backwards and guarantee it?

Also, do you know how frequently AlmaLinux updates available Rust version? It would be helpful to know how many versions we should consider lagging current stable by.

@locobastos
Copy link

@samuelcolvin,

It's not a big deal, it just means that building on RHEL8-like distro is limited to an older version of pydantic + pydantic-core.
We can have newer version by using pip3 install pydantic pydantic-core:

Successfully installed annotated-types-0.6.0 pydantic-2.6.1 pydantic-core-2.16.2 typing-extensions-4.9.0

@PatrickBaus
Copy link

This issue also persists with alpine Linux <= 3.19 as it uses Rust 1.72.1-r0. This breaks my builds of a python docker container for the ARMv6 Raspberry Pi platform.

As said above, the last working version is Pydantic 2.5.3 + Pydantic-Core 2.14.6.

  • Python 3.11.6-r1
  • Rust 1.72.1-r0

@locobastos
Copy link

locobastos commented Feb 8, 2024

Red Hat is pretty slow to release packages because of their aim of the stability. Anyway, here is what I've found on the version history:

  • Rust 1.47.0
    --> Released on 8 October 2020
    --> Available in AlmaLinux 8.3 repository on 12 March 2021
    --> + 155 days
  • Rust 1.49.0
    --> Release on 31 December 2020
    --> Available in AlmaLinux 8.4 repository on 17 April 2021
    --> + 107 days
  • Rust 1.52.1
    --> Released on 10 May 2021
    --> Available in AlmaLinux 8.4 repository on 11 August 2021
    --> + 101 days
  • Rust 1.54.0
    --> Released on 29 July 2021
    --> Available in AlmaLinux 8.5 repository on 10 October 2021
    --> + 73 days
  • Rust 1.58.1
    --> Released on 20 January 2022
    --> Available in AlmaLinux 8.6 repository on 12 April 2022
    --> + 82 days
  • Rust 1.62.1
    --> Released on 19 July 2022
    --> Available in AlmaLinux 8.7 repository on 13 October 2022
    --> + 86 days
  • Rust 1.66.1
    --> Released on 10 January 2023
    --> Available in AlmaLinux 8.8 repository on 6 April 2023
    --> + 86 days
  • Rust 1.71.1
    --> Released on 3 August 2023
    --> Available 18 October 2023
    --> + 49 days

It seems they decrease the time between the release date and the availibility date, but I also know that they will release only versions they need.

@locobastos
Copy link

@davidhewitt, I will not have the time to help you. The only one thing I will do, is to try on an AlmaLinux 8 docker container as I'm doing today. I'm not sure I'll have a capital gains on this issue. @arnaudsjs already gave the command to reproduce this issue.

@davidhewitt
Copy link
Contributor

Thanks @locobastos, that table is very helpful 👍

@arnaudsjs
Copy link
Author

@davidhewitt I won't have the time to work on this. We are currently working around this issue by using the binary wheel instead. We were facing this issue on RockyLinux 8, which is like AlmaLinux, a binary-compatible derivative of RedHat Enterprise Linux. So the above-mentioned table should hold for both AlmaLinux, RockyLinux and RedHat Enterprise Linux.

@davidhewitt davidhewitt changed the title Build fails for v2.16.1 Consider setting a fixed minimum Rust version Feb 12, 2024
@davidhewitt davidhewitt added help wanted Extra attention is needed good first issue Good for newcomers labels Feb 12, 2024
@BtbN
Copy link

BtbN commented Feb 15, 2024

This is also happening on Alpine, for which no wheels are available.
The latest rust version available there is 1.72, and installing a lot of stuff has recently become impossible, specially if pydantic-core is a build-time dependency.

@davidhewitt
Copy link
Contributor

@BtbN I'm surprised you are finding there are no Alpine wheels, we do build for musllinux.

Can you run pip debug and show the first 10 compatible tags it lists? E.g. for my desktop I get

Compatible tags: 1041
  cp312-cp312-manylinux_2_38_x86_64
  cp312-cp312-manylinux_2_37_x86_64
  cp312-cp312-manylinux_2_36_x86_64
  cp312-cp312-manylinux_2_35_x86_64
  cp312-cp312-manylinux_2_34_x86_64
  cp312-cp312-manylinux_2_33_x86_64
  cp312-cp312-manylinux_2_32_x86_64
  cp312-cp312-manylinux_2_31_x86_64
  cp312-cp312-manylinux_2_30_x86_64
  cp312-cp312-manylinux_2_29_x86_64
  ...
  [First 10 tags shown. Pass --verbose to show all.]

@davidhewitt
Copy link
Contributor

We have a user needing 1.68 in #1202.

To extend back that far we'd need to replace our OnceLock from the std library with the external once_cell crate. Not the end of the world.

@hsteinhaus
Copy link

Thanks @davidhewitt for pointing me to this issue.

Is there a chance to catch that type of problem earlier, i.e. with some kind of an explicit dependency check before failing with an obscure compile error?

@davidhewitt
Copy link
Contributor

davidhewitt commented Feb 26, 2024

Yes, there is a rust-version key we should set in the Cargo.toml. #1206 will do that.

@locobastos
Copy link

Rust 1.75.0
--> Released on 28 December 2023
--> Available since 10 April 2024 on AlmaLinux 8.10
--> + 104 days

This Rust version allows us to build pydantic-core v2.16.3 / pydantic 2.6.4
@davidhewitt

@davidhewitt
Copy link
Contributor

👍 next pydantic-core will have MSRV of 1.75.0

@locobastos
Copy link

Just a note.

On an AlmaLinux 8.10 with Rust 1.75.0 + Cargo 1.75.0 + Python 3.11.7:

pydantic == 2.5.3            Build OK
└── pydantic_core == 2.14.6  Build OK

pydantic == 2.6.0            Build OK
└── pydantic_core == 2.16.1  Build OK

pydantic == 2.6.1            Build OK
└── pydantic_core == 2.16.2  Build OK

pydantic == 2.6.2            Build OK
└── pydantic_core == 2.16.3  Build OK

pydantic == 2.6.3            Build OK
└── pydantic_core == 2.16.3  Build OK

pydantic == 2.6.4            Build OK
└── pydantic_core == 2.16.3  Build OK

pydantic == 2.7.0            Build OK
└── pydantic_core == 2.18.1  Build FAILED (Need Rust >= 1.76)

pydantic == 2.7.1            Build OK
└── pydantic_core == 2.18.2  Build FAILED (Need Rust >= 1.76)

pydantic == 2.7.2            Build OK
└── pydantic_core == 2.18.3  Build FAILED (Need Rust >= 1.76)

pydantic == 2.7.3            Build OK
└── pydantic_core == 2.18.4  Build FAILED (Need Rust >= 1.76)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants