summaryrefslogtreecommitdiff
path: root/guix
AgeCommit message (Collapse)Author
2020-09-19utils: Add 'call-with-temporary-output-file'.Ludovic Courtès
* guix/utils.scm: Re-export 'call-with-temporary-output-file'. (call-with-temporary-output-file): Move to... * guix/build/utils.scm (call-with-temporary-output-file): ... here.
2020-09-19Remove (guix build rpath).Ludovic Courtès
This file was unused and is now superseded by (guix build gremlin). * guix/build/rpath.scm: Remove. * Makefile.am (MODULES): Remove it.
2020-09-19gremlin: Add 'set-file-runpath', 'file-runpath', and 'file-needed'.Ludovic Courtès
* guix/build/gremlin.scm (file-dynamic-info, file-runpath, file-needed): New procedures. (&missing-runpath-error, &runpath-too-long-error): New condition types. (set-file-runpath): New procedure. * tests/gremlin.scm ("set-file-runpath + file-runpath"): New test.
2020-09-19build-system/gnu: strip with --strip-unneeded [v2]Jakub Kądziołka
[Accidentally pushed patch v1, this commit contains the rest of the changes. Revised commit message follows.] Apart from debug information, one can also strip some symbols. This can be a significant difference, the closure of gcc-toolchain@7 got reduced by 15 MB in my tests. As per [1], --strip-debug is included in --strip-unneeded, and the debug files created also contain a copy of the information removed by --strip-unneeded. Linux From Scratch suggests that this option shouldn't be used on static libraries [2], however other sources [3] indicate otherwise. Building a toolchain with this patch succeeds, and the result works fine for 'gcc -static hello-world.c'. [1]: https://stackoverflow.com/a/52555093 [2]: http://www.linuxfromscratch.org/lfs/view/9.1/chapter05/stripping.html [3]: https://www.technovelty.org/linux/stripping-shared-libraries.html * guix/build/gnu-build-system.scm (strip): Use --strip-unneeded. * guix/build-system/gnu.scm (static-package, gnu-build, gnu-cross-build): Likewise.
2020-09-19build-system/gnu: strip with --strip-unneededJakub Kądziołka
Apart from debug information, one can also strip some symbols. This can be a significant difference, qtbase:out consists of about 5 MB of those symbols. As per [1], --strip-debug is included in --strip-unneeded, and the debug files created also contain a copy of the information removed by --strip-unneeded. Linux From Scratch suggests that this option shouldn't be used on static libraries [2], however other sources [3] indicate otherwise. Building a toolchain with this patch succeeds, and the result works fine for 'gcc -static hello-world.c'. [1]: https://stackoverflow.com/a/52555093 [2]: http://www.linuxfromscratch.org/lfs/view/9.1/chapter05/stripping.html [3]: https://www.technovelty.org/linux/stripping-shared-libraries.html * guix/build/gnu-build-system.scm (strip): Use --strip-unneeded.
2020-09-14Merge remote-tracking branch 'origin/master' into core-updatesMaxim Cournoyer
2020-09-14ui: 'show-what-to-build' displays download estimate more prominently.Ludovic Courtès
* guix/ui.scm (show-what-to-build): When VERBOSITY is 1, add a newline before the "would/will be downloaded" line, and wrap that message in 'highlight'.
2020-09-14authenticate: Cache the ACL and key pairs.Ludovic Courtès
In practice we're always using the same key pair, /etc/guix/signing-key.{pub,sec}. Keeping them in cache allows us to avoid redundant I/O and parsing when signing multiple store items in a row. * guix/scripts/authenticate.scm (load-key-pair): New procedure. (sign-with-key): Remove 'key-file' parameter and add 'public-key' and 'secret-key'. Adjust accordingly. (validate-signature): Add 'acl' parameter and pass it to 'authorized-key?'. (guix-authenticate)[call-with-reply]: New procedure. [with-reply]: New macro. Call 'current-acl' upfront and cache its result. Add 'key-pairs' as an argument to 'loop' and use it as a cache of key pairs.
2020-09-14daemon: Spawn 'guix authenticate' once for all.Ludovic Courtès
Previously, we'd spawn 'guix authenticate' once for each item that has to be signed (when exporting) or authenticated (when importing). Now, we spawn it once for all and then follow a request/reply protocol. This reduces the wall-clock time of: guix archive --export -r $(guix build coreutils -d) from 30s to 2s. * guix/scripts/authenticate.scm (sign-with-key): Return the signature instead of displaying it. Raise a &formatted-message instead of calling 'leave'. (validate-signature): Likewise. (read-command): New procedure. (define-enumerate-type, reply-code): New macros. (guix-authenticate)[send-reply]: New procedure. Change to read commands from current-input-port. * nix/libstore/local-store.cc (runAuthenticationProgram): Remove. (authenticationAgent, readInteger, readAuthenticateReply): New functions. (signHash, verifySignature): Rewrite in terms of the agent. * tests/store.scm ("import not signed"): Remove 'pk' call. ("import signed by unauthorized key"): Check the error message of C. * tests/guix-authenticate.sh: Rewrite using the new protocol. fixlet
2020-09-14guix: Fix download-svn-to-store.Paul Garlick
* guix/svn-download.scm (download-svn-to-store): Add a subdirectory to the download path. The subdirectory is used as the target for the 'svn export' command, avoiding a 'directory exists' error when attempting to use the parent directory directly.
2020-09-14database: register-items: reduce transaction scope.Christopher Baines
It was made transactional in a4678c6ba18d8dbd79d931f80426eebf61be7ebe, with the reasoning to prevent broken intermediate states from being visible. I think this means something like an entry being in ValidPaths, but the Refs not being inserted. Using a transaction for this makes sense, but I think using one single transaction for the whole register-items call is unnecessary to avoid broken states from being visible, and could block other writes to the store database while register-items is running. Because the deduplication and resetting timestamps happens within the transaction as well, even though these things don't involve the database, writes to the database will still be blocked while this is happening. To reduce the potential for register-items to block other writers to the database for extended periods, this commit moves the transaction to just wrap the call to sqlite-register. This is the one place where writes occur, so that should prevent the broken intermediate states issue above. The one difference this will make is some of the registered items will be visible to other connections while others may be still being added. I think this is OK, as it's equivalent to just registering different items. * guix/store/database.scm (register-items): Reduce transaction scope. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-09-14database: document extra registration requirements.Caleb Ristvedt
It's necessary that store items be locked and protected from garbage collection while they are being registered. This documents that. * guix/store/database.scm (register-path, register-items): document GC protection and locking requirements. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-09-14deduplication: pass store directory to replace-with-link.Caleb Ristvedt
This causes with-writable-file to take into consideration the actual store being used, as passed to 'deduplicate', rather than whatever (%store-directory) may return. * guix/store/deduplication.scm (replace-with-link): new keyword argument 'store'. Pass to with-writable-file. (with-writable-file, call-with-writable-file): new store argument. (deduplicate): pass store to replace-with-link. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-09-14build-system: linux-module: Delete some huge items that we probably don't need.Danny Milosavljevic
* guix/build-system/linux-module.scm (make-linux-module-builder): Delete some huge items that we probably don't need.
2020-09-12ui: Lexicographically sort transaction entries based on their package name.Maxim Cournoyer
* guix/ui.scm (show-manifest-transaction): Sort entries to be displayed in a tabulated view.
2020-09-12ui: Refactor the package-strings helper in show-manifest-transaction.Maxim Cournoyer
* guix/ui.scm (show-manifest-transaction)[package-strings]: Add an OLD-VERSIONS keyword parameter. Absorb the code path previously found in the upgrade-string. Remove upgrade-string. (show-manifest-transaction): Adjust to the above changes.
2020-09-11daemon: Simplify interface with 'guix authenticate'.Ludovic Courtès
There's no reason at this point to mimic the calling convention of the 'openssl' command. * nix/libstore/local-store.cc (LocalStore::exportPath): Add only "sign" and HASH to ARGS. Remove 'tmpDir' and 'hashFile'. (LocalStore::importPath): Add only "verify" and SIGNATURE to * guix/scripts/authenticate.scm (guix-authenticate): Adjust accordingly; remove the OpenSSL-style clauses. (read-hash-data): Remove. (sign-with-key): Replace 'port' with 'sha256' and adjust accordingly. (validate-signature): Export SIGNATURE to be a canonical sexp. * tests/guix-authenticate.sh: Adjust tests accordingly.
2020-09-11doc: Distinguish the "nar bundle" format from "nar".Ludovic Courtès
* doc/guix.texi (Invoking guix archive): Introduce the term "nar bundle" and clarify what the output of "guix archive --export" really is. * guix/nar.scm (restore-one-item, restore-file-set): Use the term "nar bundle" in docstrings.
2020-09-10scripts: Use 'define-command' and have 'guix help' use that.Ludovic Courtès
This changes 'guix help' to print a short synopsis for each command and to group commands by category. * guix/scripts.scm (synopsis, category): New variables. (define-command-categories, define-command): New macros. (%command-categories): New variable. * guix/ui.scm (<command>): New record type. (source-file-command): New procedure. (command-files): Return absolute file names. (commands): Return a list of <command> records. (show-guix-help)[display-commands, category-predicate]: New procedures. Display commands grouped in three categories. * guix/scripts/archive.scm (guix-archive): Use 'define-command'. * guix/scripts/authenticate.scm (guix-authenticate): Likewise. * guix/scripts/build.scm (guix-build): Likewise. * guix/scripts/challenge.scm (guix-challenge): Likewise. * guix/scripts/container.scm (guix-container): Likewise. * guix/scripts/copy.scm (guix-copy): Likewise. * guix/scripts/deploy.scm (guix-deploy): Likewise. * guix/scripts/describe.scm (guix-describe): Likewise. * guix/scripts/download.scm (guix-download): Likewise. * guix/scripts/edit.scm (guix-edit): Likewise. * guix/scripts/environment.scm (guix-environment): Likewise. * guix/scripts/gc.scm (guix-gc): Likewise. * guix/scripts/git.scm (guix-git): Likewise. * guix/scripts/graph.scm (guix-graph): Likewise. * guix/scripts/hash.scm (guix-hash): Likewise. * guix/scripts/import.scm (guix-import): Likewise. * guix/scripts/install.scm (guix-install): Likewise. * guix/scripts/lint.scm (guix-lint): Likewise. * guix/scripts/offload.scm (guix-offload): Likewise. * guix/scripts/pack.scm (guix-pack): Likewise. * guix/scripts/package.scm (guix-package): Likewise. * guix/scripts/perform-download.scm (guix-perform-download): Likewise. * guix/scripts/processes.scm (guix-processes): Likewise. * guix/scripts/publish.scm (guix-publish): Likewise. * guix/scripts/pull.scm (guix-pull): Likewise. * guix/scripts/refresh.scm (guix-refresh): Likewise. * guix/scripts/remove.scm (guix-remove): Likewise. * guix/scripts/repl.scm (guix-repl): Likewise. * guix/scripts/search.scm (guix-search): Likewise. * guix/scripts/show.scm (guix-show): Likewise. * guix/scripts/size.scm (guix-size): Likewise. * guix/scripts/substitute.scm (guix-substitute): Likewise. * guix/scripts/system.scm (guix-system): Likewise. * guix/scripts/time-machine.scm (guix-time-machine): Likewise. * guix/scripts/upgrade.scm (guix-upgrade): Likewise. * guix/scripts/weather.scm (guix-weather): Likewise.
2020-09-10ui: '--help' output links to <https://guix.gnu.org/help/>.Ludovic Courtès
* guix/ui.scm (show-bug-report-information): Link to <https://guix.gnu.org/help/> instead of <https://www.gnu.org/gethelp/>. The former is much more useful and includes links to GNU manuals.
2020-09-10utils: 'dump-port' has an optional 'len' parameter.Ludovic Courtès
* guix/build/utils.scm (dump-port): Add optional 'len' parameter and honor it.
2020-09-08Remove (guix json) and require Guile-JSON 4.3.0+.Ludovic Courtès
This is a followup to 4071879c86d059ee087c8986915ea72b8c742b72. * guix/json.scm: Remove. * Makefile.am (MODULES): Adjust accordingly. * m4/guix.m4 (GUIX_CHECK_GUILE_JSON): Check for 'define-json-mapping'. * doc/guix.texi (Requirements): Require Guile-JSON 4.3.0+. * guix/ci.scm, guix/cve.scm, guix/import/cpan.scm, guix/import/crate.scm, guix/swh.scm: Remove (guix json) import. * guix/import/gem.scm, guix/import/pypi.scm: Likewise, and import (json). * guix/self.scm (specification->package): Switch to GUILE-JSON-4. * guix/git-download.scm (git-fetch): Likewise.
2020-09-08android-repo-download: Remove unnecessary use of Guile-JSON.Ludovic Courtès
* guix/android-repo-download.scm (android-repo-fetch)[guile-json]: Remove. [build]: Remove GUILE-JSON from 'with-extensions'.
2020-09-06git: Export url-cache-directory.Mathieu Othacehe
* guix/git.scm (url-cache-directory): Export it.
2020-09-05scripts: system: Expand some help messages.Efraim Flashner
* guix/scripts/system.scm (show-help): Add to '--share=SPEC' and '--expose=SPEC' that it also works for containers.
2020-09-03android-repo-download: Use parallel-job-count instead of hard-coding jobDanny Milosavljevic
count. * guix/build/android-repo.scm (android-repo-fetch): Use parallel-job-count instead of hard-coding job count.
2020-09-03android-repo-download: Clean up typos; remove unused imports.Danny Milosavljevic
Follow-up to 3feb846420f24ef1c8b3fe310d293c7a2c91e1d4. * guix/android-repo-download.scm (android-repo-fetch): Fix docstring.
2020-09-02ssh: Fix progress bar crash when there are zero items to send.Ludovic Courtès
* guix/ssh.scm (notify-transfer-progress): Do nothing when TOTAL is zero.
2020-09-02ssh: Fix regression in 'send-files'.Ludovic Courtès
Regression introduced in b03267df6d5ec44e9617b6aab0df14a2e79f822e. The (take files 20) is a leftover from testing session. * guix/ssh.scm (send-files): Fix value for 'missing'.
2020-09-02ui: Attempt to fall back to "en_US.utf8" rather than "C".Ludovic Courtès
* guix/ui.scm (install-locale): Add call to 'setlocale' in 'catch' handler.
2020-09-02store: 'set-build-options' sends LC_MESSAGES, not LC_ALL.Ludovic Courtès
* guix/store.scm (set-build-options): Change #:locale default value to (setlocale LC_MESSAGES).
2020-09-02substitute: Set LC_MESSAGES to the client's locale, not LC_ALL.Ludovic Courtès
Fixes <https://bugs.gnu.org/43039>. Reported by Adam Griffiths <adam.lw.griffiths@gmail.com>. Previously, a client could lead 'guix substitute' to run in a non-UTF-8 locale, such as the "C" locale. Consequently, 'guix substitute' would now fail to decode UTF-8 file names such as those that appear in the 'nss-certs' package. * guix/scripts/substitute.scm (guix-substitute): Set LC_MESSAGES, not LC_ALL.
2020-09-02Add (guix android-repo-download).Danny Milosavljevic
* guix/build/android-repo.scm: New file. * guix/android-repo-download.scm: New file. * Makefile.am (MODULES): Add them.
2020-09-01build: ruby-build-system: Remove an extraneous binding.Maxim Cournoyer
* guix/build/ruby-build-system.scm (install): Remove the RUBY-VERSION binding, no longer used. Fix the indentation of a comment.
2020-09-01import: launchpad: Recognize more URLs.Arun Isaac
* guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs.
2020-09-01import: launchpad: Recognize the .orig.tar.gz extension.Arun Isaac
* guix/import/launchpad.scm (find-extension): Recognize the .orig.tar.gz extension.
2020-09-01import: launchpad: Handle list of source URLs correctly.Arun Isaac
* guix/import/launchpad.scm (updated-launchpad-url): Return updated URL when package has a list of URLs, not the old URL.
2020-09-01gexp: computed-file: Prevent mistakenly overriding default option values.Maxim Cournoyer
In order to do so, default to an empty options list, and expose options whose default values are sensitive directly as keyword arguments. * guix/gexp.scm (computed-file): Extract the LOCAL-BUILD? parameter from the OPTIONS parameter to make it a stand-alone keyword argument. Introduce an OPTIONS* binding which is obtained by combining the LOCAL-BUILD? keyword and its value with OPTIONS. * doc/guix.texi (G-Expressions): Adjust doc. Suggested-by: Ludovic Courtès <ludo@gnu.org>
2020-08-31guix: system: Add `--label' option.Julien Lepiller
* guix/scripts/system.scm (%options): Add `--label'. (system-derivation-for-action): Take a #:label key to set volume ID. (perform-action): Take a #:label key. (%default-options): Add default label value. (process-action): Pass label value from command-line to perform-action. * gnu/system/image.scm (image-with-label): New procedure.
2020-08-31guix system: Clarify what happens where service upgrade fails.Ludovic Courtès
* guix/scripts/system.scm (report-shepherd-error): Use 'warning' instead of 'report-error'. Add extra 'warning' and 'display-hint' calls.
2020-08-31guix system: reconfigure: Tell users about 'herd status'.Ludovic Courtès
* guix/scripts/system.scm (perform-action): Mention 'herd status' when 'upgrade-shepherd-services' completes.
2020-08-31packages: <content-hash> printer gracefully handle #f values.Ludovic Courtès
Suggested by Robin Green <greenrd@greenrd.org>. * guix/packages.scm (print-content-hash): Gracefully deal with cases with 'content-hash-value' returns #f, as is the case for 'linux-libre'.
2020-08-31ssh: 'send-files' displays a progress bar.Ludovic Courtès
* guix/store.scm (export-paths): Add #:start, #:progress, and #:finish parameters and honor them. * guix/ssh.scm (prepare-to-send, notify-transfer-progress) (notify-transfer-completion): New procedures. (send-files): Pass #:start, #:progress, and #:finish to 'export-paths'.
2020-08-30environment: Set USER and LOGNAME in containerLars-Dominik Braun
* guix/scripts/environment.scm (launch-environment/container): Set username environment variables. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-08-29copy, offload: Explicitly close SSH channels and sessions.Ludovic Courtès
Fixes <https://bugs.gnu.org/42740>. * guix/scripts/copy.scm (send-to-remote-host): Keep the result of 'connect-to-remote-daemon' in scope, and explicitly close it after the call to 'send-files'. (retrieve-from-remote-host): Explicitly close REMOTE and disconnect SESSION. * guix/scripts/offload.scm (transfer-and-offload): Explicitly close STORE and disconnect SESSION upon completion.
2020-08-28derivations: Avoid uses of 'write' in 'write-derivation'.Ludovic Courtès
This leads a 4% improvement on the wall-clock time of: guix build -e '(@@ (gnu packages libreoffice) libreoffice)' --no-grafts -d * guix/derivations.scm (escaped-string): New procedure. (write-derivation)[write-escaped-string]: New procedure. [write-string-list, write-output, write-env-var]: Use it.
2020-08-28derivations: Avoid uses of 'display' in 'write-derivation'.Ludovic Courtès
This yields a 4% improvement on the wall-clock time of: guix build -e '(@@ (gnu packages libreoffice) libreoffice)' --no-grafts -d * guix/derivations.scm (write-sequence, write-list, write-tuple): Use 'put-char' instead of 'display'. (write-derivation): Use 'put-string' and 'put-char', and remove unused 'format' binding.
2020-08-28store: 'with-store' returns as many values as its body.Ludovic Courtès
Fixes <https://bugs.gnu.org/42912>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in 'call-with-values'. * tests/store.scm ("with-store, multiple values"): New test.
2020-08-28build: ruby-build-system: Adjust replace-git-ls-files.Maxim Cournoyer
The file names returned by `find ...` instead of `git ls-files...` contains leading './' characters, which can cause problems when the file lists is further processed with regexps, for example, as was discovered while updating the ruby-asciidoctor package in commit 5df1126c3adf557f3a5b386e391e7cb56b9c1d63. * guix/build/ruby-build-system.scm (replace-git-ls-files): Strip the first two characters ("./") of the file names returned by the 'find' command. Fix typo in doc. Simplify '(when (not ...' into '(unless ...'.
2020-08-27pull: Avoid "Migrating profile" message on the first run.Ludovic Courtès
* guix/scripts/pull.scm (ensure-default-profile): Do not call 'migrate-generations' when %USER-PROFILE-DIRECTORY (~/.config/guix/current) does not exist. This avoids a confusing "Migrating profile" message when the user runs 'guix pull' for the first time.