Commit Graph

4218 Commits (b6dc08393e6a8313b88ce422fc3c1e4e9c0efc6f)

Author SHA1 Message Date
Ludovic Courtès 77c2899cd4
compile: Enable 'shadowed-toplevel' warning.
* guix/build/compile.scm (%warnings): Add 'shadowed-toplevel'.
2019-06-25 17:41:24 +02:00
Ludovic Courtès b6f5339dd0
progress: Call 'time-difference' on times of the same type.
Guile 2.2.5 and 2.9.2 would catch the issue.
This is a followup to 88bc3c89bf.

* guix/progress.scm (display-download-progress)[elapsed]: Pass
'current-time' the same type as START-TIME.
2019-06-24 23:10:13 +02:00
Ludovic Courtès bb11825f35
publish: Work around Guile 2.2.5 (web server) bug.
* guix/scripts/publish.scm: Replace (@@ (web http) read-header-line) on
Guile 2.2.5.
2019-06-24 17:50:08 +02:00
Ludovic Courtès 92359aed40
guix build: '--log-file' no longer returns several log files.
Fixes a regression introduced in
9353b199c1 whereby something like:

  guix build --log-file $(guix build -d guile)

would return two log files.  This led to a failure of 'tests/guix-build.sh'.

* guix/scripts/build.scm (guix-build): Filter out derivation file names
from ITEMS.
2019-06-23 19:53:03 +02:00
Ludovic Courtès 0f2d9c3290
guix build: Use 'warning' for warnings.
* guix/scripts/build.scm (options->derivations): Use 'warning' instead
of 'format'.
2019-06-23 19:53:03 +02:00
Giovanni Biscuolo 78407a27cf
licenses: Add Historical Permission Notice and Disclaimer license
* gnu/licenses.scm (hpnd): New variable.
2019-06-20 18:24:49 +02:00
Robert Vollmert 3149c00264
utils: canonical-newline-port: Fix handling of carriage return at buffer end.
Prior to this change the added test fails for me locally at byte
1024. It might depend on some default buffer sizes.

Fixes <https://bugs.gnu.org/35863>.

* tests/utils.scm ("canonical-newline-port-1024"): Add test.
* guix/utils.scm (canonical-newline-port): Correct comments on CR/LF.
Remove CR even when they're at the end of the buffer.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-20 14:07:01 +02:00
Ludovic Courtès aad086d871
grafts: Avoid 'query-valid-derivers' RPC.
Previously we'd make 502 'query-valid-derivers' RPCs for
"guix build vim -d", and after this patch, we don't do any.

Furthermore, the previous strategy was "stateful" in the sense that
'item->deriver' could return a derivation that is not the one that was
actually computed by this process, but an "equivalent" one (due to
fixed-output derivations); which one is chosen would depend on the state
of the store.

This in turn means that we'd have to call 'read-derivation-from-file' to
actually read .drv files (as opposed to getting them from
%DERIVATION-CACHE).  This is costly and doesn't work with
GUIX_DAEMON_SOCKET=ssh://….

* guix/grafts.scm (item->deriver): Remove.
(reference-origin): New procedure.
(cumulative-grafts): Use it instead of 'item->deriver'.
2019-06-19 22:56:27 +02:00
Ludovic Courtès 2ef22a9f37
derivations: Add 'derivation-input-derivation'.
* guix/derivations.scm (derivation-input-derivation): New procedure.
(derivation-prerequisites): Use it.
2019-06-19 22:56:27 +02:00
Ludovic Courtès 9353b199c1
guix build: '--log-file' looks for build logs of equivalent derivations.
Previously, '--log-file' would look for log files only for the current
derivation, and thus wouldn't find log files of equivalent derivations
that produce the same output.

* guix/scripts/build.scm (guix-build) <log-file?>: Replace
'derivation-file-name' by 'derivation->output-path'.
2019-06-18 16:25:09 +02:00
Marius Bakke a60dbad3bc
Merge branch 'staging' 2019-06-15 09:46:12 +02:00
Robert Vollmert ca45da9fc9
import: hackage: Handle Hackage revisions.
Hackage packages can have metadata revisions (Cabal file only) that are
not reflected in the source archive.  The Haskell build system has
support for this, but until now the Hackage importer would create a
package based on the revised Cabal file which would then build using the
old Cabal file.

Fixes <https://bugs.gnu.org/35750>.

* guix/import/cabal.scm (<cabal-package>): Add 'revision' field.
(eval-cabal): Parse 'x-revision:' property.
* guix/import/hackage.scm (read-cabal-and-hash): New procedure.
(hackage-fetch-and-hash): New procedure.
(hackage-fetch): Rewrite using 'hackage-fetch-and-hash'.
(hackage-module->sexp): Add 'cabal-hash' argument and use it to populate
the '#:cabal-revision' argument.
(hackage->guix-package): Use the new '-and-hash' functions to get the
hash of the Cabal file and pass it to 'hackage-module->sexp'.
* guix/tests/hackage.scm: Test import of Cabal file revision.

Signed-off-by: Timothy Sample <samplet@ngyro.com>
2019-06-13 22:18:52 -04:00
Robert Vollmert ed8d3f33a5
build-system/haskell: Generate Setup.hs if needed.
The default Setup.hs is boilerplate that is frequently left out of
source packages.  Several packages already add a phase to generate it,
so moving this phase to the build system is just factoring out an
existing pattern.

See <https://github.com/phadej/time-compat/issues/4>.

* guix/build/haskell-build-system.scm (generate-setuphs): New procedure.
(%standard-phases): Add it after 'unpack'.
* gnu/packages/haskell.scm (ghc-foundation, ghc-inline-c,
ghc-inline-c-cpp, ghc-rio): Remove 'arguments'.

Signed-off-by: Timothy Sample <samplet@ngyro.com>
2019-06-13 13:30:24 -04:00
Robert Vollmert 5f9f2c82e6
build-system/haskell: Fix Haddock phase docstring.
* guix/build/haskell-build-system.scm (haddock): Fix docstring.

Signed-off-by: Timothy Sample <samplet@ngyro.com>
2019-06-13 13:30:23 -04:00
Ivan Petkov 5a9ef8a960
import: crate: Define dependencies as arguments.
* guix/import/crate.scm:
(crate-fetch)[input-crates]: Rename to dev-crates.
[native-input-crates]: Rename to dev-dep-crates.
[inputs]: Rename to cargo-inputs.
[native-inputs]: Rename to cargo-development-inputs.
(maybe-cargo-inputs, maybe-cargo-development-inputs, maybe-arguments): Add
them.
(make-crate-sexp)[inputs]: Rename to cargo-inputs.
[native-inputs]: Rename to cargo-development-inputs.
[maybe-native-inputs, maybe-inputs]: Replace with maybe-arguments.
* guix/import/utils.scm: (package-names->package-inputs): Make public.  Add
docstring.
* tests/crate.scm (crate->guix-package): Update the match pattern.

Signed-off-by: Chris Marusich <cmmarusich@gmail.com>
2019-06-11 18:05:44 -07:00
Ivan Petkov d608e231e3
build-system/cargo: Don't copy source as an output.
* guix/build-system/cargo.scm: (cargo-build)[build-expression->derivation]:
Don't add "src" output.
* guix/build/cargo-build-system.scm: (install-source): Delete it.
(%standard-phases): Delete 'install-source.

Signed-off-by: Chris Marusich <cmmarusich@gmail.com>
2019-06-11 18:05:44 -07:00
Ivan Petkov efdf2ae14e
build-system/cargo: Use sources from package sources.
* guix/build/cargo-build-system.scm (crate-src?): New procedure.
(configure): Use the new procedure to expand crate tarballs in the vendor
directory.

Signed-off-by: Chris Marusich <cmmarusich@gmail.com>
2019-06-11 18:05:44 -07:00
Ivan Petkov a6ab6b7877
build-system/cargo: Expand transitive crate sources.
* guix/build/cargo: (package-cargo-inputs): Add it.
(package-cargo-development-inputs): Add it.
(crate-closure): Add it.
(expand-crate-sources): Add it.
(lower)[private-keywords]: Add #:cargo-inputs and
[bag]: Use expand-crate-sources to augment build-inputs.

Signed-off-by: Chris Marusich <cmmarusich@gmail.com>
2019-06-11 18:05:41 -07:00
Ludovic Courtès c5f66d2931
pack: Fix 'guix pack -f docker'.
Regression introduced in a0f352b30f.

* guix/scripts/pack.scm (docker-image): Check whether ENTRY-POINT is
true before returning (string-append #$profile ...).
2019-06-10 23:16:47 +02:00
Ludovic Courtès f8a9f99cd6
store: 'build-things' accepts derivation/output pairs.
This allows callers to request the substitution of a single derivation
output.

* guix/store.scm (build-things): Accept derivation/output pairs among
THINGS.
* guix/derivations.scm (build-derivations): Likewise.
* tests/store.scm ("substitute + build-things with specific output"):
New test.
* tests/derivations.scm ("build-derivations with specific output"):
New test.
* doc/guix.texi (The Store): Adjust accordingly.
2019-06-10 22:42:59 +02:00
Ludovic Courtès 416a7c69f1
ssh: Add missing import.
* guix/ssh.scm: Use (ice-9 format).
2019-06-10 22:42:52 +02:00
Ludovic Courtès 883dc11c3a
download: Update list of content-addressed mirrors.
* guix/download.scm (%content-addressed-mirrors): Change
"berlin.guixsd.org" to "ci.guix.gnu.org" and move it first.
2019-06-10 22:42:23 +02:00
Marius Bakke 0defdb636f
gnu-maintenance: Switch to ftp.mirrorservice.org for KDE updater.
mirrors.mit.edu seems no longer available over FTP.

* guix/gnu-maintenance.scm (latest-kde-release): Change from mirrors.mit.edu
to ftp.mirrorservice.org.
2019-06-10 13:58:24 +02:00
Ludovic Courtès f54cab2784
import: utils: 'specs->package-lists' correctly matches "out".
* guix/import/utils.scm (specs->package-lists): Match "out", not ("out").
2019-06-07 22:55:50 +02:00
Ludovic Courtès c0a4db6697
import: print: Honor the outputs of inputs (!).
Fixes <http://bugs.gnu.org/35893>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

* guix/import/print.scm (package->code)[package-lists->code]: Preserve
OUT in the result.
* tests/print.scm (define-with-source): New macro.
(pkg): Use it.
(pkg-source): New variable.
(pkg-with-inputs, pkg-with-inputs-source): New variables.
("simple package"): Refer to 'pkg-source'.
("package with inputs"): New test.
2019-06-07 22:49:47 +02:00
Ludovic Courtès a0f352b30f
pack: Add '--entry-point'.
* guix/scripts/pack.scm (self-contained-tarball): Add #:entry-point and
warn when it's true.
(squashfs-image): Add #:entry-point and honor it.
(docker-image): Add #:entry-point and honor it.
(%options, show-help): Add '--entry-point'.
(guix-pack): Honor '--entry-point' and pass #:entry-point to BUILD-IMAGE.
* gnu/tests/docker.scm (run-docker-test): Test 'docker run' with the
default entry point.
(build-tarball&run-docker-test): Pass #:entry-point to 'docker-image'.
* doc/guix.texi (Invoking guix pack): Document it.
* gnu/tests/singularity.scm (run-singularity-test)["singularity run"]:
New test.
(build-tarball&run-singularity-test): Pass #:entry-point to
'squashfs-image'.
2019-06-07 09:57:19 +02:00
Robert Vollmert 5d9fe4311a
guix: git-download: Remove explicit import.
With guile-git version 0.2, repository-working-directory is no
longer private.

* guix/git-download.scm (git-file-list): Refer to public
repository-working-directory.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-06 20:35:54 +02:00
Ludovic Courtès 70a7a1b5dc
nar: Really lock store files.
Previously, 'lock-store-file' would immediately close the file
descriptor of the '.lock' file, and thus it would immediately release
the lock.

* guix/nar.scm (lock-store-file, unlock-store-file): Remove.
(finalize-store-file): Use 'lock-file' and 'unlock-file' instead.
2019-06-05 23:10:37 +02:00
Ludovic Courtès 5f0cf1df71
syscalls: 'with-lock-file' catches ENOSYS.
* guix/build/syscalls.scm (call-with-file-lock): Catch ENOSYS raised by
'lock-file'.
2019-06-05 23:10:36 +02:00
Ludovic Courtès 89ceb86ad4
syscalls: 'with-file-lock' expands to a call to 'call-with-file-lock'.
* guix/build/syscalls.scm (call-with-file-lock): New procedure.
(with-file-lock): Expand to a call to 'call-with-file-lock'.
2019-06-05 23:10:36 +02:00
Ludovic Courtès b7178c22bf
syscalls: Add 'with-file-lock' macro.
* guix/scripts/offload.scm (lock-file, unlock-file, with-file-lock):
Move to...
* guix/build/syscalls.scm: ... here.
2019-06-05 23:10:36 +02:00
Ludovic Courtès bcb7c900cc
guix package: Do not list environment variables that need to be set.
Fixes <https://bugs.gnu.org/35942>.

* guix/scripts/package.scm (display-search-paths): Rename to...
(display-search-path-hint): ... this.  Adjust callers.
Remove #:kind parameter.  Replace the list of environment variables with
an invitation to source $GUIX_PROFILE/etc/profile or run 'guix package
--search-paths'.
2019-06-05 23:10:36 +02:00
Ludovic Courtès 69962ab7a8
deprecation: Use the 'warning' procedure for diagnostics.
Until now, (guix deprecation) had its own warning mechanism, which was
inconsistent (it did not use colors, etc.)

* guix/deprecation.scm (deprecation-warning-port): Remove
(source-properties->location-string): Remove.
(warn-about-deprecation): Use 'warning' instead of 'format'.
(define-deprecated, define-deprecated/alias): Adjust docstring.
* guix/channels.scm (build-from-source): Refer to 'guix-warning-port'
instead of 'deprecation-warning-port'.
2019-06-03 23:18:47 +02:00
Ludovic Courtès 1b5ee3bdaa
Add (guix diagnostics).
* guix/ui.scm (warning, info, report-error, leave)
(location->string, guix-warning-port, program-name)
(highlight-argument, %highlight-argument, define-diagnostic)
(%warning-color, %info-color, %error-color)
(print-diagnostic-prefix): Move to...
* guix/diagnostics.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
2019-06-03 23:18:47 +02:00
Ludovic Courtès ee2691fa33
services: guix-publish: Allow for multi-compression.
This is a followup to b8fa86adfc.

* guix/deprecation.scm (warn-about-deprecation): Make public.
* gnu/services/base.scm (<guix-publish-configuration>)[compression]: New
field.
[compression-level]: Default to #f.  Add '%' to getter name.
(guix-publish-configuration-compression-level): Define as deprecated.
(default-compression): New procedure.
(guix-publish-shepherd-service)[config->compression-options]: New
procedure.
Use 'match-record' instead of 'match'.
* doc/guix.texi (Base Services): Remove 'compression-level' and document
'compression'.
2019-06-03 23:18:47 +02:00
Robert Vollmert 5b315f3ea9
guix: import: simplify recursive import
This simplifies the logic of recursive-import, intending no
major functional changes. The package import function is no
longer called twice per package. Failed imports now make it
to the package stream as '() instead of #f.

* guix/import/utils.scm (recursive-import): Simplify.

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
2019-06-03 22:52:10 +03:00
Robert Vollmert 959c9d159d
import: hackage: Parse braced properties.
This adds partial support for Cabal properties that use curly
braces instead of the layout rule.  See for example
https://hackage.haskell.org/package/cassava/

* guix/import/cabal.scm (read-braced-value): New procedure.
(is-property): Remove.
(is-layout-property, is-braced-property): New variables.
(lex-property): Rename to...
(lex-layout-property): ... this.
(lex-braced-property, lex-property): New procedures.
(lex-token): Add call to 'lex-property'.
* guix/tests/hackage.scm: Test braced description import.
* tests/hackage.scm (test-cabal-multiline-desc): Rename to...
(test-cabal-multiline-layout): ... this.
("hackage->guix-package test multiline desc"): Rename to...
("hackage->guix-package test multiline desc (layout)"): ... this.
(test-cabal-multiline-braced): New variable.
("hackage->guix-package test multiline desc (braced)"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-06-02 22:16:05 +02:00
Ludovic Courtès b90ae065b5
substitute: Select the best compression methods.
When a server publishes several URLs with different compression methods,
'guix substitute' can now choose the best one among the compression
methods that it supports.

* guix/scripts/substitute.scm (<narinfo>)[uri]: Replace with...
[uris]: ... this.
[compression]: Replace with...
[compressions]: ... this.
[file-size]: Replace with...
[file-sizes]: ... this.
[file-hash]: Replace with...
[file-hashes]: ... this.
(narinfo-maker): Adjust accordingly.  Ensure 'file-sizes' and
'file-hashes' have the right length.
(assert-valid-signature, valid-narinfo?): Use the first element of
'narinfo-uris' in error messages.
(read-narinfo): Expect "URL", "Compression", "FileSize", and "FileHash"
to occur multiple times.
(display-narinfo-data): Call 'select-uri' to determine the file size.
(%compression-methods): New variable.
(supported-compression?, compresses-better?, select-uri): New
procedures.
(process-substitution): Call 'select-uri' to select the URI and
compression.
* guix/scripts/weather.scm (report-server-coverage): Account for all the
values returned by 'narinfo-file-sizes'.
* tests/substitute.scm ("substitute, narinfo with several URLs"): New
test.
2019-06-02 22:01:57 +02:00
Ludovic Courtès b8fa86adfc
publish: '--compression' can be repeated.
This allows 'guix publish' to compress and advertise multiple
compression methods from which users can choose.

* guix/scripts/publish.scm (actual-compression): Rename to...
(actual-compressions): ... this.  Expect REQUESTED to be a list, and
always return a list.
(%default-options): Remove 'compression.
(store-item->recutils): New procedure.
(narinfo-string): Change #:compression to #:compressions (plural).
Adjust accordingly.
(render-narinfo, render-narinfo/cached): Likewise.
(bake-narinfo+nar): Change #:compression to #:compressions.
[compressed-nar-size]: New procedure.
Call 'compress-nar' for each item returned by 'actual-compressions'.
Create a narinfo for each compression.
(effective-compression): New procedure.
(make-request-handler): Change #:compression to #:compressions.
Use 'effective-compression' to determine the applicable compression.
(guix-publish): Adjust handling of '--compression'.
Print a message for each compression that is enabled.
* tests/publish.scm ("/*.narinfo"): Adjust to new narinfo field
ordering.
("/*.narinfo with properly encoded '+' sign"): Likewise.
("/*.narinfo with lzip + gzip"): New test.
("with cache, lzip + gzip"): New test.
* doc/guix.texi (Invoking guix publish): Document it.
2019-06-02 22:01:57 +02:00
Ludovic Courtès e006f7493f
build-system/guile: Display progress report as expected by (guix status).
* guix/build/guile-build-system.scm (report-build-progress): Use a
format string suitable for (guix status).
2019-06-02 22:01:34 +02:00
Ludovic Courtès 30eb738366
build-system/guile: Add #:not-compiled-file-regexp.
* guix/build/guile-build-system.scm (build): Add
 #:not-compiled-file-regexp and honor it.
* guix/build-system/guile.scm (guile-build): Likewise.
(guile-cross-build): Likewise.
2019-06-02 22:01:34 +02:00
Ludovic Courtès abeb54c00b
build-system/guile: Improve reporting of 'guild compile' failures.
* guix/build/guile-build-system.scm (invoke-each)[processes]: New
variable.
[wait-for-one-process]: Check PROCESSES and update it.
[fork-and-run-command]: Update PROCESSES.
2019-06-02 22:01:34 +02:00
Ludovic Courtès b2cddc6fb1
compile: Adjust for Guile 3.
* guix/build/compile.scm (%default-optimizations): Adjust to the new
names in Guile 2.9.2.
2019-06-02 01:38:36 +02:00
Ludovic Courtès 88bc3c89bf
progress: Provide the proper type for %PROGRESS-INTERVAL.
The (srfi srfi-19) module of Guile 2.9.2 catches the wrong type.

* guix/progress.scm (%progress-interval): Change type to TIME-DURATION.
2019-06-02 01:38:36 +02:00
Ludovic Courtès 87399dfc20
lzlib: 'make-lzip-input-port' better handles end of decompression.
Suggested by Pierre Neidhardt <mail@ambrevar.xyz>.

* guix/lzlib.scm (lzread!): Call 'lz-decompress-finish' when
'feed-decoder!' returns EOF.  Call 'lz-decompress-finished?' to
determine end of compression.
2019-06-01 15:26:30 +02:00
Robert Vollmert 1cc12357a6
import: hackage: Update list of ghc-included packages.
Update the list of excepted dependencies for current ghc-8.4, based on the
release notes at
https://downloads.haskell.org/~ghc/8.4.3/docs/html/users_guide/8.4.3-notes.html

Particularly, this adds `text` to the list, which is a dependency of `parsec`
which was already on the list before, causing build failures with updated
versions of the `text` package.

* guix/import/hackage.scm (ghc-standard-libraries): Update list.

Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
2019-06-01 06:22:57 +02:00
Ludovic Courtès 73bddab545
publish: Factorize 'compress-nar'.
* guix/scripts/publish.scm (compress-nar): New procedure.
(bake-narinfo+nar): Use it.
2019-05-29 23:16:49 +02:00
Ludovic Courtès e84e036943
publish: Remove outdated comment.
* guix/scripts/publish.scm (make-request-handler): Remove outdated TODO.
2019-05-29 23:16:49 +02:00
Ricardo Wurmus 531940d388
import: cran: Ignore invalid packages from the system requirements.
* guix/import/cran.scm (description->package): Filter invalid packages from
the list of system requirements.
2019-05-28 23:56:59 +02:00
Ricardo Wurmus fa86654824
self: Fix unquoting.
This is a follow-up to commit dfc69e4b6d.

* guix/self.scm (whole-package): Unquote %storedir in the daemon wrapper.
2019-05-28 23:21:27 +02:00
Ludovic Courtès 35d1354fe8
publish: Display the compression method and level in use.
* guix/scripts/publish.scm (guix-publish): Use 'info' instead of
'format' for the initial message.  When COMPRESSION is true, display the
method and level in use.
2019-05-27 22:47:24 +02:00
Ludovic Courtès c131bea276
lzlib: 'lzread!' never returns more than it was asked for.
Fixes a bug whereby 'lzread!' could return more than COUNT.

* guix/lzlib.scm (lzread!): Rewrite in a semi-functional style.
2019-05-27 22:47:24 +02:00
Ludovic Courtès 73ac9098b1
self: Add dependency on lzlib.
* guix/self.scm (compiled-guix): Pass #:lzlib to 'make-config.scm'.
(make-config.scm): Add #:lzlib and honor it.
(specification->package): Add "lzlib".
2019-05-27 22:47:24 +02:00
Ludovic Courtès 66229b04ae
publish: Add support for lzip.
* guix/scripts/publish.scm (show-help, %options): Support '-C METHOD'
and '-C METHOD:LEVEL'.
(default-compression): New procedure.
(bake-narinfo+nar): Add lzip.
(nar-response-port): Likewise.
(string->compression-type): New procedure.
(make-request-handler): Generalize /nar/gzip handler to handle /nar/lzip
as well.
* tests/publish.scm ("/nar/lzip/*"): New test.
("/*.narinfo with lzip compression"): New test.
* doc/guix.texi (Invoking guix publish): Document it.
(Requirements): Mention lzlib.
2019-05-27 22:47:24 +02:00
Ludovic Courtès 4e48923e75
utils: Support compression and decompression with lzip.
* guix/utils.scm (lzip-port): New procedure.
(decompressed-port, compressed-port, compressed-output-port): Add 'lzip
case.
* tests/utils.scm <top level>: Call 'test-compression/decompression' for
'lzip as well.
2019-05-27 22:47:24 +02:00
Ludovic Courtès 2a991f3ae4
lzlib: Add 'make-lzip-input-port/compressed'.
* guix/lzlib.scm (lzwrite!, make-lzip-input-port/compressed): New
procedures.
* tests/lzlib.scm ("make-lzip-input-port/compressed"): New test.
* guix/tests.scm (%seed): Export.
2019-05-27 22:47:24 +02:00
Ludovic Courtès e13354a7ca
lzlib: Adjust 'lz-compress-read' docstring.
* guix/lzlib.scm (lz-compress-read): The integer return can be zero;
adjust docstring accordingly.
2019-05-27 22:47:23 +02:00
Ludovic Courtès ad7466aafd
import: hackage: Fix Cabal test.
* guix/import/hackage.scm (hackage->guix-package): Remove call to 'memoize'.
(hackage->guix-package/m): New procedure.
(hackage-recursive-import): Use it.
* tests/hackage.scm ("hackage->guix-package test 6"): Adjust.

Co-authored-by: Robert Vollmert <rob@vllmrt.net>
2019-05-26 23:20:30 +02:00
Robert Vollmert 002d17dcaa
discovery: 'all-modules' returns modules in path order.
A particular effect of this is that if there are ambiguous
packages in a directory specified with `-L module_dir` and the
distribution, the version from `module_dir` will be loaded,
which is usually what would be expected. (E.g. for `guix build`
or `guix package -i`.)

* guix/discovery.scm (all-modules): Return modules in path order.
* tests/guix-package.sh: Test local definitions take precedence.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-05-26 23:02:02 +02:00
Ludovic Courtès dfc69e4b6d
self: 'guix-daemon' honors %localstatedir, %sysconfdir, and %storedir.
Fixes <https://bugs.gnu.org/35874>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

Previously, the 'guix-daemon' program provided by 'guix pull' would
systematically use default directory locations for these.

* guix/self.scm (whole-package)[wrap]: Set GUIX_STATE_DIRECTORY,
GUIX_CONFIGURATION_DIRECTORY, and NIX_STORE_DIR.
2019-05-26 22:01:42 +02:00
Robert Vollmert 0607f89088
import: hackage: Recognize "BSD-3-Clause" and "PublicDomain".
* guix/import/hackage.scm (string->license): Add two licenses.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
2019-05-26 10:22:05 +02:00
Ludovic Courtès 7fcb86da2b
store: Fix 'hash-part->path' docstring.
* guix/store.scm (hash-part->path): Adjust docstring to match reality.
2019-05-26 01:34:17 +02:00
Ludovic Courtès 493375cdb2
publish: Maintain a hash-part-to-store-item mapping in cache.
Fixes <https://bugs.gnu.org/33897>.

* guix/scripts/publish.scm (hash-part-mapping-cache-file)
(hash-part->path*): New procedures.
* guix/scripts/publish.scm (render-narinfo/cached)[delete-entry]: Delete
the 'hash-part-mapping-cache-file'.
Use 'hash-part->path*' instead of 'hash-part->path'.
* tests/publish.scm ("with cache, vanishing item"): New test.
2019-05-26 01:34:17 +02:00
Ricardo Wurmus e96619baf7
import: cran: Ignore invalid packages.
* guix/import/cran.scm (invalid-packages): New variable.
(description->package): Use it.
2019-05-23 16:10:32 +02:00
Ludovic Courtès b1903b99e0
weather: Accept package specs on the command line.
Previously, non-option arguments would be ignored.  Now it puts them to
good use.

* guix/scripts/weather.scm (guix-weather)[package-list]: New procedure.
Use it.
* doc/guix.texi (Invoking guix weather): Adjust accordingly.
2019-05-22 00:09:42 +02:00
Ludovic Courtès 3f8326237d
pack: Warn when building an empty pack.
* guix/scripts/pack.scm (guix-pack): Warn when MANIFEST has zero
entries.
2019-05-22 00:09:41 +02:00
Ludovic Courtès fd214f1522
pack: Add '--root'.
* guix/scripts/pack.scm (%options, show-help): Add "--root".
(guix-pack): Honor it.
* tests/guix-pack.sh: Test it.
* doc/guix.texi (Invoking guix pack): Document it.
2019-05-22 00:09:41 +02:00
Ludovic Courtès a901574727
self: Remove unused variables.
* guix/self.scm (info-manual)[po4a, gettext]: Remove.
2019-05-20 23:23:00 +02:00
Ludovic Courtès ce10e6053b
guix system: Type-check the file or expression.
Previously, users would get a wrong-type-arg exception down the road
with an intimidating backtrace.

* guix/scripts/system.scm (process-action)[ensure-operating-system]: New
procedure.
Use it.
2019-05-16 13:24:06 +02:00
Ludovic Courtès 7ff4fde257
docker: 'build-docker-image' accepts an optional #:entry-point.
* guix/docker.scm (config): Add #:entry-point and honor it.
(build-docker-image): Likewise.
2019-05-15 16:36:21 +02:00
Arun Isaac 06c7b1f614
import: github: Sort releases before picking the latest one.
* guix/import/github.scm (latest-released-version): Sort releases before
picking the first one as the latest.
2019-05-15 13:29:50 +05:30
Arun Isaac c558772b0f
import: github: Improve readability.
* guix/import/github.scm (latest-released-version)[release->version]: Separate
out release->version as a new function.
2019-05-15 13:29:50 +05:30
Ludovic Courtès 45d41c035e
guix build: Gracefully handle invalid '--with-git-url' specs.
* guix/scripts/build.scm (transform-package-source-git-url): Add case
for when 'string-split' does not return exactly two elements.
2019-05-14 12:11:05 +02:00
Maxim Cournoyer d03de6be0a
vm: Auto-detect if inputs should be registered.
The default value of the argument REGISTER-CLOSURE? of the ISO9660-IMAGE,
QEMU-IMAGE and SYSTEM-DOCKER-IMAGE procedures can be computed automatically,
since the operating-system definition is available in its context.  When the
operating-system definition does not contain the GUIX-SERVICE-TYPE, do not
register the closure in the database of Guix, as it takes time and doesn't
serve a purpose.

* gnu/system/vm.scm (has-guix-service-type): Add predicate.
(iso9660-image)[register-closures?]: Use it to compute the argument's default
value.
(qemu-image)[register-closures?]: Likewise, and update docstring.
(system-docker-image)[register-closures?]: Likewise.
(system-disk-image): Do not explicit a value for the REGISTER-CLOSURES?
argument of the ISO9660-IMAGE and QEMU-IMAGE procedure calls, so that its
default value is used instead.
* guix/scripts/system.scm (system-derivation-for-action): Do not explicit a
value for the REGISTER-CLOSURES? argument of the SYSTEM-DOCKER-IMAGE
procedure call, so that its default value is used instead.
2019-05-13 22:59:09 -04:00
Arun Isaac b33454ae0b
linux-container: Support container network sharing.
* gnu/system/linux-container.scm (container-essential-services): If network is
to be shared with the host, remove network configuration files from etc
service.
(containerized-operating-system): If network is to be shared with the host,
remove nscd service and map host's /var/run/nscd if it exists.
(container-script): If network is to be shared with the host, do not create
network namespace.
* guix/scripts/system.scm (system-derivation-for-action): Add
#:container-shared-network? argument.
(perform-action): Add #:container-shared-network? argument.
(show-help): Add "-N, --network" help information.
(%options): Add network option.
(process-action): Call perform-action with #container-shared-network? argument.
* doc/guix.texi (Invoking guix system): Document the "-N, --network" option.

Co-authored-by: Christopher Baines <mail@cbaines.net>
2019-05-14 02:54:58 +05:30
宋文武 9bc8175cfa
download: Support 'https_proxy'.
* guix/build/download.scm (setup-http-tunnel): New procedure.
(open-connection-for-uri): Honor the 'https_proxy' environment variable.
2019-05-13 21:36:03 +08:00
Ludovic Courtès 637a2a23ea
gnu-maintenance: Update URL for package databases.
The databases migrated away from the Womb a couple of days ago.

* guix/gnu-maintenance.scm (%gnumaint-base-url): Update URL.
2019-05-12 23:15:13 +02:00
Ivan Petkov e88735b45f
build/cargo-utils: Remove "src-name" parameter.
* gnu/packages/gnuzilla.scm (icecat)[arguments]<#:phases>
[patch-cargo-checksums]: Delete "null-file" variable.
* gnu/packages/rust.scm (%cargo-reference-project-file): Delete variable.
* gnu/packages/rust.scm (rust-1.19): Remove reference to
"%cargo-reference-project-file".
* guix/build/cargo-utils.scm (generate-checksums): Remove "src-name"
parameter.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2019-05-10 00:44:08 +02:00
Marius Bakke 5f5499d684
syscalls: Add 'arp-network-interface?'.
* guix/build/syscalls.scm (IFF_NOARP): New variable.
(arp-network-interface?): New public procedure.
2019-05-09 20:00:21 +02:00
Ludovic Courtès a0dc97a517
pull: Display 'hash guix' hint when the new and old 'guix' are different.
Fixes <https://bugs.gnu.org/35601>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

Previously we were calling (which "guix") after the new profile had been
built and symlinked, so in most cases the hint would not be triggered,
even though it should have been triggered.

* guix/scripts/pull.scm (build-and-install)[guix-command]: New variable.
Compare PROFILE/bin/guix against GUIX-COMMAND.
2019-05-09 17:42:31 +02:00
Chris Marusich 387e6b9e34
ui: Make package outputs searchable.
* guix/ui.scm (relevance): Allow the "field" procedure of a metric to
return a list, and handle that case appropriately.  Update docstring.
(%package-metrics): Add a metric for package outputs.
* guix/scripts/package.scm (find-packages-by-description): Update
docstring.
* tests/guix-package.sh: Add a test case to verify that package outputs are
included in search results.

Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr>
2019-05-09 00:10:34 -07:00
Maxim Cournoyer 4ac69ea10f
Add (guix bzr-download).
* guix/bzr-download.scm, guix/build/bzr.scm,
etc/snippets/scheme-mode/guix-bzr-reference: New files.
* Makefile.am (MODULES): Add them.
* etc/snippets/scheme-mode/guix-origin: Add "bzr-fetch" to the origin choices.
2019-05-09 00:22:37 -04:00
Pierre Neidhardt ecfc54403e
guix: Simplify and robustify lzread!.
* guix/lzlib.scm (lzread!): Do it.

Previously lzread! would fail if COUNT was bigger
than (lz-decompress-write-size).  This is possible if a previous call to
lzread! didn't empty the LZ_decompress input buffer (e.g. BV was too small to
fit all the data).
2019-05-07 18:40:40 +02:00
Ludovic Courtès d108f59761
environment: Non ad-hoc mode also honors transformation options.
Fixes <https://bugs.gnu.org/35618>.
Reported by Florent Pruvost <florent.pruvost@inria.fr>.

* guix/scripts/environment.scm (options/resolve-packages): Add call to
TRANSFORM in non "ad-hoc" case.
* tests/guix-environment.sh: Add test.
2019-05-07 15:46:53 +02:00
Pierre Neidhardt fea338c6ca
Add (guix lzlib).
* guix/lzlib.scm, tests/lzlib.scm: New files.
* Makefile.am (MODULES): Add guix/lzlib.scm.
(SCM_TESTS): Add tests/lzlib.scm.
* m4/guix.m4 (GUIX_LIBLZ_LIBDIR): New macro.
* configure.ac (LIBLZ_LIBDIR): Use it.  Define and substitute
'LIBLZ'.
* guix/config.scm.in (%liblz): New variable.
* guix/self.scm (make-config.scm): Add TODO comment.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2019-05-06 23:21:33 +02:00
Maxim Cournoyer a321312e3a
build: go-build-system: Follow-up to commit f42e4ebb56.
This follows commit f42e4ebb56, which made it so that the unpack phase return
value could be left unspecified.

* guix/build/go-build-system.scm (unpack): Ensure that the value returned upon
a successful completion of the phase is #t.
2019-05-05 23:01:03 -04:00
Maxim Cournoyer 2edec51c5e
build: go-build-system: Follow-up commit.
There was an extraneous pair of parens in commit 7e84d3eef7.  Thanks for Mark
Weaver for reporting the issue.

* guix/build/go-build-system.scm (unpack): Remove the extraneous pair of
  parentheses surrounding the `display' function call.
2019-05-05 22:41:11 -04:00
Maxim Cournoyer f42e4ebb56
build: go-build-system: Ensure uniform unpacking directory.
Depending on whether the source is a directory or an archive, we strip the
source directory or preserve it, respectively.  This change makes it so that
whether the type of the source, it is unpacked at the expected location given
by the IMPORT-PATH of the Go build system.

* guix/build/go-build-system.scm: Add the (ice-9 ftw) module.
(unpack): Add inner procedure to maybe strip the top level directory of an
archive, document it and use it.
2019-05-05 20:06:19 -04:00
Maxim Cournoyer 7e84d3eef7
build: go-build-system: Use WHEN for side-effect conditionals.
* guix/build/go-build-system.scm (unpack): Replace single branch `if' by
`when'.
2019-05-05 20:06:18 -04:00
Maxim Cournoyer b5f0528354
build: go-build-system: Re-ident.
* guix/build/go-build-system.scm (unpack): Fix indentation.
2019-05-05 20:06:18 -04:00
Ricardo Wurmus 6490cd31cc
guix: Update to Bioconductor 3.9.
* guix/build-system/r.scm (bioconductor-uri): Use 3.9 archive URL.
* guix/import/cran.scm (%bioconductor-version): Update to 3.9.
2019-05-06 00:14:27 +02:00
Ludovic Courtès 746ac457cc
Merge branch 'version-1.0.0' 2019-05-02 15:32:30 +02:00
Ludovic Courtès 757e633d57
build: Change default substitute server to "ci.guix.gnu.org".
* config-daemon.ac: Replace "ci.guix.info" with "ci.guix.gnu.org".
* doc/guix.texi (SUBSTITUTE-SERVER): Likewise.
* etc/substitutes/ci.guix.gnu.org.pub: New file.
* Makefile.am (dist_pkgdata_DATA): Add it.
* guix/scripts/build.scm (%default-log-urls): Update.
* guix/scripts/substitute.scm (%default-substitute-urls): Likewise.
* guix/store.scm (%default-substitute-urls): Likewise.
* guix/self.scm (miscellaneous-files): Add "ci.guix.gnu.org".
2019-05-01 11:05:47 +02:00
Tobias Geerinckx-Rice e13bd3088d
guix: Fix another typo in another docstring.
* guix/build/clojure-utils.scm (include-list\exclude-list)<docstring>:
Fix typo.
2019-04-30 14:13:50 +02:00
Tobias Geerinckx-Rice 88401314f9
guix: Fix typo in docstring.
* guix/build/syscalls.scm (device-in-use?)<docstring>: Fix typo.
2019-04-30 13:56:35 +02:00
Ludovic Courtès c20d4cac1f
processes: Gracefully handle daemons without clients.
Fixes <https://bugs.gnu.org/34716>.
Reported by Mark H Weaver <mhw@netris.org>.

The problem could be reproduced by running, on one hand:

  sh -c 'exec -a guix-daemon sleep 777'

and on the other hand:

  guix processes

If there is no process with PID 777, 'guix processes' would barf as it
stumbles upon a <daemon-session> record whose client is #f.

* guix/scripts/processes.scm (daemon-sessions)[child-process->session]:
New procedure, with lambda formerly passed to 'map'.  Handle #f returns
from 'lookup-process'.
Call 'child-process->session' within 'filter-map', not just 'map'.
2019-04-29 21:54:10 +02:00
Ludovic Courtès c21d912a02
processes: 'process-open-files' ignores disappeared /proc/PID/fd entries.
Previously, 'process-open-files' would throw ENOENT if an entry had
vanished after the 'scandir' call and before the 'readlink' call.

* guix/scripts/processes.scm (process-open-files): Catch ENOENT errors
from 'readlink'.
2019-04-29 21:39:38 +02:00
Ludovic Courtès da56f10971
guix package: Add 'guix search' alias.
* guix/scripts/search.scm: New file.
* Makefile.am (MODULES): Add it.
* po/guix/POTFILES.in: Add it.
* tests/guix-package-aliases.sh: Add test.
* doc/guix.texi (Invoking guix package): Document it and use it in a
couple of examples.
2019-04-29 12:19:24 +02:00
rendaw 9d3053819d
file-systems: Support the 'no-atime' flag.
* guix/build/syscalls.scm (MS_NOATIME): New variable.
* gnu/build/file-systems.scm (mount-flags->bit-mask): Support it.
* doc/guix.texi (File Systems): Document it and add cross-references to
the relevant documentation.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2019-04-29 12:19:03 +02:00
Ludovic Courtès d824cfbabe
guix package: Add 'install', 'remove', and 'upgrade' aliases.
* guix/scripts/install.scm, guix/scripts/remove.scm,
guix/scripts/upgrade.scm, tests/guix-package-aliases.sh: New files.
* Makefile.am (MODULES, SH_TESTS): Add them.
* po/guix/POTFILES.in: Add them.
* guix/scripts/package.scm (guix-package): Split with...
(guix-package*): ... this.  New procedure.
* doc/guix.texi (Invoking guix package): Document them.
(Binary Installation, Application Setup, Package Management)
(Packages with Multiple Outputs, Package Modules)
(X.509 Certificates, Installing Debugging Files): Use 'guix install' in
simple examples.
* etc/completion/bash/guix (_guix_complete): Handle "install", "remove",
and "upgrade".
2019-04-29 10:13:44 +02:00