Commit Graph

1617 Commits (0058239ed3e3ea2ff752487bd15b9d21f6702a19)

Author SHA1 Message Date
Ludovic Courtès fa96048f0a profiles: Remove duplicate entries in 'etc/profile'.
Reported by Andy Wingo
at <http://lists.gnu.org/archive/html/guix-devel/2015-08/msg00109.html>.

* guix/profiles.scm (profile-derivation)[builder]: Delete duplicates in
  SEARCH-PATHS.
2015-08-20 19:12:36 +02:00
Ricardo Wurmus 2824146bd8 guix: Add Sleepycat license.
* guix/licenses.scm (sleepycat): New variable.
2015-08-20 08:32:28 +02:00
David Thompson 0d2794005c scripts: package: Add --install-from-file option.
* guix/scripts/package.scm (show-help): Add help text for --install-from-file
  option.
  (%options): Add --install-from-file option.
* tests/guix-package.sh: Test it.
* doc/guix.texi ("invoking guix package"): Document it.
* doc/package-hello.scm: New file.
* doc.am (EXTRA_DIST): Add it.
2015-08-19 22:23:59 -04:00
Ludovic Courtès 83bde59fb3 size: Get the item's size from the daemon rather than compute it.
This removes all I/O, which obviously makes things faster.

* guix/scripts/size.scm (file-size, store-item-exists?): Remove.
  (query-path-info*): New procedure.
  (file-size*): Rename to...
  (file-size): ... this; adjust caller.  Use 'query-path-info*' instead of
  'file-size'.
2015-08-19 11:39:18 +02:00
Ludovic Courtès 40a7d4e58b lint: Add 'formatting' checker.
* guix/scripts/lint.scm (report-tabulations, report-trailing-white-space,
  report-long-line, report-formatting-issues, check-formatting): New
  procedures.
  (%formatting-reporters): New variable.
  (%checkers): Add 'formatting' checker.
* tests/lint.scm ("formatting: tabulation", "formatting: trailing white
  space", "formatting: long line", "formatting: alright"): New tests.
* doc/guix.texi (Invoking guix lint): Mention the 'formatting' checker.
2015-08-19 11:39:17 +02:00
David Thompson e83c6d009f build: ruby: Rewrite build system to use gem archives.
Co-Authored-By: Pjotr Prins <pjotr.public01@thebird.nl>

* guix/build-system/ruby.scm (lower): Remove git dependency.
  (rubygems-uri): New procedure.
* guix/build/ruby-build-system (gitify): Delete.
  (unpack): Use 'gem unpack' utility.
  (check): Add docstring.
  (build): Repack modified gem.
  (install): Rebuild unpacked gem and install it.
  (%standard-phases): Remove gitify and build phases.
* gnu/packages/ruby.scm (ruby-hoe, ruby-rake-compiler, ruby-i18n,
  ruby-rspec-support, ruby-rspec-core, ruby-diff-lcs-for-rspec,
  ruby-rspec-expectations, ruby-rspec-mocks, ruby-rspec, bundler,
  ruby-useragent, ruby-bacon, ruby-arel, ruby-connection-pool,
  ruby-net-http-persistent, ruby-minitest, ruby-minitest-sprint,
  ruby-minitest-bacon, ruby-daemons, ruby-git, ruby-slop,
  ruby-multipart-post): Convert to new build system.
* doc/guix.texi (ruby-build-system): Document the gem archive requirement.
2015-08-18 17:58:13 -04:00
David Thompson 39e336b5c8 syscalls: setns: Skip binding if there is no such C function.
On systems with a glibc prior to 2.14, the 'setns' function is not available.

Thanks to Eric Bavier for reporting the issue.

* guix/build/syscalls.scm (setns): Wrap with 'false-if-exception'.
2015-08-17 14:51:18 -04:00
Alex Kost 1d3eaef90c import: elpa: Fix typo.
Reported by Eric Dvorsak <eric@dvorsak.fr> on #guix.

* guix/scripts/import/elpa.scm (%default-options): Remove redundant
  quote which led to an error if --archive option was not specified.
2015-08-10 15:46:10 +03:00
Mark H Weaver 9f6509c655 python-build-system: Fix 'get-python-version'.
* guix/build/python-build-system.scm (get-python-version): Rewrite to handle
  multiple-digit version number components.
2015-08-06 16:33:54 -04:00
Federico Beffa 40aee1a133 build: emacs: Fix bug and improvement robustness.
* guix/build/emacs-build-system.scm (emacs-inputs): Fix matching pattern.
  (patch-el-files): Improve regexp pattern.
2015-08-01 12:37:13 +02:00
Federico Beffa 6544aba5fc import: elpa: Improve error message reporting.
* guix/import/elpa.scm (filter-dependencies): Fix bug.
  (call-with-downloaded-file): Add optional parameter 'error-thunk'.
  (fetch-package-description): Use it.
2015-08-01 12:36:21 +02:00
Ludovic Courtès e7f5691d45 syscalls: Add 'network-interfaces', which wraps libc's 'getifaddrs'.
Based on discussions with Rohan Prinja <rohan.prinja@gmail.com>.

* guix/build/syscalls.scm (<interface>): New record type.
  (write-interface, values->interface, unfold-interface-list,
  network-interfaces, free-ifaddrs): New procedures.
  (ifaddrs): New C struct.
  (%struct-ifaddrs-type, %sizeof-ifaddrs): New macros.
* tests/syscalls.scm ("network-interfaces returns one or more interfaces",
  "network-interfaces returns \"lo\""): New tests.
2015-07-25 14:43:45 +02:00
Ludovic Courtès 573b4c1ff3 syscalls: 'define-c-struct' properly align reads.
* guix/build/syscalls.scm (alignof*, align): New macros.
  (write-types, read-types): Use 'align' to compute the actual offset to
  read/write a value of TYPE0.
2015-07-25 14:43:45 +02:00
Ludovic Courtès 3ca337699a syscalls: 'read-socket-address' gracefully handles unsupported families.
* guix/build/syscalls.scm (PF_PACKET, AF_PACKET): New variables.
  (read-socket-address): Make 'index' optional.  Return (vector FAMILY) when
  FAMILY is neither AF_INET nor AF_INET6.
2015-07-25 14:43:44 +02:00
Ludovic Courtès 4a30e84e61 syscalls: 'define-c-struct' distinguishes pointers from integers.
* guix/build/syscalls.scm (read-type): Add special-case for when TYPE is '*.
2015-07-25 14:43:44 +02:00
Ludovic Courtès b89e74054e syscalls: Rename 'network-interfaces' and 'all-network-interfaces'.
* guix/build/syscalls.scm (network-interfaces): Rename to...
  (network-interface-names): ... this.
  (all-network-interfaces): Rename to...
  (all-network-interface-names): ... this.
* gnu/services/networking.scm (dhcp-client-service): Adjust accordingly.
* tests/syscalls.scm ("all-network-interfaces"): Rename to...
  ("all-network-interface-names"): ... this, and adjust accordingly.
  ("network-interfaces"): Rename to...
  ("network-interface-names"): ... this, and adjust accordingly.
2015-07-25 14:43:44 +02:00
Ludovic Courtès 69b4ffcfbd Fix typos in translatable strings.
Reported by Anders Jonsson <anders.jonsson@norsjovallen.se>.

* gnu/packages/backup.scm, gnu/packages/databases.scm,
  gnu/packages/linux.scm, gnu/packages/perl.scm,
  gnu/packages/web.scm, guix/scripts/lint.scm,
  guix/scripts/publish.scm: Fix typos in translatable strings.
2015-07-23 09:42:23 +02:00
Ludovic Courtès d490d06e0f size: Add '--substitute-urls' option.
* guix/scripts/size.scm (show-help, %options): Add --substitute-urls.
  (%default-options): Add 'substitute-urls'.
  (guix-size): Honor it.
* doc/guix.texi (Invoking guix size): Document it.
2015-07-22 22:56:41 +02:00
Ludovic Courtès 1eabf4ec63 derivations: Improve docstring of 'substitution-oracle'.
* guix/derivations.scm (substitution-oracle): Improve docstring.
2015-07-22 22:56:41 +02:00
Ludovic Courtès b59df2434a derivations: Improve complexity of 'substitution-oracle'.
* guix/derivations.scm (substitution-oracle): Use a final 'concatenate'
  instead of repeated 'append's.
2015-07-22 22:56:41 +02:00
Ludovic Courtès 2c59cbc26a import: hackage: Remove reference to unbound variable.
* guix/scripts/import/hackage.scm (guix-import-hackage): Fix error message for
  imports from stdin, which referred to unbound variable 'package-name'.
2015-07-22 22:56:41 +02:00
Ludovic Courtès 1acd8d22af size: Remove leftover 'pk'.
* guix/scripts/size.scm (profile->page-map): Remove leftover 'pk'.
2015-07-22 22:56:41 +02:00
Ludovic Courtès dee2b3bdb9 import: pypi: Improve warning message.
* guix/import/pypi.scm (guess-requirements): Add missing newline and quotes in
  warning.
2015-07-21 21:14:33 +02:00
Mark H Weaver e170571887 Merge branch 'core-updates' 2015-07-19 20:28:56 -04:00
Ludovic Courtès 94080a7263 publish: Do not load archive content in memory.
Previously, before replying to a /nar/* request, 'guix publish' would first
build up the whole nar into memory (as a consequence of
<http://bugs.gnu.org/21093>), which obviously doesn't scale.

* guix/scripts/publish.scm (render-nar): Return STORE-PATH instead of a
  procedure that calls 'write-file'.
  (sans-content-length): New procedure.
  (http-write): For 'x-nix-archive', don't call '%http-write'.  Instead, call
  'write-file' right from here, using BODY as the file name.
2015-07-20 00:37:47 +02:00
Mark H Weaver 1b4e48d498 Merge branch 'master' into core-updates 2015-07-19 18:12:34 -04:00
Ludovic Courtès 7f23fb0088 publish: Serve /nar requests in a separate thread.
* guix/scripts/publish.scm (%http-write): New variable.
  (http-write): New procedure.
  (concurrent-http-server): New variable.
  (run-publish-server): Use it.
2015-07-19 23:59:29 +02:00
pjotrp 6e9f2913ba build-system/ruby: Add #:gem-flags parameter.
* guix/build-system/ruby.scm (build): add 'gem-flags' key
* guix/build/ruby-build-system.scm (build): use 'gem-flags' key
* doc/guix.texi (Build Systems): Mention #:gem-flags.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-07-18 17:15:03 +02:00
Ludovic Courtès 3b307162e8 publish: Write hashes in nix-base32 format.
* guix/scripts/publish.scm (narinfo-string): Use
  'bytevector->nix-base32-string', not 'bytevector->base32-string'.
2015-07-18 00:14:04 +02:00
Ludovic Courtès 13f0c6ed41 syscalls: Struct deserializer can now return arbitrary objects.
* guix/build/syscalls.scm (read-types): Add RETURN and VALUES parameters.
  (define-c-struct): Add WRAP-FIELDS parameter and pass it to 'read-types'.
  (sockaddr-in, sockaddr-in6): Add first argument that uses
  'make-socket-address'.
  (read-socket-address): Remove 'match' on the result of 'read-sockaddr-in'
  and 'read-sockaddr-in6'.
2015-07-17 23:31:29 +02:00
Ludovic Courtès 4f7b564adb download: Remove spurious warning about 'https_proxy'.
* guix/build/download.scm (open-connection-for-uri)[with-https-proxy]: Warn
  about 'https_proxy' only when 'getenv' returns a non-empty string.
2015-07-17 22:31:12 +02:00
Ludovic Courtès 0eed5501b8 licenses: Add Fontana's copyleft-next.
* guix/licenses.scm (copyleft-next): New variable.
2015-07-17 15:35:57 +02:00
Ludovic Courtès ee2a6304f3 system: Add 'kernel-arguments' field.
* gnu/system.scm (<operating-system>)[kernel-arguments]: New field.
  (operating-system-grub.cfg): Honor it.
  (operating-system-parameters-file): Add 'kernel-arguments' to the parameters
  file.
* guix/scripts/system.scm (previous-grub-entries)[system->grub-entry]: Read
  the 'kernel-arguments' field of the parameters file, when available.
* gnu/system/vm.scm (system-qemu-image/shared-store-script):
  Use (operating-system-kernel-arguments os) in '-append'.
* doc/guix.texi (operating-system Reference): Document it.
2015-07-17 01:11:06 +02:00
Mark H Weaver 3bacb7a698 python-build-system: Add 'ensure-no-mtimes-pre-1980' phase.
* guix/build/python-build-system.scm (ensure-no-mtimes-pre-1980):
  New phase.
  (%standard-phases): Add it after 'unpack'.
2015-07-16 01:49:39 -04:00
Ludovic Courtès d2f2c8f126 size: Gracefully handle EPIPE.
* guix/scripts/size.scm (guix-size): Wrap body in 'leave-on-EPIPE'.
2015-07-15 23:57:01 +02:00
Ludovic Courtès df36e62938 ui: Add 'leave-on-EPIPE'.
* guix/scripts/package.scm (leave-on-EPIPE): Move to...
* guix/ui.scm (leave-on-EPIPE): ... here.
2015-07-15 23:57:01 +02:00
Mark H Weaver 35995769b5 Merge branch 'master' into core-updates 2015-07-15 15:10:32 -04:00
Mark H Weaver 2e9511dfbd packages: patch-and-repack: Build tarballs deterministically.
* guix/packages.scm (patch-and-repack)[build]: When invoking 'tar' to repack
  the archive, pass "--mtime=@0", "--owner=root:0", and "--group=root:0".
2015-07-14 19:41:20 -04:00
Mark H Weaver 3c7d023d64 build-system/gnu: Pass --build=<triplet> to configure by default.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Accept #:build
  keyword argument.  Pass it to 'gnu-build' on the build side.
* guix/build/gnu-build-system.scm (configure): Accept #:build keyword
  argument.  Unless it is false, pass --build to configure.
2015-07-13 18:54:40 -04:00
Ludovic Courtès ef8f910fce substitute: Improve functional decomposition.
* guix/scripts/substitute.scm (display-narinfo-data,
  process-query, process-substitution): New procedures.  Code moved from...
  (guix-substitute): ... here.  Use them.
2015-07-13 18:29:01 +02:00
Ludovic Courtès f8a8e0fe16 guix build: Add '--substitute-urls' client option.
* guix/scripts/build.scm (%standard-build-options,
  show-build-options-help): Add --substitute-urls=URLS.
  (set-build-options-from-command-line): Honor it.
* guix/store.scm (%default-substitute-urls): Make public.
* doc/guix.texi (Substitutes): Add xref to the client --substitute-urls
  option.
  (Invoking guix build): Document it.
  (Invoking guix-daemon): Add 'daemon-substitute-urls' anchor.
2015-07-13 18:29:01 +02:00
Ludovic Courtès 24f5aaaf24 substitute: Honor "substitute-urls" option passed by "untrusted" clients.
* guix/scripts/substitute.scm (or*): New macro.
  (%cache-url): Honor "untrusted-substitute-urls".
* guix/tests.scm (%test-substitute-urls): New variable.
  (open-connection-for-tests): Use it.
* tests/derivations.scm ("derivation-prerequisites-to-build and substitutes",
  "derivation-prerequisites-to-build and substitutes, non-substitutable
  build", "derivation-prerequisites-to-build and substitutes, local build"):
  Pass it to 'set-build-options'.
* tests/guix-daemon.sh: Likewise.
* tests/store.scm ("substitute query, alternating URLs"): New test.
  ("substitute query", "substitute", "substitute + build-things with output
  path", "substitute, corrupt output hash", "substitute --fallback"): Pass
  #:substitute-urls to 'set-build-options'.
2015-07-13 18:29:01 +02:00
Ludovic Courtès 895d1eda54 substitute: Store cached narinfo in cache-specific sub-directories.
This ensures that switching between different substitute servers doesn't lead
to a polluted narinfo cache.

* guix/scripts/substitute.scm (narinfo-cache-file): Add 'cache-url'
  parameter.  Add the base32 of CACHE-URL as a sub-directory under
  %NARINFO-CACHE-DIRECTORY.  Update callers.
  (cached-narinfo): Likewise.  Call 'mkdir-p' on the dirname of the cache
  file.  Update callers.
  (remove-expired-cached-narinfos): Add 'directory' parameter and use it
  instead of %NARINFO-CACHE-DIRECTORY.
  (narinfo-cache-directories): New procedure.
  (maybe-remove-expired-cached-narinfo): Call 'remove-expired-cached-narinfos'
  for each item returned by 'narinfo-cache-directories'.
2015-07-13 18:29:01 +02:00
Ludovic Courtès 074efd63a8 substitute: Pass the cache URL instead of <cache> objects.
* guix/scripts/substitute.scm (<cache>): Rename to...
  (<cache-info>): ... this.
  (open-cache): Rename to...
  (download-cache-info): ... this.  Return a <cache-info> or #f.
  (open-cache*): Remove.
  (cache-narinfo!): Take a URL instead of a <cache> as the first parameter.
  (fetch-narinfos): Likewise.  Call 'download-cache-info'.  Remove use of
  'force'.
  (guix-substitute): Replace calls to 'open-cache*' with %CACHE-URL.
2015-07-13 18:29:01 +02:00
Ludovic Courtès e4e099feca substitute: Remove unneeded conditionals.
* guix/scripts/substitute.scm (guix-substitute): Remove unneeded (if cache
  ...) forms since CACHE is always true (it's a promise.)
2015-07-13 18:29:01 +02:00
Alex Kost 663d0733c8 guix lint: Remove duplicated module lines.
* guix/scripts/lint.scm (guix): Remove duplicated lines for using
  'srfi-34' and 'srfi-35' modules.  These lines were introduced twice by
  commits b210b35 and 002c57c.
2015-07-13 10:20:34 +03:00
Ludovic Courtès 161094c8e2 packages: Rewrite 'transitive-inputs' to be linear and remove duplicates.
There were two issues:

  1. Use of 'delete-duplicates', which is quadratic, was a serious problem for
     closures with lots of propagated inputs, such as that of the 'hydra'
     package (several minutes for 'guix build hydra -n'!).

  2. The 'delete-duplicates' call essentially had no effect since duplicate
     inputs typically had a different label and were thus kept.  For
     instance, (bag-transitive-inputs (package->bag inkscape)) would return
     216 items whereas (delete-duplicates (map cdr THAT)) contains only 67
     items.

     The new implementation returns 67 items in this case.  For 'hydra', we're
     down from 42211 items to 361, and roughly 13s for 'guix build hydra'.

* guix/packages.scm (transitive-inputs): Rewrite as a breadth-first
  traversal.  Remove duplicate propagated inputs.
* tests/packages.scm ("package-transitive-inputs", "package->bag, propagated
  inputs"): Adjust to use simple labels for propagated inputs, without "/".
  ("package-transitive-inputs, no duplicates"): New test.
2015-07-12 01:27:00 +02:00
Ludovic Courtès b19649a132 offload: Add 'ssh-options' field to <build-machine>.
* guix/scripts/offload.scm (<build-machine>)[ssh-options]: New field.
  (remote-pipe): Use it.
  (send-files): Likewise.
2015-07-09 11:59:26 +02:00
Federico Beffa d8b6fcdeda import: cabal: Make token recognition case-insensitive.
* guix/import/cabal.scm (make-rx-matcher): Add optional parameter FLAG.
  (is-property, is-flag, is-src-repo, is-exec, is-test-suite, is-benchmark,
  is-lib, is-else, is-if): Make test case-insensitive.
2015-07-08 10:53:05 +02:00
Federico Beffa e9137a5310 build: Add 'emacs-build-system'.
* Makefile.am (MODULES): Add 'guix/build-system/emacs.scm' and
  'guix/build/emacs-build-system.scm'.
* guix/build-system/emacs.scm: New file.
* guix/build/emacs-build-system.scm: New file.
* doc/guix.texi (Build Systems): Document it.
2015-07-08 10:53:05 +02:00