help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packaging a python package that is using setuptools_rust


From: Efraim Flashner
Subject: Re: Packaging a python package that is using setuptools_rust
Date: Sun, 25 Oct 2020 14:26:44 +0200

On Sun, Oct 25, 2020 at 02:58:22PM +0330, Hamzeh Nasajpour wrote:
> Thanks for your quick reply.
> 
> 
> >   (native-inputs
> >    `(...
> >      ("rust:cargo" ,rust "cargo")
> >      ...))
> 
> Thanks this step passed, but now I face with another error in dependencies. 
> 
> ```
> ...
> phase `patch-generated-file-shebangs' succeeded after 0.0 seconds
> starting phase `build'                                                        
>                                                                               
>                                                                               
>   
> running "python setup.py" with command "build" and parameters ()
> running build
> running build_py
> creating build
> creating build/lib
> creating build/lib/etebase
> copying etebase/__init__.py -> build/lib/etebase
> running build_ext
> running build_rust
> error: failed to load source for a dependency on `cpython`
> 
> Caused by:
>   Unable to update registry `https://github.com/rust-lang/crates.io-index`
> 
> Caused by:
>   failed to create directory 
> `/homeless-shelter/.cargo/registry/index/github.com-1ecc6299db9ec823`
> 
> Caused by:
>   Permission denied (os error 13)
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "setup.py", line 4, in <module>
> ...
> ```
> 
> indeed, this library is python and internally it's using a rust library. the 
> `cpython` is one its dependencies that I packaged it (`rust-cpython`) and it 
> needs to it. I don't know how can I add rust  dependencies here since I'm 
> using python build system. I added it to inputs but not resolved.
> 
> Indeed now the problem is adding dependencies (some of them rust and some of 
> them python) to this package while I'm using the python build system. Do you 
> have any idea?
> 

This one is a little harder. You can add cargo-build-system phases into
the python-build-system (see icecat for an example) and add a phase to
place the rust dependencies _sources_ in the correct location, or you
can switch it over to a cargo-build-system and add back the
python-build-system phases (see newsboat for an example). IMO the
cargo-build-system option is easier since it takes care of dependency
management for you in terms of #:cargo-inputs.

> 
> Regards,
> Hamzeh
> 
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]