From patchwork Mon Dec 16 23:30:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Becze X-Patchwork-Id: 16545 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5C9DF17919; Mon, 16 Dec 2019 23:32:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2CE2317915 for ; Mon, 16 Dec 2019 23:32:24 +0000 (GMT) Received: from localhost ([::1]:33262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igzqh-0005KE-Cz for patchwork@mira.cbaines.net; Mon, 16 Dec 2019 18:32:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49089) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igzqT-0005K0-Bs for guix-patches@gnu.org; Mon, 16 Dec 2019 18:32:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igzqM-00084E-OM for guix-patches@gnu.org; Mon, 16 Dec 2019 18:32:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igzqM-000845-EO for guix-patches@gnu.org; Mon, 16 Dec 2019 18:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igzqM-0001rb-Az for guix-patches@gnu.org; Mon, 16 Dec 2019 18:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38408] Rewrote recursive-import-semver based on topological-sort References: In-Reply-To: Resent-From: Martin Becze Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Dec 2019 23:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38408 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38408@debbugs.gnu.org Received: via spool by 38408-submit@debbugs.gnu.org id=B38408.15765390897105 (code B ref 38408); Mon, 16 Dec 2019 23:32:02 +0000 Received: (at 38408) by debbugs.gnu.org; 16 Dec 2019 23:31:29 +0000 Received: from localhost ([127.0.0.1]:40517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igzpj-0001qS-Cb for submit@debbugs.gnu.org; Mon, 16 Dec 2019 18:31:28 -0500 Received: from mx1.riseup.net ([198.252.153.129]:41436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igzpg-0001qE-1I for 38408@debbugs.gnu.org; Mon, 16 Dec 2019 18:31:21 -0500 Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 47cHYq37wJzFcfp for <38408@debbugs.gnu.org>; Mon, 16 Dec 2019 15:30:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1576539077; bh=sZygSWcl2Zg02mPTEImh3z+KlSjfoIKzD9KwYTFffOQ=; h=Date:From:To:Subject:From; b=tMtZfUfbs10clOeAFAaTAJ8U/ig/b/F0B4cTOYO7XkawbcVdfp97ONha30FxfcyWH wpd/Y+OJZT3qd7dRbPkmAbZggqkb5Q/eE4fcrXstdMcGrjzLmlbcGQcF6nhG+jVvkH QQNua5hrGnrg2ulAmmgZDDGvNMysM18C2qcK6lq0= X-Riseup-User-ID: 4D4D63BC91CA8BBAF4DD4A351E721D1A16F3CE255A9E5A666B3C8AFACAD3661C Received: from [127.0.0.1] (localhost [127.0.0.1]) by capuchin.riseup.net (Postfix) with ESMTPSA id 47cHYq21b7z8vWg for <38408@debbugs.gnu.org>; Mon, 16 Dec 2019 15:30:07 -0800 (PST) MIME-Version: 1.0 Date: Mon, 16 Dec 2019 15:30:07 -0800 From: Martin Becze Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Guix, I rewrote the recursive-import-semver procedure to use the new topological-sort procedure. I also return a list instead of a stream like (recursive-import). So to recap (recursive-import-semver) imports dependency using semantic version to find the correct version of a dependency. The crate importer has also be converted to use recursive-import-semver. It will now use recursive-import-semver when "guix import crate -r" is used. You can also specify the range that you would like to import such as guix import crate -r rand@^0.6". Here is an example of the format that it will produce. (define-public rust-bincode-1.2.1 (package (name "rust-bincode") (version "1.2.1") (source (origin (method url-fetch) (uri (crate-uri "bincode" version)) (file-name (string-append name "-" version ".crate")) (sha256 (base32 "1gvxm3n67xv1874fwxmnlircdlphlk1hcw75ykrrnw9l2nky4lsp")))) (build-system cargo-build-system) (arguments `(#:skip-build? #t #:cargo-inputs (("rust-byteorder-1.3.2" ,rust-byteorder-1.3.2) ("rust-serde-1.0.103" ,rust-serde-1.0.103)))) (home-page "https://github.com/servo/bincode") (synopsis "A binary serialization / deserialization strategy that uses Serde for transforming structs into bytes and vice versa!") (description "This package provides a binary serialization / deserialization strategy that uses Serde for transforming structs into bytes and vice versa!") (license license:expat))) -Martin From aa6aaeacb5f91508f4158999ba6e7f95e8309bed Mon Sep 17 00:00:00 2001 From: Martin Becze Date: Mon, 16 Dec 2019 18:11:38 -0500 Subject: [PATCH 4/4] gnu: scripts: import: crate: Remove `define-public` generation from UI * guix/scripts/import/crate.scm (guix-import-crate): Remove `define-public` generation from UI --- guix/scripts/import/crate.scm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm index 92034dab3c..9a08c9b8b4 100644 --- a/guix/scripts/import/crate.scm +++ b/guix/scripts/import/crate.scm @@ -95,12 +95,7 @@ Import and convert the crate.io package for PACKAGE-NAME.\n")) (package-name->name+version spec)) (if (assoc-ref opts 'recursive) - (map (match-lambda - ((and ('package ('name name) . rest) pkg) - `(define-public ,(string->symbol name) - ,pkg)) - (_ #f)) - (crate-recursive-import name)) + (crate-recursive-import name version) (let ((sexp (crate->guix-package name version))) (unless sexp (leave (G_ "failed to download meta-data for package '~a'~%") -- 2.24.0