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

Fail building with Poetry #61

Open
albertocevallos opened this issue Sep 7, 2023 · 6 comments
Open

Fail building with Poetry #61

albertocevallos opened this issue Sep 7, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@albertocevallos
Copy link

Version
Latest

Platform
Linux

Description
Installation via Poetry seems to fail.

I tried this code:
poetry add cryo-python
or
poetry install (if the pkg was manually added to pyproject.toml)

I expected to see this happen: Successful installation and pkg added to pyproject.toml

Instead, this happened:

           Compiling cryo_freeze v0.2.0 (/private/var/folders/6m/hnbzzws969d7blnlbb51qp9w0000gn/T/pip-req-build-mnzq0bdu/local_dependencies/cryo_freeze)
           Compiling pyo3-polars v0.4.0
        error: environment variable `GIT_DESCRIPTION` not defined at compile time
          --> local_dependencies/cryo_cli/src/reports.rs:44:69
           |
        44 |     let cryo_version = format!("{}__{}", env!("CARGO_PKG_VERSION"), env!("GIT_DESCRIPTION"));
           |                                                                     ^^^^^^^^^^^^^^^^^^^^^^^
           |
           = help: use `std::env::var("GIT_DESCRIPTION")` to read the variable at run time
           = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
        
        The following warnings were emitted during compilation:
        
        warning: Could not determine git description
        
        error: could not compile `cryo_cli` (lib) due to previous error
        warning: build failed, waiting for other jobs to finish...
        💥 maturin failed
          Caused by: Failed to build a native library through cargo
          Caused by: Cargo build finished with "exit status: 101": `MACOSX_DEPLOYMENT_TARGET="10.7" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.10-64bit" PYO3_PYTHON="/Users/Library/Caches/pypoetry/virtualenvs/ape-test-CVGu-StC-py3.10/bin/python" PYTHON_SYS_EXECUTABLE="/Users/Library/Caches/pypoetry/virtualenvs/ape-test-CVGu-StC-py3.10/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/private/var/folders/6m/hnbzzws969d7blnlbb51qp9w0000gn/T/pip-req-build-mnzq0bdu/Cargo.toml" "--release" "--lib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/cryo._cryo_rust.cpython-310-darwin.so"`
        Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/Users/Library/Caches/pypoetry/virtualenvs/ape-test-CVGu-StC-py3.10/bin/python', '--compatibility', 'off'] 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 wheel for cryo_python
  Failed to build cryo_python
  ERROR: Could not build wheels for cryo_python, which is required to install pyproject.toml-based projects
  
  [notice] A new release of pip available: 22.3.1 -> 23.2.1
  [notice] To update, run: pip install --upgrade pip
  

  at ~/.poetry/lib/poetry/utils/env.py:1195 in _run
      1191│                 output = subprocess.check_output(
      1192│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1193│                 )
      1194│         except CalledProcessError as e:
    → 1195│             raise EnvCommandError(e, input=input_)
      1196│ 
      1197│         return decode(output)
      1198│ 
      1199│     def execute(self, bin, *args, **kwargs):
@albertocevallos albertocevallos added the bug Something isn't working label Sep 7, 2023
@sslivkoff
Copy link
Member

the error printed is related to git not being available

can you install git (e.g. brew install git) and see if the command still fails?

@albertocevallos
Copy link
Author

Had git installed, but ran brew reinstall git just in case and the command is still failing

Prob same as #27, building from source worked though

@dino-rodriguez
Copy link

did you install maturin separately?

@sslivkoff
Copy link
Member

do you know if there is some reason why git might not be available to poetry during build time? I'm not a poetry user and am not familiar with how this issue might arrise

the problem is with this file that runs during the build process. the git command is attempted and for some reason fails, leading to the git warning

@albertocevallos
Copy link
Author

so i found an interim solution

cloned the cryo repo in my working directory, ran maturin and added this to my pyproject.toml:

[tool.poetry.dependencies]
cryo-python = { file = "./cryo/target/wheels/cryo_python-0.2.0-cp310-cp310-macosx_10_7_x86_64.whl" }

btw @sslivkoff are you using venv or flit instead?

@fmrmf
Copy link

fmrmf commented Sep 9, 2023

seeing the same issue with hatch and adding cryo. could it be due to the latest on pypi being released before the fix in #30?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants