unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Hamzeh Nasajpour <h.nasajpour@pantherx.org>
Cc: SuarezMiguelC via <help-guix@gnu.org>
Subject: Re: Packaging a python package that is using setuptools_rust
Date: Sun, 25 Oct 2020 14:26:44 +0200	[thread overview]
Message-ID: <20201025122644.GA1083@E5400> (raw)
In-Reply-To: <ee5060e7-03d7-4236-8213-645d998530c0@www.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 2547 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-10-25 12:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 10:52 Packaging a python package that is using setuptools_rust Hamzeh Nasajpour
2020-10-24 13:54 ` Hartmut Goebel
2020-10-25 10:16   ` Hamzeh Nasajpour
2020-10-25 10:47     ` Tobias Geerinckx-Rice
2020-10-25 11:28       ` Hamzeh Nasajpour
2020-10-25 12:26         ` Efraim Flashner [this message]
2021-12-31  8:33 ` Lars-Dominik Braun
2022-01-13  7:58   ` phodina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201025122644.GA1083@E5400 \
    --to=efraim@flashner.co.il \
    --cc=h.nasajpour@pantherx.org \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).