From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CEXsG63UT2TNZwAASxT56A (envelope-from ) for ; Mon, 01 May 2023 17:03:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id UHbTGq3UT2SpoAAAG6o9tA (envelope-from ) for ; Mon, 01 May 2023 17:03:09 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 07612152C8 for ; Mon, 1 May 2023 17:03:09 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptSWE-0006vV-HO; Mon, 01 May 2023 08:20:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psUOt-0001Yg-1i for help-guix@gnu.org; Fri, 28 Apr 2023 16:09:03 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1psUOq-0004z6-NF for help-guix@gnu.org; Fri, 28 Apr 2023 16:09:02 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-9505214c47fso39476366b.1 for ; Fri, 28 Apr 2023 13:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682712538; x=1685304538; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=p061x/3wOZvp2TS9sjH6Umt1LDNNZHHRWRuhUKfsjjg=; b=VC7YcxHVuRiQGg6sR486j9lrUWCP4Z8dwwIFjSMKZr8Ijx4l8YZryV+obPQBM2QOuy zFsPju47jdhEWeuVDgEgXh7XPyXwafLmWogIwjeRKVDC272DyzkkDxQ2taq/0bJd4Cic ZYv4IdXef9F0H+4priBsPxqLc/qetY84Id5AEQ0Y5baeJivCaigzjbtwS3pWyAf7ArS4 DpQqZfrK1/O1hOf12FAMOtSapf8aTW035HyHdDr9S2P0L5jTu2Sbmhrlk0/VPPomIaXy lM6NYliD08fGF+cdQxxDn1C6wUocRQcu3883AJghSVdP9P51m+A9bb+9bPubgR2mxlUV T7WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682712538; x=1685304538; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p061x/3wOZvp2TS9sjH6Umt1LDNNZHHRWRuhUKfsjjg=; b=Pcmu8uVwoYREyUMrZhbW4Y5YRyMr7r5vUTQE95nwcXs115Y2r8WDCq/AJXt/9QnIrE /851CTVOuR8dfzI5nUzagRUa8AVmc7SC3TITF5N7N9DG/XYZJ5AH4UoGraTps/E+kP6N fyKbums5y3XF1MY6PIV2yxTI5CHYu/B8UlmCWOyPfXA24+h2gZlAGiNiRGM5NzCEadCN wjHH6oeHhpX3hXvhz2NnewdQtwXo80kSRNLQPDtNmvMSQaV+mrtjwwgIcyxqFtGi9sun 78PzEFpgCBX8fCJgvrVn1nWQXTPbIK5N7OlKUo8GjKb5Eun7t2NCZHpTempcBottFedD jdug== X-Gm-Message-State: AC+VfDzLbW+QLR9VHJB8tN/pY9SduOPVrzPpuNsnsBmV3pfjeUoXeopX +8RFZFYaoFD89v2JfNdwuF9CnBSnbr1CPwnmRJTM3SwLU5rzkQ== X-Google-Smtp-Source: ACHHUZ6a48XQVi4KM73ETfKNQt2ykCrME9izZBhFStMeKV/OtU0Ut7aQDxq306u85wS2DSJTM4S3Vc8IAqV3kaRLT4A= X-Received: by 2002:a17:907:320b:b0:94f:3521:396 with SMTP id xg11-20020a170907320b00b0094f35210396mr6428220ejb.23.1682712537646; Fri, 28 Apr 2023 13:08:57 -0700 (PDT) MIME-Version: 1.0 References: <87ttx5g5qj.fsf@disroot.org> <87mt2xg5l5.fsf@disroot.org> <87fs8ojyhc.fsf@disroot.org> <87edo7fbau.fsf@disroot.org> <87zg6tz3fi.fsf@disroot.org> <87mt2s9iy6.fsf@disroot.org> In-Reply-To: <87mt2s9iy6.fsf@disroot.org> From: Timothy Washington Date: Fri, 28 Apr 2023 16:08:45 -0400 Message-ID: Subject: Re: Howto supply cargo-build-system dependency to guix package definition To: "(" Cc: help-guix@gnu.org Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=twashing@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 01 May 2023 08:20:34 -0400 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682953389; a=rsa-sha256; cv=none; b=cG0E+s7Z7SXWJldSf70E80tU1aGfIa1cb2enz6klO2ThpCptmr7XfZw94u4STzI/ASi29x WBoNUUtttLqoxy3KVS6r7pW1WUTwezTJhrOnojpH6m4WyHkd2che1IGlSN16GdcF3Lf2/w okv+Gs+3ra6KpxjDiyi3a6wK36Gsi3qMdQDvcysj6DRV+n8vs5ochftKOHvgplg/j7Pbmw HIi2pun/KD/K/df0tcif+pvIsNMvF1VRu2pmSbm2kPqtmsO1JG/taR/p5TdUt0rMCndxcS rwD/hyn4ET7NXyTnB2yLytsjhs4+5fG8HD8kErAjgc4fUsLsDVGC61fjv67S8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20221208 header.b=VC7YcxHV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682953389; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Scjc8Nn0qv6xH2Uv762MgSHsFGmQ0PvphljaPgHkW7k=; b=qMDaQqI4jpYBagu+JZIbFmyxTzNlzhG42RiS/tl5H/gYA5uqP9GpgOeiR32HC5GA0zClkY cHC5f5DTxe7s/dT3bjQIuRzE30xN3K7YUQIhnwZLacvBuNJLgMJPml8/M1O3Cb+1A/vSXc XZ/FRWwrLjC7Lm6N1PZ8wLMd5vqTNQmt6+WFHVIVBdrV7leEgh03GXJpxx+dhh0m7GNKTf KMG2XVzpEEHyomXckFWX9V2HUxvvplz6b2nCMznx548uzBx9rLzYGh3PJft3P/Hg+y9xfd KXVKQIZ/6iaFekV3jwqlnxPhtEgQ6yse/tc8EtYOognBJA1Oy0rDj1FCPzPaOA== X-Migadu-Spam-Score: -0.91 X-Spam-Score: -0.91 X-Migadu-Queue-Id: 07612152C8 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20221208 header.b=VC7YcxHV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: BpOCEh8iBM86 Beauutiful! A. Actually the "guix import crate" command set off a light bulb... Can't I just pull in those dependencies recursively. And indeed you can. The only reason I needed to pull in those crates, were as dependencies to rustscan . So I went back to the beginning and ran a recursive import on rustscan. $ guix import crate -r rustscan ... $ guix build -L ~/dotfiles/ rust-rustscan-2 phase `check' succeeded after 0.0 seconds starting phase `install' Installing rustscan v2.1.1 (/tmp/guix-build-rust-rustscan-2.1.1.drv-0/rustscan-2.1.1) Finished release [optimized] target(s) in 0.19s Installing /gnu/store/10sivvy746n5jdnsgny5afxpwa5yzy5f-rust-rustscan-2.1.1/bin/rustscan Installed package `rustscan v2.1.1 (/tmp/guix-build-rust-rustscan-2.1.1.drv-0/rustscan-2.1.1)` (executable `rustscan`) warning: be sure to add `/gnu/store/10sivvy746n5jdnsgny5afxpwa5yzy5f-rust-rustscan-2.1.1/bin` to your PATH to be able to run the ... successfully built /gnu/store/58bdgq64bdxkhwjvfmragj4xq8h7grhb-rust-rustscan-2.1.1.drv /gnu/store/10sivvy746n5jdnsgny5afxpwa5yzy5f-rust-rustscan-2.1.1 B. Should I supply this to an upstream configuration? Or should each user run their own "guix import"? I'm happy to supply this as a definition if need be. And thanks again! Tim On Fri, 28 Apr 2023 at 10:31, ( wrote: > Timothy Washington writes: > > ..the build fails on missing "cidr-utils". Now "cidr-utils" is in Rust's > crates.io. > > But is that what Guix' cargo-build-system is referencing? > > Otherwise, do we need to create a Guix .scm (scheme definition)? > > Guix can't grab things from the internet during the build for > reproducibility reasons, so it uses a Cargo feature that lets you > substitute the registry for a directory full of tarballed crates, and > unpacks all the CARGO-INPUTS there (this is why CARGO-BUILD-SYSTEM uses > its own input list rather than just INPUTS). > > It seems like Guix doesn't have RUST-CIDR-UTILS yet: > > ``` > $ guix show rust-cidr-utils > guix show: error: rust-cidr-utils: package not found > ``` > > You don't have to write the package definition manually, though: > > ``` > $ guix import crate cidr-utils > (define-public rust-cidr-utils-0.5 > (package > (name "rust-cidr-utils") > (version "0.5.10") > (source (origin > (method url-fetch) > (uri (crate-uri "cidr-utils" version)) > (file-name (string-append name "-" version ".tar.gz")) > (sha256 > (base32 > "0750jbxvdbyyxcqnzsw438158r9drs2g077ymx9r9lv193q3dypx")))) > (build-system cargo-build-system) > (arguments > `(#:cargo-inputs (("rust-debug-helper" ,rust-debug-helper-0.3) > ("rust-num-bigint" ,rust-num-bigint-0.4) > ("rust-num-traits" ,rust-num-traits-0.2) > ("rust-once-cell" ,rust-once-cell-1) > ("rust-regex" ,rust-regex-1) > ("rust-serde" ,rust-serde-1)))) > (home-page "https://magiclen.org/cidr-utils") > (synopsis > "This crate provides data structures and functions to deal with IPv4 > CIDRs and IPv6 CIDRs.") > (description > "This crate provides data structures and functions to deal with IPv4 > CIDRs and > IPv6 CIDRs.") > (license license:expat))) > ``` > > Above your main package definition, you should copy in this package, and > you'll want to edit the SYNOPSIS and DESCRIPTION to make them less alike > and make them follow the usual style: > > ``` > (synopsis "CIDR library for IPv4 and IPv6") > (description > "This package provides a crate for dealing with Classless Inter-Domain > Routing in IPv4 and IPv6.") > ``` > > Now you can just use RUST-CIDR-UTILS-0.5 like any other crate. >