aboutsummaryrefslogtreecommitdiff
path: root/guix
Commit message (Collapse)AuthorAge
* licenses: Add Apple Public Source License 2.0.André Batista2020-09-25
| | | | | | * guix/licenses.scm (apsl2): New variable. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* import: Fix docstring typoes.Tobias Geerinckx-Rice2020-09-23
| | | | | | * guix/import/cabal.scm (cabal-flags->alist): Fix typo in docstring. * guix/import/stackage.scm (lts-info-ghc-version): Likewise. * guix/scripts/import/hackage.scm (show-help): Likewise.
* guix: scripts: build: Mention 'PACKAGE' in '--with-source' option.zimoun2020-09-21
| | | | | | | * guix/scripts/build.scm (show-transformation-options-help): Mention 'PACKAGE' in '--with-source' option. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* environment: '--link-profile' uses ~/.guix-profile for environment variables.Ludovic Courtès2020-09-21
| | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we had: $ guix environment -CP --ad-hoc coreutils [env]$ echo $PATH /gnu/store/…-profile/bin [env]$ echo $GUIX_ENVIRONMENT /gnu/store/…-profile After this patch: $ guix environment -CP --ad-hoc coreutils [env]$ echo $PATH /home/ludo/.guix-profile/bin [env]$ echo $GUIX_ENVIRONMENT /home/ludo/.guix-profile * guix/scripts/environment.scm (launch-environment/container): When LINK-PROFILE? is true, pass ~/.guix-profile as the second argument to 'launch-environment'. * tests/guix-environment-container.sh: Adjust test accordingly. * doc/guix.texi (Invoking guix environment): Update accordingly.
* describe: Save the original value of (program-arguments).Ludovic Courtès2020-09-19
| | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/42688>. Reported by pkill9 <pkill9@runbox.com>. This ensures that 'guix repl -s SCRIPT' give SCRIPT the right value of (current-profile), which in turn ensures that (%package-module-path) is initialized with the right set of channels. * guix/describe.scm (initial-program-arguments): New variable. (current-profile): Use it. * guix/scripts/repl.scm (guix-repl): Call 'current-profile' before 'set-program-arguments'.
* repl: Look for script files in (getcwd).Konrad Hinsen2020-09-16
| | | | | | | | | Fixes <https://bugs.gnu.org/43331>. * guix/scripts/repl.scm (guix-repl): Replace "." by (getcwd) * tests/guix-repl.sh: Add test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* import: cpan: Export cpan-release-module.Tobias Geerinckx-Rice2020-09-15
| | | | * guix/import/cpan.scm: Fix typo.
* authenticate: Encode strings as ISO-8859-1.Ludovic Courtès2020-09-15
| | | | | | | | | | Fixes <https://bugs.gnu.org/43421>. * guix/scripts/authenticate.scm (read-command): Decode strings as ISO-8859-1, not UTF-8. (guix-authenticate)[send-reply]: Encode strings as ISO-8859-1, not UTF-8. * tests/guix-authenticate.sh: Add test.
* ui: 'show-what-to-build' displays download estimate more prominently.Ludovic Courtès2020-09-14
| | | | | | * 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'.
* authenticate: Cache the ACL and key pairs.Ludovic Courtès2020-09-14
| | | | | | | | | | | | | | | | | 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.
* daemon: Spawn 'guix authenticate' once for all.Ludovic Courtès2020-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* guix: Fix download-svn-to-store.Paul Garlick2020-09-14
| | | | | | | * 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.
* database: register-items: reduce transaction scope.Christopher Baines2020-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* database: document extra registration requirements.Caleb Ristvedt2020-09-14
| | | | | | | | | | 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>
* deduplication: pass store directory to replace-with-link.Caleb Ristvedt2020-09-14
| | | | | | | | | | | | | 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>
* build-system: linux-module: Delete some huge items that we probably don't need.Danny Milosavljevic2020-09-14
| | | | | * guix/build-system/linux-module.scm (make-linux-module-builder): Delete some huge items that we probably don't need.
* ui: Lexicographically sort transaction entries based on their package name.Maxim Cournoyer2020-09-12
| | | | | * guix/ui.scm (show-manifest-transaction): Sort entries to be displayed in a tabulated view.
* ui: Refactor the package-strings helper in show-manifest-transaction.Maxim Cournoyer2020-09-12
| | | | | | | * 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.
* daemon: Simplify interface with 'guix authenticate'.Ludovic Courtès2020-09-11
| | | | | | | | | | | | | | | 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.
* doc: Distinguish the "nar bundle" format from "nar".Ludovic Courtès2020-09-11
| | | | | | | * 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.
* scripts: Use 'define-command' and have 'guix help' use that.Ludovic Courtès2020-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ui: '--help' output links to <https://guix.gnu.org/help/>.Ludovic Courtès2020-09-10
| | | | | | * 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.
* Remove (guix json) and require Guile-JSON 4.3.0+.Ludovic Courtès2020-09-08
| | | | | | | | | | | | | | 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.
* android-repo-download: Remove unnecessary use of Guile-JSON.Ludovic Courtès2020-09-08
| | | | | * guix/android-repo-download.scm (android-repo-fetch)[guile-json]: Remove. [build]: Remove GUILE-JSON from 'with-extensions'.
* git: Export url-cache-directory.Mathieu Othacehe2020-09-06
| | | | * guix/git.scm (url-cache-directory): Export it.
* scripts: system: Expand some help messages.Efraim Flashner2020-09-05
| | | | | * guix/scripts/system.scm (show-help): Add to '--share=SPEC' and '--expose=SPEC' that it also works for containers.
* android-repo-download: Use parallel-job-count instead of hard-coding jobDanny Milosavljevic2020-09-03
| | | | | | | count. * guix/build/android-repo.scm (android-repo-fetch): Use parallel-job-count instead of hard-coding job count.
* android-repo-download: Clean up typos; remove unused imports.Danny Milosavljevic2020-09-03
| | | | | | Follow-up to 3feb846420f24ef1c8b3fe310d293c7a2c91e1d4. * guix/android-repo-download.scm (android-repo-fetch): Fix docstring.
* ssh: Fix progress bar crash when there are zero items to send.Ludovic Courtès2020-09-02
| | | | | * guix/ssh.scm (notify-transfer-progress): Do nothing when TOTAL is zero.
* ssh: Fix regression in 'send-files'.Ludovic Courtès2020-09-02
| | | | | | | Regression introduced in b03267df6d5ec44e9617b6aab0df14a2e79f822e. The (take files 20) is a leftover from testing session. * guix/ssh.scm (send-files): Fix value for 'missing'.
* ui: Attempt to fall back to "en_US.utf8" rather than "C".Ludovic Courtès2020-09-02
| | | | * guix/ui.scm (install-locale): Add call to 'setlocale' in 'catch' handler.
* store: 'set-build-options' sends LC_MESSAGES, not LC_ALL.Ludovic Courtès2020-09-02
| | | | | * guix/store.scm (set-build-options): Change #:locale default value to (setlocale LC_MESSAGES).
* substitute: Set LC_MESSAGES to the client's locale, not LC_ALL.Ludovic Courtès2020-09-02
| | | | | | | | | | | | 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.
* Add (guix android-repo-download).Danny Milosavljevic2020-09-02
| | | | | | * guix/build/android-repo.scm: New file. * guix/android-repo-download.scm: New file. * Makefile.am (MODULES): Add them.
* import: launchpad: Recognize more URLs.Arun Isaac2020-09-01
| | | | * guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs.
* import: launchpad: Recognize the .orig.tar.gz extension.Arun Isaac2020-09-01
| | | | | * guix/import/launchpad.scm (find-extension): Recognize the .orig.tar.gz extension.
* import: launchpad: Handle list of source URLs correctly.Arun Isaac2020-09-01
| | | | | * guix/import/launchpad.scm (updated-launchpad-url): Return updated URL when package has a list of URLs, not the old URL.
* gexp: computed-file: Prevent mistakenly overriding default option values.Maxim Cournoyer2020-09-01
| | | | | | | | | | | | | 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>
* guix: system: Add `--label' option.Julien Lepiller2020-08-31
| | | | | | | | | * 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.
* guix system: Clarify what happens where service upgrade fails.Ludovic Courtès2020-08-31
| | | | | * guix/scripts/system.scm (report-shepherd-error): Use 'warning' instead of 'report-error'. Add extra 'warning' and 'display-hint' calls.
* guix system: reconfigure: Tell users about 'herd status'.Ludovic Courtès2020-08-31
| | | | | * guix/scripts/system.scm (perform-action): Mention 'herd status' when 'upgrade-shepherd-services' completes.
* packages: <content-hash> printer gracefully handle #f values.Ludovic Courtès2020-08-31
| | | | | | | 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'.
* ssh: 'send-files' displays a progress bar.Ludovic Courtès2020-08-31
| | | | | | | | * 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'.
* environment: Set USER and LOGNAME in containerLars-Dominik Braun2020-08-30
| | | | | | | * guix/scripts/environment.scm (launch-environment/container): Set username environment variables. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* copy, offload: Explicitly close SSH channels and sessions.Ludovic Courtès2020-08-29
| | | | | | | | | | | | 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.
* derivations: Avoid uses of 'write' in 'write-derivation'.Ludovic Courtès2020-08-28
| | | | | | | | | | 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.
* derivations: Avoid uses of 'display' in 'write-derivation'.Ludovic Courtès2020-08-28
| | | | | | | | | | | 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.
* store: 'with-store' returns as many values as its body.Ludovic Courtès2020-08-28
| | | | | | | | | 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.
* pull: Avoid "Migrating profile" message on the first run.Ludovic Courtès2020-08-27
| | | | | | | | * 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.
* lint: Use 'with-error-handling'.Ludovic Courtès2020-08-26
| | | | | | | | This improves the error message when unable to access ~/.cache as reported by Jonathan Brielmaier <jonathan.brielmaier@web.de> in <https://bugs.gnu.org/42859>. * guix/scripts/lint.scm (guix-lint): Wrap body in 'with-error-handling'.