Commit Graph

5881 Commits

Author SHA1 Message Date
Maxim Cournoyer
15fd870c3f
Revert "build-system/qt: Wrappers set 'QTWEBENGINEPROCESS_PATH' if needed."
This reverts commit 06eb21856f.  It will need to
be refactored to fit on top of 2214b7b78d.
2021-07-02 16:50:09 -04:00
Maxim Cournoyer
3a94998f5e
Revert "build-system/qt: Fix wrapping with QTWEBENGINEPROCESS_PATH."
This reverts commit fed28a9632.  It will need to
be refactored to fit on top of 2214b7b78d.
2021-07-02 16:50:09 -04:00
Maxime Devos
5532371a3a
lint: Verify if #:tests? is respected in the 'check' phase.
There have been a few patches to the mailing list lately
not respecting this, and this linter detects 630 package
definitions that could be modified to support the --without-tests
package transformation.

* guix/lint.scm
  (check-optional-tests): New linter.
  (%local-checkers)[optional-tests]: Add it.
* tests/lint.scm
  (package-with-phase-changes): New procedure.
  ("optional-tests: no check phase")
  ("optional-tests: check hase respects #:tests?")
  ("optional-tests: check phase ignores #:tests?")
  ("optional-tests: do not crash when #:phases is invalid")
  ("optional-tests: allow G-exps (no warning)")
  ("optional-tests: allow G-exps (warning)")
  ("optional-tests: complicated 'check' phase")
  ("optional-tests: 'check' phase is not first phase"): New tests.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-30 13:53:00 +02:00
Maxime Devos
d9e0ae07db
guix: gexp: Define gexp->approximate-sexp.
It will be used in the 'optional-tests' linter.

* guix/gexp.scm (gexp->approximate-sexp): New procedure.
* tests/gexp.scm
  ("no references", "unquoted gexp", "unquoted gexp (native)")
  ("spliced gexp", "unspliced gexp, approximated")
  ("unquoted gexp, approximated"): Test it.
* doc/gexp.scm ("G-Expressions"): Document it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-30 13:53:00 +02:00
Maxim Cournoyer
82daab4281
pack: Add support for the deb format.
* .dir-locals.el (scheme-mode)[gexp->derivation]: Define indentation rule.
* guix/scripts/pack.scm (debian-archive): New procedure.
(%formats): Register the new deb format.
(show-formats): Add it to the usage string.
* tests/pack.scm (%ar-bootstrap): New variable.
(deb archive with symlinks): New test.
* doc/guix.texi (Invoking guix pack): Document it.
* NEWS: Add news entry.
2021-06-29 14:53:21 -04:00
Maxim Cournoyer
4f3bdc8f21
pack: Prevent duplicate files in tar archives.
Tar translate duplicate files in the archive into hard links.  These can cause
problems, as not every tool support them; for example dpkg doesn't.

* gnu/system/file-systems.scm (reduce-directories): New procedure.
(file-prefix?): Lift the restriction on file prefix.  The procedure can be
useful for comparing relative file names.  Adjust doc.
(file-name-depth): New procedure, extracted from ...
(btrfs-store-subvolume-file-name): ... here.
* guix/scripts/pack.scm (self-contained-tarball/builder): Use
reduce-directories.
* tests/file-systems.scm ("reduce-directories"): New test.
2021-06-29 14:53:21 -04:00
Maxim Cournoyer
6b0e55cde9
pack: Improve naming of the packs store file names.
Instead of just naming them by their pack type, add information from the
package(s) they contain to make it easier to differentiate them.

* guix/scripts/pack.scm (define-with-source): New macro.
(manifest->friendly-name): Extract procedure from ...
(docker-image): ... here, now defined via the above macro.  Adjust REPOSITORY
argument value accordingly.
(guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME.
2021-06-29 14:53:21 -04:00
Maxim Cournoyer
f72aa3834b
pack: Fix typo.
* guix/scripts/pack.scm (self-contained-tarball/builder): Fix typo.
2021-06-29 14:53:21 -04:00
Maxim Cournoyer
7708c0b5e3
pack: Factorize base tar options.
* guix/docker.scm (%tar-determinism-options): Move to a new module and rename
to `tar-base-options'.  Adjust references accordingly.
* guix/build/pack.scm: New file.
* Makefile.am (MODULES): Register it.
* guix/scripts/pack.scm (self-contained-tarball/builder): Use it.
2021-06-29 14:53:21 -04:00
Maxim Cournoyer
91e8372838
pack: Extract builder code from self-contained-tarball.
This is made to allow reusing it for the debian-archive pack format, added in
a subsequent commit.

* guix/scripts/pack.scm (self-contained-tarball/builder): New procedure,
containing the build code extracted from self-contained-tarball.
(self-contained-tarball): Use the above procedure.
2021-06-29 14:53:20 -04:00
Maxime Devos
5ef96ecaae
weather: Handle zero requested store items gracefully.
This can happen if the weather information of a package
is requested for an unsupported system.  For example,
try "guix weather icecat --system=aarch64-linux".

* guix/scripts/weather.scm
  (report-server-coverage): Do not divide by zero when zero
  store items are requested from a server.

Fixes: <https://issues.guix.gnu.org/49263>
Reported-By: Jack Hill <jackhill@jackhill.us>
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-29 20:11:56 +02:00
Ludovic Courtès
05528dcd48
Revert "guix build: Autoload (gnu packages)."
This reverts commit fd62b4cf88, which
would lead 'GUIX_PACKAGE_PATH' to be ignored for instance when using
'guix build -f file.scm', as shown by 'tests/guix-build.sh'.
2021-06-29 00:10:54 +02:00
Ludovic Courtès
fd62b4cf88
guix build: Autoload (gnu packages).
* guix/scripts/build.scm: Autoload (gnu packages).
2021-06-29 00:00:14 +02:00
Ludovic Courtès
f386a993ef
pull: Use SRFI-71 instead of SRFI-11.
* guix/scripts/pull.scm (display-new/upgraded-packages): Use SRFI-71 'let'.
2021-06-29 00:00:14 +02:00
Ludovic Courtès
0ba4f0caa4
pull: Autoload (gnu ...) modules.
This reduces startup time for 'guix pull --help' and similar.

* guix/scripts/pull.scm: Autoload (gnu ...) modules.
2021-06-29 00:00:13 +02:00
Ludovic Courtès
ab37731a8d
ui: Have 'guix help' stat less.
This reduces the number of syscalls for:

  env -i $(type -P strace) -c $(type -P guix) help

from 4.3K to 2.2K, thereby reducing startup time.

Reported by Julien Lepiller.

* guix/ui.scm (run-guix-command): Move %FILE-PORT-NAME-CANONICALIZATION
to...
(run-guix): ... here.
2021-06-29 00:00:13 +02:00
Leo Prikler
0f2a17de06
guix: Delete duplicates from emacs-load-path.
It has been reported in IRC, that directories may show up multiple times in
subdirs.el, probably a result of propagation.  This can for instance be seen
by ‘guix environment --ad-hoc emacs emacs-guix’, which will generate multiple
references to dash.  With this patch only one reference per package is
generated.

* guix/profiles.scm (emacs-subdirs): wrap subdirs added to
‘normal-top-level-add-to-load-path’ in ‘delete-duplictes’.
2021-06-28 21:59:02 +02:00
Sarah Morgensen via Guix-patches via
9d9152425e
import: go: Fix match-error in 'go-package-description'
* guix/import/go.scm (go-package-description): Make sure description* is
always a list, so the result is properly matched.

Signed-off-by: Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
2021-06-28 08:52:15 +02:00
Ludovic Courtès
b36267b1d9
download: 'tls-wrap' retries handshake upon non-fatal errors.
Fixes <https://bugs.gnu.org/49223>.
Reported by Domagoj Stolfa <ds815@gmx.com>.

* guix/build/download.scm (tls-wrap): Retry up to 5 times when
'handshake' throws a non-fatal error.
2021-06-25 23:44:15 +02:00
Ludovic Courtès
7fe195f3b7
guix substitute: Adjust comment about GnuTLS bug.
* guix/scripts/substitute.scm (call-with-cached-connection): Adjust
comment.
2021-06-25 23:44:15 +02:00
Philip Munksgaard
dfac3e643a
import: hackage: Support "common" field and imports
Fixes <https://issues.guix.gnu.org/48701>.

* guix/import/cabal.scm (make-cabal-parser): Modify.
(is-common): New variable.
(lex-common): New procedure.
(is-id): Modify.
(eval-cabal): Modify.
* tests/hackage.scm ("hackage->guix-package test cabal import") New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-25 15:12:05 +02:00
Ludovic Courtès
7916201c4d
reconfigure: Use 'formatted-message'.
* guix/scripts/system/reconfigure.scm (ensure-forward-reconfigure): Use
'formatted-message'.
* guix/scripts/deploy.scm (deploy-machine*): Handle it.
2021-06-25 15:12:05 +02:00
Ludovic Courtès
1b4931555b
deploy: Leave on hard error.
Previously, the error message would be displayed, followed by a
backtrace ending in &non-continuable.

* guix/scripts/deploy.scm (deploy-machine*): Call 'leave' rather than
'report-error' when C is a &message.
2021-06-25 15:12:05 +02:00
Sergey Trofimov
d3e8890613
gnu: Add ausweisapp2.
* gnu/packages/security-token.scm (ausweisapp2): New variable.
* guix/licenses.scm (eupl1.2): New variable.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-06-24 23:43:05 +02:00
Ludovic Courtès
8a81ae61c1
lint: 'github-url' checker gracefully handles networking errors.
Fixes <https://bugs.gnu.org/49114>.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.

* guix/lint.scm (call-with-networking-fail-safe, with-networking-fail-safe):
Move higher in the file.
* guix/lint.scm (check-github-url): Wrap call to
'follow-redirects-to-github' in 'with-networking-fail-safe'.
2021-06-24 23:40:48 +02:00
Ludovic Courtès
468a5f8676
lint: 'with-networking-fail-safe' handles 'gnutls-error' exceptions.
* guix/lint.scm (call-with-networking-fail-safe): Add clause for 'gnutls-error'.
2021-06-24 23:40:48 +02:00
Lars-Dominik Braun
9c93573d15
build: Make outputs of node-build-system reproducible.
package.json records two hashes of package.tgz, which change for each
build, resulting in non-reproducible builds.

* guix/build/node-build-system.scm (repack): Add reproducibility options
to tar command.
2021-06-24 14:10:29 +02:00
Andrew Tropin
1f3d7b4534
gexp: 'mixed-text-file' UTF-8-encodes its output.
* guix/gexp.scm (mixed-text-file)[build]: Call 'set-port-encoding!'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-23 23:35:28 +02:00
Ludovic Courtès
b9a95420ab
profiles: Build union of inputs in the right order.
Fixes <https://bugs.gnu.org/49102>.
Reported by Mathieu Othacehe <othacehe@gnu.org>
and Tobias Geerinckx-Rice <me@tobias.gr>.

Fixes a regression introduced in
8cef92d063, whereby in case of file
collisions, the "wrong" one would take precedence.

* guix/build/profiles.scm (manifest-sexp->inputs+search-paths): Perform
a breadth-first traversal.  Reverse INPUTS and SEARCH-PATHS in the base
case.
* tests/profiles.scm ("profile-derivation, ordering & collisions"):
New test.
2021-06-22 17:55:05 +02:00
Julien Lepiller
7f902d368d
guix: java-utils: Look for actual jar files.
* guix/build/java-utils.scm (install-from-pom): Fix `find-files` to look
only for jar files.
2021-06-22 13:10:36 +02:00
Julien Lepiller
cc09453862
guix: maven: Use a temporary file to fix pom files.
* guix/build/maven/pom.scm (fix-pom-dependencies): Actually use the
temporary file that was created.
2021-06-22 13:10:32 +02:00
Julien Lepiller
5bb3395c42
guix: maven: Look in local packages when searching for package version.
* guix/build/maven/pom.scm (fix-pom-dependencies): Also look at local
packages when looking for a package version.
2021-06-22 13:10:30 +02:00
Julien Lepiller
0db1393b73
guix: maven: Support fixing modules.
* guix/build/maven/pom.scm (fix-pom-dependencies): Support fixing
modules that do not exist.
* guix/build/maven-build-system.scm (fix-pom): Fix modules.
2021-06-22 13:10:28 +02:00
Julien Lepiller
9711970c99
guix: maven: Support fixing extensions.
* guix/build/maven/pom.scm (fix-pom-dependencies): Add support for fixing
extension versions.
2021-06-22 13:10:27 +02:00
Julien Lepiller
6ec2109ab6
guix: maven: Simplify finding local packages and modules.
* guix/build/maven-build-system (fix-pom): Fix a single pom file without
recursing
(fix-pom-files): Find local packages and all submodules, and fix them
all at once.
(add-local-package): Move to...
* guix/build/maven/pom.scm (add-local-package): ...here.
(pom-and-submodules, pom-local-packages): New procedures.
2021-06-22 13:10:24 +02:00
Julien Lepiller
573b43c116
guix: maven: Simplify finding version and group information.
* guix/build/maven/pom.scm (pom-version, pom-groupid): Do not use inputs
and local packages information anymore. Adapt file to new arguments.
* guix/build/maven-build-system.scm: Adapt to new arguments.
* guix/build/java-utils.scm: Adapt to new arguments.
2021-06-22 13:09:57 +02:00
Julien Lepiller
4c98db94b0
guix: java-utils: Factorize pom.xml generation.
* guix/build/java-utils.scm (generate-pom.xml): New procedure.
* gnu/packages/maven.scm (java-surefire-junit4): Use it.
* gnu/packages/java.scm (java-qdox, java-jsr250, java-jsr305)
(java-aopalliance, java-jboss-el-api-spec)
(java-jboss-interceptors-api-spec): Use it.
(java-qdox-M9): Ensure the generated pom file has the correct version.
2021-06-22 13:09:41 +02:00
Tobias Geerinckx-Rice
fe255fb8bc
import: egg: Edit egg->guix-package docstring.
* guix/import/egg.scm (egg->guix-package): Edit docstring.
2021-06-21 18:27:19 +02:00
Brice Waegeneire
3aabe51e8c
import: launchpad: Fix typo.
* guix/import/launchpad.scm (latest-release): Rename 'origin-github-uri'
to 'origin-launchpad-uri'.
2021-06-19 22:21:47 +02:00
Matthew James Kraai
9171079e51
import: launchpad: Use repository to retrieve releases.
* guix/import/launchpad.scm (latest-released-version): Use repository instead
of package name.
(latest-release): Pass repository to latest-released-version.

Signed-off-by: Brice Waegeneire <brice@waegenei.re>
2021-06-19 22:20:08 +02:00
Ludovic Courtès
01f5795578
profiles: Add "XAUTHORITY" to the precious variables.
Suggested by Maxime Devos <maximedevos@telenet.be>.

* guix/profiles.scm (%precious-variables): Add "XAUTHORITY".
2021-06-18 14:18:07 +02:00
Ludovic Courtès
ee61777a32
profiles: Add 'load-profile'.
* guix/profiles.scm (%precious-variables): New variable.
(purify-environment, load-profile): New procedures.
* guix/scripts/environment.scm (%precious-variables)
(purify-environment, create-environment): Remove.
(launch-environment): Call 'load-profile' instead of 'create-environment'.
* tests/profiles.scm ("load-profile"): New test.
2021-06-18 14:18:07 +02:00
Ludovic Courtès
c5b1b48f09
lint: check-patch-headers: Recognize Git diffs.
* guix/lint.scm (check-patch-headers): Add "diff --git " prefix.
2021-06-18 14:18:06 +02:00
Ludovic Courtès
f371972e78
import: launchpad: Gracefully handle 404s from api.launchpad.net.
Fixes <https://bugs.gnu.org/49031>.
Reported by Emad Alblueshi <emad.albloushi@gmail.com>.

* guix/import/launchpad.scm (latest-released-version): Gracefully handle
'json-fetch' returning #f.
2021-06-18 14:18:06 +02:00
Christopher Baines
4985a42724
Start enabling substitutes from bordeaux.guix.gnu.org.
In addition to substitutes from ci.guix.gnu.org.  There are more changes that
can be made in the future, but these changes seem like a good start.

* config-daemon.ac (guix_substitute_urls): Add https://bordeaux.guix.gnu.org.
* guix/scripts/substitute.scm (%default-substitute-urls): Add
http://bordeaux.guix.gnu.org.
* guix/store.scm (%default-substitute-urls): Add bordeaux.guix.gnu.org.
* doc/guix.texi: Adjust accordingly.
* doc/contributing.texi: Adjust accordingly.
2021-06-18 11:25:41 +01:00
Maxim Cournoyer
375d5d03c9
pack: Fix the system value passed to build-docker-image.
Before this change, the system value would be passed as x86_64 when using a
i686-linux emulated system, e.g.:

  $ guix environment --system=i686-linux --ad-hoc  guile -- \
      guile -c '(display (utsname:machine (uname))) (newline)'
  x86_64

This change uses the Guile builtin %host-type variable, which doesn't have
this problem:

  $ guix environment --system=i686-linux --ad-hoc guile -- \
      guile -c '(display %host-type) (newline)'
  i686-unknown-linux-gnu

* guix/scripts/pack.scm (docker-image)[#:system] Use %host-type as a fall-back
when target is not defined.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-06-16 21:44:33 -04:00
Ludovic Courtès
0b535f7b8b
hg-download: Make (guix swh) output visible.
* guix/hg-download.scm (hg-fetch)[build]: Add 'setvbuf' calls.
2021-06-14 18:35:18 +02:00
Xinglu Chen
69d7333217
hg-download: Support falling back to SWH.
* guix/hg-download.scm (hg-fetch): Fall back to fetching the source from SWH
if the upstream source is missing.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-14 18:35:18 +02:00
Xinglu Chen
c4ff492879
swh: Support lookup of Hg tags.
* guix/swh.scm (lookup-origin-revision): Support lookup of Hg tags, not just
Git tags.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-14 18:35:18 +02:00
itd
1aa8cc2f0e
hg-download: Remove bogus hg-reference-recursive? export.
* guix/hg-download.scm: Do not export undefined hg-reference-recursive?.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-06-14 10:02:15 +02:00