summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/import/crate.scm1
-rw-r--r--tests/crate.scm8
2 files changed, 8 insertions, 1 deletions
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 3bc261b04e..c10c0d55ea 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -92,6 +92,7 @@
string->symbol)
(requirement crate-dependency-requirement "req")) ;string
+;; Autoload Guile-Semver so we only have a soft dependency.
(module-autoload! (current-module)
'(semver) '(string->semver semver->string semver<?))
(module-autoload! (current-module)
diff --git a/tests/crate.scm b/tests/crate.scm
index a24f734093..bb7032c344 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -317,6 +317,9 @@
(define test-source-hash
"")
+(define have-guile-semver?
+ (false-if-exception (resolve-interface '(semver))))
+
(test-begin "crate")
@@ -326,8 +329,9 @@
(dummy-package
"rust-rustc-serialize"
(source (dummy-origin
- (uri (crate-uri "rustc-serialize" "1.0")))))))
+ (uri (crate-uri "rustc-serialize" "1.0")))))))
+(unless have-guile-semver? (test-skip 1))
(test-assert "crate->guix-package"
;; Replace network resources with sample data.
(mock ((guix http-client) http-fetch
@@ -380,6 +384,7 @@
(x
(pk 'fail x #f)))))
+(unless have-guile-semver? (test-skip 1))
(test-assert "cargo-recursive-import"
;; Replace network resources with sample data.
(mock ((guix http-client) http-fetch
@@ -614,6 +619,7 @@
(test-assert "self-test: rust-docopt 0.8.x is gone, please adjust the test case"
(not (null? (find-packages-by-name "rust-docopt" "0.8"))))
+(unless have-guile-semver? (test-skip 1))
(test-assert "cargo-recursive-import-hoors-existing-packages"
(mock ((guix http-client) http-fetch
(lambda (url . rest)