Commit Graph

3104 Commits (a7ebe9dc39450efef2543ff7315c69811f9fa6f4)

Author SHA1 Message Date
Ludovic Courtès 85f4f7b790
zlib: Fix race condition when closing gzip ports.
Fixes <https://bugs.gnu.org/29335>.

* guix/zlib.scm (close-procedure): Remove.
(make-gzip-input-port): Do (dup (fileno port)) to get a file descriptor
for 'gzdopen'.  Close PORT before returning.  Use 'gzclose' as the
'close' procedure of the returned port.
(make-gzip-output-port): Likewise.
2017-11-19 23:09:01 +01:00
Ludovic Courtès 52d174d6d1
ssh: Use (guix i18n).
* guix/ssh.scm: Use (guix i18n) instead of (guix ui).
2017-11-19 23:09:01 +01:00
Julien Lepiller 965ba54be0
licenses: Add cddl1.1.
* guix/licenses.scm (cddl1.1): New variable.
2017-11-18 11:29:36 +01:00
Ricardo Wurmus 82af2c2f0f
build-system: texlive: Only make a union of directories.
* guix/build/texlive-build-system.scm (configure): Filter the input
directories to ensure that source tarballs are excluded.
2017-11-18 11:18:42 +01:00
Leo Famulari d8e257113c
build-system/go: Don't let Go executables refer to the Go compiler.
* guix/build/go-build-system.scm (remove-store-reference, remove-go-references):
New procedures.
(%standard-phases): Add 'remove-go-references' phase.
* guix/build-system/go.scm (go-build): Add allow-go-reference? key.
2017-11-17 18:25:20 -05:00
Ludovic Courtès d5ce7bcfa2
workers: Display backtrace in pre-unwind handler.
* guix/workers.scm (worker-thunk): Add (const #f) as the 'catch'
handler, and move previous handler as pre-unwind handler.  Protect
against 'make-stack' returning #f.
2017-11-17 10:47:56 +01:00
Ludovic Courtès 232b3d3101
workers: 'pool-idle?' returns true only if the workers are idle.
Fixes <https://bugs.gnu.org/28779>.
Reported by Eric Bavier <bavier@cray.com>.

* guix/workers.scm (<pool>)[busy]: New field.
(worker-thunk): Add #:idle and #:busy and use them.
(make-pool): Pass #:busy and #:idle to 'worker-thunk'.  Pass a 'busy'
value to '%make-pool'.
* guix/workers.scm (pool-idle?): Check whether 'pool-busy' returns zero
and adjust docstring.
2017-11-17 10:10:30 +01:00
Ludovic Courtès 304a53f67a
ui: Add source file name to the package search metrics.
* guix/ui.scm (%package-metrics): Include 'package-location'.  Increase
score of the other fields.
2017-11-16 08:45:15 +01:00
Ludovic Courtès 7482b98120
cve: Use 'http-fetch/cached' instead of having custom caching.
That way CVE fetching benefits from 'If-Modified-Since' handling.

* guix/http-client.scm (http-fetch/cached): Add #:write-cache and
 #:cache-miss parameters and honor them.
* guix/cve.scm (%current-year-ttl, %past-year-ttl): Reduce.
(call-with-cve-port): Remove.
(write-cache): New procedure.
(fetch-vulnerabilities): Rewrite in terms of 'http-fetch/cached'.
2017-11-16 08:45:15 +01:00
Ludovic Courtès 866f37fb7e
download: Improve efficiency of 'write-request' over TLS.
This is another instance of <https://bugs.gnu.org/22966>.
The Microsoft-IIS/7.5 server at static.nvd.nist.gov would sometimes hang
when receiving our requests byte by byte.

* guix/build/download.scm (tls-wrap) [!guile-2.0]: Add 'setvbuf' call.
2017-11-16 08:45:14 +01:00
Ludovic Courtès 9f8605958e
download: Pass the timeout to 'ftp-retr'.
This ensures the timeout applies when connecting to the port returned by
PASV.

* guix/ftp-client.scm (ftp-list): Add #:timeout parameter.  Use
'connect*' instead of 'connect' and pass TIMEOUT.
(ftp-retr): Likewise.
* guix/build/download.scm (ftp-fetch): Pass TIMEOUT to 'ftp-retr'.
2017-11-14 23:46:53 +01:00
Leo Famulari 412716eff2
grafts: Clarify the status of the workaround for <http://bugs.gnu.org/24659>.
* guix/build/graft.scm (mkdir-p*): Annotate.
2017-11-14 16:38:02 -05:00
Leo Famulari d0b87779f0
download: Use HTTPS for the first ImageMagick mirror.
* guix/download.scm (%mirrors)[imagemagick]: Use HTTPS for <sunsite.icm.edu.pl>.
2017-11-12 17:50:01 -05:00
Leo Famulari ecc585711e
download: Try FTP servers last.
* guix/download.scm (%mirrors)[savannah, kernel.org, apache, xorg, imagemagick]:
Re-arrange so that FTP is last.
2017-11-12 17:50:01 -05:00
Ludovic Courtès b1488c7653
git: Check whether 'clone-init-options' is defined.
This is a followup to 195f0d05c3.

* guix/git.scm (clone*): Check whether 'clone-init-options' is defined
before using it.
2017-11-11 20:09:25 +01:00
Ludovic Courtès 65a19abf3f
download: Work around more bogus HTTP handling in Guile 2.2 <= 2.2.2.
Reported by Mark H Weaver <mhw@netris.org>
at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00190.html>.

* guix/build/download.scm (guile-2.2) [write-request-line]: Backport
Guile commit 6ad28ae3bc6a6d9e95ab7d70510d12c97673a143.
2017-11-11 15:20:02 +01:00
Ludovic Courtès 59da6f04f4
download: Work around bogus HTTP handling in Guile 2.2 <= 2.2.2.
Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>
at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00070.html>.

* guix/build/download.scm (write-request-line) [guile-2.2]: New
procedure.
2017-11-10 23:11:52 +01:00
Ludovic Courtès 195f0d05c3
git: Work around wrong default argument of 'clone'.
Fixes <https://bugs.gnu.org/29238>.
Reported by Benjamin Andresen <benny@in-ulm.de>.

* guix/git.scm (clone*): Pass second argument to 'clone'.
2017-11-10 13:07:54 +01:00
Ludovic Courtès dc856223f5
ui: Add an 'unbound-variable' exception printer.
* guix/ui.scm (print-unbound-variable-error): New variable.
Use it as the 'unbound-variable' printer.
2017-11-09 23:54:47 +01:00
Ludovic Courtès a2985bb101
ui: Provide hints for unbound-variable errors.
* guix/ui.scm (known-variable-definition): New procedure.
(report-load-error): Handle 'unbound-variable'.
2017-11-09 23:54:47 +01:00
Ludovic Courtès 935542fbde
ui: Add 'display-hint'.
* guix/ui.scm (known-variable-definition): New procedure.
(report-load-error): Use it.
2017-11-09 23:54:47 +01:00
Ludovic Courtès 23735137eb
ui: Define and honor '&error-location' and '&fix-hint' conditions.
* guix/utils.scm (&error-location, &fix-hint): New condition types.
* guix/ui.scm (report-load-error): Handle them.
(call-with-error-handling): Honor '&error-location'.
2017-11-08 22:31:58 +01:00
Ludovic Courtès 37eed374d9
ui: Introduce (guix i18n).
* guix/ui.scm (G_, N_, _P, %gettext-domain, %package-text-domain): Move
to...
* guix/i18n.scm: ... here.  New file.
2017-11-08 22:31:58 +01:00
Ricardo Wurmus 25e51b1c45
guix: Add archive support for bioconductor-uri.
* guix/build-system/r.scm (bioconductor-uri): Also return the archive URL.
* guix/import/cran.scm (latest-bioconductor-release, fetch-description):
Adjust because bioconductor-uri now returns a list.
2017-11-07 08:14:09 +01:00
Ricardo Wurmus 27baf50956
import: cran: Use Bioconductor 3.6 helpers.
* guix/import/cran.scm (bioconductor-mirror-url): Remove procedure.
(fetch-description): Extract DESCRIPTION file from tarball for Bioconductor
packages.
(latest-bioconductor-release): Use latest-bioconductor-package-version.
2017-11-07 08:13:35 +01:00
Ricardo Wurmus 84dfdc5759
import: cran: Add support for Bioconductor 3.6.
* guix/import/cran.scm (%bioconductor-version,
%bioconductor-packages-list-url): New variables.
(bioconductor-packages-list, latest-bioconductor-package-version): New
procedures.
2017-11-07 08:13:34 +01:00
Ricardo Wurmus 6b46b04f91
import: utils: Add string helpers.
* guix/import/utils.scm (read-lines, chunk-lines): New procedures.
2017-11-07 08:07:51 +01:00
Ludovic Courtès 8e57e416c0
refresh: Account for hidden packages.
Suggested by Marius Bakke <mbakke@fastmail.com>
in <https://bugs.gnu.org/29177>.

* guix/scripts/refresh.scm (all-packages): Pass #:select? to
'fold-packages'.
2017-11-07 00:12:10 +01:00
Ludovic Courtès c9405c461b
compile: Fix VPATH builds.
Fixes <https://bugs.gnu.org/29091>.
Reported by Eric Bavier <bavier@cray.com>.

* guix/build/compile.scm (relative-file): New procedure.
(load-files): Use it before calling 'file-name->module-name'.
(compile-files): Likewise before calling 'scm->go'.
* guix/build/pull.scm (build-guix): Remove 'with-directory-excursion'
and file name hack from ce33c3af76.
Pass OUT to 'all-scheme-files'.
2017-11-07 00:12:10 +01:00
Ludovic Courtès 0ad5f80982
Fix ambiguous imports.
* gnu/packages/ocaml.scm: Hide 'zip' from (srfi srfi-1).
* guix/git.scm: Select 'mkdir-p' from (guix build utils).
2017-11-07 00:12:10 +01:00
nee 6692d8454a
guix: records: Add match-record.
* guix/records.scm: New syntax-rule.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-11-05 15:21:53 +01:00
Tobias Geerinckx-Rice 63ae4800de
download: Refresh the cpan.org mirror list.
* guix/download.scm (%mirrors)[cpan]: Update the list of CPAN mirrors (of
which several are dead) with a more-or-less geographically diverse selection.
2017-11-01 01:02:03 +01:00
Tobias Geerinckx-Rice b5c7574b2f
Revert "import: cpan: Use HTTPS for home pages."
This reverts commit 29f7bf59d5d4d4b848eaedc6766bb4e02cae20d3: HTTPS support
at search.cpan.org is unreliable, at best.  Don't rely on it.
2017-10-30 17:20:42 +01:00
Tobias Geerinckx-Rice 29f7bf59d5
import: cpan: Use HTTPS for home pages.
* guix/import/cpan.scm (cpan-home): Use HTTPS.
* tests/cpan.scm ("cpan->guix-package"): Expect it.
2017-10-29 17:32:35 +01:00
Tobias Geerinckx-Rice 6d176ad379
import: cpan: Actually use CPAN-HOME.
* guix/import/cpan.scm (cpan-module->sexp): Use the CPAN-HOME procedure.
2017-10-29 17:32:35 +01:00
Tobias Geerinckx-Rice 73f33b9379
import: cpan: Add trailing "/" to CPAN-HOME.
Prevent regression after commit e4bc172730.

* guix/import/cpan.scm (cpan-home): Add trailing "/".
2017-10-29 17:32:12 +01:00
Eric Bavier e4bc172730
import: cpan: Add trailing "/" on home-page.
This appeases 'guix lint', which otherwise complains about permanent
redirects.

* guix/import/cpan.scm (cpan-module->sexp): Add trailing "/" on home-page.
* tests/cpan.scm ("cpan->guix-package"): Adjust accordingly.
2017-10-28 18:20:59 -05:00
Eric Bavier 23055424f2
import: cpan: Propagate imported dependencies.
This is most often the need for perl module dependencies.

* guix/import/cpan.scm (cpan-module->sexp): 'inputs -> 'propagated-inputs.
* tests/cpan.scm ("cpan->guix-package"): Adjust accordingly.
2017-10-28 18:20:58 -05:00
Ludovic Courtès 34b1f339cd
graph: Remove mention of Graphviz from the summary line.
* guix/scripts/graph.scm (show-help): Remove mention of Graphviz from
the summary line.
2017-10-28 09:45:54 +02:00
Ludovic Courtès 0a2ce1ea0a
import: elpa: Do not abort when failing to download the archive.
* guix/import/elpa.scm (elpa-fetch-archive): Use 'http-fetch/cached'
directly instead of 'call-with-downloaded-file'.  This ensures we don't
just abort when networking access is lacking, which is required to allow
'guix refresh -c refresh' to proceed.
2017-10-28 09:45:54 +02:00
Ludovic Courtès 90297811a9
import: github: Gracefully handle multiple-URL origins.
* guix/import/github.scm (latest-release)[origin-github-uri]: New
procedure.  Use it.
2017-10-28 09:45:54 +02:00
Ludovic Courtès 6d6d193221
lint: 'refresh' gracefully handles lack of networking access.
* guix/scripts/lint.scm (check-for-updates): Wrap
'package-latest-release*' call in 'with-networking-fail-safe'.
2017-10-28 09:45:54 +02:00
Ludovic Courtès 4b879e0acf
lint: Extract network-related exception handling.
* guix/scripts/lint.scm (call-with-networking-fail-safe): New procedure.
(with-networking-fail-safe): New macro.
(current-vulnerabilities*): Rewrite in terms of 'with-networking-fail-safe'.
2017-10-28 09:45:54 +02:00
Ludovic Courtès a1ff7e1d8d
scripts: Factorize option parsing sans 'GUIX_BUILD_OPTIONS'.
* guix/scripts.scm (parse-command-line): Add #:build-options? parameter
and honor it.
* guix/scripts/challenge.scm (guix-challenge): Use 'parse-command-line'
with #:build-options? #f instead of 'args-fold*'.
* guix/scripts/gc.scm (guix-gc): Likewise.
* guix/scripts/graph.scm (guix-graph): Likewise.
* guix/scripts/hash.scm (guix-hash): Likewise.
* guix/scripts/lint.scm (guix-lint): Likewise.
* guix/scripts/refresh.scm (guix-refresh): Likewise.
* guix/scripts/size.scm (guix-size): Likewise.
* guix/scripts/weather.scm (guix-weather): Likewise.
2017-10-28 09:45:53 +02:00
Ludovic Courtès efff3dd4c9
scripts: Use 'args-fold*' for command that do not honor build flags.
Fixes <https://bugs.gnu.org/28984>.
Reported by Eric Bavier.

* guix/scripts/challenge.scm (guix-challenge): Use 'args-fold*' instead
of 'parse-command-line'.
* guix/scripts/size.scm (guix-size): Likewise.
* guix/scripts/weather.scm (guix-weather): Likewise.
2017-10-27 13:11:26 -07:00
Leo Famulari 552ee77250
build-system/go: Fix installation path of executable files.
* guix/build/go-build-system.scm (setup-environment): Set GOBIN correctly.
2017-10-26 12:14:33 -04:00
Ludovic Courtès bf7dfb1f07
challenge: Display an overall summary.
* guix/scripts/challenge.scm (summarize-report-list): New procedure.
(guix-challenge): Use it.
* doc/guix.texi (Invoking guix challenge): Adjust command output in
example.
2017-10-25 22:25:19 -07:00
Ludovic Courtès d213cc8c7f
substitute: Don't send more than 1000 requests in a row.
Fixes <https://bugs.gnu.org/28731>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

* guix/scripts/substitute.scm (at-most): New procedure.
(http-multiple-get): Use it to send at most 1000 requests at once.
2017-10-25 22:25:19 -07:00
Ludovic Courtès 44c6a87f53
guix package: '--list-available' does not show superseded packages.
* guix/scripts/package.scm (process-query) <'list-available>: Filter out
P if it matches 'package-superseded'.
2017-10-25 22:25:19 -07:00
Leo Famulari c10851cf91
build-system/go: Parameterize installing the source code.
* guix/build-system/go.scm (go-build): Add install-source? key.
* guix/build/go-build-system.scm (install-source): Check if
install-source? is true.
2017-10-24 13:10:34 -04:00
Leo Famulari 1c37f839fb
build-system/go: Strip the Go binaries with the native tool.
* guix/build/go-build-system.scm (build): Tell the Go linker to strip some
symbol tables and debugging information.
2017-10-24 13:10:34 -04:00
Ludovic Courtès 2900665888
pull: Hide compilation warnings.
* guix/build/pull.scm (build-guix): Bind 'current-warning-port' to a
void port.
2017-10-23 17:08:51 -07:00
Ludovic Courtès ce33c3af76
pull: Add (guix build compile) to the mix.
Fixes <https://bugs.gnu.org/28956>.
Reported by Leo Famulari <leo@famulari.name>.

* build-aux/build-self.scm (build): Add (guix build compile) to
 #:modules.
* guix/build/pull.scm (build-guix): Wrap 'compile-files' call in
'with-directory-excursion'.  Strip "./" from FILES when passing it to
'compile-files'.
2017-10-23 17:08:50 -07:00
Ludovic Courtès d298c815e6
gexp: Add 'directory-union'.
* gnu/services.scm (directory-union): Move to...
* guix/gexp.scm (directory-union): ... here.  New procedure.
* doc/guix.texi (G-Expressions): Document it.
2017-10-22 22:09:00 -07:00
Ludovic Courtès dedb512f8f
gexp: Add 'file-union'.
* gnu/services.scm (file-union): Move to...
* guix/gexp.scm (file-union): ... here.  New procedure.
* doc/guix.texi (G-Expressions): Document it.
2017-10-22 22:09:00 -07:00
Ludovic Courtès 7a51c78c6e
discovery: Move 'file-name->module-name' to (guix modules).
* guix/discovery.scm (file-name->module-name): Move to...
* guix/modules.scm (file-name->module-name): ... here.
* guix/build/compile.scm: Use (guix modules) instead of (guix discovery).
2017-10-22 22:09:00 -07:00
Ludovic Courtès 2890ad332f
build: Factorize module compilation in (guix build compile).
* guix/build/compile.scm: New file.
* Makefile.am (MODULES): Add it.
* build-aux/compile-all.scm: Use it.
(warnings, file->module, load-module-file)
(%default-optimizations, %lightweight-optimizations)
(optimization-options, compile-file*): Remove.
<top level>: Use 'compile-files'.
* guix/build/pull.scm (%default-optimizations)
(%lightweight-optimizations, optimization-options): Remove.
(build-guix): Rewrite as a call to 'compile-files'.
* guix/discovery.scm (file-name->module-name): Export.
2017-10-22 22:09:00 -07:00
Tobias Geerinckx-Rice 5713bbf157
Use HTTPS for bioconductor.org.
* doc/guix.texi (Invoking guix import, Invoking guix refresh): Use HTTPS for
bioconductor.org URLs.
* gnu/packages/bioinformatics.scm (r-annotate, r-geneplotter, r-genefilter)
(r-deseq2, r-dexseq, r-annotationforge, r-rbgl, r-gseabase, r-category)
(r-gostats, r-shortread, r-biocgenerics, r-biocinstaller, r-biocviews)
(r-biocstyle, r-bioccheck, r-s4vectors, r-iranges, r-genomeinfodbdata)
(r-genomeinfodb, r-xvector, r-genomicranges, r-biobase, r-annotationdbi)
(r-biomart, r-biocparallel, r-biostrings, r-rsamtools, r-delayedarray)
(r-summarizedexperiment, r-genomicalignments, r-rtracklayer)
(r-genomicfeatures, r-graph, r-topgo, r-bsgenome, r-impute, r-seqpattern)
(r-seqlogo, r-motifrg, r-bamsignals, r-mutationalpatterns, r-tximport)
(r-rhdf5, r-chipseq, r-sva, r-affy, r-vsn, r-mzid, r-msnid)
(r-interactivedisplaybase, r-annotationhub)[home-page]: Likewise.
* gnu/packages/bioinformatics.scm (r-txdb-hsapiens-ucsc-hg19-knowngene)
(r-go-db, r-bsgenome-hsapiens-1000genomes-hs37d5, r-org-hs-eg-db)
(r-org-ce-eg-db, r-org-dm-eg-db, r-org-mm-eg-db)
(r-bsgenome-hsapiens-ucsc-hg19, r-bsgenome-mmusculus-ucsc-mm9)
(r-bsgenome-mmusculus-ucsc-mm10, r-txdb-mmusculus-ucsc-mm10-knowngene)
(r-bsgenome-celegans-ucsc-ce6, r-bsgenome-celegans-ucsc-ce10)
(r-bsgenome-dmelanogaster-ucsc-dm3, r-copyhelper)[source, home-page]:
Likewise.
* gnu/packages/statistics.scm (r-rcurl)[source]: Likewise.
* guix/build-system/r.scm (bioconductor-uri): Likewise.
* guix/import/cran.scm (%cran-url, bioconductor-package?)
(bioconductor-data-package?, bioconductor-experiment-package?): Likewise.
2017-10-21 17:43:40 +02:00
Ludovic Courtès 37ce440dcf
download: Download a nar when a VCS checkout fails.
Fixes <https://bugs.gnu.org/28709>.

* guix/build/download-nar.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/cvs-download.scm (cvs-fetch)[zlib, config.scm, modules]: New
variables.
[build]: Use MODULES.  Add call to 'download-nar'.
* guix/git-download.scm (git-fetch): Likewise.
* guix/hg-download.scm (hg-fetch): Likewise.
2017-10-19 23:21:49 +02:00
Ludovic Courtès 8c3488259e
Add (guix progress).
Among other things, this removes (guix utils), (guix ui), (guix config),
etc. from the closure of (guix build download), as was the case since
798648515b.

* guix/utils.scm (<progress-reporter>, call-with-progress-reporter):
Move to...
* guix/progress.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* guix/build/download.scm (current-terminal-columns)
(nearest-exact-integer, duration->seconds, seconds->string)
(byte-count->string, progress-bar, string-pad-middle)
(rate-limited, progress-reporter/file, dump-port*)
(time-monotonic): Move to progress.scm.
* guix/scripts/download.scm: Adjust accordingly.
* guix/scripts/substitute.scm: Likewise.
2017-10-19 23:21:49 +02:00
Ludovic Courtès 347fa4aebf
download: Make 'http-fetch' public.
* guix/build/download.scm (http-fetch): Remove 'file' parameter.  Change
to return an input port and the content-length.  Make public.
(url-fetch): Adjust accordingly.
2017-10-19 23:21:49 +02:00
Ludovic Courtès b3ac341d4e
download: Remove old-Guile leftovers.
This is a followup to 36626c556e.

* guix/build/download.scm (http-fetch): Rename 'port-or-bv' to 'port'.
Assume (port? port) is always true, and remove other branch.
2017-10-19 23:21:49 +02:00
宋文武 5efa0e4d4f
guix: substitute: Report the last progress in the child process.
Fixes <https://bugs.gnu.org/28756>.

* guix/utils.scm (filtered-port): Close the 'input' port for the current
process, and close it upon exit in the child process.
* guix/scripts/substitute.scm (progress-substitution): Display "\n\n" after
the reporter has finished.
2017-10-17 19:00:35 +08:00
Christopher Baines 4cb036d604
emacs-build-system: Change how patch-el-files substitutes commands.
Previously the regex would match from /bin/ to a closing quote. However, this
is greedy, so will match up until the last ". This causes problems when there
are several quotes on the same line, for example:

org-effectiveness.el:
196:      (call-process "/bin/bash" nil t nil "-c" strplot)

Therefore, change . to \S so that it doesn't include whitespace
characters. Changing to a lazy quantifier would be an option, if that were
supported.

* guix/build/emacs-build-system.scm (patch-el-files): Change the regular
  expression used.
2017-10-15 19:02:44 +01:00
Christopher Baines dd2de28423
emacs-build-system: Handle missing programs when patching.
Previously the string-append here would error, which isn't useful as it
doesn't tell you which command couldn't be found. To make the error
actionable, catch it earlier, and explicitly error.

* guix/build/emacs-build-system.scm (patch-el-files): Handle (which cmd)
  returning #f.
2017-10-15 19:02:43 +01:00
Leo Famulari 91525b486c
build: Add the Go build system.
* guix/build-system/go.scm,
guix/build/go-build-system.scm: New files.
* Makefile.am (MODULES): Add new files.
* doc/guix.texi (Build Systems): Document the go-build-system.
2017-10-12 21:22:40 -04:00
Ludovic Courtès 61f28fe7e9
lint: 'home-page' checker reports permanent redirects.
* guix/scripts/lint.scm (probe-uri): Add special case for HTTP 301.
(validate-uri): Likewise.
* tests/lint.scm ("home-page: 301, invalid")
("home-page: 301 -> 200", "home-page: 301 -> 404")
("source: 301 -> 200", "source: 301 -> 404"): New tests.
2017-10-12 23:47:48 +02:00
Ludovic Courtès 6ea10db973
tests: Support multiple HTTP server instances.
* guix/tests/http.scm (%http-server-socket): Turn into...
(open-http-server-socket): ... this procedure.
(http-server-can-listen?): New procedure.
(http-write, %http-server-lock, %http-server-ready)
(http-open, stub-http-server): Move to 'call-with-http-server' body.
(call-with-http-server): Add #:headers parameter.
(with-http-server): Add an additional pattern with headers.
* tests/derivations.scm: Use (http-server-can-listen?) instead
of (force %http-server-socket).
* tests/lint.scm: Likewise.
2017-10-12 23:47:48 +02:00
Ludovic Courtès d8e89b1c79
offload: Reduce the number of calls to 'machine-load'.
Previously we would call 'machine-load' once per machine, which was very
costly when there were many machines.  Now we arrange to call it only
once on average (when all the machines have the same 'speed' value).

* guix/scripts/offload.scm (random-seed, shuffle): New procedures.
(choose-build-machine)[machines+slots+loads]: Rename to...
[machines+slots]: ... this.  Remove load from the tuples therein.
[undecorate]: Adjust accordingly.
[machine-less-loaded-or-faster?]: Remove.
[machine-faster?]: New procedure.
Sort MACHINES+SLOTS according to 'machine-faster?'.  Call
'machine-load?' as the last thing.
2017-10-12 17:51:41 +02:00
宋文武 abaee53c80
substitute: Close the progress port after substitute finished.
Fixes <https://bugs.gnu.org/28756>.

* guix/scripts/substitute.scm (progress-substitution):
Call '(close-port progress)'.
2017-10-12 22:31:22 +08:00
Ludovic Courtès 85a2b58987
zlib: Fix memory leak due to revealed ports not being GC'd.
Fixes <https://bugs.gnu.org/28784>.

This mostly reverts 81a0f1cdf1, which
introduced a regression: revealed ports are *never* GC'd (contrary to
what Guile's manual suggests).

In addition to the revert, 'close-procedure' now explicitly swallows
EBADF errors when 'close-port' is called.

* guix/zlib.scm (close-procedure): New procedure.
(make-gzip-input-port)[gzfile]: Use 'fileno' instead of 'port->fdes'.
Use 'close-procedure' instead of 'gzclose'.
(make-gzip-output-port): Likewise.
* tests/zlib.scm ("compression/decompression pipe"): Use 'port-closed?'
to determine whether PARENT has been closed.
2017-10-11 15:20:50 +02:00
Ludovic Courtès 90eaa9419a
import: cpan: Load (gnu packages perl) lazily.
* guix/import/cpan.scm: Remove dependency on (gnu packages perl).
(perl-package): New procedure.
(%corelist, core-module?): Use it instead of referring to 'perl'.
2017-10-10 23:12:04 +02:00
Ludovic Courtès b719ddbbbb
import: pypi: Remove unneeded import.
* guix/import/pypi.scm: Remove unneeded import.
2017-10-10 23:12:03 +02:00
Ludovic Courtès a6e22d8445
ui: Improve reporting of missing closing parentheses.
Suggested by Ricardo Wurmus.
Works around <https://bugs.gnu.org/28295>.

* guix/ui.scm (report-load-error): Add case for 'read-error'.
* tests/guix-system.sh: Test missing-closing-paren errors.
2017-10-10 23:12:03 +02:00
Efraim Flashner 8b4af8284a
guix: mirrors: Add kde archive mirror.
* guix/download.scm (%mirrors)[kde]: Add kde-attic mirror.
2017-10-10 17:01:32 +03:00
Eric Bavier 7f0bb6540a
syscalls: clone: Define syscall-id for aarch64.
* guix/build/syscalls.scm (clone): Define syscall-id for aarch64 machines.
2017-10-09 18:55:18 -05:00
Ludovic Courtès 735f6b63d0
lint: Remove extra newline.
* guix/scripts/lint.scm (check-for-updates): Remove trailing "~%".
2017-10-09 23:17:49 +02:00
Efraim Flashner adf0c531a8
guix: lint: Add checker for new upstream versions.
* guix/scripts/lint.scm (check-for-updates): New procedure.
(%checkers): Add it.
* guix/scripts/refresh.scm (importer-modules, %updaters): Move
from here ...
* guix/upstream.scm: ... to here.
2017-10-09 14:05:17 +03:00
Oleg Pykhalov cca6941fee
pull: Add GUIX_PULL_URL environment variable.
* guix/scripts/pull.scm (%repository-url): Add GUIX_PULL_URL environment
  variable.
* doc/guix.texi (Invoking guix pull): Mention GUIX_PULL_URL.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-10-07 23:01:52 +02:00
Ludovic Courtès aba219af0f
pull: Honor 'parallel-job-count'.
* guix/build/pull.scm (build-guix): Use 'n-par-for-each' and honor
'parallel-job-count'.
2017-10-07 17:08:33 +02:00
Ludovic Courtès 1f3ea89871
store: Add missing import.
* guix/store.scm: Use (ice-9 format).
2017-10-07 17:08:32 +02:00
Ludovic Courtès eca16a3d1d
guix package: '--upgrade' no longer reverses package order.
Reported by Oleg Pykhalov <go.wigust@gmail.com>
at <https://lists.gnu.org/archive/html/help-guix/2017-10/msg00000.html>.

* guix/scripts/package.scm (options->installable)[upgraded]: Use
'fold-right' instead of 'fold'.
2017-10-07 17:08:32 +02:00
Ludovic Courtès e5788ebbe1
publish: Cache uncompressed nars as well.
Fixes <https://bugs.gnu.org/28664>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/scripts/publish.scm (bake-narinfo+nar): When COMPRESSION is
'none, write NAR instead of doing nothing.
(make-request-handler): Use 'render-nar/cached' for /nar URLs with no
compression.
* tests/publish.scm ("with cache", "with cache, uncompressed"): Adjust
expected result accordingly.
2017-10-05 23:05:06 +02:00
Ludovic Courtès 9d80d0e95c
guix system: Error out when passed a wrong file system UUID/label.
* guix/scripts/system.scm (check-file-system-availability): New
procedure.
(perform-action): Use it.
2017-10-05 12:09:17 +02:00
Julien Lepiller f403d7abdf
guix: ant-build-system: Add #:test-include and #:test-exclude arguments.
* guix/build-system/ant.scm: Add #:test-include and #:test-exclude
arguments.
* guix/build/ant-build-system.scm: Generate test list from arguments.
* doc/guix.texi (Build Systems): Document it.
2017-10-03 21:38:23 +02:00
Julien Lepiller 8df1faa047
guix: ant-build-system: Add main-class support.
* guix/build-system/ant.scm: New #:main-class argument
* guix/build/ant-build-system.scm: Generate a manifest file with
additional properties.
* doc/guix.texi (Build Systems): Document it.
2017-10-03 21:37:47 +02:00
Ricardo Wurmus 07f80c27fd
guix: Revert accidentally committed changes.
This is a follow-up to commit fb1db38547.

* guix/scripts/build.scm (lazy-util): Remove procedure.
(options->things-to-build): Remove special case for files with ".json"
extension.
2017-09-28 16:34:12 +02:00
Ricardo Wurmus fb1db38547
import: Add JSON importer.
* doc/guix.texi (Invoking guix import): Document it.
* guix/scripts/import/json.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/import.scm (importers): Add json importer.
2017-09-28 13:10:11 +02:00
Ricardo Wurmus 5e892bc365
import: Add generic data to package converter.
* guix/import/utils.scm (build-system-modules, lookup-build-system-by-name,
specs->package-lists, source-spec->object, alist->package): New procedures.
* tests/import-utils.scm: Add tests for alist->package.
2017-09-28 13:10:11 +02:00
Ricardo Wurmus 68a91a183b
import: Add package->code.
* guix/import/print.scm: New file.
* tests/print.scm: New file.
* Makefile.am (SCM_TESTS): Add new test file.
(MODULES): Add print.scm.
2017-09-28 13:10:10 +02:00
Mohammed Sadiq ea1cd554cc
build-system: meson: Fix typo in variable name.
* guix/build-system/meson.scm (lower): fix typo in glib-or-gtk?.
2017-09-26 19:58:26 +02:00
Ludovic Courtès 06acf6b52f
http-client: Reset cache TTL upon 304 "Not Modified" responses.
* guix/http-client.scm (http-fetch/cached)[update-cache]: Add call to
'utime' in the 304 case.
2017-09-26 00:35:06 +02:00
Ludovic Courtès c1d8b3b3b5
upstream: Add new GNOME updater.
Partly fixes <https://bugs.gnu.org/28159>.
Reported by Hartmut Goebel <h.goebel@crazy-compilers.com>.

* guix/import/gnome.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/gnu-maintenance.scm (latest-gnome-release)
(%gnome-updater): Remove.
2017-09-26 00:35:06 +02:00
Ludovic Courtès 97abc90733
upstream: Add 'url-prefix-predicate'.
* guix/gnu-maintenance.scm (url-prefix-predicate): Move to...
* guix/upstream.scm (url-prefix-predicate): ... here.
2017-09-26 00:35:06 +02:00
Arun Isaac 2374dee7bc
licenses: Add CC-Sampling+ 1.0.
* guix/licenses.scm (cc-sampling-plus-1.0): New variable.

Signed-off-by: Kei Kebreau <kkebreau@posteo.net>
2017-09-22 08:04:32 -04:00
宋文武 798648515b
download: Don't report the progress too fast.
* guix/utils.scm (<progress-reporter>): New record type.
(call-with-progress-reporter): New procedure.
* guix/build/download.scm (dump-port*, rate-limited, progress-reporter/file):
New procedures.
(ftp-fetch, http-fetch): Use 'dump-port*'.
(progress-proc): Remove procedure.
* guix/scripts/substitute.scm (progress-report-port): Rewrite in terms of
<progress-reporter>.
(process-substitution): Adjust accordingly.
2017-09-20 19:49:31 +08:00
Ludovic Courtès f1b65d0dd9
cve: Disable position recording while reading the CVE list.
* guix/cve.scm (fetch-vulnerabilities)[read*]: New procedure.
Use it in lieu of 'read'.
2017-09-19 23:58:25 +02:00
Ludovic Courtès 3ce1b9021a
http-client: 'http-client/cached' uses 'If-Modified-Since'.
* guix/http-client.scm (http-fetch/cached)[update-cache]: Add
'cache-port' parameter.  Check its mtime and compute 'if-modified-since'
header accordingly.  Guard 'http-get-error?' and honor 304.
Adjust callers of 'update-cache'.
* guix/gnu-maintenance.scm (ftp.gnu.org-files): Set #:ttl to 15m.
2017-09-19 12:19:15 +02:00
Ludovic Courtès 82781d871f
utils: 'current-source-directory' gracefully deals with lack of location info.
* guix/utils.scm (current-source-directory): Adjust for when
'syntax-source' returns #f.
2017-09-19 12:19:15 +02:00
宋文武 4220514b8f
substitute: Close the download port after substitution finished.
* guix/scripts/substitute.scm (progress-substitution): Call 'close-port'
after 'restore-file'.
2017-09-18 19:05:29 +08:00