unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: John Soo <jsoo1@asu.edu>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: rust-build-system: Unvendor *-sys libraries in phase?
Date: Sat, 25 Jan 2020 20:49:59 +0200	[thread overview]
Message-ID: <20200125184959.GM1603@E5400> (raw)
In-Reply-To: <6C5117EB-3049-4DDA-A343-3BDFAFB24CE0@asu.edu>

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

On Fri, Jan 24, 2020 at 01:49:21PM -0800, John Soo wrote:
> Hi guix,
> 
> After working on a few rust packages, it looks like there could be another step on the process.  There are a number of libraries in the crates registry that wrap and vendor c libraries - libgit2, openssl, or jemalloc for example. The wrapping libraries, for reference, are usually called <c-library-name>-sys - libgit2-sys for example.
> 
> In the current rust-build-system, the onus of removing the vendored code falls on the ultimate consumer of the library. So, for instance, cbindgen would have to define a phase to remove the vendored code in a *-sys library even if that library is a transitive dependency.
> 
> What would you all think about adding a phase to the standard phases of the rust-build-system? I’m imagining some phase that would delete the vendored code and performed the other necessary steps to use the c libraries in /gnu/store.
> 
> Wdyt?

IMO the correct way to do it would be in the crate source that we
download. We regularly add snippets to remove vendored code, this should
be no different. The only real difference is that right now the
cargo-build-system is "too smart" and checks the #:cargo-inputs to make
sure they actually are crates before untarring them and putting them in
the guix-vendor dor. Currently the 'patch-and-rezip phase always uses xz
for compression, and crates always use gzip, so we cannot use patches or
snippets on crates. IMO the easiest way around this is to
unconditionally untar anything in #:cargo-inputs into guix-vendor/ and
continue on.

Then the only thing left is to set certain environment variables, some
of which can probably be moved to the cargo-build-system if they don't
require an actual path. LIB(GIT|SSH)2_SYS_USE_PKG_CONFIG can move,
JEMALLOC_OVERRIDE and LIBCLANG_PATH can't.

-- 
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-01-25 18:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 21:49 rust-build-system: Unvendor *-sys libraries in phase? John Soo
2020-01-25 18:49 ` Efraim Flashner [this message]
2020-01-25 19:01   ` John Soo
2020-01-25 19:36     ` Efraim Flashner
2020-01-27 14:44       ` John Soo
2020-01-27 16:36         ` Efraim Flashner

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=20200125184959.GM1603@E5400 \
    --to=efraim@flashner.co.il \
    --cc=guix-devel@gnu.org \
    --cc=jsoo1@asu.edu \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).