Commit graph

5968 commits

Author SHA1 Message Date
Efraim Flashner
de4f5df95d
build/go: Support cross compiling.
* guix/build-system/go.scm (go-target): New procedure.
(go-build): Add goarch, goos keywords. Adjust bag depending if doing a
native or cross compile.
(go-cross-build): New procedure.
* guix/build/go-build-system.scm (setup-go-environment): Accept goarch,
goos keywords. Set go environment variables based on target architecture.
* doc/guix.texi (Build Systems): Mention new go-build-system keywords.
2021-09-13 15:33:30 +03:00
Ludovic Courtès
8531997d2a
packages: Add 'package-definition-location'.
Suggested by Maxime Devos <maximedevos@telenet.be>.

* guix/packages.scm (current-definition-location): New syntax parameter.
(define-public*): New macro.
(<package>)[definition-location]: New field.
(package-definition-location): New procedure.
* tests/packages.scm ("package-definition-location"): New test.
2021-09-13 12:31:10 +02:00
Ludovic Courtès
10c981b135
packages: Store 'location' field as a literal vector.
This is slightly more efficient than storing an alist in terms of .go
file size (< 1% smaller) and load time.

* guix/packages.scm (current-location-vector): New macro.
(sanitize-location): New procedure.
(<package>)[location]: Change 'default' and add 'sanitize'.
(package-location): New procedure.
2021-09-13 12:31:10 +02:00
Xinglu Chen
9875f9bca3
import: elpa: Don't hardcode default branch to 'master'.
Otherwise, remotes without a branch named 'master' will cause an error when
importing.

* guix/import/elpa (git-repository->origin): Fallback to HEAD instead of the
  'master' branch.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-10 17:30:55 +02:00
Ludovic Courtès
60b42bec84
swh: 'swh-download' reports revision lookup failures.
* guix/swh.scm (swh-download): Log lookup failures.
2021-09-10 17:30:54 +02:00
Ludovic Courtès
ff613c2b68
swh: Adjust to new vault API.
Previously the path to query the vault or request cooking of a directory
was /api/1/vault/directory/ID.  It is now deprecated in favor if
/api/1/vault/flat/SWHID.  This commit adjusts code accordingly and also
prepares for 'git-bare' support.

* guix/swh.scm (vault-url): New procedure.
(query-vault, request-cooking): Make 'kind' optional, and add #:archive-type.
Use 'vault-url'.
(vault-fetch): Make 'kind' optional and add #:archive-type.  Adjust
'query-vault' and 'request-cooking' calls accordingly.
2021-09-10 17:30:54 +02:00
Ludovic Courtès
163d6385fd
lint: archival: Warn about non-origin sources.
* guix/lint.scm (check-archival): Warn about non-origin sources.
2021-09-10 17:30:54 +02:00
Ludovic Courtès
cb06f7c61e
base32: Provide an open-coded 'bit-field'.
This improves the throughput of 'bytevector->base32-string' a bit.

* guix/base32.scm (bit-field): New macro.
2021-09-10 17:30:54 +02:00
Maxime Devos
a87d8c912d
base16: Reduce GC pressure in bytevector->base16-string.
This makes bytevector->base16-string two times faster.

* guix/base16.scm (bytevector->base16-string): Use utf8->string
  and iteration instead of string-concatenate and named let.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-10 17:30:54 +02:00
Ludovic Courtès
fb32a38db1
swh: Adjust <vault-reply> to latest API changes.
Fixes uses of 'swh-download' as reported at
<https://lists.gnu.org/archive/html/guix-devel/2021-09/msg00115.html>.
Reported by zimoun.

* guix/swh.scm (<vault-reply>)[object-id, object-type]: Remove.  These
two fields are no longer provided in JSON replies.
[swhid]: New field.
2021-09-09 11:18:06 +02:00
Marius Bakke
16ef7b4938
transformations: Git tags and 'git describe' style IDs are used as version.
* guix/transformations.scm (commit->version-string): New procedure.  Use git
tags and 'git describe' style identifiers directly.
(transform-package-source-commit): Adjust accordingly.
* tests/transformations.scm
("options->transformation, with-commit, version transformation"): New test.
* doc/guix.texi (Package Transformation Options): Mention the 'git describe'
style.
2021-09-08 18:03:50 +02:00
Marius Bakke
1dc3825e99
git: 'resolve-reference' handles 'git describe'-style commit IDs.
* guix/git.scm (resolve-reference): Rewrite tag-or-commit case to recognize
'git describe' style identifiers and resolve them as commits.
* doc/guix.texi (origin Reference): Mention it.
2021-09-08 18:03:50 +02:00
pukkamustard
f8f94cc544
guix: dune-build-system: Put dune into a reproducible release mode.
* guix/build/dune-build-system.scm (build,check): Replace the profile parameter
with the appropriate release flags.
* guix/build-system/dune.scm: Remove the profile parameter.
* doc/guix.texi: Remove paragraph on profile parameter.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2021-09-08 13:39:27 +02:00
Sarah Morgensen
e8a67f0fc4
import: go: Fix import when import path redirects.
* guix/import/go.scm (fetch-module-meta-data): If no meta entries
have a matching import prefix, return the first entry instead of #f.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-07 15:59:35 +02:00
Xinglu Chen
af4fa7c00c
import: elpa: Support NonGNU ELPA.
* guix/import/elpa.scm (elpa-url): Add NonGNU ELPA URL.
* doc/guix.texi (Invoking guix import): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-07 15:59:34 +02:00
zimoun
b8b56badd3
system: Add hint for action typo.
* guix/scripts/system.scm (actions): New variable.
(define-command): Add hint for action typo.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-07 15:59:34 +02:00
zimoun
1cf866c863
import: Add hint for importer typo.
* guix/scripts/import.scm (define-command): Add hint.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-07 15:59:34 +02:00
Ludovic Courtès
153fd217b6
swh: Add 'lookup-snapshot-branch'.
* guix/swh.scm (<snapshot>)[id]: New field.
(snapshot-url, lookup-snapshot-branch): New procedures.
2021-09-06 22:58:12 +02:00
Ludovic Courtès
63ed618e33
swh: <revisions> accept null 'date' fields.
* guix/swh.scm (maybe-null): New procedure.
(<revision>)[date]: Use it.
2021-09-06 22:58:12 +02:00
Ludovic Courtès
b452c3b37a
swh: Export <snapshot> accessors.
* guix/swh.scm: Export <snapshot> accessors.
2021-09-06 22:58:12 +02:00
Christopher Baines
9540323458
weather: Don't look for exported package replacements twice.
* guix/scripts/weather.scm (all-packages): Delete duplicates, so that exported
replacements aren't included twice.
2021-09-03 10:08:27 +01:00
Ludovic Courtès
e53d8a84c6
publish: Simplify 'narinfo-string'.
This is a followup to 222f4661ed, which
was intended to improve performance of 'narinfo-string'.

* guix/scripts/publish.scm (narinfo-string): Remove 'catch' and
'read-derivation-from-file' call when rendering "Deriver".
2021-09-03 10:41:55 +02:00
zimoun
be13e2be08
import: go: Improve error handling.
* guix/import/go.scm (go-module->guix-package*): Handle errors, remove
memoize.
(go-module-recursive-import): Remove 'guard', add memoize.
* guix/scripts/import/go.scm (guix-import-go): Adjust.
* tests/go.scm: Adjust.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-01 23:41:42 +02:00
Sarah Morgensen
f95bdeb93a
import: utils: Skip not found packages.
* guix/import/utils.scm (recursive-import): Skip packages when the
package returned by 'repo->guix-package' is false.
* tests/import-utils.scm: New tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-01 23:41:42 +02:00
Sarah Morgensen
16579a7c57
import: go: Return false for package not found.
* guix/import/go.scm (go-module-recursive-import): Explicitly return
false when packages are not found.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-01 23:41:42 +02:00
Mathieu Othacehe
222f4661ed
publish: Do not render the narinfo "System" field.
This has been discussed here: https://issues.guix.gnu.org/50040.

* guix/scripts/publish.scm (narinfo-string): Do not render the "System" field
that is expensive to compute and currently unused.
2021-08-31 13:33:30 +02:00
Xinglu Chen
0508622848
build-system: chicken: Add 'egg-uri' procedure.
Once Chicken 6 gets released, we can just adjust the URL in the ‘egg-uri’
procedure, instead of having to change the URL for all the Chicken packages.
Making things a little more future-proof.

* guix/build-system/chicken.scm (egg-uri): New procedure.
* guix/import/egg.scm (egg-source-url): Adjust accordingly.
(egg->guix-package): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-08-30 14:38:50 +02:00
Maxim Cournoyer
2ca982ff41
gnu: bootloader: Support multiple targets.
Fixes <https://issues.guix.gnu.org/40997>.

* gnu/bootloader.scm (<bootloader-configuration>): New 'targets' field.
(%bootloader-configuration-target): New procedure.
(bootloader-configuration-target): Add deprecation warning.
(bootloader-configuration-targets): New procedure.
* guix/scripts/system.scm (install): Access targets via
bootloader-configuration-targets.
(perform-action)[bootloader-target]: Remove unused argument and update doc.
Access targets via bootloader-configuration-targets and fix indentation.
(process-action): Access targets via bootloader-configuration-targets.
Do not provide the unused BOOTLOADER-TARGET argument when applying
`perform-action'.
* guix/scripts/system/reconfigure.scm (install-bootloader-program): Rename
DEVICE argument to DEVICES.  Adjust doc and comment.  Apply `installer' and
`disk-installer' for every DEVICES.
(install-bootloader): Access targets via bootloader-configuration-targets and
rename variable from DEVICE to DEVICES.
* gnu/tests/install.scm: Adjust accordingly.
* tests/guix-system.sh: Likewise.
* gnu/tests/reconfigure.scm (run-install-bootloader-test): Adjust the DEVICES
argument so that it is a list.
* doc/guix.texi: Update doc.
2021-08-29 01:05:26 -04:00
Mathieu Othacehe
bb5f395a08
ci: Add jobs history support.
* guix/ci.scm (history?, history-evaluation, history-checkouts, history-jobs,
jobs-history): New procedures.
(<history>): New record.
2021-08-22 21:36:29 +02:00
Alice BRENON
fc29c80b96
guix: opam: More flexibility in the importer.
* guix/scripts/import/opam.scm: Pass all instances of --repo as a list
  to the importer.
* guix/import/opam.scm (opam-fetch): Stop expecting "expanded"
  repositories and call get-opam-repository instead to keep values
  "symbolic" as long as possible and factorize.
  (get-opam-repository): Use the same repository source as CLI opam does
  (i.e. HTTP-served index.tar.gz instead of git repositories).
  (find-latest-version): Be more flexible on the repositories structure
  instead of expecting packages/PACKAGE-NAME/PACKAGE-NAME.VERSION/.
* tests/opam.scm: Update the call to opam->guix-package since repo is
  now expected to be a list and remove the mocked get-opam-repository
  deprecated by the support for local folders by the actual
  implementation.
* doc/guix.texi: Document the new semantics and valid arguments for the
  --repo option.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2021-08-21 00:05:21 +02:00
pukkamustard
33a1ec29fa
guix: dune-build-system: Add a profile parameter.
* guix/build-system/dune.scm: Add a profile parameter.
* guix/build/dune-build-system.scm (build): Use it.
* doc/guix.texi: Document it.
* gnu/packages/ocaml.scm: Remove profile being set from build flags.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2021-08-20 23:51:11 +02:00
Leo Prikler
b7d1698f7f
gnu: minetest: move to minetest.scm.
* gnu/packages/games.scm (minetest, minetest-data): Move from here...
* gnu/packages/minetest.scm (minetest, minetest-data): ... to here.
* guix/build-system/minetest.scm (default-minetest): Adjust accordingly.
2021-08-20 13:37:32 +02:00
Maxime Devos
467e874a86
guix: Add ContentDB importer.
* guix/import/contentdb.scm: New file.
* guix/scripts/import/contentdb.scm: New file.
* tests/contentdb.scm: New file.
* Makefile.am (MODULES, SCM_TESTS): Register them.
* po/guix/POTFILES.in: Likewise.
* doc/guix.texi (Invoking guix import): Document it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
2021-08-20 12:41:54 +02:00
Maxime Devos
d08455934c
import/utils: Recognise GPL-3.0-or-later and friends.
* guix/import/utils.scm (spdx-string->license): Recognise
  GPL-N-only and GPL-N-or-later.  Likewise for LGPL and AGPL.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
2021-08-20 12:41:54 +02:00
Maxime Devos
3df485152c
build-system: Add 'minetest-mod-build-system'.
* guix/build-system/minetest.scm: New module.
* guix/build/minetest-build-system.scm: Likewise.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'minetest-mod-build-system'.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
2021-08-20 12:41:54 +02:00
Brice Waegeneire
613a9c7cb3
import: gem: Fix typo.
* guix/scripts/import/gem.scm (%options): Fix typo.
2021-08-15 08:44:02 +02:00
Ludovic Courtès
5291fd7a42
records: Support field sanitizers.
* guix/records.scm (make-syntactic-constructor): Add #:sanitizers.
[field-sanitizer]: New procedure.
[wrap-field-value]: Honor F's sanitizer.
(define-record-type*)[field-sanitizer]: New procedure.
Pass #:sanitizer to 'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* & sanitize")
("define-record-type* & sanitize & thunked"): New tests.
2021-08-12 12:34:13 +02:00
Ludovic Courtès
373e7ac4f9
transformations: 'with-patch' works on non-origin sources.
Fixes <https://issues.guix.gnu.org/49697>.
Reported by Philippe Swartvagher <philippe.swartvagher@inria.fr>.

* guix/transformations.scm (patched-source): New procedure.
(transform-package-patches)[package-with-extra-patches]: Use it
when (package-source p) is not an origin.
* tests/transformations.scm ("options->transformation, with-commit +
with-patch"): New test.
2021-08-11 16:35:28 +02:00
Ludovic Courtès
fa81971cba
store: Add 'map/accumulate-builds' cutoff to address pathological cases.
Fixes <https://bugs.gnu.org/49439>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

Previously, a command such as:

  guix environment pigx-scrnaseq

could lead to unbounded memory growth and could even fail to complete
when some items are missing from the store.  This was because
'map/accumulate-builds' callees would keep making .drv build requests
that were turned into <unresolved> nodes; in this case, there are often
many identical build requests.  Stopping accumulation earlier allows us
to unlock the situation by proceeding with the first few build requests
instead of spinning until we've accumulated all the build requests.

* guix/store.scm (map/accumulate-builds): Define 'accumulation-cutoff'.
Use a loop when iterating over LST and maintain a counter of unresolved
nodes met so far; return when the counter exceeds ACCUMULATION-CUTOFF.
2021-08-10 17:32:18 +02:00
Mathieu Othacehe
53a487e871
scripts: publish: Remove leftover comment.
* guix/scripts/publish.scm (render-narinfo/cached): Remove leftover comment.
2021-08-10 12:00:45 +02:00
Mathieu Othacehe
dc8451c1cd
scripts: publish: Remove unused argument. 2021-08-10 11:51:26 +02:00
Ludovic Courtès
7bd5f72918
inferior: 'cached-channel-instance' no longer calls 'show-what-to-build'.
This allows the user of 'cached-channel-instance' to install the build
handler of its choice.  In particular, it allows "guix time-machine" to
install a build notifier with the right options instead of using the
defaults that 'cached-channel-instance' would pass to
'show-what-to-build*'.

* guix/inferior.scm (cached-channel-instance): Remove call to
'show-what-to-build*'.
(inferior-for-channels): Wrap body in 'with-build-handler'.
* guix/scripts/time-machine.scm (guix-time-machine): Use
'with-build-handler'.
2021-08-09 18:14:37 +02:00
Ludovic Courtès
27f00963d3
self: Use default config variable values for derivations.
The value of %localstatedir, %storedir, and %sysconfdir is known to have
no impact on the compilation of the Guix modules.  Thus, explicitly
build those modules against a (guix config) module that uses all the
default values.  That way, a Guix installation that uses different
config values can still benefit from substitutes.

Reported by Ricardo Wurmus.

* guix/self.scm (%default-config-variables): New variable.
(make-config.scm): Add #:config-variables and honor it.
(compiled-guix)[*core-modules*]: Pass #:config-variables to
'make-config.scm'.
2021-08-09 18:14:33 +02:00
Leo Famulari
189003c83e
download: Remove defunct GNOME mirrors.
* guix/download.scm (%mirrors): Remove defunct GNOME mirrors, and try
the canonical site first.
2021-07-27 12:34:57 -04:00
Sarah Morgensen
15452f319c
import: Use PARSE-COMMAND-LINE for options.
* guix/scripts/import/go.scm (guix-import-go)[parse-options]: Use
PARSE-COMMAND-LINE instead of ARGS-FOLD*.
* guix/scripts/import/egg.scm (guix-import-egg)[parse-options]:
Likewise.
* guix/scripts/import/gem.scm (guix-import-gem)[parse-options]:
Likewise.
* guix/scripts/import/gnu.scm (guix-import-gnu)[parse-options]:
Likewise.
* guix/scripts/import/cpan.scm (guix-import-cpan)[parse-options]:
Likewise.
* guix/scripts/import/cran.scm (guix-import-cran)[parse-options]:
Likewise.
* guix/scripts/import/elpa.scm (guix-import-elpa)[parse-options]:
Likewise.
* guix/scripts/import/json.scm (guix-import-json)[parse-options]:
Likewise.
* guix/scripts/import/opam.scm (guix-import-opam)[parse-options]:
Likewise.
* guix/scripts/import/pypi.scm (guix-import-pypi)[parse-options]:
Likewise.
* guix/scripts/import/crate.scm (guix-import-crate)[parse-options]:
Likewise.
* guix/scripts/import/texlive.scm (guix-import-texlive)[parse-options]:
Likewise.
* guix/scripts/import/hackage.scm (guix-import-hackage)[parse-options]:
Likewise.
* guix/scripts/import/stackage.scm (guix-import-stackage)[parse-options]:
Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-08-04 17:22:19 +02:00
Maxim Cournoyer
10f554700c
Reinstate "services: Add a service for Jami."
This reverts commit 4673f81793, which reverted
commit 69dcc24c9f with the fix detailed below.

Thanks to Christopher Baines for reporting the failure and proposing a fix.

* guix/self.scm (compiled-guix) [*system-test-modules*]: Add the test data
files via the 'extra-files' argument.
* gnu/local.mk (dist_patch_DATA): Move the tests/data/jami-dummy-account.dat
file to...
* gnu/local.mk (MODULES_NOT_COMPILED): ... here.
2021-08-02 17:23:30 -04:00
Ludovic Courtès
92d99aa5dc
licenses: Remove 'cc-sampling-plus-1.0' export.
This is a followup to 65e1d39f9f.

* guix/licenses.scm (cc-sampling-plus-1.0): Remove export.
2021-08-02 18:11:32 +02:00
Ron Nazarov
65e1d39f9f
licenses: Remove CC-Sampling+-1.0.
* guix/licenses.scm (cc-sampling-plus-1.0): Remove variable.
2021-07-30 10:01:31 +02:00
Ludovic Courtès
78daf9e02e
derivations: Make 'coalesce-duplicate-inputs' linear in the number of inputs.
Partly fixes <https://issues.guix.gnu.org/49439>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

When running the command:

  guix environment pigx-scrnaseq --search-paths --no-grafts

this change reduces total heap allocations from 1.4GiB to 717MiB (49%)
and wall-clock time from 7.5s to 5.7s (24%).

Without '--no-grafts', heap allocations go from 2.1GiB to 1.4GiB (33%)
and wall-clock time from 12.1s to 10.9s (10%).

* guix/derivations.scm (coalesce-duplicate-inputs): Rewrite using a hash
table to make it O(N) rather than O(N²).
2021-07-27 18:26:08 +02:00
Maxim Cournoyer
4f51a4ac27
utils: Do not request block buffering in pretty-print-table.
Re-testing 'guix package -A' using the default line buffering set in (guix
ui), there doesn't seem to be a performance gain to use block buffering, so
remove this extraneous side effect.

* guix/utils.scm (pretty-print-table): Do not set buffering mode to block.

Reported-by: Ludovic Courtès <ludo@gnu.org>
2021-07-21 17:42:30 -04:00