unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50871: Stackage importer change breaks tests/lint, build
@ 2021-09-28 16:22 Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2021-09-28 18:39 ` Xinglu Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-09-28 16:22 UTC (permalink / raw)
  To: 50871; +Cc: Xinglu Chen


[-- Attachment #1.1: Type: text/plain, Size: 198 bytes --]

Guix,

Guix doesn't currently build because of a ‘lint’ test failure (log 
attached).  Reverting commit 
9c5e5ca1c0de56a0d5b2b924de10548172095b58 makes it pass.

Kind regards,

T G-R


[-- Attachment #1.2: test-suite.log --]
[-- Type: application/octet-stream, Size: 75686 bytes --]

==================================================
   GNU Guix 1.3.0.5633-3f7817: ./test-suite.log
==================================================

# TOTAL: 120
# PASS:  119
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/lint
================

test-name: description: not a string
location: /home/nckx/guix/tests/lint.scm:94
source:
+ (test-equal
+   "description: not a string"
+   "invalid description: foobar"
+   (single-lint-warning-message
+     (check-description-style
+       (dummy-package "x" (description 'foobar)))))
expected-value: "invalid description: foobar"
actual-value: "invalid description: foobar"
result: PASS

test-name: description: not empty
location: /home/nckx/guix/tests/lint.scm:100
source:
+ (test-equal
+   "description: not empty"
+   "description should not be empty"
+   (single-lint-warning-message
+     (check-description-style
+       (dummy-package "x" (description "")))))
expected-value: "description should not be empty"
actual-value: "description should not be empty"
result: PASS

test-name: description: invalid Texinfo markup
location: /home/nckx/guix/tests/lint.scm:106
source:
+ (test-equal
+   "description: invalid Texinfo markup"
+   "Texinfo markup in description is invalid"
+   (single-lint-warning-message
+     (check-description-style
+       (dummy-package "x" (description "f{oo}b@r")))))
expected-value: "Texinfo markup in description is invalid"
actual-value: "Texinfo markup in description is invalid"
result: PASS

test-name: description: does not start with an upper-case letter
location: /home/nckx/guix/tests/lint.scm:112
source:
+ (test-equal
+   "description: does not start with an upper-case letter"
+   "description should start with an upper-case letter or digit"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (description "bad description."))))
+       (check-description-style pkg))))
expected-value: "description should start with an upper-case letter or digit"
actual-value: "description should start with an upper-case letter or digit"
result: PASS

test-name: description: may start with a digit
location: /home/nckx/guix/tests/lint.scm:119
source:
+ (test-equal
+   "description: may start with a digit"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (description "2-component library."))))
+     (check-description-style pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: description: may start with lower-case package name
location: /home/nckx/guix/tests/lint.scm:125
source:
+ (test-equal
+   "description: may start with lower-case package name"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (description "x is a dummy package."))))
+     (check-description-style pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: description: two spaces after end of sentence
location: /home/nckx/guix/tests/lint.scm:131
source:
+ (test-equal
+   "description: two spaces after end of sentence"
+   "sentences in description should be followed by two spaces; possible infraction at 3"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (description "Bad. Quite bad."))))
+       (check-description-style pkg))))
expected-value: "sentences in description should be followed by two spaces; possible infraction at 3"
actual-value: "sentences in description should be followed by two spaces; possible infraction at 3"
result: PASS

test-name: description: end-of-sentence detection with abbreviations
location: /home/nckx/guix/tests/lint.scm:138
source:
+ (test-equal
+   "description: end-of-sentence detection with abbreviations"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (description
+                  "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD)."))))
+     (check-description-style pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: description: may not contain trademark signs: ?
location: /home/nckx/guix/tests/lint.scm:145
source:
+ (test-equal
+   "description: may not contain trademark signs: ?"
+   "description should not contain trademark sign '?' at 20"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (description "Does The Right Thing?"))))
+       (check-description-style pkg))))
expected-value: "description should not contain trademark sign '?' at 20"
actual-value: "description should not contain trademark sign '?' at 20"
result: PASS

test-name: description: may not contain trademark signs: ?
location: /home/nckx/guix/tests/lint.scm:152
source:
+ (test-equal
+   "description: may not contain trademark signs: ?"
+   "description should not contain trademark sign '?' at 17"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (description "Works with Format?"))))
+       (check-description-style pkg))))
expected-value: "description should not contain trademark sign '?' at 17"
actual-value: "description should not contain trademark sign '?' at 17"
result: PASS

test-name: description: suggest ornament instead of quotes
location: /home/nckx/guix/tests/lint.scm:159
source:
+ (test-equal
+   "description: suggest ornament instead of quotes"
+   "use @code or similar ornament instead of quotes"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (description "This is a 'quoted' thing."))))
+       (check-description-style pkg))))
expected-value: "use @code or similar ornament instead of quotes"
actual-value: "use @code or similar ornament instead of quotes"
result: PASS

test-name: description: leading whitespace
location: /home/nckx/guix/tests/lint.scm:166
source:
+ (test-equal
+   "description: leading whitespace"
+   "description contains leading whitespace"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (description " Whitespace."))))
+       (check-description-style pkg))))
expected-value: "description contains leading whitespace"
actual-value: "description contains leading whitespace"
result: PASS

test-name: description: trailing whitespace
location: /home/nckx/guix/tests/lint.scm:173
source:
+ (test-equal
+   "description: trailing whitespace"
+   "description contains trailing whitespace"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (description "Whitespace. "))))
+       (check-description-style pkg))))
expected-value: "description contains trailing whitespace"
actual-value: "description contains trailing whitespace"
result: PASS

test-name: synopsis: not a string
location: /home/nckx/guix/tests/lint.scm:180
source:
+ (test-equal
+   "synopsis: not a string"
+   "invalid synopsis: #f"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (synopsis #f))))
+       (check-synopsis-style pkg))))
expected-value: "invalid synopsis: #f"
actual-value: "invalid synopsis: #f"
result: PASS

test-name: synopsis: not empty
location: /home/nckx/guix/tests/lint.scm:187
source:
+ (test-equal
+   "synopsis: not empty"
+   "synopsis should not be empty"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (synopsis ""))))
+       (check-synopsis-style pkg))))
expected-value: "synopsis should not be empty"
actual-value: "synopsis should not be empty"
result: PASS

test-name: synopsis: valid Texinfo markup
location: /home/nckx/guix/tests/lint.scm:194
source:
+ (test-equal
+   "synopsis: valid Texinfo markup"
+   "Texinfo markup in synopsis is invalid"
+   (single-lint-warning-message
+     (check-synopsis-style
+       (dummy-package "x" (synopsis "Bad $@ texinfo")))))
expected-value: "Texinfo markup in synopsis is invalid"
actual-value: "Texinfo markup in synopsis is invalid"
result: PASS

test-name: synopsis: does not start with an upper-case letter
location: /home/nckx/guix/tests/lint.scm:200
source:
+ (test-equal
+   "synopsis: does not start with an upper-case letter"
+   "synopsis should start with an upper-case letter or digit"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (synopsis "bad synopsis"))))
+       (check-synopsis-style pkg))))
expected-value: "synopsis should start with an upper-case letter or digit"
actual-value: "synopsis should start with an upper-case letter or digit"
result: PASS

test-name: synopsis: may start with a digit
location: /home/nckx/guix/tests/lint.scm:207
source:
+ (test-equal
+   "synopsis: may start with a digit"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (synopsis "5-dimensional frobnicator"))))
+     (check-synopsis-style pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: synopsis: ends with a period
location: /home/nckx/guix/tests/lint.scm:213
source:
+ (test-equal
+   "synopsis: ends with a period"
+   "no period allowed at the end of the synopsis"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (synopsis "Bad synopsis."))))
+       (check-synopsis-style pkg))))
expected-value: "no period allowed at the end of the synopsis"
actual-value: "no period allowed at the end of the synopsis"
result: PASS

test-name: synopsis: ends with 'etc.'
location: /home/nckx/guix/tests/lint.scm:220
source:
+ (test-equal
+   "synopsis: ends with 'etc.'"
+   '()
+   (let ((pkg (dummy-package "x" (synopsis "Foo, bar, etc."))))
+     (check-synopsis-style pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: synopsis: starts with 'A'
location: /home/nckx/guix/tests/lint.scm:226
source:
+ (test-equal
+   "synopsis: starts with 'A'"
+   "no article allowed at the beginning of the synopsis"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (synopsis "A bad synop?is"))))
+       (check-synopsis-style pkg))))
expected-value: "no article allowed at the beginning of the synopsis"
actual-value: "no article allowed at the beginning of the synopsis"
result: PASS

test-name: synopsis: starts with 'An'
location: /home/nckx/guix/tests/lint.scm:233
source:
+ (test-equal
+   "synopsis: starts with 'An'"
+   "no article allowed at the beginning of the synopsis"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (synopsis "An awful synopsis"))))
+       (check-synopsis-style pkg))))
expected-value: "no article allowed at the beginning of the synopsis"
actual-value: "no article allowed at the beginning of the synopsis"
result: PASS

test-name: synopsis: starts with 'a'
location: /home/nckx/guix/tests/lint.scm:240
source:
+ (test-equal
+   "synopsis: starts with 'a'"
+   '("no article allowed at the beginning of the synopsis"
+     "synopsis should start with an upper-case letter or digit")
+   (sort (map lint-warning-message
+              (let ((pkg (dummy-package "x" (synopsis "a bad synopsis"))))
+                (check-synopsis-style pkg)))
+         string<?))
expected-value: ("no article allowed at the beginning of the synopsis" "synopsis should start with an upper-case letter or digit")
actual-value: ("no article allowed at the beginning of the synopsis" "synopsis should start with an upper-case letter or digit")
result: PASS

test-name: synopsis: starts with 'an'
location: /home/nckx/guix/tests/lint.scm:251
source:
+ (test-equal
+   "synopsis: starts with 'an'"
+   '("no article allowed at the beginning of the synopsis"
+     "synopsis should start with an upper-case letter or digit")
+   (sort (map lint-warning-message
+              (let ((pkg (dummy-package
+                           "x"
+                           (synopsis "an awful synopsis"))))
+                (check-synopsis-style pkg)))
+         string<?))
expected-value: ("no article allowed at the beginning of the synopsis" "synopsis should start with an upper-case letter or digit")
actual-value: ("no article allowed at the beginning of the synopsis" "synopsis should start with an upper-case letter or digit")
result: PASS

test-name: synopsis: too long
location: /home/nckx/guix/tests/lint.scm:262
source:
+ (test-equal
+   "synopsis: too long"
+   "synopsis should be less than 80 characters long"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (synopsis (make-string 80 #\X)))))
+       (check-synopsis-style pkg))))
expected-value: "synopsis should be less than 80 characters long"
actual-value: "synopsis should be less than 80 characters long"
result: PASS

test-name: synopsis: start with package name
location: /home/nckx/guix/tests/lint.scm:269
source:
+ (test-equal
+   "synopsis: start with package name"
+   "synopsis should not start with the package name"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (name "Foo")
+                  (synopsis "Foo, a nice package"))))
+       (check-synopsis-style pkg))))
expected-value: "synopsis should not start with the package name"
actual-value: "synopsis should not start with the package name"
result: PASS

test-name: synopsis: start with package name prefix
location: /home/nckx/guix/tests/lint.scm:277
source:
+ (test-equal
+   "synopsis: start with package name prefix"
+   '()
+   (let ((pkg (dummy-package
+                "arb"
+                (synopsis "Arbitrary precision"))))
+     (check-synopsis-style pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: synopsis: start with abbreviation
location: /home/nckx/guix/tests/lint.scm:283
source:
+ (test-equal
+   "synopsis: start with abbreviation"
+   '()
+   (let ((pkg (dummy-package
+                "uucp"
+                (synopsis "UUCP implementation")
+                (description "Imagine this is Taylor UUCP."))))
+     (check-synopsis-style pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: synopsis: contains trailing whitespace
location: /home/nckx/guix/tests/lint.scm:291
source:
+ (test-equal
+   "synopsis: contains trailing whitespace"
+   "synopsis contains trailing whitespace"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (synopsis "Whitespace "))))
+       (check-synopsis-style pkg))))
expected-value: "synopsis contains trailing whitespace"
actual-value: "synopsis contains trailing whitespace"
result: PASS

test-name: name: use underscore in package name
location: /home/nckx/guix/tests/lint.scm:298
source:
+ (test-equal
+   "name: use underscore in package name"
+   "name should use hyphens instead of underscores"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "under_score")))
+       (check-name pkg))))
expected-value: "name should use hyphens instead of underscores"
actual-value: "name should use hyphens instead of underscores"
result: PASS

test-name: tests-true: #:tests? must not be set to #t
location: /home/nckx/guix/tests/lint.scm:304
source:
+ (test-equal
+   "tests-true: #:tests? must not be set to #t"
+   "#:tests? must not be explicitly set to #t"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package "x" (arguments '(#:tests? #t)))))
+       (check-tests-true pkg))))
expected-value: "#:tests? must not be explicitly set to #t"
actual-value: "#:tests? must not be explicitly set to #t"
result: PASS

test-name: tests-true: absent #:tests? is acceptable
location: /home/nckx/guix/tests/lint.scm:310
source:
+ (test-equal
+   "tests-true: absent #:tests? is acceptable"
+   '()
+   (let ((pkg (dummy-package "x")))
+     (check-tests-true pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: tests-true: #:tests? #f is acceptable
location: /home/nckx/guix/tests/lint.scm:315
source:
+ (test-equal
+   "tests-true: #:tests? #f is acceptable"
+   '()
+   (let ((pkg (dummy-package "x" (arguments '(#:tests? #f)))))
+     (check-tests-true pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: tests-true: #:tests? #t acceptable when compiling natively
location: /home/nckx/guix/tests/lint.scm:320
source:
+ (test-equal
+   "tests-true: #:tests? #t acceptable when compiling natively"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (arguments
+                  `(#:tests? ,(not (%current-target-system)))))))
+     (check-tests-true pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: inputs: pkg-config is probably a native input
location: /home/nckx/guix/tests/lint.scm:327
source:
+ (test-equal
+   "inputs: pkg-config is probably a native input"
+   "'pkg-config' should probably be a native input"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (inputs `(("pkg-config" ,pkg-config))))))
+       (check-inputs-should-be-native pkg))))
expected-value: "'pkg-config' should probably be a native input"
actual-value: "'pkg-config' should probably be a native input"
result: PASS

test-name: inputs: glib:bin is probably a native input
location: /home/nckx/guix/tests/lint.scm:334
source:
+ (test-equal
+   "inputs: glib:bin is probably a native input"
+   "'glib:bin' should probably be a native input"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (inputs `(("glib" ,glib "bin"))))))
+       (check-inputs-should-be-native pkg))))
expected-value: "'glib:bin' should probably be a native input"
actual-value: "'glib:bin' should probably be a native input"
result: PASS

test-name: inputs: python-setuptools should not be an input at all (input)
location: /home/nckx/guix/tests/lint.scm:341
source:
+ (test-equal
+   "inputs: python-setuptools should not be an input at all (input)"
+   "'python-setuptools' should probably not be an input at all"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (inputs
+                    `(("python-setuptools" ,python-setuptools))))))
+       (check-inputs-should-not-be-an-input-at-all pkg))))
expected-value: "'python-setuptools' should probably not be an input at all"
actual-value: "'python-setuptools' should probably not be an input at all"
result: PASS

test-name: inputs: python-setuptools should not be an input at all (native-input)
location: /home/nckx/guix/tests/lint.scm:350
source:
+ (test-equal
+   "inputs: python-setuptools should not be an input at all (native-input)"
+   "'python-setuptools' should probably not be an input at all"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (native-inputs
+                    `(("python-setuptools" ,python-setuptools))))))
+       (check-inputs-should-not-be-an-input-at-all pkg))))
expected-value: "'python-setuptools' should probably not be an input at all"
actual-value: "'python-setuptools' should probably not be an input at all"
result: PASS

test-name: inputs: python-setuptools should not be an input at all (propagated-input)
location: /home/nckx/guix/tests/lint.scm:360
source:
+ (test-equal
+   "inputs: python-setuptools should not be an input at all (propagated-input)"
+   "'python-setuptools' should probably not be an input at all"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (propagated-inputs
+                    `(("python-setuptools" ,python-setuptools))))))
+       (check-inputs-should-not-be-an-input-at-all pkg))))
expected-value: "'python-setuptools' should probably not be an input at all"
actual-value: "'python-setuptools' should probably not be an input at all"
result: PASS

test-name: explicit #:sh argument to 'wrap-program' is acceptable
location: /home/nckx/guix/tests/lint.scm:369
source:
+ (test-equal
+   "explicit #:sh argument to 'wrap-program' is acceptable"
+   '()
+   (let* ((phases
+            `(modify-phases
+               %standard-phases
+               (add-after
+                 'install
+                 'wrap
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (define catfish
+                     (string-append
+                       (assoc-ref outputs "out")
+                       "/bin/catfish"))
+                   (define hsab
+                     (string-append
+                       (assoc-ref inputs "hsab")
+                       "/bin/hsab"))
+                   (wrap-program
+                     catfish
+                     #:sh
+                     hsab
+                     `("PYTHONPATH" = (,"blabla")))))))
+          (pkg (dummy-package
+                 "x"
+                 (arguments `(#:phases ,phases)))))
+     (check-wrapper-inputs pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: 'check-wrapper-inputs' detects 'wrap-program' without "bash" in inputs
location: /home/nckx/guix/tests/lint.scm:385
source:
+ (test-equal
+   "'check-wrapper-inputs' detects 'wrap-program' without \"bash\" in inputs"
+   "\"bash-minimal\" should be in 'inputs' when 'wrap-program' is used"
+   (let* ((phases
+            `(modify-phases
+               %standard-phases
+               (add-after
+                 'install
+                 'wrap
+                 (lambda _ (wrap-program the-binary bla-bla)))))
+          (pkg (dummy-package
+                 "x"
+                 (arguments `(#:phases ,phases)))))
+     (single-lint-warning-message
+       (check-wrapper-inputs pkg))))
expected-value: "\"bash-minimal\" should be in 'inputs' when 'wrap-program' is used"
actual-value: "\"bash-minimal\" should be in 'inputs' when 'wrap-program' is used"
result: PASS

test-name: 'check-wrapper-inputs' detects 'wrap-qt-program' without "bash" in inputs
location: /home/nckx/guix/tests/lint.scm:396
source:
+ (test-equal
+   "'check-wrapper-inputs' detects 'wrap-qt-program' without \"bash\" in inputs"
+   "\"bash-minimal\" should be in 'inputs' when 'wrap-qt-program' is used"
+   (let* ((phases
+            `(modify-phases
+               %standard-phases
+               (add-after
+                 'install
+                 'qtwrap
+                 (lambda _ (wrap-qt-program the-binary bla-bla)))))
+          (pkg (dummy-package
+                 "x"
+                 (arguments `(#:phases ,phases)))))
+     (single-lint-warning-message
+       (check-wrapper-inputs pkg))))
expected-value: "\"bash-minimal\" should be in 'inputs' when 'wrap-qt-program' is used"
actual-value: "\"bash-minimal\" should be in 'inputs' when 'wrap-qt-program' is used"
result: PASS

test-name: "bash" in 'inputs' satisfies 'check-wrapper-inputs'
location: /home/nckx/guix/tests/lint.scm:407
source:
+ (test-equal
+   "\"bash\" in 'inputs' satisfies 'check-wrapper-inputs'"
+   '()
+   (let* ((phases
+            `(modify-phases
+               %standard-phases
+               (add-after
+                 'install
+                 'wrap
+                 (lambda _ (wrap-program the-binary bla-bla)))))
+          (pkg (dummy-package
+                 "x"
+                 (arguments `(#:phases ,phases))
+                 (inputs `(("bash" ,bash))))))
+     (check-wrapper-inputs pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: "bash-minimal" in 'inputs' satisfies 'check-wrapper-inputs'
location: /home/nckx/guix/tests/lint.scm:418
source:
+ (test-equal
+   "\"bash-minimal\" in 'inputs' satisfies 'check-wrapper-inputs'"
+   '()
+   (let* ((phases
+            `(modify-phases
+               %standard-phases
+               (add-after
+                 'install
+                 'wrap
+                 (lambda _ (wrap-program THE-BINARY bla-bla)))))
+          (pkg (dummy-package
+                 "x"
+                 (arguments `(#:phases ,phases))
+                 (inputs `(("bash-minimal" ,bash-minimal))))))
+     (check-wrapper-inputs pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: 'cut' doesn't hide bad usages of 'wrap-program'
location: /home/nckx/guix/tests/lint.scm:429
source:
+ (test-equal
+   "'cut' doesn't hide bad usages of 'wrap-program'"
+   "\"bash-minimal\" should be in 'inputs' when 'wrap-program' is used"
+   (let* ((phases
+            `(modify-phases
+               %standard-phases
+               (add-after
+                 'install
+                 'wrap-program
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin-dir (string-append out "/bin/"))
+                          (site-dir
+                            (string-append out "/lib/perl5/site_perl/"))
+                          (lib-path (getenv "PERL5LIB")))
+                     (for-each
+                       (cut wrap-program
+                            <>
+                            `("PERL5LIB" ":" prefix (,lib-path ,site-dir)))
+                       (find-files bin-dir)))))))
+          (pkg (dummy-package
+                 "x"
+                 (arguments `(#:phases ,phases)))))
+     (single-lint-warning-message
+       (check-wrapper-inputs pkg))))
expected-value: "\"bash-minimal\" should be in 'inputs' when 'wrap-program' is used"
actual-value: "\"bash-minimal\" should be in 'inputs' when 'wrap-program' is used"
result: PASS

test-name: bogus phase specifications don't crash the linter
location: /home/nckx/guix/tests/lint.scm:447
source:
+ (test-equal
+   "bogus phase specifications don't crash the linter"
+   "invalid phase clause"
+   (let* ((phases
+            `(modify-phases %standard-phases (add-invalid)))
+          (pkg (dummy-package
+                 "x"
+                 (arguments `(#:phases ,phases)))))
+     (single-lint-warning-message
+       (check-wrapper-inputs pkg))))
expected-value: "invalid phase clause"
actual-value: "invalid phase clause"
result: PASS

test-name: file patches: different file name -> warning
location: /home/nckx/guix/tests/lint.scm:455
source:
+ (test-equal
+   "file patches: different file name -> warning"
+   "file names of patches should start with the package name"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (source
+                    (dummy-origin
+                      (patches (list "/path/to/y.patch")))))))
+       (check-patch-file-names pkg))))
expected-value: "file names of patches should start with the package name"
actual-value: "file names of patches should start with the package name"
result: PASS

test-name: file patches: same file name -> no warnings
location: /home/nckx/guix/tests/lint.scm:464
source:
+ (test-equal
+   "file patches: same file name -> no warnings"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (dummy-origin
+                    (patches (list "/path/to/x.patch")))))))
+     (check-patch-file-names pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: <origin> patches: different file name -> warning
location: /home/nckx/guix/tests/lint.scm:472
source:
+ (test-equal
+   "<origin> patches: different file name -> warning"
+   "file names of patches should start with the package name"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (source
+                    (dummy-origin
+                      (patches
+                        (list (dummy-origin (file-name "y.patch")))))))))
+       (check-patch-file-names pkg))))
expected-value: "file names of patches should start with the package name"
actual-value: "file names of patches should start with the package name"
result: PASS

test-name: <origin> patches: same file name -> no warnings
location: /home/nckx/guix/tests/lint.scm:484
source:
+ (test-equal
+   "<origin> patches: same file name -> no warnings"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (dummy-origin
+                    (patches
+                      (list (dummy-origin (file-name "x.patch")))))))))
+     (check-patch-file-names pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: patches: file name too long
location: /home/nckx/guix/tests/lint.scm:495
source:
+ (test-equal
+   "patches: file name too long"
+   (string-append
+     "x-"
+     (make-string 100 #\a)
+     ".patch: file name is too long")
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (source
+                    (dummy-origin
+                      (patches
+                        (list (string-append
+                                "x-"
+                                (make-string 100 #\a)
+                                ".patch"))))))))
+       (check-patch-file-names pkg))))
expected-value: "x-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.patch: file name is too long"
actual-value: "x-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.patch: file name is too long"
result: PASS

test-name: patches: not found
location: /home/nckx/guix/tests/lint.scm:509
source:
+ (test-equal
+   "patches: not found"
+   "this-patch-does-not-exist!: patch not found\n"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (source
+                    (dummy-origin
+                      (patches
+                        (list (search-patch
+                                "this-patch-does-not-exist!"))))))))
+       (check-patch-file-names pkg))))
expected-value: "this-patch-does-not-exist!: patch not found\n"
actual-value: "this-patch-does-not-exist!: patch not found\n"
result: PASS

test-name: patch headers: no warnings
location: /home/nckx/guix/tests/lint.scm:520
source:
+ (test-assert
+   "patch headers: no warnings"
+   (call-with-temporary-directory
+     (lambda (directory)
+       (call-with-output-file
+         (string-append directory "/t.patch")
+         (lambda (port)
+           (display
+             "This is a patch.\n\n--- a\n+++ b\n"
+             port)))
+       (parameterize
+         ((%patch-path (list directory)))
+         (let ((pkg (dummy-package
+                      "x"
+                      (source
+                        (dummy-origin
+                          (patches (search-patches "t.patch")))))))
+           (null? (check-patch-headers pkg)))))))
actual-value: #t
result: PASS

test-name: patch headers: missing comment
location: /home/nckx/guix/tests/lint.scm:534
source:
+ (test-equal
+   "patch headers: missing comment"
+   "t.patch: patch lacks comment and upstream status"
+   (call-with-temporary-directory
+     (lambda (directory)
+       (call-with-output-file
+         (string-append directory "/t.patch")
+         (lambda (port) (display "\n--- a\n+++ b\n" port)))
+       (parameterize
+         ((%patch-path (list directory)))
+         (let ((pkg (dummy-package
+                      "x"
+                      (source
+                        (dummy-origin
+                          (patches (search-patches "t.patch")))))))
+           (single-lint-warning-message
+             (check-patch-headers pkg)))))))
expected-value: "t.patch: patch lacks comment and upstream status"
actual-value: "t.patch: patch lacks comment and upstream status"
result: PASS

test-name: patch headers: empty
location: /home/nckx/guix/tests/lint.scm:549
source:
+ (test-equal
+   "patch headers: empty"
+   "t.patch: empty patch"
+   (call-with-temporary-directory
+     (lambda (directory)
+       (call-with-output-file
+         (string-append directory "/t.patch")
+         (const #t))
+       (parameterize
+         ((%patch-path '()))
+         (let ((pkg (dummy-package
+                      "x"
+                      (source
+                        (dummy-origin
+                          (patches
+                            (list (local-file
+                                    (string-append
+                                      directory
+                                      "/t.patch")))))))))
+           (single-lint-warning-message
+             (check-patch-headers pkg)))))))
expected-value: "t.patch: empty patch"
actual-value: "t.patch: empty patch"
result: PASS

test-name: patch headers: patch not found
location: /home/nckx/guix/tests/lint.scm:565
source:
+ (test-equal
+   "patch headers: patch not found"
+   "does-not-exist.patch: patch not found\n"
+   (parameterize
+     ((%patch-path '()))
+     (let ((pkg (dummy-package
+                  "x"
+                  (source
+                    (dummy-origin
+                      (patches (search-patches "does-not-exist.patch")))))))
+       (single-lint-warning-message
+         (check-patch-headers pkg)))))
expected-value: "does-not-exist.patch: patch not found\n"
actual-value: "does-not-exist.patch: patch not found\n"
result: PASS

test-name: derivation: invalid arguments
location: /home/nckx/guix/tests/lint.scm:574
source:
+ (test-equal
+   "derivation: invalid arguments"
+   "failed to create x86_64-linux derivation: (wrong-type-arg \"map\" \"Wrong type argument: ~S\" (invalid-module) ())"
+   (match (let ((pkg (dummy-package
+                       "x"
+                       (arguments
+                         '(#:imported-modules (invalid-module))))))
+            (check-derivation pkg))
+          (((and (? lint-warning?) first-warning)
+            others
+            ...)
+           (lint-warning-message first-warning))))
expected-value: "failed to create x86_64-linux derivation: (wrong-type-arg \"map\" \"Wrong type argument: ~S\" (invalid-module) ())"
actual-value: "failed to create x86_64-linux derivation: (wrong-type-arg \"map\" \"Wrong type argument: ~S\" (invalid-module) ())"
result: PASS

test-name: profile-collisions: no warnings
location: /home/nckx/guix/tests/lint.scm:583
source:
+ (test-equal
+   "profile-collisions: no warnings"
+   '()
+   (check-profile-collisions (dummy-package "x")))
expected-value: ()
actual-value: ()
result: PASS

test-name: profile-collisions: propagated inputs collide
location: /home/nckx/guix/tests/lint.scm:587
source:
+ (test-equal
+   "profile-collisions: propagated inputs collide"
+   "propagated inputs p0@1 and p0@2 collide"
+   (let* ((p0 (dummy-package "p0" (version "1")))
+          (p0* (dummy-package "p0" (version "2")))
+          (p1 (dummy-package
+                "p1"
+                (propagated-inputs `(("p0" ,p0)))))
+          (p2 (dummy-package
+                "p2"
+                (propagated-inputs `(("p1" ,p1)))))
+          (p3 (dummy-package
+                "p3"
+                (propagated-inputs `(("p0" ,p0*)))))
+          (p4 (dummy-package
+                "p4"
+                (propagated-inputs `(("p2" ,p2) ("p3" ,p3))))))
+     (single-lint-warning-message
+       (check-profile-collisions p4))))
expected-value: "propagated inputs p0@1 and p0@2 collide"
actual-value: "propagated inputs p0@1 and p0@2 collide"
result: PASS

test-name: profile-collisions: propagated inputs collide, store items
location: /home/nckx/guix/tests/lint.scm:599
source:
+ (test-assert
+   "profile-collisions: propagated inputs collide, store items"
+   (string-match-or-error
+     "propagated inputs /[[:graph:]]+-p0-1 and /[[:graph:]]+-p0-1 collide"
+     (let* ((p0 (dummy-package "p0" (version "1")))
+            (p0* (dummy-package
+                   "p0"
+                   (version "1")
+                   (inputs `(("x" ,(dummy-package "x"))))))
+            (p1 (dummy-package
+                  "p1"
+                  (propagated-inputs `(("p0" ,p0)))))
+            (p2 (dummy-package
+                  "p2"
+                  (propagated-inputs `(("p1" ,p1)))))
+            (p3 (dummy-package
+                  "p3"
+                  (propagated-inputs `(("p0" ,p0*)))))
+            (p4 (dummy-package
+                  "p4"
+                  (propagated-inputs `(("p2" ,p2) ("p3" ,p3))))))
+       (single-lint-warning-message
+         (check-profile-collisions p4)))))
actual-value: #("propagated inputs /home/nckx/guix/test-tmp/store/vss3yff0a4ji5hcaq44mfsrwbr34bhr7-p0-1 and /home/nckx/guix/test-tmp/store/ifcf5vzbykssksxqfnqbnw5dlcxhzidn-p0-1 collide" (0 . 167))
result: PASS

test-name: license: invalid license
location: /home/nckx/guix/tests/lint.scm:613
source:
+ (test-equal
+   "license: invalid license"
+   "invalid license field"
+   (single-lint-warning-message
+     (check-license (dummy-package "x" (license #f)))))
expected-value: "invalid license field"
actual-value: "invalid license field"
result: PASS

test-name: home-page: wrong home-page
location: /home/nckx/guix/tests/lint.scm:618
source:
+ (test-equal
+   "home-page: wrong home-page"
+   "invalid value for home page"
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page #f))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "invalid value for home page"
actual-value: "invalid value for home page"
result: PASS

test-name: home-page: invalid URI
location: /home/nckx/guix/tests/lint.scm:626
source:
+ (test-equal
+   "home-page: invalid URI"
+   "invalid home page URL: \"foobar\""
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page "foobar"))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "invalid home page URL: \"foobar\""
actual-value: "invalid home page URL: \"foobar\""
result: PASS

test-name: home-page: host not found
location: /home/nckx/guix/tests/lint.scm:634
source:
+ (test-assert
+   "home-page: host not found"
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page "http://does-not-exist"))))
+     (warning-contains?
+       "domain not found"
+       (check-home-page pkg))))
actual-value: 26
result: PASS

test-name: home-page: Connection refused
location: /home/nckx/guix/tests/lint.scm:642
source:
+ (test-equal
+   "home-page: Connection refused"
+   "URI http://localhost:9999/foo/bar unreachable: Connection refused"
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page (%local-url)))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "URI http://localhost:9999/foo/bar unreachable: Connection refused"
actual-value: "URI http://localhost:9999/foo/bar unreachable: Connection refused"
result: PASS

test-name: home-page: 200
location: /home/nckx/guix/tests/lint.scm:650
source:
+ (test-equal
+   "home-page: 200"
+   '()
+   (with-http-server
+     `((200 ,%long-string))
+     (let ((pkg (package
+                  (inherit (dummy-package "x"))
+                  (home-page (%local-url)))))
+       (check-home-page pkg))))
expected-value: ()
actual-value: ()
result: PASS

test-name: home-page: 200 but short length
location: /home/nckx/guix/tests/lint.scm:659
source:
+ (test-equal
+   "home-page: 200 but short length"
+   (format
+     #f
+     "URI ~a returned suspiciously small file (18 bytes)"
+     (%local-url))
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page (%local-url)))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "URI http://localhost:42147/foo/bar returned suspiciously small file (18 bytes)"
actual-value: "URI http://localhost:42147/foo/bar returned suspiciously small file (18 bytes)"
result: PASS

test-name: home-page: 404
location: /home/nckx/guix/tests/lint.scm:670
source:
+ (test-equal
+   "home-page: 404"
+   (format
+     #f
+     "URI ~a not reachable: 404 (\"Such is life\")"
+     (%local-url))
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page (%local-url)))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "URI http://localhost:46453/foo/bar not reachable: 404 (\"Such is life\")"
actual-value: "URI http://localhost:46453/foo/bar not reachable: 404 (\"Such is life\")"
result: PASS

test-name: home-page: 301, invalid
location: /home/nckx/guix/tests/lint.scm:679
source:
+ (test-equal
+   "home-page: 301, invalid"
+   (format
+     #f
+     "invalid permanent redirect from ~a"
+     (%local-url))
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page (%local-url)))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "invalid permanent redirect from http://localhost:37429/foo/bar"
actual-value: "invalid permanent redirect from http://localhost:37429/foo/bar"
result: PASS

test-name: home-page: 301 -> 200
location: /home/nckx/guix/tests/lint.scm:695
source:
+ (test-equal
+   "home-page: 301 -> 200"
+   (format
+     #f
+     "permanent redirect from ~a to ~a"
+     (%local-url)
+     initial-url)
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page (%local-url)))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "permanent redirect from http://localhost:44073/foo/bar to http://localhost:37051/foo/bar"
actual-value: "permanent redirect from http://localhost:44073/foo/bar to http://localhost:37051/foo/bar"
result: PASS

test-name: home-page: 301 -> 404
location: /home/nckx/guix/tests/lint.scm:712
source:
+ (test-equal
+   "home-page: 301 -> 404"
+   (format
+     #f
+     "URI ~a not reachable: 404 (\"Such is life\")"
+     (%local-url))
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (home-page (%local-url)))))
+     (single-lint-warning-message
+       (check-home-page pkg))))
expected-value: "URI http://localhost:39537/foo/bar not reachable: 404 (\"Such is life\")"
actual-value: "URI http://localhost:39537/foo/bar not reachable: 404 (\"Such is life\")"
result: PASS

test-name: source-file-name
location: /home/nckx/guix/tests/lint.scm:721
source:
+ (test-equal
+   "source-file-name"
+   "the source file name should contain the package name"
+   (let ((pkg (dummy-package
+                "x"
+                (version "3.2.1")
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri "http://www.example.com/3.2.1.tar.gz")
+                    (sha256 %null-sha256))))))
+     (single-lint-warning-message
+       (check-source-file-name pkg))))
expected-value: "the source file name should contain the package name"
actual-value: "the source file name should contain the package name"
result: PASS

test-name: source-file-name: v prefix
location: /home/nckx/guix/tests/lint.scm:733
source:
+ (test-equal
+   "source-file-name: v prefix"
+   "the source file name should contain the package name"
+   (let ((pkg (dummy-package
+                "x"
+                (version "3.2.1")
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri "http://www.example.com/v3.2.1.tar.gz")
+                    (sha256 %null-sha256))))))
+     (single-lint-warning-message
+       (check-source-file-name pkg))))
expected-value: "the source file name should contain the package name"
actual-value: "the source file name should contain the package name"
result: PASS

test-name: source-file-name: bad checkout
location: /home/nckx/guix/tests/lint.scm:745
source:
+ (test-equal
+   "source-file-name: bad checkout"
+   "the source file name should contain the package name"
+   (let ((pkg (dummy-package
+                "x"
+                (version "3.2.1")
+                (source
+                  (origin
+                    (method git-fetch)
+                    (uri (git-reference
+                           (url "http://www.example.com/x.git")
+                           (commit "0")))
+                    (sha256 %null-sha256))))))
+     (single-lint-warning-message
+       (check-source-file-name pkg))))
expected-value: "the source file name should contain the package name"
actual-value: "the source file name should contain the package name"
result: PASS

test-name: source-file-name: good checkout
location: /home/nckx/guix/tests/lint.scm:759
source:
+ (test-equal
+   "source-file-name: good checkout"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (version "3.2.1")
+                (source
+                  (origin
+                    (method git-fetch)
+                    (uri (git-reference
+                           (url "http://git.example.com/x.git")
+                           (commit "0")))
+                    (file-name (string-append "x-" version))
+                    (sha256 %null-sha256))))))
+     (check-source-file-name pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: source-file-name: valid
location: /home/nckx/guix/tests/lint.scm:773
source:
+ (test-equal
+   "source-file-name: valid"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (version "3.2.1")
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri "http://www.example.com/x-3.2.1.tar.gz")
+                    (sha256 %null-sha256))))))
+     (check-source-file-name pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: source-unstable-tarball
location: /home/nckx/guix/tests/lint.scm:784
source:
+ (test-equal
+   "source-unstable-tarball"
+   "the source URI should not be an autogenerated tarball"
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri "https://github.com/example/example/archive/v0.0.tar.gz")
+                    (sha256 %null-sha256))))))
+     (single-lint-warning-message
+       (check-source-unstable-tarball pkg))))
expected-value: "the source URI should not be an autogenerated tarball"
actual-value: "the source URI should not be an autogenerated tarball"
result: PASS

test-name: source-unstable-tarball: source #f
location: /home/nckx/guix/tests/lint.scm:795
source:
+ (test-equal
+   "source-unstable-tarball: source #f"
+   '()
+   (let ((pkg (dummy-package "x" (source #f))))
+     (check-source-unstable-tarball pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: source-unstable-tarball: valid
location: /home/nckx/guix/tests/lint.scm:801
source:
+ (test-equal
+   "source-unstable-tarball: valid"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri "https://github.com/example/example/releases/download/x-0.0/x-0.0.tar.gz")
+                    (sha256 %null-sha256))))))
+     (check-source-unstable-tarball pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: source-unstable-tarball: package named archive
location: /home/nckx/guix/tests/lint.scm:811
source:
+ (test-equal
+   "source-unstable-tarball: package named archive"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri "https://github.com/example/archive/releases/download/x-0.0/x-0.0.tar.gz")
+                    (sha256 %null-sha256))))))
+     (check-source-unstable-tarball pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: source-unstable-tarball: not-github
location: /home/nckx/guix/tests/lint.scm:821
source:
+ (test-equal
+   "source-unstable-tarball: not-github"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri "https://bitbucket.org/archive/example/download/x-0.0.tar.gz")
+                    (sha256 %null-sha256))))))
+     (check-source-unstable-tarball pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: source-unstable-tarball: git-fetch
location: /home/nckx/guix/tests/lint.scm:831
source:
+ (test-equal
+   "source-unstable-tarball: git-fetch"
+   '()
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (origin
+                    (method git-fetch)
+                    (uri (git-reference
+                           (url "https://github.com/archive/example")
+                           (commit "0")))
+                    (sha256 %null-sha256))))))
+     (check-source-unstable-tarball pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: optional-tests: no check phase
location: /home/nckx/guix/tests/lint.scm:852
source:
+ (test-equal
+   "optional-tests: no check phase"
+   '()
+   (let ((pkg (package-with-phase-changes '())))
+     (check-optional-tests pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: optional-tests: check phase respects #:tests?
location: /home/nckx/guix/tests/lint.scm:857
source:
+ (test-equal
+   "optional-tests: check phase respects #:tests?"
+   '()
+   (let ((pkg (package-with-phase-changes
+                '((replace
+                    'check
+                    (lambda* (#:key tests? #:allow-other-keys?)
+                      (when tests? (invoke "./the-test-suite"))))))))
+     (check-optional-tests pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: optional-tests: check phase ignores #:tests?
location: /home/nckx/guix/tests/lint.scm:866
source:
+ (test-equal
+   "optional-tests: check phase ignores #:tests?"
+   "the 'check' phase should respect #:tests?"
+   (let ((pkg (package-with-phase-changes
+                '((replace
+                    'check
+                    (lambda _ (invoke "./the-test-suite")))))))
+     (single-lint-warning-message
+       (check-optional-tests pkg))))
expected-value: "the 'check' phase should respect #:tests?"
actual-value: "the 'check' phase should respect #:tests?"
result: PASS

test-name: optional-tests: do not crash when #:phases is invalid
location: /home/nckx/guix/tests/lint.scm:875
source:
+ (test-equal
+   "optional-tests: do not crash when #:phases is invalid"
+   "incorrect call to ?modify-phases?"
+   (let ((pkg (package-with-phase-changes 'this-is-not-a-list)))
+     (single-lint-warning-message
+       (check-optional-tests pkg))))
expected-value: "incorrect call to ?modify-phases?"
actual-value: "incorrect call to ?modify-phases?"
result: PASS

test-name: optional-tests: allow G-exps (no warning)
location: /home/nckx/guix/tests/lint.scm:881
source:
+ (test-equal
+   "optional-tests: allow G-exps (no warning)"
+   '()
+   (let ((pkg (package-with-phase-changes (gexp ()))))
+     (check-optional-tests pkg)))
expected-value: ()
actual-value: ()
result: PASS

test-name: optional-tests: allow G-exps (warning)
location: /home/nckx/guix/tests/lint.scm:886
source:
+ (test-equal
+   "optional-tests: allow G-exps (warning)"
+   "the 'check' phase should respect #:tests?"
+   (let ((pkg (package-with-phase-changes
+                (gexp ((replace
+                         'check
+                         (lambda _ (invoke "/the-test-suite"))))))))
+     (single-lint-warning-message
+       (check-optional-tests pkg))))
expected-value: "the 'check' phase should respect #:tests?"
actual-value: "the 'check' phase should respect #:tests?"
result: PASS

test-name: optional-tests: complicated 'check' phase
location: /home/nckx/guix/tests/lint.scm:895
source:
+ (test-equal
+   "optional-tests: complicated 'check' phase"
+   "the 'check' phase should respect #:tests?"
+   (let ((pkg (package-with-phase-changes
+                '((replace
+                    'check
+                    (lambda* (#:key inputs tests? #:allow-other-keys)
+                      (let ((something (stuff from inputs or native-inputs)))
+                        (delete-file "dateutil/test/test_utils.py")
+                        (invoke "pytest" "-vv"))))))))
+     (single-lint-warning-message
+       (check-optional-tests pkg))))
expected-value: "the 'check' phase should respect #:tests?"
actual-value: "the 'check' phase should respect #:tests?"
result: PASS

test-name: optional-tests: 'check' phase is not first phase
location: /home/nckx/guix/tests/lint.scm:906
source:
+ (test-equal
+   "optional-tests: 'check' phase is not first phase"
+   "the 'check' phase should respect #:tests?"
+   (let ((pkg (package-with-phase-changes
+                '((add-after
+                    'unpack
+                    (lambda _ (chdir "libtestcase-0.0.0")))
+                  (replace
+                    'check
+                    (lambda _ (invoke "./test-suite")))))))
+     (single-lint-warning-message
+       (check-optional-tests pkg))))
expected-value: "the 'check' phase should respect #:tests?"
actual-value: "the 'check' phase should respect #:tests?"
result: PASS

test-name: source: 200
location: /home/nckx/guix/tests/lint.scm:917
source:
+ (test-equal
+   "source: 200"
+   '()
+   (with-http-server
+     `((200 ,%long-string))
+     (let ((pkg (package
+                  (inherit (dummy-package "x"))
+                  (source
+                    (origin
+                      (method url-fetch)
+                      (uri (%local-url))
+                      (sha256 %null-sha256))))))
+       (check-source pkg))))
expected-value: ()
actual-value: ()
result: PASS

test-name: source: 200 but short length
location: /home/nckx/guix/tests/lint.scm:929
source:
+ (test-equal
+   "source: 200 but short length"
+   (format
+     #f
+     "URI ~a returned suspiciously small file (18 bytes)"
+     (%local-url))
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri (%local-url))
+                    (sha256 %null-sha256))))))
+     (match (check-source pkg)
+            ((first-warning
+               (and (? lint-warning?) second-warning))
+             (lint-warning-message second-warning)))))
expected-value: "URI http://localhost:33369/foo/bar returned suspiciously small file (18 bytes)"
actual-value: "URI http://localhost:33369/foo/bar returned suspiciously small file (18 bytes)"
result: PASS

test-name: source: 404
location: /home/nckx/guix/tests/lint.scm:944
source:
+ (test-equal
+   "source: 404"
+   (format
+     #f
+     "URI ~a not reachable: 404 (\"Such is life\")"
+     (%local-url))
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri (%local-url))
+                    (sha256 %null-sha256))))))
+     (match (check-source pkg)
+            ((first-warning
+               (and (? lint-warning?) second-warning))
+             (lint-warning-message second-warning)))))
expected-value: "URI http://localhost:37731/foo/bar not reachable: 404 (\"Such is life\")"
actual-value: "URI http://localhost:37731/foo/bar not reachable: 404 (\"Such is life\")"
result: PASS

test-name: source: 404 and 200
location: /home/nckx/guix/tests/lint.scm:958
source:
+ (test-equal
+   "source: 404 and 200"
+   '()
+   (with-http-server
+     `((404 ,%long-string))
+     (let ((bad-url (%local-url)))
+       (parameterize
+         ((%http-server-port (+ 1 (%http-server-port))))
+         (with-http-server
+           `((200 ,%long-string))
+           (let ((pkg (package
+                        (inherit (dummy-package "x"))
+                        (source
+                          (origin
+                            (method url-fetch)
+                            (uri (list bad-url (%local-url)))
+                            (sha256 %null-sha256))))))
+             (check-source pkg)))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: source: 301 -> 200
location: /home/nckx/guix/tests/lint.scm:982
source:
+ (test-equal
+   "source: 301 -> 200"
+   (format
+     #f
+     "permanent redirect from ~a to ~a"
+     (%local-url)
+     initial-url)
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri (%local-url))
+                    (sha256 %null-sha256))))))
+     (match (check-source pkg)
+            ((first-warning
+               (and (? lint-warning?) second-warning))
+             (lint-warning-message second-warning)))))
expected-value: "permanent redirect from http://localhost:44741/foo/bar to http://localhost:44923/foo/bar"
actual-value: "permanent redirect from http://localhost:44741/foo/bar to http://localhost:44923/foo/bar"
result: PASS

test-name: source, git-reference: 301 -> 200
location: /home/nckx/guix/tests/lint.scm:1004
source:
+ (test-equal
+   "source, git-reference: 301 -> 200"
+   (format
+     #f
+     "permanent redirect from ~a to ~a"
+     (%local-url)
+     initial-url)
+   (let ((pkg (dummy-package
+                "x"
+                (source
+                  (origin
+                    (method git-fetch)
+                    (uri (git-reference
+                           (url (%local-url))
+                           (commit "v1.0.0")))
+                    (sha256 %null-sha256))))))
+     (single-lint-warning-message (check-source pkg))))
expected-value: "permanent redirect from http://localhost:34819/foo/bar to http://localhost:46079/foo/bar"
actual-value: "permanent redirect from http://localhost:34819/foo/bar to http://localhost:46079/foo/bar"
result: PASS

test-name: source: 301 -> 404
location: /home/nckx/guix/tests/lint.scm:1024
source:
+ (test-equal
+   "source: 301 -> 404"
+   (format
+     #f
+     "URI ~a not reachable: 404 (\"Such is life\")"
+     (%local-url))
+   (let ((pkg (package
+                (inherit (dummy-package "x"))
+                (source
+                  (origin
+                    (method url-fetch)
+                    (uri (%local-url))
+                    (sha256 %null-sha256))))))
+     (match (check-source pkg)
+            ((first-warning
+               (and (? lint-warning?) second-warning))
+             (lint-warning-message second-warning)))))
expected-value: "URI http://localhost:36771/foo/bar not reachable: 404 (\"Such is life\")"
actual-value: "URI http://localhost:36771/foo/bar not reachable: 404 (\"Such is life\")"
result: PASS

test-name: mirror-url
location: /home/nckx/guix/tests/lint.scm:1039
source:
+ (test-equal
+   "mirror-url"
+   '()
+   (let ((source
+           (origin
+             (method url-fetch)
+             (uri "http://example.org/foo/bar.tar.gz")
+             (sha256 %null-sha256))))
+     (check-mirror-url
+       (dummy-package "x" (source source)))))
expected-value: ()
actual-value: ()
result: PASS

test-name: mirror-url: one suggestion
location: /home/nckx/guix/tests/lint.scm:1047
source:
+ (test-equal
+   "mirror-url: one suggestion"
+   "URL should be 'mirror://gnu/foo/foo.tar.gz'"
+   (let ((source
+           (origin
+             (method url-fetch)
+             (uri "http://ftp.gnu.org/pub/gnu/foo/foo.tar.gz")
+             (sha256 %null-sha256))))
+     (single-lint-warning-message
+       (check-mirror-url
+         (dummy-package "x" (source source))))))
expected-value: "URL should be 'mirror://gnu/foo/foo.tar.gz'"
actual-value: "URL should be 'mirror://gnu/foo/foo.tar.gz'"
result: PASS

test-name: github-url
location: /home/nckx/guix/tests/lint.scm:1056
source:
+ (test-equal
+   "github-url"
+   '()
+   (with-http-server
+     `((200 ,%long-string))
+     (check-github-url
+       (dummy-package
+         "x"
+         (source
+           (origin
+             (method url-fetch)
+             (uri (%local-url))
+             (sha256 %null-sha256)))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: github-url: one suggestion
location: /home/nckx/guix/tests/lint.scm:1067
source:
+ (test-equal
+   "github-url: one suggestion"
+   (string-append "URL should be '" github-url "'")
+   (let ((redirect
+           (build-response
+             #:code
+             301
+             #:headers
+             `((location unquote (string->uri github-url))))))
+     (with-http-server
+       `((,redirect ""))
+       (let* ((initial-url (%local-url))
+              (redirect
+                (build-response
+                  #:code
+                  302
+                  #:headers
+                  `((location unquote (string->uri initial-url))))))
+         (parameterize
+           ((%http-server-port 0))
+           (with-http-server
+             `((,redirect ""))
+             (single-lint-warning-message
+               (check-github-url
+                 (dummy-package
+                   "x"
+                   (source
+                     (origin
+                       (method url-fetch)
+                       (uri (%local-url))
+                       (sha256 %null-sha256))))))))))))
expected-value: "URL should be 'https://github.com/foo/bar/bar-1.0.tar.gz'"
actual-value: "URL should be 'https://github.com/foo/bar/bar-1.0.tar.gz'"
result: PASS

test-name: github-url: already the correct github url
location: /home/nckx/guix/tests/lint.scm:1090
source:
+ (test-equal
+   "github-url: already the correct github url"
+   '()
+   (check-github-url
+     (dummy-package
+       "x"
+       (source
+         (origin
+           (method url-fetch)
+           (uri github-url)
+           (sha256 %null-sha256))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: cve
location: /home/nckx/guix/tests/lint.scm:1099
source:
+ (test-equal
+   "cve"
+   '()
+   (mock ((guix lint) package-vulnerabilities (const '()))
+         (check-vulnerabilities (dummy-package "x"))))
expected-value: ()
actual-value: ()
result: PASS

test-name: cve: one vulnerability
location: /home/nckx/guix/tests/lint.scm:1104
source:
+ (test-equal
+   "cve: one vulnerability"
+   "probably vulnerable to CVE-2015-1234"
+   (let ((dummy-vulnerabilities
+           (lambda (package)
+             (list (make-struct/no-tail
+                     (@@ (guix cve) <vulnerability>)
+                     "CVE-2015-1234"
+                     (list (cons (package-name package)
+                                 (package-version package))))))))
+     (single-lint-warning-message
+       (check-vulnerabilities
+         (dummy-package "pi" (version "3.14"))
+         dummy-vulnerabilities))))
expected-value: "probably vulnerable to CVE-2015-1234"
actual-value: "probably vulnerable to CVE-2015-1234"
result: PASS

test-name: cve: one patched vulnerability
location: /home/nckx/guix/tests/lint.scm:1117
source:
+ (test-equal
+   "cve: one patched vulnerability"
+   '()
+   (mock ((guix lint)
+          package-vulnerabilities
+          (lambda (package)
+            (list (make-struct/no-tail
+                    (@@ (guix cve) <vulnerability>)
+                    "CVE-2015-1234"
+                    (list (cons (package-name package)
+                                (package-version package)))))))
+         (check-vulnerabilities
+           (dummy-package
+             "pi"
+             (version "3.14")
+             (source
+               (dummy-origin
+                 (patches (list "/a/b/pi-CVE-2015-1234.patch"))))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: cve: known safe from vulnerability
location: /home/nckx/guix/tests/lint.scm:1133
source:
+ (test-equal
+   "cve: known safe from vulnerability"
+   '()
+   (mock ((guix lint)
+          package-vulnerabilities
+          (lambda (package)
+            (list (make-struct/no-tail
+                    (@@ (guix cve) <vulnerability>)
+                    "CVE-2015-1234"
+                    (list (cons (package-name package)
+                                (package-version package)))))))
+         (check-vulnerabilities
+           (dummy-package
+             "pi"
+             (version "3.14")
+             (properties `((lint-hidden-cve "CVE-2015-1234")))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: cve: vulnerability fixed in replacement version
location: /home/nckx/guix/tests/lint.scm:1146
source:
+ (test-equal
+   "cve: vulnerability fixed in replacement version"
+   '()
+   (mock ((guix lint)
+          package-vulnerabilities
+          (lambda (package)
+            (match (package-version package)
+                   ("0"
+                    (list (make-struct/no-tail
+                            (@@ (guix cve) <vulnerability>)
+                            "CVE-2015-1234"
+                            (list (cons (package-name package)
+                                        (package-version package))))))
+                   ("1" '()))))
+         (check-vulnerabilities
+           (dummy-package
+             "foo"
+             (version "0")
+             (replacement (dummy-package "foo" (version "1")))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: cve: patched vulnerability in replacement
location: /home/nckx/guix/tests/lint.scm:1163
source:
+ (test-equal
+   "cve: patched vulnerability in replacement"
+   '()
+   (mock ((guix lint)
+          package-vulnerabilities
+          (lambda (package)
+            (list (make-struct/no-tail
+                    (@@ (guix cve) <vulnerability>)
+                    "CVE-2015-1234"
+                    (list (cons (package-name package)
+                                (package-version package)))))))
+         (check-vulnerabilities
+           (dummy-package
+             "pi"
+             (version "3.14")
+             (source (dummy-origin))
+             (replacement
+               (dummy-package
+                 "pi"
+                 (version "3.14")
+                 (source
+                   (dummy-origin
+                     (patches (list "/a/b/pi-CVE-2015-1234.patch"))))))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: formatting: lonely parentheses
location: /home/nckx/guix/tests/lint.scm:1181
source:
+ (test-equal
+   "formatting: lonely parentheses"
+   "parentheses feel lonely, move to the previous or next line"
+   (single-lint-warning-message
+     (check-formatting
+       (dummy-package "ugly as hell!"))))
expected-value: "parentheses feel lonely, move to the previous or next line"
actual-value: "parentheses feel lonely, move to the previous or next line"
result: PASS

test-name: formatting: tabulation
location: /home/nckx/guix/tests/lint.scm:1189
source:
+ (test-assert
+   "formatting: tabulation"
+   (string-match-or-error
+     "tabulation on line [0-9]+, column [0-9]+"
+     (single-lint-warning-message
+       (check-formatting
+         (dummy-package "leave the tab here:\t")))))
actual-value: #("tabulation on line 1193, column 57" (0 . 34))
result: PASS

test-name: formatting: trailing white space
location: /home/nckx/guix/tests/lint.scm:1195
source:
+ (test-assert
+   "formatting: trailing white space"
+   (string-match-or-error
+     "trailing white space .*"
+     (single-lint-warning-message
+       (check-formatting (dummy-package "x")))))
actual-value: #("trailing white space on line 1200" (0 . 33))
result: PASS

test-name: formatting: long line
location: /home/nckx/guix/tests/lint.scm:1202
source:
+ (test-assert
+   "formatting: long line"
+   (string-match-or-error
+     "line [0-9]+ is way too long \\([0-9]+ characters\\)"
+     (single-lint-warning-message
+       (check-formatting (dummy-package "x")))))
actual-value: #("line 1206 is way too long (118 characters)" (0 . 42))
result: PASS

test-name: formatting: alright
location: /home/nckx/guix/tests/lint.scm:1209
source:
+ (test-equal
+   "formatting: alright"
+   '()
+   (check-formatting (dummy-package "x")))
expected-value: ()
actual-value: ()
result: PASS

test-name: archival: missing content
location: /home/nckx/guix/tests/lint.scm:1213
source:
+ (test-assert
+   "archival: missing content"
+   (let* ((origin
+            (origin
+              (method url-fetch)
+              (uri "http://example.org/foo.tgz")
+              (sha256 (make-bytevector 32))))
+          (warnings
+            (with-http-server
+              '((404 "Not archived.")
+                (404 "Not in Disarchive database."))
+              (parameterize
+                ((%swh-base-url (%local-url)))
+                (mock ((guix download)
+                       %disarchive-mirrors
+                       (list (%local-url)))
+                      (check-archival
+                        (dummy-package "x" (source origin))))))))
+     (warning-contains? "not archived" warnings)))
actual-value: 7
result: PASS

test-name: archival: content available
location: /home/nckx/guix/tests/lint.scm:1227
source:
+ (test-equal
+   "archival: content available"
+   '()
+   (let* ((origin
+            (origin
+              (method url-fetch)
+              (uri "http://example.org/foo.tgz")
+              (sha256 (make-bytevector 32))))
+          (content
+            "{ \"checksums\": {}, \"data_url\": \"xyz\",\n                      \"length\": 42 }"))
+     (with-http-server
+       `((200 ,content))
+       (parameterize
+         ((%swh-base-url (%local-url)))
+         (check-archival
+           (dummy-package "x" (source origin)))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: archival: content unavailable but disarchive available
location: /home/nckx/guix/tests/lint.scm:1240
source:
+ (test-equal
+   "archival: content unavailable but disarchive available"
+   '()
+   (let* ((origin
+            (origin
+              (method url-fetch)
+              (uri "http://example.org/foo.tgz")
+              (sha256 (make-bytevector 32))))
+          (disarchive
+            (object->string
+              '(disarchive
+                 (version 0)
+                 ...
+                 "swh:1:dir:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")))
+          (directory
+            "[ { \"checksums\": {},\n                         \"dir_id\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n                         \"type\": \"file\",\n                         \"name\": \"README\"\n                         \"length\": 42 } ]"))
+     (with-http-server
+       `((404 "") (200 ,disarchive) (200 ,directory))
+       (mock ((guix download)
+              %disarchive-mirrors
+              (list (%local-url)))
+             (parameterize
+               ((%swh-base-url (%local-url)))
+               (check-archival
+                 (dummy-package "x" (source origin))))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: archival: missing revision
location: /home/nckx/guix/tests/lint.scm:1263
source:
+ (test-assert
+   "archival: missing revision"
+   (let* ((origin
+            (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "http://example.org/foo.git")
+                     (commit
+                       "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")))
+              (sha256 (make-bytevector 32))))
+          (save "{ \"origin_url\": \"http://example.org/foo.git\",\n                      \"save_request_date\": \"2014-11-17T22:09:38+01:00\",\n                      \"save_request_status\": \"accepted\",\n                      \"save_task_status\": \"scheduled\" }")
+          (warnings
+            (with-http-server
+              `((404 "No revision.")
+                (404 "No origin.")
+                (200 ,save))
+              (parameterize
+                ((%swh-base-url (%local-url)))
+                (check-archival
+                  (dummy-package "x" (source origin)))))))
+     (warning-contains? "scheduled" warnings)))
actual-value: 0
result: PASS

test-name: archival: revision available
location: /home/nckx/guix/tests/lint.scm:1282
source:
+ (test-equal
+   "archival: revision available"
+   '()
+   (let* ((origin
+            (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "http://example.org/foo.git")
+                     (commit
+                       "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")))
+              (sha256 (make-bytevector 32))))
+          (revision
+            "{ \"author\": {}, \"parents\": [],\n                      \"date\": \"2014-11-17T22:09:38+01:00\" }"))
+     (with-http-server
+       `((200 ,revision))
+       (parameterize
+         ((%swh-base-url (%local-url)))
+         (check-archival
+           (dummy-package "x" (source origin)))))))
expected-value: ()
actual-value: ()
result: PASS

test-name: archival: rate limit reached
location: /home/nckx/guix/tests/lint.scm:1297
source:
+ (test-assert
+   "archival: rate limit reached"
+   (let* ((origin
+            (origin
+              (method url-fetch)
+              (uri "http://example.org/foo.tgz")
+              (sha256 (make-bytevector 32))))
+          (too-many
+            (build-response
+              #:code
+              429
+              #:reason-phrase
+              "Too many requests"
+              #:headers
+              '((x-ratelimit-remaining . "0")
+                (x-ratelimit-reset . "3000000000"))))
+          (warnings
+            (with-http-server
+              `((,too-many "Rate limit reached."))
+              (parameterize
+                ((%swh-base-url (%local-url)))
+                (append-map
+                  (lambda (name)
+                    (check-archival
+                      (dummy-package name (source origin))))
+                  '("x" "y" "z"))))))
+     (string-contains
+       (single-lint-warning-message warnings)
+       "rate limit reached")))
actual-value: 18
result: PASS

test-name: haskell-stackage
location: /home/nckx/guix/tests/lint.scm:1318
source:
+ (test-assert
+   "haskell-stackage"
+   (let* ((stackage
+            (string-append
+              "{ \"packages\": [{"
+              "    \"name\":\"x\","
+              "    \"version\":\"1.0\" }]}"))
+          (packages
+            (map (lambda (version)
+                   (dummy-package
+                     (string-append "ghc-x")
+                     (version version)
+                     (source
+                       (dummy-origin
+                         (method url-fetch)
+                         (uri (string-append
+                                "https://hackage.haskell.org/package/"
+                                "x-"
+                                version
+                                "/x-"
+                                version
+                                ".tar.gz"))))))
+                 '("0.9" "1.0" "2.0")))
+          (warnings
+            (pk (with-http-server
+                  `((200 ,stackage)
+                    (200 "name: x\nversion: 1.0\n")
+                    (200 "name: x\nversion: 1.0\n")
+                    (200 "name: x\nversion: 1.0\n"))
+                  (parameterize
+                    ((%hackage-url (%local-url))
+                     (%stackage-url (%local-url)))
+                    (append-map check-haskell-stackage packages))))))
+     (match warnings
+            (((? lint-warning? warning))
+             (and (string=?
+                    (package-version (lint-warning-package warning))
+                    "2.0")
+                  (string-contains
+                    (lint-warning-message warning)
+                    "ahead of Stackage LTS version"))))))
actual-value: #f
actual-error:
+ (out-of-range
+   "list-ref"
+   "Argument ~A out of range: ~S"
+   (2 2)
+   (2))
result: FAIL

fetching CVE database for 2021...
fetching CVE database for 2020...
fetching CVE database for 2019...
fetching CVE database for 2018...


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#50871: Stackage importer change breaks tests/lint, build
  2021-09-28 16:22 bug#50871: Stackage importer change breaks tests/lint, build Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2021-09-28 18:39 ` Xinglu Chen
  2021-09-28 20:29   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 1 reply; 3+ messages in thread
From: Xinglu Chen @ 2021-09-28 18:39 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice, 50871


[-- Attachment #1.1: Type: text/plain, Size: 329 bytes --]

On Tue, Sep 28 2021, Tobias Geerinckx-Rice via Bug reports for GNU Guix wrote:

> Guix,
>
> Guix doesn't currently build because of a ‘lint’ test failure (log 
> attached).  Reverting commit 
> 9c5e5ca1c0de56a0d5b2b924de10548172095b58 makes it pass.

Thanks for catching this!  The attached patch should fix this.


[-- Attachment #1.2: 0001-test-lint-Fix-haskell-stackage-test.patch --]
[-- Type: text/x-patch, Size: 3510 bytes --]

From 45b002a1a39adaf76ca0ab6ca2c1dd95eb26da30 Mon Sep 17 00:00:00 2001
Message-Id: <45b002a1a39adaf76ca0ab6ca2c1dd95eb26da30.1632854267.git.public@yoctocell.xyz>
From: Xinglu Chen <public@yoctocell.xyz>
Date: Tue, 28 Sep 2021 20:34:25 +0200
Subject: [PATCH] =?UTF-8?q?test:=20lint:=20Fix=20=E2=80=98haskell-stackage?=
 =?UTF-8?q?=E2=80=99=20test.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is a follow-up to commit 9c5e5ca1c0de56a0d5b2b924de10548172095b58.

The previous package was called “ghc-x” which is not available on Stackage,
instead change it to “ghc-pandoc” which does exist, and adjust its version.

* tests/lint.scm ("haskell-stackage"): Add additional metadata for the
  package; change package name to “ghc-pandoc”; and change to version to
  “100.0”.

Reported-by: Tobias Geerinckx-Rice <me@tobias.gr>
---
 tests/lint.scm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tests/lint.scm b/tests/lint.scm
index 0f51b9ef79..e96265a55a 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1317,29 +1317,30 @@ (define (package-with-phase-changes changes)
 
 (test-assert "haskell-stackage"
   (let* ((stackage (string-append "{ \"packages\": [{"
-                                  "    \"name\":\"x\","
+                                  "    \"name\":\"pandoc\","
+                                  "    \"synopsis\":\"synopsis\","
                                   "    \"version\":\"1.0\" }]}"))
          (packages (map (lambda (version)
                           (dummy-package
-                           (string-append "ghc-x")
+                           "ghc-pandoc"
                            (version version)
                            (source
                             (dummy-origin
                              (method url-fetch)
                              (uri (string-append
                                    "https://hackage.haskell.org/package/"
-                                   "x-" version "/x-" version ".tar.gz"))))))
-                        '("0.9" "1.0" "2.0")))
+                                   "pandoc-" version "/pandoc-" version ".tar.gz"))))))
+                        '("0.9" "1.0" "100.0")))
          (warnings (pk (with-http-server `((200 ,stackage) ; memoized
-                                           (200 "name: x\nversion: 1.0\n")
-                                           (200 "name: x\nversion: 1.0\n")
-                                           (200 "name: x\nversion: 1.0\n"))
+                                           (200 "name: pandoc\nversion: 1.0\n")
+                                           (200 "name: pandoc\nversion: 1.0\n")
+                                           (200 "name: pandoc\nversion: 1.0\n"))
                          (parameterize ((%hackage-url (%local-url))
                                         (%stackage-url (%local-url)))
                            (append-map check-haskell-stackage packages))))))
     (match warnings
       (((? lint-warning? warning))
-       (and (string=? (package-version (lint-warning-package warning)) "2.0")
+       (and (string=? (package-version (lint-warning-package warning)) "100.0")
             (string-contains (lint-warning-message warning)
                              "ahead of Stackage LTS version"))))))
 

base-commit: 5edfa6d15e5bb92609ecff7e37e3985eced1dd4d
-- 
2.33.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#50871: Stackage importer change breaks tests/lint, build
  2021-09-28 18:39 ` Xinglu Chen
@ 2021-09-28 20:29   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 0 replies; 3+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-09-28 20:29 UTC (permalink / raw)
  To: Xinglu Chen; +Cc: 50871-done

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

Xinglu,

Xinglu Chen 写道:
> On Tue, Sep 28 2021, Tobias Geerinckx-Rice via Bug reports for 
> GNU Guix wrote:
>
>> Guix,

Oops, sorry for forgetting to address you…

>> Guix doesn't currently build because of a ‘lint’ test failure 
>> (log 
>> attached).  Reverting commit 
>> 9c5e5ca1c0de56a0d5b2b924de10548172095b58 makes it pass.
>
> Thanks for catching this!  The attached patch should fix this.

It did!  Thanks for the prompt fix, which I've now pushed as 
50d24214191abefc6b8f6c881f9a91c1f818a650.

…aand closing,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-28 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-28 16:22 bug#50871: Stackage importer change breaks tests/lint, build Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-09-28 18:39 ` Xinglu Chen
2021-09-28 20:29   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix

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