Commit Graph

5196 Commits

Author SHA1 Message Date
Ludovic Courtès 3b72618f6e
nar: Use (guix i18n).
* guix/nar.scm: Use (guix i18n) instead of (guix ui).
2020-06-18 14:48:17 +02:00
Ludovic Courtès d7fb553801
nar: Avoid opening the database an additional time.
* guix/nar.scm (finalize-store-file): Call 'register-items' and pass it
DB.  This avoids opening the database a second time and hopefully
reduces contention on 'db.sqlite-shm'.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 97a46055ca
database: 'register-items' takes an open database.
* guix/store/database.scm (store-database-directory)
(store-database-file): New procedures.
(call-with-database): Add call to 'mkdir-p'.
(register-items): Add 'db' parameter and remove #:state-directory and #:schema.
(register-path): Use 'store-database-file' and 'with-database', and
parameterize SQL-SCHEMA.
* gnu/build/image.scm (register-closure): Likewise.
* gnu/build/vm.scm (register-closure): Likewise.
* guix/scripts/pack.scm (store-database)[build]: Likewise.
2020-06-18 14:48:17 +02:00
Ludovic Courtès f9a0fc9dbb
build-system/gnu: Fix 'install' phase of 'gnu-dist'.
* guix/build/gnu-dist.scm (install-dist): Fix 2nd argument to
'for-each'.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 290c316621
repl: Fix typo that would lead ~/.guile to be used when running scripts.
This is a followup to c924e54139.

* guix/scripts/repl.scm (guix-repl)[opts]: Set 'ignore-dot-guile?', with
question mark.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 4ae762af76
channels: Warn when pulling from a mirror.
* guix/channels.scm (<channel-metadata>)[url]: New field.
(read-channel-metadata): Initialize it.
(read-channel-metadata-from-source): Likewise.
(channel-instance-primary-url): New procedure.
(latest-channel-instances): Compare CHANNEL's URL against it.
* doc/guix.texi (Channels)[Primary URL]: New subsection.
2020-06-17 19:32:43 +02:00
Ludovic Courtès ba8c09f289
build-system/gnu: Rename "make dist" phase to 'build-dist'.
* guix/build/gnu-dist.scm (%dist-phases): Add BUILD under the name
'build-dist'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 7488d70c55
build-system/gnu: Simplify 'dist-package'.
* guix/build-system/gnu.scm (dist-package): Use default keyword
arguments in 'substitute-keyword-arguments'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès dabbddbbaa
build-system/gnu: Remove redundant 'unpack' phase from 'gnu-dist'.
This has become redundant with the standard 'unpack' phase since
17919a5801.

* guix/build/gnu-dist.scm (copy-source): Remove.
(%dist-phases): Remove 'unpack' phase.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 03686f26cc
build-system/gnu: Remove Hydra-specific code from 'gnu-dist'.
* guix/build/gnu-dist.scm (install-dist): Remove code for
'hydra-build-products'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 2ee1cce324
build-system/gnu: Remove 'autoreconf' phase from 'gnu-dist'.
This has been superseded by the 'bootstrap' phase added in
189be331ac.

* guix/build/gnu-dist.scm (autoreconf): Remove.
(%dist-phases): Remove it.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 8cca3f939a
build-system/gnu: Adjust 'dist-package' to current 'autoconf-wrapper' API.
This is a followup to 464f544739.

* guix/build-system/gnu.scm (dist-package): Do not call 'autoconf-wrapper'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 94642ab06b
profiles: Add comment at the top of 'manifest' file.
* guix/build/profiles.scm (build-profile): Add comment at the top of
MANIFEST-FILE.
2020-06-17 12:06:33 +02:00
Ludovic Courtès 838ac881ec
time-machine: Add '--disable-authentication'.
* guix/inferior.scm (cached-channel-instance): Add #:authenticate? and
pass it to 'latest-channel-instances'.
* guix/scripts/time-machine.scm (show-help, %options): Add
'--disable-authentication'.
(%default-options): Add 'authenticate-channels?'.
(guix-time-machine): Honor it.
2020-06-16 16:10:47 +02:00
Ludovic Courtès a9eeeaa6ae
pull: Add '--disable-authentication'.
* guix/channels.scm (latest-channel-instance): Add #:authenticate? and
honor it.
(latest-channel-instances): Likewise.
* guix/scripts/pull.scm (%default-options): Add 'authenticate-channels?'.
(show-help, %options): Add '--disable-authentication'.
(guix-pull): Pass #:authenticate? to 'latest-channel-instances'.
* doc/guix.texi (Invoking guix pull): Document it.
2020-06-16 16:10:47 +02:00
Ludovic Courtès c3f6f564e9
channels: Automatically add introduction for the official 'guix' channel.
This is useful when people run "guix time-machine -C channels.scm",
where 'channels.scm' misses channel introductions.

* guix/channels.scm (%default-channel-url): New variable.
(%default-channels): Use it.
(ensure-default-introduction): New procedure.
(latest-channel-instance): Call it.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 5bafc70d1e
channels: Make 'validate-pull' call right after clone/pull.
This should come before patching, authentication, etc.

* guix/channels.scm (latest-channel-instance): Add #:validate-pull
parameter and honor it.  Return a single value: the instance.
(ensure-forward-channel-update): Change 'instance' parameter to 'commit'
and adjust accordingly.
(latest-channel-instances): Adjust to 'latest-channel-instance' changes.
* guix/scripts/pull.scm (warn-about-backward-updates): Change 'instance'
parameter to 'commit' and adjust accordingly.
* tests/channels.scm ("latest-channel-instances #:validate-pull"):
Likewise.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 43badf261f
channels: 'latest-channel-instance' authenticates Git checkouts.
Fixes <https://bugs.gnu.org/22883>.

* guix/channels.scm (<channel>)[introduction]: New field.
(<channel-introduction>): New record type.
(%guix-channel-introduction): New variable.
(%default-channels): Use it.
(<channel-metadata>)[keyring-reference]: New field.
(%default-keyring-reference): New variable.
(read-channel-metadata, read-channel-metadata-from-source): Initialize
the 'keyring-reference' field.
(commit-short-id, verify-introductory-commit)
(authenticate-channel): New procedures.
(latest-channel-instance): Call 'authenticate-channel' when CHANNEL has
an introduction.
* tests/channels.scm (gpg+git-available?, commit-id-string): New
procedures.
("authenticate-channel, wrong first commit signer"):
("authenticate-channel, .guix-authorizations"): New tests.
* doc/guix.texi (Invoking guix pull): Mention authentication.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 1e2b9bf2d4
tests: Move OpenPGP helpers to (guix tests gnupg).
* tests/git-authenticate.scm (key-id): Remove.
(%ed25519-public-key-file, %ed25519-secret-key-file)
(%ed25519bis-public-key-file, %ed25519bis-secret-key-file)
(read-openpgp-packet, key-fingerprint): Move to...
* guix/tests/gnupg.scm: ... here.
2020-06-16 16:10:46 +02:00
Ludovic Courtès 41946b79f1
git-authenticate: 'authenticate-commits' takes a #:keyring parameter.
* guix/git-authenticate.scm (authenticate-commits): Add #:keyring
parameter.
2020-06-16 16:10:46 +02:00
Ludovic Courtès a450b4343b
git-authenticate: Cache takes a key parameter.
* guix/git-authenticate.scm (authenticated-commit-cache-file)
(cache-authenticated-commit, previously-authenticated-commits): Add
'key' parameter and honor it.
* build-aux/git-authenticate.scm (git-authenticate): Pass
"channels/guix" as the key.
2020-06-16 16:10:46 +02:00
Efraim Flashner 3646a44a14
build-system: cmake: Add substitutable keyword.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build): Add
substitutable keyword.
2020-06-16 16:40:27 +03:00
Tobias Geerinckx-Rice 38ee8f7dba
pack: Add zstd compressor.
* guix/scripts/pack.scm (%compressors): Add zstd.
* doc/guix.texi (Invoking guix pack): Document it.
2020-06-16 13:35:33 +02:00
Arun Isaac bd03e99f66
ui: Use package-description-string.
* guix/ui.scm (package->recutils): Use package-description-string instead of
package-description and P_.
2020-06-15 23:31:56 +05:30
Arun Isaac a1da0904a6
ui: Do not translate package synopsis a second time.
* guix/ui.scm (package->recutils): package-synopsis-string already returns a
translated string. Do not attempt to translate it again.
2020-06-15 23:31:56 +05:30
Arun Isaac e70a884706
ui: Cut off search early if any regexp does not match.
* guix/ui.scm (relevance): When one of the regexps does not match, cut off
early and return 0. Do not try to match the remaining regexps.
2020-06-15 23:31:56 +05:30
Mathieu Othacehe 53e6195607
ci: Add build-products id field and export accessors.
* guix/ci.scm (build-product?, build-product-id,
build-product-type, build-product-file-size,
build-product-path): Export them,
[id]: new field.
2020-06-15 15:34:19 +02:00
Mathieu Othacehe 9e989d9e36
ci: Add status option to "latest-builds".
* guix/ci.scm (latest-builds): Add "status" option.
2020-06-15 15:33:42 +02:00
Tobias Geerinckx-Rice c9ea4eecf4
download: Remove usa-mirror.go-parts.com mirror.
It incorrectly redirects 404s (at least) to the commercial home page.

* guix/download.scm (%mirrors): Remove usa-mirror.go-parts.com URLs.
2020-06-15 14:26:44 +02:00
Mathieu Othacehe bb76f50b9b
ci: Fix buildproducts reading.
This is a follow-up of 4e05bbb093.

* guix/ci.scm (<build>)[products]: Test for vector type, as products can be
"null".
2020-06-15 09:53:02 +02:00
Mathieu Othacehe ef6f9f16fe
ci: Add job option to "latest-builds".
* guix/ci.scm (latest-builds): Add "job" option.
2020-06-15 09:15:08 +02:00
Mathieu Othacehe 4e05bbb093
ci: Add build products support.
* guix/ci.scm (<build-product>): New json mapping,
(<build)[products]: new field.
2020-06-15 09:15:08 +02:00
Konrad Hinsen c924e54139
guix repl: Add script execution.
* guix/scripts/repl.scm: Add filename options for script execution.
* doc/guix.texi (Invoking guix repl): Document it.
* tests/guix-repl.sh: Test it.
* Makefile.am: (SH_TESTS): Add it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-14 23:02:36 +02:00
Mathieu Othacehe 80f92866e3
scripts: system: Fix "init" command.
This is a follow-up of 7ca533c723. The
introduced "target" variable is shadowing the target argument.

* guix/scripts/system.scm (perform-action): Rename "target" variable to
"target*".
2020-06-14 17:42:36 +02:00
Ludovic Courtès 993023a28e
lint: Add 'check-for-collisions' checker.
Suggested by Edouard Klein <edk@beaver-labs.com>.

* guix/profiles.scm (check-for-collisions): Export.
* guix/lint.scm (check-profile-collisions): New procedure.
(%local-checkers): Add 'profile-collisions' checker.
* tests/lint.scm ("profile-collisions: no warnings")
("profile-collisions: propagated inputs collide")
("profile-collisions: propagated inputs collide, store items"): New tests.
* doc/guix.texi (Invoking guix lint): Document it.
2020-06-14 15:34:42 +02:00
Ludovic Courtès 9acac9f9c6
profiles: Fix pathological performance of 'manifest-transitive-entries'.
For packages with lots of propagated inputs,
'manifest-transitive-entries', as called from 'check-for-collisions',
would exhibit pathological behavior.  For example, "guix install cl-ana"
wouldn't complete in 1mn; now, it's down to 20s.

The issue was that manifest entries would never be 'equal?' due to the
delayed field in <manifest-entry>.

* guix/profiles.scm (manifest-transitive-entries): Use a vhash instead
of a set.  Use 'manifest-entry=?' instead of 'equal?' when checking for
equality.
2020-06-14 15:34:41 +02:00
Ludovic Courtès e66f243e92
ui: Set 'LESS' environment variable unconditionally.
Fixes <https://bugs.gnu.org/41811>.
Reported by Lars-Dominik Braun <lars@6xq.net>.

* guix/ui.scm (call-with-paginated-output-port): Remove (getenv "LESS")
call.
2020-06-14 15:34:38 +02:00
Marius Bakke 8ab70bae52
Merge branch 'staging' 2020-06-13 22:52:25 +02:00
Jan (janneke) Nieuwenhuizen 7ca533c723
image: Make 'find-image' non-monadic.
* gnu/system/image.scm (find-image): Make non-monadic.  Add 'target'
parameter.
* gnu/tests/install.scm (run-install): Update caller,
passing (%current-target-system).
* guix/scripts/system.scm (perform-action): Likewise.
2020-06-13 15:03:55 +02:00
Ricardo Wurmus 8e518d4802
guix: Update to Bioconductor 3.11.
* guix/build-system/r.scm (bioconductor-uri): Use new URL.
* guix/import/cran.scm (%bioconductor-version): Update to 3.11.
2020-06-13 01:19:38 +02:00
Christopher Baines db6290af7c
lint: check-patch-file-names: Use origin-actual-file-name.
This avoids crashes for the patch-file-names checker where a <origin> is used
for a patch, but without a value for the file-name field. This is currently
the case with the bash package.

* guix/lint.scm (check-patch-file-names): Change origin-file-name to
origin-actual-file-name.
2020-06-12 22:26:47 +01:00
Ludovic Courtès 52c529ff20
git-authenticate: Disallow SHA1 (and MD5) signatures.
* guix/git-authenticate.scm (commit-signing-key): Add
 #:disallowed-hash-algorithms and honor it.
(authenticate-commit)[recent-commit?]: New variable.
Pass #:disallowed-hash-algorithms to 'commit-signing-key'.
* tests/git-authenticate.scm ("signed commits, SHA1 signature"): New test.
2020-06-12 18:56:11 +02:00
Efraim Flashner 205a0ecd5b
download: Add more apache mirrors.
* guix/download.scm (%mirrors): Add more apache mirrors.
2020-06-12 18:28:51 +03:00
Chris Marusich 21887021b9
guix: lint: Support origins in check-patch-file-names.
* guix/lint.scm (check-patch-file-names)[starts-with-package-name?]: New
procedure, extracted from the existing logic.  Using it, add a clause to
the match-lambda to handle origin records.
2020-06-11 22:30:14 -07:00
Marius Bakke 9b043df740
Merge branch 'master' into staging 2020-06-11 23:30:32 +02:00
Ludovic Courtès 03a70e4c19
packages: 'package-grafts' returns grafts for all the relevant outputs.
Fixes <https://bugs.gnu.org/41796>.
Reported by Jakub Kądziołka <kuba@kadziolka.net>.

* guix/packages.scm (input-graft): Add 'output' parameter and honor it.
Add OUTPUT to the cache key.
(input-cross-graft): Likewise.
(fold-bag-dependencies): Operate on inputs instead of nodes.  Turn
VISITED into a vhash instead of a set.  Pass PROC HEAD and OUTPUT
instead of just HEAD.
(bag-grafts): Adjust accordingly.
* tests/packages.scm ("package-grafts, dependency on several outputs"):
New test.
2020-06-11 19:05:05 +02:00
Caleb Ristvedt 8971f626f2
database: separate transaction-handling and retry-handling.
Previously call-with-transaction would both retry when SQLITE_BUSY errors were
thrown and do what its name suggested (start and rollback/commit a
transaction).  This changes it to do only what its name implies, which
simplifies its implementation.  Retrying is provided by the new
call-with-SQLITE_BUSY-retrying procedure.

* guix/store/database.scm (call-with-transaction): no longer restarts, new
  #:restartable? argument controls whether "begin" or "begin immediate" is
  used.
  (call-with-SQLITE_BUSY-retrying, call-with-retrying-transaction,
  call-with-retrying-savepoint): new procedures.
  (register-items): use call-with-retrying-transaction to preserve old
  behavior.

* .dir-locals.el (call-with-retrying-transaction,
  call-with-retrying-savepoint): add indentation information.
2020-06-10 21:54:35 -05:00
Caleb Ristvedt 37545de4a3
database: ensure update-or-insert is run within a transaction
update-or-insert can break if an insert occurs between when it decides whether
to update or insert and when it actually performs that operation.  Putting the
check and the update/insert operation in the same transaction ensures that the
update/insert will only succeed if no other write has occurred in the middle.

* guix/store/database.scm (call-with-savepoint): new procedure.
  (update-or-insert): use call-with-savepoint to ensure the read and the
  insert/update occur within the same transaction.
2020-06-10 21:54:35 -05:00
Caleb Ristvedt 5d6e225528
database: rewrite query procedures in terms of with-statement.
Most of our queries would fail to finalize their statements properly if sqlite
returned an error during their execution.  This resolves that, and also makes
them somewhat more concise as a side-effect.

This also makes some small changes to improve certain queries where behavior
was strange or overly verbose.

* guix/store/database.scm (call-with-statement): new procedure.
  (with-statement): new macro.
  (last-insert-row-id, path-id, update-or-insert, add-references): rewrite to
  use with-statement.
  (update-or-insert): factor last-insert-row-id out of the end of both
  branches.
  (add-references): remove pointless last-insert-row-id call.

* .dir-locals.el (with-statement): add indenting information.
2020-06-10 21:54:35 -05:00
Caleb Ristvedt 3cd92a855e
database: work around guile-sqlite3 bug preventing statement reset
guile-sqlite3 provides statement caching, making it unnecessary for sqlite to
keep re-preparing statements that are frequently used.  Unfortunately it
doesn't quite emulate the semantics of sqlite_finalize properly, because it
doesn't cause a commit if the statement being finalized is the last "active"
statement (see https://notabug.org/guile-sqlite3/guile-sqlite3/issues/12).  We
work around this by wrapping sqlite-finalize with our own version that ensures
sqlite-reset is called, which does The Right Thing™.

* guix/store/database.scm (sqlite-finalize): new procedure that shadows the
  sqlite-finalize from (sqlite3).
2020-06-10 21:54:32 -05:00
Tobias Geerinckx-Rice 35b00d4caa
import: stackage: Fix typo.
* guix/import/stackage.scm (latest-lts-release): Fix spelling of ‘if’.
2020-06-09 22:30:08 +02:00
Marius Bakke 2e08394b3c
import: stackage: Fix typo.
* guix/import/stackage.scm (latest-lts-release): Fix spelling of "included".
2020-06-09 20:43:36 +02:00
Lars-Dominik Braun 7a45b5d5ba
store: Use buffered I/O for all protocol writes
* guix/store.scm (run-gc) Use buffered output port.
(export-path) Same.
(add-file-tree-to-store) Same.
(set-build-options): Same. Add explicit flush.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-09 10:43:54 +02:00
Ludovic Courtès eef859e853
git-authenticate: 'commit-authorized-keys' properly handles orphan commits.
Previously it would trigger a wrong-number-of-arguments error for
'lset-intersection'.

* guix/git-authenticate.scm (commit-authorized-keys): Add case for when
'commit-parents' returns the empty list.
2020-06-09 00:34:52 +02:00
Ludovic Courtès 72357e2170
git: 'commit-difference' really excludes the ancestors of #:excluded.
* guix/git.scm (commit-difference): Initialize VISITED to the closure of
OLD and EXCLUDED, as written in the docstring.
* tests/git.scm ("commit-difference, excluded commits"): Adjust
accordingly.
2020-06-09 00:34:52 +02:00
Marius Bakke dd2d3ed2d3
Merge branch 'master' into staging 2020-06-08 19:05:56 +02:00
Jan (janneke) Nieuwenhuizen ab9e30039d
syscalls: set-thread-name, thread-name: Fix thinko.
* guix/build/syscalls.scm (set-thread-name, thread-name): Oops, fix thinko.
2020-06-08 16:49:03 +02:00
Jan (janneke) Nieuwenhuizen 1428926f1f
syscalls: set-thread-name, thread-name: Stub for the Hurd.
Avoid crash

    Backtrace:
    guix/build/syscalls.scm:405:8: In procedure prctl: Function not implemented

because of missing prctl on the Hurd.

* guix/build/syscalls.scm (set-thread-name, thread-name): Rename to ...
(set-thread-name!/linux,thread-name/linux): ...this.
(set-thread-name, thread-name): Swtich between linux implementation and or
stub.
2020-06-08 13:51:17 +02:00
Ludovic Courtès e782756080
git-authenticate: Prevent removal of '.guix-authorizations'.
* guix/git-authenticate.scm (commit-authorized-keys)
[parents-have-authorizations-file?, assert-parents-lack-authorizations]:
New procedures.
Use the latter before returning DEFAULT-AUTHORIZATIONS.
* guix/git.scm (false-if-git-not-found): Export.
* guix/tests/git.scm (populate-git-repository): Add 'remove' clause.
* tests/git-authenticate.scm ("signed commits, .guix-authorizations removed"):
New test.
2020-06-07 23:10:46 +02:00
Ludovic Courtès 1fd7de45f2
git: 'update-cached-checkout' gracefully handles missing starting commit.
Fixes <https://bugs.gnu.org/41604>
Reported by John Soo <jsoo1@asu.edu> and zimoun <zimon.toutoune@gmail.com>.

* guix/git.scm (false-if-git-not-found): New macro.
(reference-available?): Use it.
(update-cached-checkout): Use it when looking up STARTING-COMMIT.
Set RELATION to 'unrelated when OLD is #false.
2020-06-07 23:10:46 +02:00
Ludovic Courtès c39693d760
ui: 'display-search-results' automatically invokes the pager.
* guix/ui.scm (call-with-paginated-output-port): New procedure.
(with-paginated-output-port): New macro.
(display-search-results): Use it instead of displaying a hint.
2020-06-06 23:28:49 +02:00
Ludovic Courtès d67a881966
utils: Add 'with-environment-variables'.
* guix/tests/gnupg.scm (call-with-environment-variables)
(with-environment-variables): Move to...
* guix/utils.scm: ... here.
* guix/tests/git.scm: Adjust accordingly.
2020-06-06 23:28:49 +02:00
Ludovic Courtès b49caaa2b7
packages: Make 'bag-grafts' insensitive to '%current-target-system'.
Fixes <https://bugs.gnu.org/41713>.
Reported by Mathieu Othacehe.

* guix/packages.scm (bag-grafts): Wrap 'fold-bag-dependencies' calls in
'parameterize'.
* tests/packages.scm ("package->bag, sensitivity to
%current-target-system"): New test.
2020-06-06 23:28:48 +02:00
Ludovic Courtès 58bb833365
grafts: Improve performance for derivations with many inputs.
Partly fixes <https://bugs.gnu.org/41702>.
Reported by Lars-Dominik Braun <ldb@leibniz-psychology.org>.

Previously we'd potentially traverse the same sub-graph of DEPS several
times.

With this patch, command:

  guix environment --ad-hoc r-learnr --search-paths

goes from 11.3s to 4.6s.

* guix/grafts.scm (reference-origin): Rename to...
(reference-origins): ... this.  Change 'item' parameter to 'items'.
[lookup-derivers]: New procedure.
(cumulative-grafts)[dependency-grafts]: Change 'item' to 'items' and use
'reference-origins'.
Remove 'mapm' around 'dependency-grafts' call.
2020-06-06 23:28:48 +02:00
Marius Bakke 7ce1b5e7b7
Merge branch 'master' into staging 2020-06-06 21:25:43 +02:00
Ludovic Courtès c83eedba23
git-authenticate: Add tests.
* guix/tests/git.scm (call-with-environment-variables)
(with-environment-variables): Remove.
* guix/tests/git.scm (populate-git-repository): Add clauses for signed
commits and signed merges.
* guix/tests/gnupg.scm: New file.
* tests/git-authenticate.scm: New file.
* tests/ed25519bis.key, tests/ed25519bis.sec: New files.
* Makefile.am (dist_noinst_DATA): Add 'guix/tests/gnupg.scm'.
(SCM_TESTS): Add 'tests/git-authenticate.scm'.
(EXTRA_DIST): Add tests/ed25519bis.{key,sec}.
2020-06-05 22:54:06 +02:00
Ludovic Courtès f8213f1bca
git-authenticate: Raise proper SRFI-35 conditions.
* guix/git-authenticate.scm (&git-authentication-error)
(&unsigned-commit-error, &unauthorized-commit-error)
(&signature-verification-error, &missing-key-error): New condition
types.
(commit-signing-key, authenticate-commit): Raise them.
2020-06-05 22:54:06 +02:00
Ludovic Courtès 512b9e2da2
git-authenticate: Don't hard-code "origin/" for keyring reference.
* guix/git-authenticate.scm (load-keyring-from-reference): Remove
hard-coded "origin/".  Use BRANCH-ALL instead of BRANCH-REMOTE.
2020-06-05 22:54:06 +02:00
Ludovic Courtès 41f443c90a
Add (guix git-authenticate).
* build-aux/git-authenticate.scm (commit-signing-key)
(read-authorizations, commit-authorized-keys, authenticate-commit)
(load-keyring-from-blob, load-keyring-from-reference)
(authenticate-commits, authenticated-commit-cache-file)
(previously-authenticated-commits, cache-authenticated-commit): Remove.
* build-aux/git-authenticate.scm (git-authenticate): Pass
 #:default-authorizations to 'authenticate-commits'.
* guix/git-authenticate.scm: New file, with code taken from
'build-aux/git-authenticate.scm'.  Remove references to
'%historical-authorized-signing-keys' and add #:default-authorizations
parameter instead.
* Makefile.am (MODULES): Add it.
(authenticate): Depend on guix/git-authenticate.go.
2020-06-05 22:54:06 +02:00
Danny Milosavljevic f51fd97ec5
build-system: linux-module: Allow passing #:make-flags argument.
* guix/build-system/linux-module.scm (linux-module-build): Add #:make-flags.
(linux-module-build-cross): Add #:make-flags.
* guix/build/linux-module-build-system.scm (install): Pass make-flags.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-06-02 14:22:32 +02:00
Arun Isaac 7a99c58c45
combinators: Recurse fold2 to named let loop.
* guix/combinators.scm (fold2): Recurse to named let loop, not fold2 itself.

Signed-off-by: Jakub Kądziołka <kuba@kadziolka.net>
2020-06-01 14:54:55 +02:00
Marius Bakke fe6d003908
Merge branch 'master' into staging 2020-05-29 23:36:38 +02:00
Pierre Neidhardt e70e097882
size: Document that positional arguments can be store items.
* guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument
  alternative.
2020-05-29 18:48:44 +02:00
Ludovic Courtès 17a102332a
syscalls: 'terminal-dimension' ignores EPERM.
Fixes <https://bugs.gnu.org/41581>.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.

* guix/build/syscalls.scm (terminal-dimension): Add EPERM to the list of
errno code for FALL-BACK.
2020-05-29 18:31:38 +02:00
Jesse Dowell b56cbe8974
syscalls: Properly match %HOST-TYPE.
Fixes <https://bugs.gnu.org/41546>.

Regression introduced in 0d371c633f.

* guix/build/syscalls.scm (write-socket-address!)
(read-socket-address): Use 'string-contains' instead of
'string-suffix?'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-29 18:31:38 +02:00
Ludovic Courtès 36640207c9
quirks: Build 'compute-guix-derivation' modules with 2.2 when needed.
Fixes <https://bugs.gnu.org/41595>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

* guix/quirks.scm (requires-guile-2.2?): New procedure.
(%quirks): Add it.
(%bug-41214-patch): Comment.
2020-05-29 18:31:35 +02:00
Marius Bakke fb9a57a8e6
utils: Add 'cc-for-target'.
* guix/utils.scm (cc-for-target): New procedure.
2020-05-29 15:41:30 +02:00
Mathieu Othacehe e3f0155c41
image: Do not use VM to create disk-images.
Now that installing Grub on raw disk-images is supported, we do not need to
rely on (gnu system vm) module.

* gnu/system/image.scm (make-system-image): Rename to ...
(system-image): ... this, and remove the compatibility wrapper.
(find-image): Turn to a monadic procedure. This will become useful when
introducing Hurd support, to be able to detect the target system.
* gnu/ci.scm (qemu-jobs): Use lower-object now that system-image returns a
file-like object.
* gnu/tests/install.scm (run-install): Ditto.
* guix/scripts/system.scm (system-derivation-for-action): Add a 'base-image'
argument,
(perform-action): adapt accordingly.
2020-05-29 09:12:11 +02:00
Marius Bakke 8a7a5dc780
Merge branch 'master' into staging 2020-05-26 22:38:12 +02:00
Marius Bakke aa13c5657d
Merge branch 'master' into staging 2020-05-26 22:34:46 +02:00
Marius Bakke 9edb3f66fd
Merge branch 'master' into staging 2020-05-26 22:30:51 +02:00
Ludovic Courtès 49143297fc
compile: Do not optimize "gnu/tests/*".
* guix/build/compile.scm (optimization-options): Add "gnu/tests/" to
level 0.
2020-05-25 23:00:31 +02:00
Ludovic Courtès 2c402b1a15
gexp: The result of 'imported-files/derivation' is non-substitutable.
* guix/gexp.scm (imported-files/derivation): Pass #:substitutable? #f to
'gexp->derivation'.
2020-05-25 23:00:30 +02:00
Ludovic Courtès f408d8d636
self: Optimize 'file-append*' for 'local-file?'.
* guix/self.scm (file-append*): Add 'local-file?' case.
* guix/gexp.scm (local-file-select?): Export.
2020-05-25 23:00:30 +02:00
Ludovic Courtès abf43d4511
gexp: Fix expansion for (file-append (local-file ...) ...).
Fixes <https://bugs.gnu.org/41527>.
Regression introduced in d03001a31a.

* guix/gexp.scm (lower+expand-object): When LOWERED is not a struct and
EXPAND is true, call EXPAND.
* tests/gexp.scm ("file-append, raw store item"): New test.
2020-05-25 23:00:30 +02:00
Ludovic Courtès 9744cc7b46
pull: Protect against downgrade attacks.
* guix/scripts/pull.scm (%default-options): Add 'validate-pull'.
(%options, show-help): Add '--allow-downgrades'.
(warn-about-backward-updates): New procedure.
(guix-pull): Pass #:current-channels and #:validate-pull to
'latest-channel-instances'.
* guix/channels.scm (ensure-forward-channel-update): Add hint for
when (channel-commit channel) is true.
* doc/guix.texi (Invoking guix pull): Document '--allow-downgrades'.
2020-05-25 00:00:28 +02:00
Ludovic Courtès 872898f768
channels: 'latest-channel-instances' guards against non-forward updates.
* guix/channels.scm (latest-channel-instance): Add #:starting-commit and
pass it to 'update-cached-checkout'.  Return the commit relation as a
second value.
(ensure-forward-channel-update): New procedure.
(latest-channel-instances): Add #:current-channels and #:validate-pull.
[current-commit]: New procedure.
Pass #:starting-commit to 'latest-channel-instance'.  When the returned
relation is true, call VALIDATE-PULL.
(latest-channel-derivation): Add #:current-channels and #:validate-pull.
Pass them to 'latest-channel-instances*'.
* tests/channels.scm ("latest-channel-instances #:validate-pull"): New
test.
2020-05-25 00:00:28 +02:00
Ludovic Courtès 8d1d56578a
git: 'update-cached-checkout' returns the commit relation.
* guix/git.scm (update-cached-checkout): Add #:starting-commit
parameter.  Call 'commit-relation' when #:starting-commit is true.
Always return the relation or #f as the third value.
(latest-repository-commit): Adjust accordingly.
* guix/import/opam.scm (get-opam-repository): Likewise.
* tests/channels.scm ("latest-channel-instances includes channel dependencies")
("latest-channel-instances excludes duplicate channel dependencies"):
Update mock of 'update-cached-checkout' accordingly.
2020-05-25 00:00:28 +02:00
Ludovic Courtès 9b049de84e
channels: 'latest-channel-instances' doesn't leak internal state.
* guix/channels.scm (latest-channel-instances): Remove
'previous-channels' argument.  Introduce 'loop' and use it.
2020-05-25 00:00:28 +02:00
Ludovic Courtès c098c11be8
git: Add 'commit-relation'.
* guix/git.scm (commit-relation): New procedure.
* tests/git.scm ("commit-relation"): New test.
2020-05-25 00:00:28 +02:00
zimoun 881eaae1ab
guix package: Support multiple profiles with '--list-installed'.
* guix/scripts/package.scm (process-query): List installed multiple profiles.
* tests/guix-package-net.sh: Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-23 16:29:29 +02:00
Ludovic Courtès c7d2dd6900
upstream: Use 'origin-hash'.
* guix/upstream.scm (update-package-source): Use 'origin-hash' instead
of 'origin-sha256'.
2020-05-22 01:30:10 +02:00
Ludovic Courtès feea1d0e62
lint: archival: Use 'origin-hash'.
* guix/lint.scm (check-archival): Use 'origin-hash' instead of
'origin-sha256', removing hard-coded "sha256".
2020-05-22 01:30:09 +02:00
Ludovic Courtès ce0be5675b
packages: Introduce <content-hash> and use it in <origin>.
* guix/packages.scm (<content-hash>): New record type.
(define-content-hash-constructor, build-content-hash)
(content-hash): New macros.
(print-content-hash): New procedure.
(<origin>): Rename constructor to '%origin'.
[sha256]: Remove field.
[hash]: New field.  Adjust users.
(origin-compatibility-helper, origin): New macros.
(origin-sha256): New deprecated procedure.
(origin->derivation): Adjust accordingly.
* tests/packages.scm ("package-source-derivation, origin, sha512"): New
test.
* guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax
matching.
* tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users.
* tests/derivations.scm: Likewise.
* tests/store.scm: Likewise.
* tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field
with the right length.
* gnu/packages/aspell.scm (aspell-dictionary)
(aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for
proper syntax matching.
* gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'.
* gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'.
* gnu/packages/readline.scm (readline-patch): Likewise.
* gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to
'sha256-bv'.
* guix/import/utils.scm: Hide (gcrypt hash) 'sha256'.
2020-05-22 01:29:39 +02:00
Ludovic Courtès 56f7ca6e7c
packages: Add 'base64' macro.
* guix/packages.scm (define-compile-time-decoder): New macro.
(base32): Redefine in terms of it.
(base64): New macro.
2020-05-22 00:35:24 +02:00
Ludovic Courtès 0e4e9c8e76
guix hash, guix download: Support base64 format.
* guix/scripts/download.scm (show-help, %options): Support "base64"
format.
* guix/scripts/hash.scm (show-help, %options): Likewise.
* tests/guix-hash.sh: Test it.
* doc/guix.texi (Invoking guix hash): Document it.
2020-05-22 00:35:24 +02:00
Ludovic Courtès 18ae1ec3ec
guix hash, guix download: Add '--hash'.
* guix/scripts/download.scm (%default-options): Add 'hash-algorithm'.
(show-help, %options): Add "--hash".
(guix-download): Honor it.
* guix/scripts/hash.scm (%default-options): Add 'hash-algorithm'.
(show-help, %options): Add "--hash".
(guix-hash): Honor it.
* tests/guix-hash.sh: Test '-H sha512'.
* doc/guix.texi (Invoking guix download): Document it.
(Invoking guix hash): Document it.
2020-05-22 00:35:24 +02:00
Pierre Neidhardt c3f1f09586
build: asdf-build-system: Use SBCL source in CL packages.
* guix/build/asdf-build-system.scm (copy-files-to-output): Don't attempt to
  reset timestamps on files without write access.
  (install): When parent SBCL package is in the inputs, use its source.  This
  way we get possibly patched sources in CL packages as well (e.g. for FFI).
  This is also useful for sources that generate files on load-op, like cl-unicode.

* guix/build-system/asdf.scm (package-with-build-system): Forward the SBCL
  parent as a native input so that it can be used in the above install phase.
2020-05-21 11:53:06 +02:00
Ricardo Wurmus 5e3d169945
publish: Improve performance by increasing buffer size.
* guix/scripts/publish.scm (http-write): Increase socket send buffer.
2020-05-19 23:15:41 +02:00
Alex Sassmannshausen 70e33ec795
build-system/guile: Expose #:scheme-file-regexp.
* guix/build-system/guile.scm (%scheme-file-regexp): New variable.
  (guile-build): Accept #:scheme-file-regexp and pass it on to builder.
2020-05-18 15:37:23 +02:00
Ekaitz Zarraga 9a27d84b7a
guix describe: Add '--list-formats'
* guix/scripts/describe.scm (%available-formats): New variable.
(list-formats): New procedure.
(%options, show-help): Add --list-formats
* doc/guix.texi: Add --list-formats

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-18 15:08:58 +02:00
Efraim Flashner 5b77e9ca14
build: minify-build-system: Fail to install empty files.
* guix/build/minify-build-system.scm (install): Produce an error if the
minified file is zero bytes.
2020-05-18 09:52:47 +03:00
Ludovic Courtès 300a54bb98
utils: 'target-arm32?' & co. take an optional parameter.
* guix/utils.scm (target-arm32?, target-aarch64?)
(target-arm?, target-64bit?): Make 'target' an optional parameter.
2020-05-16 00:34:41 +02:00
Ludovic Courtès 644cb40cd8
gexp: Add 'let-system'.
* guix/gexp.scm (<system-binding>): New record type.
(let-system): New macro.
(system-binding-compiler): New procedure.
(default-expander): Add 'self-quoting?' case.
(self-quoting?): New procedure.
(lower-inputs): Add 'filterm'.  Pass the result of
'mapm/accumulate-builds' through FILTERM.
(gexp->sexp)[self-quoting?]: Remove.
* tests/gexp.scm ("let-system", "let-system, target")
("let-system, ungexp-native, target")
("let-system, nested"): New tests.
* doc/guix.texi (G-Expressions): Document it.
2020-05-16 00:34:41 +02:00
Ludovic Courtès d03001a31a
gexp: Compilers can now return lowerable objects.
* guix/gexp.scm (lower-object): Iterate if LOWERED is a struct.
(lower+expand-object): New procedure.
(gexp->sexp): Use it.
(define-gexp-compiler): Adjust docstring.
2020-05-16 00:34:40 +02:00
Ludovic Courtès 2b8a9cca01
licenses: Update Zlib license URL.
* guix/licenses.scm (zlib): Change URL.
2020-05-15 12:27:22 +02:00
Ludovic Courtès 01611d141e
quirks: Add patch for <https://bugs.gnu.org/41214>.
Fixes <https://bugs.gnu.org/41214>.

* guix/quirks.scm (%bug-41214-patch): New variable.
(%patches): Add it.
2020-05-15 12:27:10 +02:00
Ludovic Courtès 9db8836916
channels: 'build-from-source' restores '%guile-for-build'.
Not restoring it would cause problems when running:

  guix time-machine --commit=6298c3ffd9654d3231a6f25390b056483e8f407c

or similar because the target Guix would be built with 2.2, and then
we'd erroneously go on and attempt build the profile with 2.2.  This
would fail because profile dependencies such as "guile-gdbm-ffi" now
target 3.0.

* guix/channels.scm (call-with-guile): New procedure.
(with-guile): New macro.
(build-from-source): Use it instead of calling 'set-guile-for-build'
just once.  This ensures that '%guile-for-build' is restored
afterwards.
2020-05-15 12:27:10 +02:00
Jan (janneke) Nieuwenhuizen 0d371c633f
syscalls: Adjust 'sockaddr-in', 'sockaddr-in6' structs for the Hurd.
* guix/build/syscalls.scm (sockaddr-in,sockaddr-in6): Rename to ...
(sockaddr-in/linux, sockaddr-in6/linux): ... this.  Rename introduced bindings
as well.
(write-socket-address!/linux,read-socket-address/linux): Rename from
(write-socket-address!, read-socket-address): ... new switches between those
and ...
(write-socket-address!/hurd, read-socket-address/hurd): ... these new function.
2020-05-15 10:08:56 +02:00
Ludovic Courtès 2050734717
channels: Move quirks and patches to (guix quirks).
* guix/channels.scm (apply-patches): Don't access <patch> record
directly; use 'applicable-patch?' and 'apply-patch' instead.
(<patch>, syscalls-reexports-local-variables?)
(guile-2.2.4, %quirks, %bug-41028-patch, %patches): Move to...
* guix/quirks.scm: ... here.  New file.
(apply-patch, applicable-patch?): New procedures.
2020-05-15 00:01:39 +02:00
Ludovic Courtès 6456232164
pack: Add relocation via ld.so and fakechroot.
* gnu/packages/aux-files/run-in-namespace.c (HAVE_EXEC_WITH_LOADER): New
macro.
(bind_mount): Rename to...
(mirror_directory): ... this.  Add 'firmlink' argument and use it
instead of calling mkdir/open/close/mount directly.
(bind_mount, make_symlink): New functions.
(exec_in_user_namespace): Adjust accordingly.
(exec_with_loader) [HAVE_EXEC_WITH_LOADER]: New function.
(exec_performance): New function.
(engines): Add them.
* guix/scripts/pack.scm (wrapped-package)[fakechroot-library]
[audit-module]: New procedures.
[audit-source]: New variable.
[build](elf-interpreter, elf-loader-compile-flags): New procedures.
(build-wrapper): Use them.
* tests/guix-pack-relocatable.sh: Test with
'GUIX_EXECUTION_ENGINE=fakechroot'.
* doc/guix.texi (Invoking guix pack): Document the 'performance' and
'fakechroot' engines.
* gnu/packages/aux-files/pack-audit.c: New file.
* Makefile.am (AUX_FILES): Add it.
2020-05-14 17:21:27 +02:00
Ludovic Courtès 80963744a2
store: 'mapm/accumulate-builds' preserves '%current-target-system'.
Fixes <https://bugs.gnu.org/41182>.

* guix/store.scm (mapm/accumulate-builds): Pass #:system and #:target to
'run-with-store'.
* tests/store.scm ("mapm/accumulate-builds, %current-target-system"):
New test.
* tests/guix-pack.sh: Add 'guix pack -d --target' test.
2020-05-14 17:21:27 +02:00
Ludovic Courtès f52fbf7094
packages: Ensure bags are insensitive to '%current-target-system'.
Fixes a bug whereby a bag's transitive dependencies would depend on the
global '%current-target-system' value.

Partly fixes <https://issues.guix.gnu.org/41182>.

* guix/packages.scm (bag-transitive-inputs)
(bag-transitive-build-inputs, bag-transitive-target-inputs):
Parameterize '%current-target-system'.
* tests/packages.scm ("package->bag, sensitivity to %current-target-system"):
New test.
2020-05-14 17:21:27 +02:00
Ludovic Courtès a89df83c79
pack: Do not cross-compile the image building tools.
Until now, something like:

  guix pack -f docker --target=arm-linux-gnueabihf

would attempt to cross-compile tar.

* guix/scripts/pack.scm (self-contained-tarball): Pass #:target to
'gexp->derivation'.
(squashfs-image): Use #+ instead of #$ for ARCHIVER.  Use 'file-append'
instead of 'string-append'.  Pass #:target to 'gexp->derivation'.
(docker-image): Likewise.
2020-05-14 17:21:27 +02:00
Jan (janneke) Nieuwenhuizen df05842332
syscalls: Add 'getxattr'.
* guix/build/syscalls.scm (getxattr): New procedure.
* tests/syscalls.scm ("getxattr, setxattr"): Test it, together with setxattr.
2020-05-14 00:48:12 +02:00
Ludovic Courtès a4d76a514f
compile: Reduce optimization levels for gnu/services and gnu/packages.
* guix/build/compile.scm (optimization-options)[strip-option]
[override-option]: New procedures.
Add case for "gnu/services".  Change "gnu/packages" to
'-O0 -Opartial-eval'.
2020-05-13 23:35:57 +02:00
Jan (janneke) Nieuwenhuizen d155c9d934
syscalls: Add 'setxattr'.
* guix/build/syscalls.scm (setxattr): New procedure.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-05-13 23:26:06 +02:00
pimi daf9fa94e2
guix: cran: Add missing default R package.
* guix/import/cran.scm (default-r-packages): Add "datasets" to the list of
default R packages.

Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
2020-05-13 14:02:58 +02:00
nikita 3c986a7dc2
mailmap: Update entries for Nikita.
* .mailmap: change email and name for Nikita.
* Makefile.am, doc/guix.texi, etc/completion/fish/guix.fish,
gnu/packages/accessibility.scm, gnu/packages/admin.scm,
gnu/packages/audio.scm, gnu/packages/autotools.scm, gnu/packages/cdrom.scm,
gnu/packages/check.scm, gnu/packages/cinnamon.scm,
gnu/packages/compression.scm, gnu/packages/crypto.scm,
gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm,
gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/emacs.scm,
gnu/packages/enlightenment.scm, gnu/packages/erlang.scm,
gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm,
gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm,
gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm,
gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile-xyz.scm,
gnu/packages/haskell-apps.scm, gnu/packages/haskell-check.scm,
gnu/packages/haskell-crypto.scm, gnu/packages/haskell-xyz.scm,
gnu/packages/haskell.scm, gnu/packages/image-viewers.scm,
gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm,
gnu/packages/libcanberra.scm, gnu/packages/linux.scm,
gnu/packages/lisp-xyz.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm,
gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm,
gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm,
gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm,
gnu/packages/ncurses.scm, gnu/packages/networking.scm,
gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm,
gnu/packages/perl-check.scm, gnu/packages/perl.scm,
gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm,
gnu/packages/python-web.scm, gnu/packages/python-xyz.scm,
gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm,
gnu/packages/rust.scm, gnu/packages/scheme.scm,
gnu/packages/serialization.scm, gnu/packages/shells.scm,
gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm,
gnu/packages/telephony.scm, gnu/packages/text-editors.scm,
gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm,
gnu/packages/tor.scm, gnu/packages/version-control.scm,
gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm,
gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm,
gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm,
gnu/services/desktop.scm, gnu/services/version-control.scm,
gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2020-05-13 09:30:26 +03:00
Ludovic Courtès 88a96c568c
guix graph: Add '--path'.
* guix/scripts/graph.scm (display-path): New procedure.
(%options, show-help): Add '--path'.
(guix-graph): Handle it.
* tests/guix-graph.sh: Add tests.
* doc/guix.texi (Invoking guix graph): Document it.
(Invoking guix size): Mention it.
2020-05-11 23:30:55 +02:00
Ludovic Courtès 36c2192414
graph: Add 'shortest-path'.
* guix/graph.scm (shortest-path): New procedure.
* tests/graph.scm ("shortest-path, packages + derivations")
("shortest-path, reverse packages")
("shortest-path, references"): New tests.
2020-05-11 23:30:55 +02:00
Ludovic Courtès 7240202136
graph: reference/referrer node types work with graph traversal.
The graph traversal procedures in (guix graph) assume that nodes can be
compared with 'eq?', which was not the case for nodes of
%REFERENCE-NODE-TYPE and %REFERRER-NODE-TYPE (strings).

* guix/scripts/graph.scm (intern): New procedure.
(ensure-store-items, references*)
(%reference-node-type, non-derivation-referrers)
(%referrer-node-type): Use it on all store items.
* tests/graph.scm ("node-transitive-edges, references"): New test.
2020-05-11 23:30:55 +02:00
zimoun baf1ce82b1
guix package, show: Support multiple queries.
* guix/scripts/package.scm (process-query): Show multiple queries.
* guix/scripts/show.scm (guix-show): Reverse to display in order.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-11 23:30:54 +02:00
Marius Bakke 4bdf4182fe
Merge branch 'core-updates' 2020-05-08 21:40:51 +02:00
Marius Bakke 2ca603f113
build-system/emacs: Hide the 'delete' binding from (guix build utils).
This gets rid of a warning from 'compute-guix-derivation.drv' when running on
Guile 3.0.  (guix build emacs-build-system) includes (srfi srfi-1) anyway.

* guix/build/emacs-build-system.scm: Do not import 'delete' from (guix build utils).
2020-05-07 15:14:46 +02:00
Caleb Ristvedt b338c41c82
nar: 'with-temporary-store-file' uses a single connection
Previously the 'with-store' form was entered every time a different temporary
file was tried.  This caused there to be as many simultaneous open connections
as there were attempts, and prevented the (loop ...) call from being a tail
call.  This change fixes that.

* guix/nar.scm (with-temporary-store-file): open connection once prior to
  entering the loop.
2020-05-07 05:56:01 -05:00
Caleb Ristvedt 37edbc91e3
nar: 'finalize-store-file' follows proper store lock protocol.
* guix/nar.scm (finalize-store-file): check for deletion token when acquiring
  lock, write deletion token and delete lock file before releasing lock.
2020-05-07 05:56:01 -05:00
Ludovic Courtès d6c43d7bc1
guix system: 'docker-image' honors '--network'.
* gnu/system/vm.scm (system-docker-image): Add #:shared-network? and
pass it to 'containerized-operating-system'.
(qemu-image):
* guix/scripts/system.scm (system-derivation-for-action): Pass
 #:shared-network? to 'system-docker-image'.
* doc/guix.texi (Invoking guix system): Document it.
2020-05-07 12:55:14 +02:00
Ludovic Courtès ff3ca7979e
channels: Add patch for <https://bugs.gnu.org/41028>.
Without this patch, we couldn't jump from here to commits before
05e783871c because the
'compute-guix-derivation' script would crash with an unbound-variable
error for 'call-with-new-thread'.

Fixes <https://bugs.gnu.org/41028>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/channels.scm (%bug-41028-patch): New variable.
(%patches): Add it.
2020-05-07 10:06:15 +02:00
Ludovic Courtès 053b10c3ef
channels: Add mechanism to patch checkouts of the 'guix channel.
* guix/channels.scm (<patch>): New record type.
(apply-patches): New procedure.
(latest-channel-instance)[dot-git?]: New procedure.
Use 'update-cached-checkout' and 'add-to-store' instead of
'latest-repository-commit'.  Call 'apply-patches' when CHANNEL is the
'guix channel.
(%patches): New variable.
* guix/git.scm (url+commit->name): Make public.
* tests/channels.scm ("latest-channel-instances includes channel dependencies")
("latest-channel-instances excludes duplicate channel dependencies"):
Mock 'update-cached-checkout' instead of 'latest-repository-commit'.
Wrap body in 'with-store' and pass the store to 'latest-channel-instances'.
2020-05-07 10:06:15 +02:00
Ludovic Courtès 4ba425060a
channels: Add 'latest-channel-instance'.
* guix/channels.scm (latest-channel-instance): New procedure.
(latest-channel-instances): Use it.
2020-05-07 10:06:15 +02:00
Jan (janneke) Nieuwenhuizen 598be42dfa
syscalls: Add ioctl flags for the Hurd.
Use

    #include <stdio.h>
    #include <net/if.h>
    #include <hurd/ioctl.h>

    int
    main ()
    {
      printf ("SIOCSIFFLAGS #x%x\n", SIOCSIFFLAGS);
      printf ("SIOCGIFADDR #x%x\n", SIOCGIFADDR);
      printf ("SIOCSIFADDR #x%x\n", SIOCSIFADDR);
      printf ("SIOCGIFNETMASK #x%x\n", SIOCGIFNETMASK);
      printf ("SIOCSIFNETMASK #x%x\n", SIOCSIFNETMASK);
    #if 0
      printf ("SIOCADDRT #x%x\n", SIOCADDRT);
      printf ("SIOCDELRT #x%x\n", SIOCDELRT);
    #endif
    }

to fill in some blanks.  Adding and removing route apparently not supported.

* guix/build/syscalls.scm (SIOCSIFFLAGS SIOCGIFADDR, SIOCSIFADDR,
SIOCGIFNETMASK, SIOCSIFNETMASK):
2020-05-07 07:11:03 +02:00
Marius Bakke c263cfdcde
Merge branch 'master' into core-updates 2020-05-06 23:37:40 +02:00
Ludovic Courtès 86f5decd20
syscalls: 'define-c-struct' supports cross-compilation.
Reported by Jan (janneke) Nieuwenhuizen <janneke@gnu.org>.

Before that, we'd always use the 'sizeof' and 'alignof' value obtained
from the host at macro-expansion time.

* guix/build/syscalls.scm (sizeof*, alignof*): When the target word size
differs from the host word size, emit a call to 'sizeof'/'alignof'.
2020-05-05 23:45:56 +02:00
Marius Bakke 87a40d7203
Merge branch 'master' into core-updates 2020-05-05 20:43:21 +02:00
Mathieu Othacehe f19cf27c2b
image: Add a new API.
Raw disk-images and ISO9660 images are created in a Qemu virtual machine. This
is quite fragile, very slow, and almost unusable without KVM.

For all these reasons, add support for host image generation. This implies the
use new image generation mechanisms.

- Raw disk images: images of partitions are created using tools such as mke2fs
  and mkdosfs depending on the partition file-system type. The partition
  images are then assembled into a final image using genimage.

- ISO9660 images: the ISO root directory is populated within the store. GNU
  xorriso is then called on that directory, in the exact same way as this is
  done in (gnu build vm) module.

Those mechanisms are built upon the new (gnu image) module.

* gnu/image.scm: New file.
* gnu/system/image.scm: New file.
* gnu/build/image: New file.
* gnu/local.mk: Add them.
* gnu/system/vm.scm (system-disk-image): Rename to system-disk-image-in-vm.
* gnu/ci.scm (qemu-jobs): Adapt to new API.
* gnu/tests/install.scm (run-install): Ditto.
* guix/scripts/system.scm (system-derivation-for-action): Ditto.
2020-05-05 16:13:53 +02:00
Mathieu Othacehe fd1351ab0a
build: store-copy: Export file-size procedure.
* guix/build/store-copy.scm (file-size): Export it.
2020-05-05 16:08:32 +02:00
Ludovic Courtès 06735a57a9
openpgp: Add missing type predicate for '&openpgp-invalid-signature-error'.
Reported by brendyyn on #guix.  The mistake led to a macro expansion
error on Guile 2.2 but not on 3.0.2.

* guix/openpgp.scm (&openpgp-invalid-signature-error): Add missing type
predicate.
2020-05-04 10:51:39 +02:00
Ludovic Courtès 05d973eef2
openpgp: Raise error conditions instead of calling 'error'.
* guix/openpgp.scm (&openpgp-error, &openpgp-unrecognized-packet-error)
(&openpgp-invalid-signature-error): New error conditions.
(openpgp-hash-algorithm): Add 'signature-port' parameter.  Raise an
error condition instead of calling 'error'.
(parse-subpackets): Likewise.
(get-data): Raise instead of calling 'error'.
(get-openpgp-detached-signature/ascii): Likewise.
(get-signature): Likewise.
2020-05-04 09:56:13 +02:00
Ludovic Courtès b835e158d5
openpgp: Add 'string->openpgp-packet'.
* guix/openpgp.scm (string->openpgp-packet): New procedure.
* tests/openpgp.scm ("verify-openpgp-signature, missing key")
("verify-openpgp-signature, good signatures")
("verify-openpgp-signature, bad signature"): Use it.
2020-05-04 09:56:13 +02:00
Ludovic Courtès bd8126558d
openpgp: 'lookup-key-by-{id,fingerprint}' return the key first.
Previously, 'lookup-key-by-{id,fingerprint}' would always return the
list of packets where the primary key is first.  Thus, the caller would
need to use 'find' to actually find the requested key.

* guix/openpgp.scm (keyring-insert): Always add KEY to PACKETS.
(lookup-key-by-id, lookup-key-by-fingerprint): Change to return the key
as the first value.
(verify-openpgp-signature): Remove now unneeded call to 'find'.
* tests/openpgp.scm ("get-openpgp-keyring"): Adjust accordingly.
2020-05-04 09:56:13 +02:00
Ludovic Courtès b45fa0a123
openpgp: 'verify-openpgp-signature' looks up by fingerprint when possible.
* guix/openpgp.scm (verify-openpgp-signature): Use
'lookup-key-by-fingerprint' when SIG contains a fingerprint.
Honor FINGERPRINT in the 'find' predicate.  Upon missing-key, return
FINGERPRINT if available.
* tests/openpgp.scm ("verify-openpgp-signature, missing key"): Adjust
expected value accordingly.
2020-05-04 09:56:12 +02:00
Ludovic Courtès efe1f0122c
openpgp: Add 'lookup-key-by-fingerprint'.
* guix/openpgp.scm (<openpgp-keyring>)[table]: Rename to...
[ids]: ... this.
[fingerprints]: New field.
(keyring-insert, lookup-key-by-fingerprint): New procedures.
(%empty-keyring): Adjust.
(get-openpgp-keyring): Manipulate KEYRING instead of its vhash, use
'keyring-insert'.
* tests/openpgp.scm ("get-openpgp-keyring"): Test
'lookup-key-by-fingerprint'.
2020-05-04 09:56:12 +02:00
Ludovic Courtès 7b2b3a13cc
openpgp: Store the issuer key id and fingerprint in <openpgp-signature>.
* guix/openpgp.scm (<openpgp-signature>)[issuer, issuer-fingerprint]:
New fields.
(openpgp-signature-issuer, openpgp-signature-issuer-fingerprint): Remove.
(verify-openpgp-signature): Use 'openpgp-signature-issuer-key-id'.
(get-signature): Initialize 'issuer' and 'issuer-fingerprint'.
* tests/openpgp.scm ("get-openpgp-detached-signature/ascii"): Adjust
accordingly.
2020-05-04 09:56:12 +02:00
Ludovic Courtès 4459c7859c
openpgp: Decode the issuer-fingerprint signature subpacket.
* guix/openpgp.scm (SUBPACKET-ISSUER-FINGERPRINT): New variable.
(openpgp-signature-issuer-fingerprint): New procedure.
(key-id-matches-fingerprint?): New procedure.
(get-signature): Look for the 'issuer and 'issuer-fingerprint
subpackets.  Ensure the issuer key ID matches the fingerprint when both
are available.
(parse-subpackets): Handle SUBPACKET-ISSUER-FINGERPRINT.
* tests/openpgp.scm (%rsa-key-fingerprint)
(%dsa-key-fingerprint, %ed25519-key-fingerprint): New variables.
* tests/openpgp.scm ("get-openpgp-detached-signature/ascii"): Check the
result of 'openpgp-signature-issuer-fingerprint'.
2020-05-04 09:56:12 +02:00
Ludovic Courtès 43408e304f
Add (guix openpgp).
* guix/openpgp.scm, tests/openpgp.scm, tests/civodul.key,
tests/dsa.key, tests/ed25519.key, tests/rsa.key,
tests/ed25519.sec: New files.
* Makefile.am (MODULES): Add guix/openpgp.scm.
(SCM_TESTS): Add tests/openpgp.scm.
(EXTRA_DIST): Add tests/*.key and tests/ed25519.sec.
2020-05-04 09:56:12 +02:00
Marius Bakke 50e6c1bf2e
Merge branch 'master' into core-updates 2020-05-02 17:31:28 +02:00
Ludovic Courtès 69de98391d
profiles: Mark manual database as non-substitutable.
Fixes <https://bugs.gnu.org/40381>.
Reported by pkill9 <pkill9@runbox.com>.

* guix/profiles.scm (manual-database): Pass #:substitutable? #f.
2020-05-01 01:21:03 +02:00
Marius Bakke 8bf8cd9b85
Merge branch 'master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/backup.scm
	gnu/packages/emacs-xyz.scm
	gnu/packages/guile.scm
	gnu/packages/lisp.scm
	gnu/packages/openldap.scm
	gnu/packages/package-management.scm
	gnu/packages/web.scm
	gnu/packages/xorg.scm
2020-04-30 23:47:49 +02:00
Jakub Kądziołka 4035c3e352
Merge branch 'master' into staging 2020-04-29 11:08:42 +02:00