2016-09-22 05:40:58 -04:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
|
;;; Copyright © 2014 David Thompson <davet@gnu.org>
|
|
|
|
|
;;; Copyright © 2016 David Craven <david@craven.ch>
|
2022-05-30 06:21:50 -04:00
|
|
|
|
;;; Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
|
2020-02-04 03:50:48 -05:00
|
|
|
|
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
|
2023-10-09 08:15:46 -04:00
|
|
|
|
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
|
2023-12-21 17:01:50 -05:00
|
|
|
|
;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
|
2016-09-22 05:40:58 -04:00
|
|
|
|
;;;
|
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
|
;;; your option) any later version.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
|
;;;
|
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (test-crate)
|
|
|
|
|
#:use-module (guix import crate)
|
|
|
|
|
#:use-module (guix base32)
|
|
|
|
|
#:use-module (guix build-system cargo)
|
2023-12-21 17:01:51 -05:00
|
|
|
|
#:use-module ((gcrypt hash)
|
|
|
|
|
#:select ((sha256 . gcrypt-sha256)))
|
|
|
|
|
#:use-module (guix packages)
|
2023-12-21 17:01:52 -05:00
|
|
|
|
#:use-module (guix read-print)
|
2016-09-22 05:40:58 -04:00
|
|
|
|
#:use-module (guix tests)
|
2020-11-15 15:25:16 -05:00
|
|
|
|
#:use-module (gnu packages)
|
2016-09-22 05:40:58 -04:00
|
|
|
|
#:use-module (ice-9 iconv)
|
|
|
|
|
#:use-module (ice-9 match)
|
|
|
|
|
#:use-module (srfi srfi-64))
|
|
|
|
|
|
2020-02-04 03:50:48 -05:00
|
|
|
|
|
|
|
|
|
;; crate versions and dependencies used here
|
|
|
|
|
;; foo-0.8.1
|
|
|
|
|
;; foo-1.0.0
|
|
|
|
|
;; foo-1.0.3
|
|
|
|
|
;; leaf-alice 0.7.5
|
2023-12-21 17:01:51 -05:00
|
|
|
|
;; bar-1.0.0
|
|
|
|
|
;; leaf-bob 3.0.1
|
2023-12-21 17:01:52 -05:00
|
|
|
|
;; leaf-bob 3.0.2 (dev-dependency)
|
|
|
|
|
;; leaf-bob 4.0.0 (dev-dependency)
|
2020-02-04 03:50:48 -05:00
|
|
|
|
;;
|
|
|
|
|
;; root-1.0.0
|
|
|
|
|
;; root-1.0.4
|
2023-12-21 17:01:50 -05:00
|
|
|
|
;; intermediate-a 1.0.42
|
|
|
|
|
;; intermediate-b ^1.0.0
|
2020-02-04 03:50:48 -05:00
|
|
|
|
;; leaf-alice ^0.7
|
2023-12-21 17:01:50 -05:00
|
|
|
|
;; leaf-bob ^3
|
|
|
|
|
;; intermediate-c 1 (dev-dependency)
|
2020-02-04 03:50:48 -05:00
|
|
|
|
;;
|
|
|
|
|
;; intermediate-a-1.0.40
|
|
|
|
|
;; intermediate-a-1.0.42
|
|
|
|
|
;; intermediate-a-1.1.0-alpha.1
|
|
|
|
|
;; intermediate-a 1.2.3
|
|
|
|
|
;; leaf-alice 0.7.5
|
|
|
|
|
;; leaf-bob ^3
|
|
|
|
|
;;
|
|
|
|
|
;; intermediate-b-1.2.3
|
|
|
|
|
;; leaf-bob 3.0.1
|
|
|
|
|
;;
|
2023-12-21 17:01:50 -05:00
|
|
|
|
;; intermediate-c-1.0.1
|
|
|
|
|
;; leaf-alice 0.7.5 (dev-dependency)
|
|
|
|
|
;;
|
2020-02-04 03:50:48 -05:00
|
|
|
|
;; leaf-alice-0.7.3
|
|
|
|
|
;; leaf-alice-0.7.5
|
|
|
|
|
;;
|
|
|
|
|
;; leaf-bob-3.0.1
|
2023-12-21 17:01:52 -05:00
|
|
|
|
;; leaf-bob-3.0.2 (yanked)
|
|
|
|
|
;; leaf-bob-4.0.0 (yanked)
|
2020-02-04 03:50:48 -05:00
|
|
|
|
|
|
|
|
|
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(define test-foo-crate
|
2016-09-22 05:40:58 -04:00
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"max_version\": \"1.0.3\",
|
2016-09-22 05:40:58 -04:00
|
|
|
|
\"name\": \"foo\",
|
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
2017-01-01 10:14:45 -05:00
|
|
|
|
\"repository\": \"http://example.com\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
|
|
|
|
\"categories\": [\"test\"],
|
2019-09-01 10:20:36 -04:00
|
|
|
|
\"actual_versions\": [
|
2020-02-04 03:50:48 -05:00
|
|
|
|
{ \"id\": 234210,
|
|
|
|
|
\"num\": \"0.8.1\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/foo/0.8.1/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2020-02-04 03:50:48 -05:00
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234212,
|
2019-09-01 10:20:36 -04:00
|
|
|
|
\"num\": \"1.0.0\",
|
2019-09-01 10:32:11 -04:00
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
2019-09-01 10:20:36 -04:00
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/foo/1.0.0/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2020-02-04 03:50:48 -05:00
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234214,
|
|
|
|
|
\"num\": \"1.0.3\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/foo/1.0.3/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2019-09-01 10:20:36 -04:00
|
|
|
|
}
|
|
|
|
|
]
|
2016-09-22 05:40:58 -04:00
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(define test-foo-dependencies
|
2016-09-22 05:40:58 -04:00
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": [
|
|
|
|
|
{
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"crate_id\": \"leaf-alice\",
|
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"0.7.5\"
|
2016-09-22 05:40:58 -04:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}")
|
|
|
|
|
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(define test-bar-crate
|
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
|
|
|
|
\"max_version\": \"1.0.0\",
|
|
|
|
|
\"name\": \"bar\",
|
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
|
|
|
|
\"repository\": \"http://example.com\",
|
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
|
|
|
|
\"categories\": [\"test\"],
|
|
|
|
|
\"actual_versions\": [
|
|
|
|
|
{ \"id\": 234100,
|
|
|
|
|
\"num\": \"1.0.0\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/bar/1.0.0/dependencies\"
|
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
|
|
|
|
(define test-bar-dependencies
|
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": [
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-bob\",
|
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"3.0.1\"
|
2023-12-21 17:01:52 -05:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-bob\",
|
|
|
|
|
\"kind\": \"dev\",
|
|
|
|
|
\"req\": \"^3.0.2\"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-bob\",
|
|
|
|
|
\"kind\": \"dev\",
|
|
|
|
|
\"req\": \"^4.0.0\"
|
2023-12-21 17:01:51 -05:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}")
|
|
|
|
|
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(define test-root-crate
|
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"max_version\": \"1.0.4\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"name\": \"root\",
|
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
|
|
|
|
\"repository\": \"http://example.com\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
|
|
|
|
\"categories\": [\"test\"],
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"actual_versions\": [
|
2020-02-04 03:50:48 -05:00
|
|
|
|
{ \"id\": 234240,
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"num\": \"1.0.0\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/root/1.0.0/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2020-02-04 03:50:48 -05:00
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234242,
|
|
|
|
|
\"num\": \"1.0.4\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/root/1.0.4/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2019-12-11 05:30:47 -05:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
|
|
|
|
(define test-root-dependencies
|
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": [
|
|
|
|
|
{
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"crate_id\": \"intermediate-a\",
|
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"1.0.42\"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
},
|
|
|
|
|
{
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"crate_id\": \"intermediate-b\",
|
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"^1.0.0\"
|
2021-01-13 16:42:49 -05:00
|
|
|
|
},
|
2019-12-11 05:30:47 -05:00
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-alice\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"^0.7\"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-bob\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"^3\"
|
2023-12-21 17:01:50 -05:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"intermediate-c\",
|
|
|
|
|
\"kind\": \"dev\",
|
|
|
|
|
\"req\": \"1\"
|
2020-04-27 16:12:59 -04:00
|
|
|
|
}
|
2019-12-11 05:30:47 -05:00
|
|
|
|
]
|
|
|
|
|
}")
|
|
|
|
|
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(define test-intermediate-a-crate
|
2019-12-11 05:30:47 -05:00
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"max_version\": \"1.1.0-alpha.1\",
|
|
|
|
|
\"name\": \"intermediate-a\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
|
|
|
|
\"repository\": \"http://example.com\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
|
|
|
|
\"categories\": [\"test\"],
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"actual_versions\": [
|
2020-02-04 03:50:48 -05:00
|
|
|
|
{ \"id\": 234251,
|
|
|
|
|
\"num\": \"1.0.40\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/intermediate-a/1.0.40/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2020-02-04 03:50:48 -05:00
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234250,
|
|
|
|
|
\"num\": \"1.0.42\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/intermediate-a/1.0.42/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2020-02-04 03:50:48 -05:00
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234252,
|
|
|
|
|
\"num\": \"1.1.0-alpha.1\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"dependencies\": \"/api/v1/crates/intermediate-a/1.1.0-alpha.1/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2019-12-11 05:30:47 -05:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(define test-intermediate-a-dependencies
|
2019-12-11 05:30:47 -05:00
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": [
|
|
|
|
|
{
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"crate_id\": \"intermediate-b\",
|
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"1.2.3\"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-alice\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"0.7.5\"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-bob\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"^3\"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}")
|
|
|
|
|
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(define test-intermediate-b-crate
|
2019-12-11 05:30:47 -05:00
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"max_version\": \"1.2.3\",
|
|
|
|
|
\"name\": \"intermediate-b\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
|
|
|
|
\"repository\": \"http://example.com\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
|
|
|
|
\"categories\": [\"test\"],
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"actual_versions\": [
|
2020-02-04 03:50:48 -05:00
|
|
|
|
{ \"id\": 234260,
|
|
|
|
|
\"num\": \"1.2.3\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"dependencies\": \"/api/v1/crates/intermediate-b/1.2.3/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2019-12-11 05:30:47 -05:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(define test-intermediate-b-dependencies
|
2019-12-11 05:30:47 -05:00
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": [
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-bob\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"kind\": \"normal\",
|
|
|
|
|
\"req\": \"3.0.1\"
|
2020-04-27 16:12:59 -04:00
|
|
|
|
}
|
2019-12-11 05:30:47 -05:00
|
|
|
|
]
|
|
|
|
|
}")
|
|
|
|
|
|
2023-12-21 17:01:50 -05:00
|
|
|
|
(define test-intermediate-c-crate
|
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
|
|
|
|
\"max_version\": \"1.0.1\",
|
|
|
|
|
\"name\": \"intermediate-c\",
|
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
|
|
|
|
\"repository\": \"http://example.com\",
|
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
|
|
|
|
\"categories\": [\"test\"],
|
|
|
|
|
\"actual_versions\": [
|
|
|
|
|
{ \"id\": 234290,
|
|
|
|
|
\"num\": \"1.0.1\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/intermediate-c/1.0.1/dependencies\"
|
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
|
|
|
|
(define test-intermediate-c-dependencies
|
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": [
|
|
|
|
|
{
|
|
|
|
|
\"crate_id\": \"leaf-alice\",
|
|
|
|
|
\"kind\": \"dev\",
|
|
|
|
|
\"req\": \"0.7.5\"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}")
|
|
|
|
|
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(define test-leaf-alice-crate
|
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"max_version\": \"0.7.5\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"name\": \"leaf-alice\",
|
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
|
|
|
|
\"repository\": \"http://example.com\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
|
|
|
|
\"categories\": [\"test\"],
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"actual_versions\": [
|
2020-02-04 03:50:48 -05:00
|
|
|
|
{ \"id\": 234270,
|
|
|
|
|
\"num\": \"0.7.3\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"dependencies\": \"/api/v1/crates/leaf-alice/0.7.3/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2020-02-04 03:50:48 -05:00
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234272,
|
|
|
|
|
\"num\": \"0.7.5\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/leaf-alice/0.7.5/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2019-12-11 05:30:47 -05:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
|
|
|
|
(define test-leaf-alice-dependencies
|
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": []
|
|
|
|
|
}")
|
|
|
|
|
|
|
|
|
|
(define test-leaf-bob-crate
|
|
|
|
|
"{
|
|
|
|
|
\"crate\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"max_version\": \"3.0.1\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"name\": \"leaf-bob\",
|
|
|
|
|
\"description\": \"summary\",
|
|
|
|
|
\"homepage\": \"http://example.com\",
|
|
|
|
|
\"repository\": \"http://example.com\",
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"keywords\": [\"dummy\", \"test\"],
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"categories\": [\"test\"]
|
|
|
|
|
\"actual_versions\": [
|
2020-02-04 03:50:48 -05:00
|
|
|
|
{ \"id\": 234280,
|
|
|
|
|
\"num\": \"3.0.1\",
|
2019-12-11 05:30:47 -05:00
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
2020-02-04 03:50:48 -05:00
|
|
|
|
\"dependencies\": \"/api/v1/crates/leaf-bob/3.0.1/dependencies\"
|
2023-10-09 08:15:46 -04:00
|
|
|
|
},
|
|
|
|
|
\"yanked\": false
|
2023-12-21 17:01:52 -05:00
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234281,
|
|
|
|
|
\"num\": \"3.0.2\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/leaf-bob/3.0.2/dependencies\"
|
|
|
|
|
},
|
|
|
|
|
\"yanked\": true
|
|
|
|
|
},
|
|
|
|
|
{ \"id\": 234282,
|
|
|
|
|
\"num\": \"4.0.0\",
|
|
|
|
|
\"license\": \"MIT OR Apache-2.0\",
|
|
|
|
|
\"links\": {
|
|
|
|
|
\"dependencies\": \"/api/v1/crates/leaf-bob/4.0.0/dependencies\"
|
|
|
|
|
},
|
|
|
|
|
\"yanked\": true
|
2019-12-11 05:30:47 -05:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}")
|
|
|
|
|
|
|
|
|
|
(define test-leaf-bob-dependencies
|
|
|
|
|
"{
|
|
|
|
|
\"dependencies\": []
|
|
|
|
|
}")
|
|
|
|
|
|
2020-11-15 15:25:16 -05:00
|
|
|
|
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(define test-source-hash
|
|
|
|
|
"")
|
|
|
|
|
|
2020-12-04 10:53:14 -05:00
|
|
|
|
(define have-guile-semver?
|
|
|
|
|
(false-if-exception (resolve-interface '(semver))))
|
|
|
|
|
|
2020-04-27 16:12:59 -04:00
|
|
|
|
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(test-begin "crate")
|
|
|
|
|
|
|
|
|
|
(test-equal "guix-package->crate-name"
|
|
|
|
|
"rustc-serialize"
|
|
|
|
|
(guix-package->crate-name
|
|
|
|
|
(dummy-package
|
|
|
|
|
"rust-rustc-serialize"
|
|
|
|
|
(source (dummy-origin
|
2020-12-04 10:53:14 -05:00
|
|
|
|
(uri (crate-uri "rustc-serialize" "1.0")))))))
|
2016-09-22 05:40:58 -04:00
|
|
|
|
|
2020-12-04 10:53:14 -05:00
|
|
|
|
(unless have-guile-semver? (test-skip 1))
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(test-assert "crate->guix-package"
|
|
|
|
|
;; Replace network resources with sample data.
|
|
|
|
|
(mock ((guix http-client) http-fetch
|
2017-02-13 10:04:09 -05:00
|
|
|
|
(lambda (url . rest)
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(match url
|
|
|
|
|
("https://crates.io/api/v1/crates/foo"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string test-foo-crate))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/foo/1.0.3/download"
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(set! test-source-hash
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(open-input-string "empty file\n"))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/foo/1.0.3/dependencies"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string test-foo-dependencies))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/leaf-alice"
|
|
|
|
|
(open-input-string test-leaf-alice-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-alice/0.7.5/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-alice/0.7.5/dependencies"
|
|
|
|
|
(open-input-string test-leaf-alice-dependencies))
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(_ (error "Unexpected URL: " url)))))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
|
|
|
|
|
(match (crate->guix-package "foo")
|
2020-11-14 15:31:33 -05:00
|
|
|
|
((define-public 'rust-foo-1
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(package (name "rust-foo")
|
|
|
|
|
(version "1.0.3")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "foo" 'version))
|
|
|
|
|
(file-name (string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system 'cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote
|
|
|
|
|
(#:skip-build? #t
|
|
|
|
|
#:cargo-inputs
|
2020-11-14 15:31:33 -05:00
|
|
|
|
(("rust-leaf-alice" ('unquote 'rust-leaf-alice-0.7))))))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
|
|
|
|
|
(string=? test-source-hash hash))
|
|
|
|
|
(x
|
|
|
|
|
(pk 'fail x #f)))))
|
2016-09-22 05:40:58 -04:00
|
|
|
|
|
2020-12-04 10:53:14 -05:00
|
|
|
|
(unless have-guile-semver? (test-skip 1))
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(test-assert "crate-recursive-import"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
;; Replace network resources with sample data.
|
|
|
|
|
(mock ((guix http-client) http-fetch
|
|
|
|
|
(lambda (url . rest)
|
|
|
|
|
(match url
|
|
|
|
|
("https://crates.io/api/v1/crates/root"
|
|
|
|
|
(open-input-string test-root-crate))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/root/1.0.4/download"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string "empty file\n"))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/root/1.0.4/dependencies"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string test-root-dependencies))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-a"
|
|
|
|
|
(open-input-string test-intermediate-a-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-a/1.0.42/download"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string "empty file\n"))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-a/1.0.42/dependencies"
|
|
|
|
|
(open-input-string test-intermediate-a-dependencies))
|
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-b"
|
|
|
|
|
(open-input-string test-intermediate-b-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-b/1.2.3/download"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string "empty file\n"))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-b/1.2.3/dependencies"
|
|
|
|
|
(open-input-string test-intermediate-b-dependencies))
|
2023-12-21 17:01:50 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-c"
|
|
|
|
|
(open-input-string test-intermediate-c-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-c/1.0.1/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2023-12-21 17:01:50 -05:00
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/intermediate-c/1.0.1/dependencies"
|
|
|
|
|
(open-input-string test-intermediate-c-dependencies))
|
2019-12-11 05:30:47 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/leaf-alice"
|
|
|
|
|
(open-input-string test-leaf-alice-crate))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/leaf-alice/0.7.5/download"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string "empty file\n"))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/leaf-alice/0.7.5/dependencies"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string test-leaf-alice-dependencies))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob"
|
|
|
|
|
(open-input-string test-leaf-bob-crate))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.1/download"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string "empty file\n"))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.1/dependencies"
|
2019-12-11 05:30:47 -05:00
|
|
|
|
(open-input-string test-leaf-bob-dependencies))
|
|
|
|
|
(_ (error "Unexpected URL: " url)))))
|
|
|
|
|
(match (crate-recursive-import "root")
|
2020-02-04 03:50:48 -05:00
|
|
|
|
;; rust-intermediate-b has no dependency on the rust-leaf-alice
|
|
|
|
|
;; package, so this is a valid ordering
|
2023-12-21 17:01:50 -05:00
|
|
|
|
(((define-public 'rust-intermediate-c-1
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-intermediate-c")
|
|
|
|
|
(version "1.0.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "intermediate-c" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:skip-build? #t)))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-leaf-alice-0.7
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-alice")
|
|
|
|
|
(version "0.7.5")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "leaf-alice" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments ('quasiquote (#:skip-build? #t)))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
2020-11-14 15:31:33 -05:00
|
|
|
|
(define-public 'rust-leaf-bob-3
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-bob")
|
|
|
|
|
(version "3.0.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "leaf-bob" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments ('quasiquote (#:skip-build? #t)))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
2020-11-14 15:31:33 -05:00
|
|
|
|
(define-public 'rust-intermediate-b-1
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(package
|
|
|
|
|
(name "rust-intermediate-b")
|
|
|
|
|
(version "1.2.3")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "intermediate-b" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:skip-build? #t
|
|
|
|
|
#:cargo-inputs
|
|
|
|
|
(("rust-leaf-bob"
|
2020-11-14 15:31:33 -05:00
|
|
|
|
('unquote rust-leaf-bob-3))))))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
2020-11-14 15:31:33 -05:00
|
|
|
|
(define-public 'rust-intermediate-a-1
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(package
|
|
|
|
|
(name "rust-intermediate-a")
|
|
|
|
|
(version "1.0.42")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "intermediate-a" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:skip-build? #t
|
|
|
|
|
#:cargo-inputs
|
|
|
|
|
(("rust-intermediate-b"
|
2020-11-14 15:31:33 -05:00
|
|
|
|
('unquote rust-intermediate-b-1))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("rust-leaf-alice"
|
2020-11-14 13:47:32 -05:00
|
|
|
|
('unquote 'rust-leaf-alice-0.7))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("rust-leaf-bob"
|
2020-11-14 15:31:33 -05:00
|
|
|
|
('unquote rust-leaf-bob-3))))))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
2020-11-14 15:31:33 -05:00
|
|
|
|
(define-public 'rust-root-1
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(package
|
|
|
|
|
(name "rust-root")
|
|
|
|
|
(version "1.0.4")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "root" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
2020-02-03 16:19:49 -05:00
|
|
|
|
('quasiquote (#:cargo-inputs
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(("rust-intermediate-a"
|
2020-11-14 15:31:33 -05:00
|
|
|
|
('unquote rust-intermediate-a-1))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("rust-intermediate-b"
|
2020-11-14 15:31:33 -05:00
|
|
|
|
('unquote rust-intermediate-b-1))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("rust-leaf-alice"
|
2020-11-14 13:47:32 -05:00
|
|
|
|
('unquote 'rust-leaf-alice-0.7))
|
2023-12-21 17:01:50 -05:00
|
|
|
|
("rust-leaf-bob"
|
|
|
|
|
('unquote rust-leaf-bob-3)))
|
|
|
|
|
#:cargo-development-inputs
|
|
|
|
|
(("rust-intermediate-c"
|
|
|
|
|
('unquote rust-intermediate-c-1))))))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0)))))
|
|
|
|
|
#t)
|
|
|
|
|
(x
|
|
|
|
|
(pk 'fail x #f)))
|
|
|
|
|
(match (crate-recursive-import "root"
|
|
|
|
|
#:recursive-dev-dependencies? #t)
|
|
|
|
|
;; rust-intermediate-b has no dependency on the rust-leaf-alice
|
|
|
|
|
;; package, so this is a valid ordering
|
|
|
|
|
(((define-public 'rust-intermediate-c-1
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-intermediate-c")
|
|
|
|
|
(version "1.0.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "intermediate-c" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:cargo-development-inputs
|
|
|
|
|
(("rust-leaf-alice"
|
|
|
|
|
('unquote rust-leaf-alice-0.7))))))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-leaf-alice-0.7
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-alice")
|
|
|
|
|
(version "0.7.5")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "leaf-alice" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-leaf-bob-3
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-bob")
|
|
|
|
|
(version "3.0.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "leaf-bob" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-intermediate-b-1
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-intermediate-b")
|
|
|
|
|
(version "1.2.3")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "intermediate-b" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:cargo-inputs
|
|
|
|
|
(("rust-leaf-bob"
|
|
|
|
|
('unquote rust-leaf-bob-3))))))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-intermediate-a-1
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-intermediate-a")
|
|
|
|
|
(version "1.0.42")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "intermediate-a" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:cargo-inputs
|
|
|
|
|
(("rust-intermediate-b"
|
|
|
|
|
('unquote rust-intermediate-b-1))
|
|
|
|
|
("rust-leaf-alice"
|
|
|
|
|
('unquote 'rust-leaf-alice-0.7))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
("rust-leaf-bob"
|
2020-11-14 15:31:33 -05:00
|
|
|
|
('unquote rust-leaf-bob-3))))))
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
2023-12-21 17:01:50 -05:00
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-root-1
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-root")
|
|
|
|
|
(version "1.0.4")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "root" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:cargo-inputs
|
|
|
|
|
(("rust-intermediate-a"
|
|
|
|
|
('unquote rust-intermediate-a-1))
|
|
|
|
|
("rust-intermediate-b"
|
|
|
|
|
('unquote rust-intermediate-b-1))
|
|
|
|
|
("rust-leaf-alice"
|
|
|
|
|
('unquote 'rust-leaf-alice-0.7))
|
|
|
|
|
("rust-leaf-bob"
|
|
|
|
|
('unquote rust-leaf-bob-3)))
|
|
|
|
|
#:cargo-development-inputs
|
|
|
|
|
(("rust-intermediate-c"
|
|
|
|
|
('unquote rust-intermediate-c-1))))))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
2020-02-04 03:50:48 -05:00
|
|
|
|
(license (list license:expat license:asl2.0)))))
|
2019-12-11 05:30:47 -05:00
|
|
|
|
#t)
|
|
|
|
|
(x
|
|
|
|
|
(pk 'fail x #f)))))
|
|
|
|
|
|
2019-11-26 15:17:21 -05:00
|
|
|
|
(test-equal "licenses: MIT OR Apache-2.0"
|
|
|
|
|
'(license:expat license:asl2.0)
|
|
|
|
|
(string->license "MIT OR Apache-2.0"))
|
|
|
|
|
|
|
|
|
|
(test-equal "licenses: Apache-2.0 / MIT"
|
|
|
|
|
'(license:asl2.0 license:expat)
|
|
|
|
|
(string->license "Apache-2.0 / MIT"))
|
|
|
|
|
|
|
|
|
|
(test-equal "licenses: Apache-2.0 WITH LLVM-exception"
|
|
|
|
|
'(license:asl2.0 unknown-license!)
|
|
|
|
|
(string->license "Apache-2.0 WITH LLVM-exception"))
|
|
|
|
|
|
|
|
|
|
(test-equal "licenses: MIT/Apache-2.0 AND BSD-2-Clause"
|
2022-05-30 06:21:50 -04:00
|
|
|
|
'(license:expat license:asl2.0 license:bsd-2)
|
2019-11-26 15:17:21 -05:00
|
|
|
|
(string->license "MIT/Apache-2.0 AND BSD-2-Clause"))
|
|
|
|
|
|
|
|
|
|
(test-equal "licenses: MIT/Apache-2.0"
|
|
|
|
|
'(license:expat license:asl2.0)
|
|
|
|
|
(string->license "MIT/Apache-2.0"))
|
|
|
|
|
|
2020-11-15 15:25:16 -05:00
|
|
|
|
|
|
|
|
|
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(define rust-leaf-bob-3
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-bob")
|
|
|
|
|
(version "3.0.1")
|
|
|
|
|
(source #f)
|
|
|
|
|
(build-system #f)
|
|
|
|
|
(home-page #f)
|
|
|
|
|
(synopsis #f)
|
|
|
|
|
(description #f)
|
|
|
|
|
(license #f)))
|
2020-11-15 15:25:16 -05:00
|
|
|
|
|
2023-12-21 17:01:52 -05:00
|
|
|
|
(define rust-leaf-bob-3.0.2-yanked
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-bob")
|
|
|
|
|
(version "3.0.2")
|
|
|
|
|
(source #f)
|
|
|
|
|
(properties '((crate-version-yanked? . #t)))
|
|
|
|
|
(build-system #f)
|
|
|
|
|
(home-page #f)
|
|
|
|
|
(synopsis #f)
|
|
|
|
|
(description #f)
|
|
|
|
|
(license #f)))
|
|
|
|
|
|
2020-12-04 10:53:14 -05:00
|
|
|
|
(unless have-guile-semver? (test-skip 1))
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(test-assert "crate-recursive-import-honors-existing-packages"
|
|
|
|
|
(mock
|
|
|
|
|
((gnu packages) find-packages-by-name
|
|
|
|
|
(lambda* (name #:optional version)
|
|
|
|
|
(match name
|
|
|
|
|
("rust-leaf-bob"
|
2023-12-21 17:01:52 -05:00
|
|
|
|
(list rust-leaf-bob-3 rust-leaf-bob-3.0.2-yanked))
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(_ '()))))
|
|
|
|
|
(mock
|
|
|
|
|
((guix http-client) http-fetch
|
|
|
|
|
(lambda (url . rest)
|
|
|
|
|
(match url
|
|
|
|
|
("https://crates.io/api/v1/crates/bar"
|
|
|
|
|
(open-input-string test-bar-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/bar/1.0.0/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/bar/1.0.0/dependencies"
|
|
|
|
|
(open-input-string test-bar-dependencies))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob"
|
|
|
|
|
(open-input-string test-leaf-bob-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.2/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.2/dependencies"
|
|
|
|
|
(open-input-string test-leaf-bob-dependencies))
|
2023-12-21 17:01:52 -05:00
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/4.0.0/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/4.0.0/dependencies"
|
|
|
|
|
(open-input-string test-leaf-bob-dependencies))
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(_ (error "Unexpected URL: " url)))))
|
2023-12-21 17:01:52 -05:00
|
|
|
|
(match (crate-recursive-import "bar"
|
|
|
|
|
#:allow-yanked? #t)
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(((define-public 'rust-bar-1
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-bar")
|
|
|
|
|
(version "1.0.0")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "bar" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:cargo-inputs
|
|
|
|
|
(("rust-leaf-bob"
|
2023-12-21 17:01:52 -05:00
|
|
|
|
('unquote 'rust-leaf-bob-3)))
|
|
|
|
|
#:cargo-development-inputs
|
|
|
|
|
(("rust-leaf-bob"
|
|
|
|
|
('unquote 'rust-leaf-bob-3.0.2-yanked))
|
|
|
|
|
("rust-leaf-bob"
|
|
|
|
|
('unquote 'rust-leaf-bob-4.0.0-yanked))))))
|
2023-12-21 17:01:51 -05:00
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0)))))
|
|
|
|
|
#t)
|
|
|
|
|
(x
|
|
|
|
|
(pk 'fail x #f))))))
|
2020-11-15 15:25:16 -05:00
|
|
|
|
|
2023-12-21 17:01:52 -05:00
|
|
|
|
(unless have-guile-semver? (test-skip 1))
|
|
|
|
|
(test-assert "crate-import-only-yanked-available"
|
|
|
|
|
(mock
|
|
|
|
|
((guix http-client) http-fetch
|
|
|
|
|
(lambda (url . rest)
|
|
|
|
|
(match url
|
|
|
|
|
("https://crates.io/api/v1/crates/bar"
|
|
|
|
|
(open-input-string test-bar-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/bar/1.0.0/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/bar/1.0.0/dependencies"
|
|
|
|
|
(open-input-string test-bar-dependencies))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob"
|
|
|
|
|
(open-input-string test-leaf-bob-crate))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.1/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.1/dependencies"
|
|
|
|
|
(open-input-string test-leaf-bob-dependencies))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.2/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/3.0.2/dependencies"
|
|
|
|
|
(open-input-string test-leaf-bob-dependencies))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/4.0.0/download"
|
|
|
|
|
(set! test-source-hash
|
|
|
|
|
(bytevector->nix-base32-string
|
|
|
|
|
(gcrypt-sha256 (string->bytevector "empty file\n" "utf-8"))))
|
|
|
|
|
(open-input-string "empty file\n"))
|
|
|
|
|
("https://crates.io/api/v1/crates/leaf-bob/4.0.0/dependencies"
|
|
|
|
|
(open-input-string test-leaf-bob-dependencies))
|
|
|
|
|
(_ (error "Unexpected URL: " url)))))
|
|
|
|
|
(match (crate-recursive-import "bar"
|
|
|
|
|
#:recursive-dev-dependencies? #t
|
|
|
|
|
#:allow-yanked? #t)
|
|
|
|
|
(((define-public 'rust-leaf-bob-4.0.0-yanked
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-bob")
|
|
|
|
|
(version "4.0.0")
|
|
|
|
|
($ <comment> "; This version was yanked!\n" #t)
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "leaf-bob" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(properties ('quote (('crate-version-yanked? . #t))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-leaf-bob-3.0.2-yanked
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-bob")
|
|
|
|
|
(version "3.0.2")
|
|
|
|
|
($ <comment> "; This version was yanked!\n" #t)
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "leaf-bob" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(properties ('quote (('crate-version-yanked? . #t))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-leaf-bob-3
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-leaf-bob")
|
|
|
|
|
(version "3.0.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "leaf-bob" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0))))
|
|
|
|
|
(define-public 'rust-bar-1
|
|
|
|
|
(package
|
|
|
|
|
(name "rust-bar")
|
|
|
|
|
(version "1.0.0")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (crate-uri "bar" version))
|
|
|
|
|
(file-name
|
|
|
|
|
(string-append name "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
(? string? hash)))))
|
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
('quasiquote (#:cargo-inputs
|
|
|
|
|
(("rust-leaf-bob"
|
|
|
|
|
('unquote 'rust-leaf-bob-3)))
|
|
|
|
|
#:cargo-development-inputs
|
|
|
|
|
(("rust-leaf-bob"
|
|
|
|
|
('unquote 'rust-leaf-bob-3.0.2-yanked))
|
|
|
|
|
("rust-leaf-bob"
|
|
|
|
|
('unquote 'rust-leaf-bob-4.0.0-yanked))))))
|
|
|
|
|
(home-page "http://example.com")
|
|
|
|
|
(synopsis "summary")
|
|
|
|
|
(description "summary")
|
|
|
|
|
(license (list license:expat license:asl2.0)))))
|
|
|
|
|
#t)
|
|
|
|
|
(x
|
|
|
|
|
(pk 'fail (pretty-print-with-comments (current-output-port) x) #f)))))
|
|
|
|
|
|
2016-09-22 05:40:58 -04:00
|
|
|
|
(test-end "crate")
|