summaryrefslogtreecommitdiff
path: root/guix
AgeCommit message (Expand)Author
2020-10-16build: Fix docstring typos....* gnu/build/image.scm (estimate-partition-size): Fix typo in docstring. * guix/build/copy-build-system.scm (install): Likewise. * guix/build/lisp-utils.scm (generate-executable): Likewise. * guix/build/maven/pom.scm (find-parent, fix-pom-dependencies): Likewise. * guix/build-system/cargo.scm (expand-crate-sources): Likewise. Tobias Geerinckx-Rice
2020-10-15packages: Delete duplicate inputs when lowering bags....This is a followup to 18fa433bf5c420868562b9f4b017c5c97251a44b and <https://issues.guix.gnu.org/43508>. * guix/packages.scm (derivation=?, input=?): New procedures. (bag->derivation, bag->cross-derivation): Add calls to 'delete-duplicates'. * tests/packages.scm ("package-derivation, inputs deduplicated"): New test. Ludovic Courtès
2020-10-08packages, scripts, utils: Enable multi-threaded xz compression....xz compression is slow; using the multi-thread mode of xz can make it more than 6 times faster, for example when compressing the large linux-libre source. * guix/build/utils.scm (%xz-parallel-args): New procedure. * guix/packages.scm (patch-and-repack): Specify the required above xz arguments by setting the XZ_DEFAULTS environment variable. * guix/scripts/pack.scm (%compressors, bootstrap-xz): Modify the commands Gexps so they do not need to be quoted. This allows lazily evaluating the arguments on the builder's side. Specify the required xz arguments. (self-contained-tarball): Do not quote the compressor command value. (docker-image): Likewise. * guix/utils.scm (decompressed-port, compressed-port) (compressed-output-port): Specify the required above xz arguments. Maxim Cournoyer
2020-10-08utils: Do not raise exceptions in delete-file-recursively....This makes it so that delete-file-recursively honors its docstring, which says it should "report but ignore errors". Fixes <https://issues.guix.gnu.org/43366>. * guix/build/utils.scm (warn-on-error): New syntax. (delete-file-recursively): Use it to catch exceptions and print warning messages. Reported-by: Fredrik Salomonsson <plattfot@gmail.com> Maxim Cournoyer
2020-09-19utils: Add 'call-with-temporary-output-file'....* 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. Ludovic Courtès
2020-09-19Remove (guix build rpath)....This file was unused and is now superseded by (guix build gremlin). * guix/build/rpath.scm: Remove. * Makefile.am (MODULES): Remove it. Ludovic Courtès
2020-09-19gremlin: Add 'set-file-runpath', 'file-runpath', and 'file-needed'....* 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. Ludovic Courtès
2020-09-19build-system/gnu: strip with --strip-unneeded [v2]...[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. Jakub Kądziołka
2020-09-19build-system/gnu: strip with --strip-unneeded...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. Jakub Kądziołka
2020-09-14Merge remote-tracking branch 'origin/master' into core-updatesMaxim Cournoyer
2020-09-14ui: 'show-what-to-build' displays download estimate more prominently....* 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'. Ludovic Courtès
2020-09-14authenticate: Cache the ACL and key pairs....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. Ludovic Courtès
2020-09-14daemon: Spawn 'guix authenticate' once for all....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 Ludovic Courtès
2020-09-14guix: Fix download-svn-to-store....* 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. Paul Garlick
2020-09-14database: register-items: reduce transaction scope....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> Christopher Baines
2020-09-14database: document extra registration requirements....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> Caleb Ristvedt
2020-09-14deduplication: pass store directory to replace-with-link....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> Caleb Ristvedt
2020-09-14build-system: linux-module: Delete some huge items that we probably don't need....* guix/build-system/linux-module.scm (make-linux-module-builder): Delete some huge items that we probably don't need. Danny Milosavljevic
2020-09-12ui: Lexicographically sort transaction entries based on their package name....* guix/ui.scm (show-manifest-transaction): Sort entries to be displayed in a tabulated view. Maxim Cournoyer
2020-09-12ui: Refactor the package-strings helper in show-manifest-transaction....* 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. Maxim Cournoyer
2020-09-11daemon: Simplify interface with 'guix authenticate'....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. Ludovic Courtès
2020-09-11doc: Distinguish the "nar bundle" format from "nar"....* 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. Ludovic Courtès
2020-09-10scripts: Use 'define-command' and have 'guix help' use that....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. Ludovic Courtès
2020-09-10ui: '--help' output links to <https://guix.gnu.org/help/>....* 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. Ludovic Courtès
2020-09-10utils: 'dump-port' has an optional 'len' parameter....* guix/build/utils.scm (dump-port): Add optional 'len' parameter and honor it. Ludovic Courtès
2020-09-08Remove (guix json) and require Guile-JSON 4.3.0+....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. Ludovic Courtès
2020-09-08android-repo-download: Remove unnecessary use of Guile-JSON....* guix/android-repo-download.scm (android-repo-fetch)[guile-json]: Remove. [build]: Remove GUILE-JSON from 'with-extensions'. Ludovic Courtès
2020-09-06git: Export url-cache-directory....* guix/git.scm (url-cache-directory): Export it. Mathieu Othacehe
2020-09-05scripts: system: Expand some help messages....* guix/scripts/system.scm (show-help): Add to '--share=SPEC' and '--expose=SPEC' that it also works for containers. Efraim Flashner
2020-09-03android-repo-download: Use parallel-job-count instead of hard-coding job...count. * guix/build/android-repo.scm (android-repo-fetch): Use parallel-job-count instead of hard-coding job count. Danny Milosavljevic
2020-09-03android-repo-download: Clean up typos; remove unused imports....Follow-up to 3feb846420f24ef1c8b3fe310d293c7a2c91e1d4. * guix/android-repo-download.scm (android-repo-fetch): Fix docstring. Danny Milosavljevic
2020-09-02ssh: Fix progress bar crash when there are zero items to send....* guix/ssh.scm (notify-transfer-progress): Do nothing when TOTAL is zero. Ludovic Courtès
2020-09-02ssh: Fix regression in 'send-files'....Regression introduced in b03267df6d5ec44e9617b6aab0df14a2e79f822e. The (take files 20) is a leftover from testing session. * guix/ssh.scm (send-files): Fix value for 'missing'. Ludovic Courtès
2020-09-02ui: Attempt to fall back to "en_US.utf8" rather than "C"....* guix/ui.scm (install-locale): Add call to 'setlocale' in 'catch' handler. Ludovic Courtès
2020-09-02store: 'set-build-options' sends LC_MESSAGES, not LC_ALL....* guix/store.scm (set-build-options): Change #:locale default value to (setlocale LC_MESSAGES). Ludovic Courtès
2020-09-02substitute: Set LC_MESSAGES to the client's locale, not LC_ALL....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. Ludovic Courtès
2020-09-02Add (guix android-repo-download)....* guix/build/android-repo.scm: New file. * guix/android-repo-download.scm: New file. * Makefile.am (MODULES): Add them. Danny Milosavljevic
2020-09-01build: ruby-build-system: Remove an extraneous binding....* guix/build/ruby-build-system.scm (install): Remove the RUBY-VERSION binding, no longer used. Fix the indentation of a comment. Maxim Cournoyer
2020-09-01import: launchpad: Recognize more URLs....* guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs. Arun Isaac
2020-09-01import: launchpad: Recognize the .orig.tar.gz extension....* guix/import/launchpad.scm (find-extension): Recognize the .orig.tar.gz extension. Arun Isaac
2020-09-01import: launchpad: Handle list of source URLs correctly....* guix/import/launchpad.scm (updated-launchpad-url): Return updated URL when package has a list of URLs, not the old URL. Arun Isaac
2020-09-01gexp: computed-file: Prevent mistakenly overriding default option values....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> Maxim Cournoyer
2020-08-31guix: system: Add `--label' option....* 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. Julien Lepiller
2020-08-31guix system: Clarify what happens where service upgrade fails....* guix/scripts/system.scm (report-shepherd-error): Use 'warning' instead of 'report-error'. Add extra 'warning' and 'display-hint' calls. Ludovic Courtès
2020-08-31guix system: reconfigure: Tell users about 'herd status'....* guix/scripts/system.scm (perform-action): Mention 'herd status' when 'upgrade-shepherd-services' completes. Ludovic Courtès
2020-08-31packages: <content-hash> printer gracefully handle #f values....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'. Ludovic Courtès
2020-08-31ssh: 'send-files' displays a progress bar....* 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'. Ludovic Courtès
2020-08-30environment: Set USER and LOGNAME in container...* guix/scripts/environment.scm (launch-environment/container): Set username environment variables. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Lars-Dominik Braun
2020-08-29copy, offload: Explicitly close SSH channels and sessions....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. Ludovic Courtès
2020-08-28derivations: Avoid uses of 'write' in 'write-derivation'....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. Ludovic Courtès