lief-project / LIEF

LIEF - Library to Instrument Executable Formats
https://lief-project.github.io/
Apache License 2.0
4.26k stars 599 forks source link

Bump pydantic-core to 2.20.0 for Python API #1073

Closed clin1234 closed 6 days ago

clin1234 commented 1 week ago

Describe the bug pydantic-core 2.20.0 adds support for Python 3.13. Without it, compiling from source fails.

Collecting git+https://github.com/lief-project/LIEF.git#subdirectory=api/python
  Cloning https://github.com/lief-project/LIEF.git to c:\users\ךינשגכהד\appdata\local\temp\pip-req-build-ggnpc67a
  Running command git clone --filter=blob:none --quiet https://github.com/lief-project/LIEF.git 'C:\Users\ךינשגכהד\AppData\Local\Temp\pip-req-build-ggnpc67a'
  Resolved https://github.com/lief-project/LIEF.git to commit 2b68ae538316f9ded03f9e3661d63551ab755cb0
  Getting requirements to build wheel ... done
  Installing backend dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install backend dependencies did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      Collecting wheel==0.42.0
        Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
      Collecting pathspec==0.12.1
        Using cached pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
      Collecting pydantic==2.7.1
        Downloading pydantic-2.7.1-py3-none-any.whl.metadata (107 kB)
           ------------------------------- 107.3/107.3 kB 263.9 kB/s eta 0:00:00
      Collecting build==1.0.3
        Using cached build-1.0.3-py3-none-any.whl.metadata (4.2 kB)
      Collecting pydantic-core==2.18.2
        Downloading pydantic_core-2.18.2.tar.gz (383 kB)
           ------------------------------- 383.4/383.4 kB 908.8 kB/s eta 0:00:00
        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 'error'
        error: subprocess-exited-with-error

        × Preparing metadata (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [19 lines of output]
            error: could not load Cargo configuration

            Caused by:
              failed to merge configuration at `C:\Users\ךינשגכהד\.cargo\config.toml`

            Caused by:
              failed to merge key `build` between C:\Users\ךינשגכהד\AppData\Local\Temp\pip-install-3wk6iamc\pydantic-core_60561a2aa53d4aa3bbe099628e6689b6\.cargo\config.toml and C:\Users\ךינשגכהד\.cargo\config.toml

            Caused by:
              failed to merge key `rustflags` between C:\Users\ךינשגכהד\AppData\Local\Temp\pip-install-3wk6iamc\pydantic-core_60561a2aa53d4aa3bbe099628e6689b6\.cargo\config.toml and C:\Users\ךינשגכהד\.cargo\config.toml

            Caused by:
              failed to merge config value from `C:\Users\ךינשגכהד\.cargo\config.toml` into `C:\Users\ךינשגכהד\AppData\Local\Temp\pip-install-3wk6iamc\pydantic-core_60561a2aa53d4aa3bbe099628e6689b6\.cargo\config.toml`: expected array, but found string
            💥 maturin failed
              Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
              Caused by: `cargo metadata` exited with an error:
            Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', 'C:\\Users\\ךינשגכהד\\AppData\\Local\\Temp\\pip-modern-metadata-83fkg4y1', '--interpreter', 'C:\\Users\\ךינשגכהד\\scoop\\apps\\python-alpha\\current\\python.exe']' returned non-zero exit status 1.
            Checking for Rust toolchain....
            Running `maturin pep517 write-dist-info --metadata-directory C:\Users\ךינשגכהד\AppData\Local\Temp\pip-modern-metadata-83fkg4y1 --interpreter C:\Users\ךינשגכהד\scoop\apps\python-alpha\current\python.exe`
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: metadata-generation-failed

      × Encountered error while generating package metadata.
      ╰─> See above for output.

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

To Reproduce Steps to reproduce the behavior:

  1. pip install git+https://github.com/lief-project/LIEF.git#subdirectory=api/python

Expected behavior Successful compilation.

Environment (please complete the following information):

romainthomas commented 6 days ago

I uploaded pre-compiled wheels for Windows & Linux so it should now works :)

(Note: the OSX GHA runner seems not available this weekend)