Commit Graph

3435 Commits (68a58775e071d4b0e000b93ad121b6e64d161b79)

Author SHA1 Message Date
Ricardo Wurmus 945449b40b
guix: Fix system reconfigure.
This is a follow-up to 378daa8cb6.

* guix/scripts/system.scm (switch-to-system): Lower the script.
2018-06-21 16:54:06 +02:00
Ludovic Courtès e203f4c26a
guix system: 'list-generation' correctly displays file system labels.
* guix/scripts/system.scm (display-system-generation): Correctly display
file system labels.  Previously, starting from commit
a5acc17a3c, it'd print #<file-system-label "foo">.
2018-06-20 23:47:08 +02:00
Ricardo Wurmus b194da0d68
build-system/waf: Use invoke.
* guix/build/waf-build-system.scm (call-waf): Use "invoke" and unconditionally
return #t.
2018-06-19 10:48:14 +02:00
Ludovic Courtès 7af5c2a248
self: Define derived '-directory' variables in config.scm.
This is a followup to d6b5aa0b03.

* guix/self.scm (%config-variables): Remove %CONFIG-DIRECTORY,
%STATE-DIRECTORY, %STORE-DATABASE-DIRECTORY, and %STORE-DIRECTORY.
(make-config.scm): Define them here.
* build-aux/build-self.scm (%config-variables, make-config.scm):
Likewise.
2018-06-18 23:56:16 +02:00
Ludovic Courtès e8cb9c01c6
build: Remove checks for 'nix-instantiate'.
* guix/import/snix.scm (open-nixpkgs): Use "nix-instantiate"
unconditionally.
* configure.ac: Remove check for 'nix-instantiate'.
* guix/config.scm.in (%nix-instantiate): Remove.
* guix/self.scm (%dependency-variables): Remove '%nix-instantiate'.
(make-config.scm): Remove it from the generated "config.scm".
* build-aux/build-self.scm (%dependency-variables, make-config.scm):
Likewise.
2018-06-18 23:19:51 +02:00
Ludovic Courtès 45779fa676
self: Make (guix config) generation really stateless.
Previously the %CONFIG-VARIABLES list would be generated based on what
the current (guix config) contains.  Thus, it would include
'%guix-register-program', which we recently removed, because
existing (guix config) most likely contained that variable.  Since its
value could differ from machine to machine, the build farm could be
building a different config.scm, thereby preventing people from getting
substitutes.

* guix/self.scm (%config-variables): Turn into a white list instead of
taking all the remaining variables from the current (guix config).
* build-aux/build-self.scm (%config-variables): Likewise.
2018-06-18 23:19:51 +02:00
Ludovic Courtès 870677cbb8
compile: Work around non-thread-safe module autoloading.
* guix/build/compile.scm <top level>: Set 'try-module-autoload' when
running on Guile < 2.2.4.
2018-06-18 23:19:51 +02:00
Ricardo Wurmus 32eb44240d
build-system/r: Accept #:r argument.
* guix/build-system/r.scm (lower): Add #:r to private-keywords.
2018-06-18 13:51:28 +02:00
Ludovic Courtès a89faa3faa
self: Install .go files to 'lib/guile/X.Y/site-ccache'.
* guix/self.scm (guix-command): Add 'compiled-modules' parameter and
honor it.
(whole-package): Likewise.
(compiled-guix)[built-modules]: Turn into a procedure.
When PULL-VERSION is 1, use separate source and compiled modules.
When PULL-VERSION is 0, return a single directory containing both .scm
and .go files.
2018-06-17 01:40:14 +02:00
Marius Bakke 259341cf93
gnu: ldb: Fix build on 32-bit systems.
* guix/utils.scm (target-64bit?): New procedure.
* gnu/packages/samba.scm (ldb)[inputs]: Only add LMDB on 64-bit systems.
[arguments]: Make #:tests? conditional on LMDB availability.
2018-06-16 21:35:25 +02:00
Ludovic Courtès 265048cc89
offload: Fix error message in 'guix offload test'.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>
in <https://bugs.gnu.org/31824>.

* guix/scripts/offload.scm (assert-node-has-guix): Fix typo in failure
message; add missing argument.
2018-06-15 10:04:59 +02:00
Ludovic Courtès a9a685cc00
offload: Gracefully handle invalid results from 'machines.scm'.
* guix/scripts/offload.scm (build-machines): Check the result of FILE.
Ignore it if it's not a list of <build-machine>.
2018-06-14 23:34:59 +02:00
Ludovic Courtès baed923682
self: Add 'guix-daemon' to the result.
* gnu/packages/package-management.scm (guix-daemon): New variable.
* guix/self.scm (whole-package): Add #:daemon and honor it.
(compiled-guix): Pass #:daemon to 'whole-package'.
2018-06-14 23:34:59 +02:00
Julien Lepiller af09bed7dc
guix: ui: Allow translation of dates.
* guix/ui.scm (display-generation): Allow translation of dates.
The format string will show dates as month day year, but some languages use a
different convention.
2018-06-14 21:53:12 +02:00
Ludovic Courtès ea0a06cee2
Remove 'guix-register' and its traces.
* Makefile.am (SH_TESTS): Remove tests/guix-register.sh.
* build-aux/pre-inst-env.in (GUIX_REGISTER): Remove.
* gnu/build/install.scm (directives): Remove outdated comment.
* gnu/build/vm.scm (root-partition-initializer): Update comment.
* gnu/packages/package-management.scm (guix-register): Remove.
* guix/config.scm.in (%sbindir, %guix-register-program): Remove.
* guix/scripts/system.scm (install): Adjust docstring.
* guix/self.scm (make-config.scm): Remove #:guix.  Do not generate
%sbindir and %guix-register-program.
(specification->package): Remove "guix".
* nix/guix-register/guix-register.cc: Remove.
* nix/libstore/store-api.cc (decodeValidPathInfo): Remove.
* nix/libstore/store-api.hh (decodeValidPathInfo): Remove declaration.
* nix/local.mk (sbin_PROGRAMS, guix_register_SOURCES)
(guix_register_CPPFLAGS, guix_register_LDFLAGS): Remove.
* tests/guix-register.sh: Remove.
2018-06-14 11:17:00 +02:00
Ludovic Courtès df2f6400b1
store: Remove 'register-path'.
* guix/store.scm (register-path): Remove.
* guix/nar.scm: Use (guix store database).
* guix/scripts/system.scm: Likewise.
* tests/store-database.scm: Remove #:hide (register-path).
* tests/store.scm ("register-path"): Remove.
2018-06-14 11:17:00 +02:00
Ludovic Courtès eb9fe97495
database: Allow for deterministic database construction.
Fixes <https://bugs.gnu.org/21073>.

* guix/store/database.scm (sqlite-register): Add #:time.
(%epoch): New variable.
(register-items): Add #:registration-time.  Pass #:time to
'sqlite-register'.
* gnu/build/install.scm (register-closure): Pass #:registration-time.
2018-06-14 11:17:00 +02:00
Ludovic Courtès 078c2329c0
install: Use 'reset-timestamps' from (guix store database).
* gnu/build/install.scm (reset-timestamps): Remove.
* gnu/build/vm.scm: Use 'reset-timestamps' from (guix store database).
2018-06-14 11:17:00 +02:00
Ludovic Courtès 31a63be878
database: Add 'register-items'.
* guix/build/store-copy.scm (store-info): Export.
* guix/store/database.scm (register-items): New procedure.
(register-path): Implement in terms of 'register-items'.
* gnu/build/install.scm (register-closure): Use 'register-items' instead
of 'for-each' and 'register-path'.
2018-06-14 11:17:00 +02:00
Ludovic Courtès ef1297e8c7
database: 'sqlite-register' takes a database, not a file name.
* guix/store/database.scm (sqlite-register): Remove #:db-file and add
'db' parameter.  Remove #:schema and 'parameterize'.
(register-path): Wrap 'sqlite-register' call in 'with-database' and in
'parameterize'.
* tests/store-database.scm ("new database")
("register-path with unregistered references"): Adjust accordingly.
2018-06-14 11:17:00 +02:00
Ludovic Courtès c45477d2a1
install: Use (guix store database) instead of 'guix-register'.
* gnu/build/install.scm (register-closure): Add #:reset-timestamps? and
and #:schema; honor them.  Rewrite in terms of 'register-path'.
(populate-single-profile-directory): Add #:schema and honor it.  Make
/var/guix/profiles and /var/guix/gcroots.
* gnu/build/vm.scm (root-partition-initializer): Pass
 #:reset-timestamps? to 'register-closure'.
* gnu/system/vm.scm (not-config?): New procedure.
(guile-sqlite3&co): New variable.
(expression->derivation-in-linux-vm)[config]: New variable.
[builder]: Use 'with-extensions'.
(iso9660-image)[schema, config]: New variables.
Wrap build expression in 'with-extensions'; add 'sql-schema' call.
Remove GUIX from INPUTS.
(qemu-image)[schema, config]: New variables.
Wrap body in 'with-extensions'.
(system-docker-image)[not-config?]: Remove.
[config]: Use 'make-config.scm'.
[schema]: New variable.
[build]: Use 'with-extensions'.  Add call to 'sql-schema'.  Remove GUIX
from INPUTS.
* gnu/system/file-systems.scm (%store-prefix): Check whether
'%store-prefix' is defined.
* guix/scripts/pack.scm (self-contained-tarball)[not-config?]
[libgcrypt, schema]: New variables.
[build]: Wrap in 'with-extensions'.  Adjust imported module list to use
'make-config.scm' for (guix config).
2018-06-14 11:16:59 +02:00
Ludovic Courtès 49c393ccaa
database: 'reset-timestamps' sets file permissions as well.
* guix/store/database.scm (reset-timestamps): Add 'chmod' calls.
2018-06-14 11:16:59 +02:00
Ludovic Courtès 122a6cad7d
database: Replace existing entries in Refs.
* guix/store/database.scm (add-reference-sql): Add "OR REPLACE".
2018-06-14 11:16:59 +02:00
Ludovic Courtès 4bd86f0d62
database: Add #:reset-timestamps? to 'register-path'.
* guix/store/database.scm (register-path): Add #:reset-timestamps? and
honor it.
2018-06-14 11:16:59 +02:00
Ludovic Courtès b85e2ff484
database: Remove extra SQL parameter in 'update-or-insert'.
* guix/store/database.scm (update-or-insert): Remove extra #:path
parameter.
2018-06-14 11:16:59 +02:00
Ludovic Courtès 0d0438ed8c
deduplicate: Fix a couple of thinkos.
* guix/store/deduplication.scm (get-temp-link): Turn 'args' in the 'catch'
handler into a rest argument.
(deduplicate): Use 'lstat' instead of 'file-is-directory?' to properly
handle symlinks.  When iterating over the result of 'scandir', exclude
the ".links" sub-directory.
* tests/store-deduplication.scm ("deduplicate"): Create sub-directories
and call 'deduplicate' directly on STORE.
2018-06-14 11:16:59 +02:00
Ludovic Courtès 866ee8c66a
database: 'register-path' creates the database directory if needed.
* guix/store/database.scm (register-path): Call 'mkdir-p'.
2018-06-14 11:16:59 +02:00
Ludovic Courtès 33fddb763a
database: Provide a way to specify the schema location.
* guix/store/database.scm (sqlite-register): Add #:schema.  Parameterize
'sql-schema' based on this.
(register-path): Add #:schema and pass it to 'sqlite-register'.
2018-06-14 11:16:59 +02:00
Ludovic Courtès 6892f0a247
store-copy: 'read-reference-graph' returns a list of records.
The previous implementation of 'read-reference-graph' was good enough
for many use cases, but it discarded the graph structure, which is
useful information in some cases.

* guix/build/store-copy.scm (<store-info>): New record type.
(read-reference-graph): Rewrite to return a list of <store-info>.
(closure-size, populate-store): Adjust accordingly.
* gnu/services/base.scm (references-file): Adjust accordingly.
* gnu/system/vm.scm (system-docker-image): Likewise.
* guix/scripts/pack.scm (squashfs-image, docker-image): Likewise.
* tests/gexp.scm ("gexp->derivation #:references-graphs"): Likewise.
2018-06-14 11:16:58 +02:00
Ludovic Courtès f8f9f7cabc
database: Fail registration when encountering unregistered references.
* guix/store/database.scm (add-reference-sql): Remove nested SELECT.
(add-references): Expect REFERENCES to be a list of ids.
(sqlite-register): Call 'path-id' for each of REFERENCES and pass it to
'add-references'.
* tests/store-database.scm ("register-path with unregistered references"):
New test.
2018-06-14 11:16:58 +02:00
Ludovic Courtès 3931c76154
database: 'with-database' can now initialize new databases.
* nix/libstore/schema.sql: Rename to...
* guix/store/schema.sql: ... this.
* Makefile.am (nobase_dist_guilemodule_DATA): Add it.
* nix/local.mk (%D%/libstore/schema.sql.hh): Adjust accordingly.
* guix/store/database.scm (sql-schema): New variable.
(sqlite-exec, initialize-database, call-with-database): New procedures.
(with-database): Rewrite in terms of 'call-with-database'.
* tests/store-database.scm ("new database"): New test.
* guix/self.scm (compiled-guix)[*core-modules*]: Add 'schema.sql' to
 #:extra-files.
2018-06-14 11:16:58 +02:00
Ludovic Courtès e2f8be0664
pull: Add '--list-generations'.
* guix/scripts/pull.scm (show-help, %options): Add '--list-generations'.
(display-profile-content, process-query): New procedures.
(guix-pull): Honor '--list-generations'.
2018-06-13 23:41:21 +02:00
Oleg Pykhalov 38212ff7b9
import: utils: Import more dependencies.
* guix/import/utils.scm (recursive-import): Import more dependencies.
2018-06-12 19:51:03 +03:00
Ludovic Courtès 2bf9351e31
substitute: Make progress message shorter.
* guix/scripts/substitute.scm (fetch-narinfos)[update-progress!]:
Shorten progress message so it fits on 80 columns.
2018-06-12 15:23:34 +02:00
Ludovic Courtès 4c97a368a6
substitute: Erase the current line when reporting progress.
* guix/scripts/substitute.scm (fetch-narinfos)[update-progress!]: Use
the ANSI erase-current-line sequence next to \r.
2018-06-12 15:23:34 +02:00
Ludovic Courtès a708de151c
offload: Honor the build timeout internally.
* guix/scripts/offload.scm (call-with-timeout): New procedure.
(with-timeout): New macro.
(process-request): Use it around 'transfer-and-offload' call.
2018-06-11 15:19:01 +02:00
Jelle Licht 3edf0d53a4
import: json: Consolidate duplicate json-fetch functionality.
* guix/import/json.scm (json-fetch): Return a list or hash table.
  (json-fetch-alist): New procedure.
* guix/import/github.scm (json-fetch*): Remove.
  (latest-released-version): Use json-fetch.
* guix/import/cpan.scm (module->dist-name): Use json-fetch-alist.
  (cpan-fetch): Likewise.
* guix/import/crate.scm (crate-fetch): Likewise.
* guix/import/gem.scm (rubygems-fetch): Likewise.
* guix/import/pypi.scm (pypi-fetch): Likewise.
* guix/import/stackage.scm (stackage-lts-info-fetch): Likewise.
2018-06-10 22:15:12 +02:00
Ludovic Courtès 77a1aac6cc
pull: Record the URL, branch, and commit as a manifest entry property.
* guix/scripts/pull.scm (derivation->manifest-entry): Turn COMMIT into a
keyword parameter; add #:url and #:branch.  Add a 'source' property to
the manifest entry.
(build-and-install): Add #:url and #:branch and pass it to
'derivation->manifest-entry'.
(guix-pull): Adjust accordingly.
2018-06-09 12:02:28 +02:00
Ludovic Courtès f6f2346f9b
profiles: Add 'properties' field to manifest entries.
* guix/profiles.scm (<manifest-entry>)[properties]: New field.
(manifest->gexp)[entry->gexp]: Serialize it.
(sexp->manifest)[sexp->manifest-entry]: Deserialize it.
2018-06-09 12:02:28 +02:00
Ludovic Courtès c423ae8918
packages: Add 'package-patched-vulnerabilities'.
* guix/packages.scm (patch-file-name): New procedure.
(%vulnerability-regexp): New variable.
(package-patched-vulnerabilities): New procedure.
* guix/scripts/lint.scm (patch-file-name): Remove.
(check-vulnerabilities): Adjust to use
'package-patched-vulnerabilities'.
* tests/packages.scm ("package-patched-vulnerabilities"): New test.
2018-06-09 12:02:28 +02:00
Ludovic Courtès efcb4441f1
profiles: Add '%current-profile', 'user-friendly-profile', & co.
* guix/scripts/package.scm (%user-profile-directory)
(%profile-directory, %current-profile, canonicalize-profile)
(user-friendly-profile): Move to...
* guix/profiles.scm: ... here.
2018-06-09 12:02:28 +02:00
Ludovic Courtès 24cb66d18e
ui: Avoid #:select'ing bindings introduced in the latest (guix build utils).
This should allow 'guix pull' to complete even when invoked from a Guix
that predates commit 5d669883ec.

* guix/ui.scm: Use #:hide instead of #:select.  This is a followup to
5d669883ec.
2018-06-09 12:02:28 +02:00
Ludovic Courtès 4554d4c8a9
self: Build the Info manual.
* guix/self.scm (info-manual): New procedure.
(whole-package): Add #:info and honor it.
(compiled-guix): Pass #:info.
2018-06-09 12:02:28 +02:00
Ludovic Courtès 9f1c3559b0
self: Compute and use locale data.
* guix/self.scm (sub-directory, locale-data): New procedures.
(guix-command): Add SOURCE parameter.  Call 'locale-data' when SOURCE is
true and use it in staged 'bindtextdomain' calls.
(whole-package): Add #:command and honor it.
(compiled-guix): Pass #:command to 'whole-package'.
2018-06-09 12:02:27 +02:00
Ludovic Courtès 75e24d7b0e
pull: Install the new Guix in a profile.
* guix/scripts/pull.scm (%pull-version): New variable.
(build-from-source): Pass #:pull-version to BUILD.
(whole-package-for-legacy, derivation->manifest-entry): New procedure.
(build-and-install): Rewrite in terms of 'build-and-use-profile'.
* guix/scripts/system.scm (maybe-suggest-running-guix-pull)[latest]:
Switch to "/current".
* scripts/guix.in (augment-load-paths!): Remove use of
~/.config/guix/latest.
* build-aux/compile-as-derivation.scm: Replace "/guix/latest/" with
"/current/share/guile/site/X.Y"
* guix/scripts.scm (warn-about-old-distro)[age]: Check "/current"
instead of "/latest".
* doc/guix.texi (Invoking guix pull): Document it.
* doc/contributing.texi (Running Guix Before It Is Installed): Remove
footnote about abusing ~/.config/guix/latest.
2018-06-09 12:02:27 +02:00
Ludovic Courtès 8a0d9bc8a3
self: Produce a complete package with the 'guix' command.
* guix/self.scm (guix-command): New procedure.
(compiled-guix): Add #:pull-version parameter.
[command, package]: New variables.
Honor PULL-VERSION.
(guix-derivation): Add #:pull-version and pass it to 'compiled-guix'.
* build-aux/build-self.scm (build-program): Add #:pull-version
parameter.  Pass it to 'guix-derivation'.
(build): Add #:pull-version and pass it to 'build-program'.
* build-aux/compile-as-derivation.scm: Pass #:pull-version to BUILD.
2018-06-09 12:02:27 +02:00
Oleg Pykhalov 62d78ec076
import: elpa: Remove unused (gnu packages) module.
* guix/import/elpa.scm: Remove unused (gnu packages) module.
2018-06-08 17:05:18 +03:00
Ludovic Courtès 9953685c09
config: Remove 'canonicalize-path' call.
The call was unnecessary and would cause test failures because
'test-tmp/db' does not exist initially.

* guix/config.scm.in (%store-database-directory): Remove
'canonicalize-path' call.
2018-06-08 15:23:39 +02:00
Oleg Pykhalov 74032da3a2
import: elpa: Add recursive import.
* doc/guix.texi (Invoking guix import): Document elpa recursive import.
* guix/import/elpa.scm (elpa-package->sexp): Return package and
dependencies values.
(elpa-guix-name, elpa-recursive-import): New procedures.
* guix/scripts/import/elpa.scm (show-help, %options): Add recursive
option.
(guix-import-elpa): Use 'elpa-recursive-import'.
2018-06-08 14:58:33 +03:00
Oleg Pykhalov ae9e5d6602
import: utils: Add recursive-import.
* guix/import/cran.scm (cran-guix-name, cran-recursive-import): New
procedures.
(recursive-import): Remove procedure.
* guix/import/utils.scm (guix-name, recursive-import): New procedures.
* guix/scripts/import/cran.scm (guix-import-cran): Use
'cran-recursive-import' procedure.
2018-06-08 14:58:33 +03:00