summaryrefslogtreecommitdiff
path: root/guix
Commit message (Collapse)AuthorAge
* deduplicate: Create the '.links' directory lazily.Ludovic Courtès2020-12-15
| | | | | | | | | | This avoids repeated (mkdir-p "/gnu/store/.links") calls when deduplicating lots of files. * guix/store/deduplication.scm (deduplicate): Remove initial call to 'mkdir-p'. Add ENOENT case in 'link' exception handler. Reindent. * tests/store-deduplication.scm ("deduplicate, ENOSPC"): Check for (<= links 4) to account for the initial 'link' call.
* database: Honor 'SOURCE_DATE_EPOCH'.Ludovic Courtès2020-12-15
| | | | | | * guix/store/database.scm (timestamp): New procedure. (sqlite-register): Use it as the default for #:time. (register-items): Likewise for #:registeration-time.
* database: Remove 'register-path'.Ludovic Courtès2020-12-15
| | | | | | | | | | | | * guix/store/database.scm (register-path): Remove. * tests/store-database.scm ("register-path"): Rename to... ("register-items"): ... this, and use 'register-items' instead of 'register-path'. ("register-path, directory"): Rename to... ("register-items, directory"): ... this, and use 'register-items' instead of 'register-path'. ("register-path with unregistered references"): Rename to... ("sqlite-register with unregistered references"): ... this.
* system: 'init' does not recompute the hash of each store item.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/44760>. Previously, the 'register-path' call would re-traverse ITEM to compute its nar hash, even though that hash is already known in the initial store. This patch also avoids repeated opening/closing of the database. * guix/store/database.scm (call-with-database): Export. * guix/scripts/system.scm (copy-item): Add 'db' parameter. Call 'sqlite-register' instead of 'register-path'. (copy-closure): Remove redundant call to 'references*'. Call 'call-with-database' and pass the database to 'copy-item'.
* database: Remove #:deduplicate? and #:reset-timestamps? from 'register-path'.Ludovic Courtès2020-12-15
| | | | | | | | * guix/store/database.scm (register-path): Remove #:deduplicate? and #:reset-timestamps?. * guix/scripts/system.scm (copy-item): Adjust accordingly. * tests/store-database.scm ("register-path") ("register-path, directory"): Call 'reset-timestamps'.
* guix system: 'init' copies, resets timestamps, and deduplicates at once.Ludovic Courtès2020-12-15
| | | | | | | | | Partly fixes <https://bugs.gnu.org/44760>. * guix/build/store-copy.scm (copy-store-item): New procedure. (populate-store): Use it instead of the inline 'copy-recursively' call. * guix/scripts/system.scm (copy-item): Likewise. Pass #:reset-timestamps? and #:deduplicate? to 'register-path'.
* database: Remove #:deduplicate? from 'register-items'.Ludovic Courtès2020-12-15
| | | | | | | | | | | | It is now up to the caller to deduplicate store contents. * guix/store/database.scm (register-items): Remove #:deduplicate? parameter and call to 'deduplicate'. (register-path): Call 'deduplicate' when #:deduplicate? is true. * gnu/build/image.scm (register-closure): Adjust call accordingly. * gnu/build/vm.scm (register-closure): Likewise. * guix/nar.scm (finalize-store-file): Likewise. * guix/scripts/pack.scm (store-database): Likewise.
* store-copy: 'populate-store' can optionally deduplicate files.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now deduplication was performed as an additional pass after copying files, which involve re-traversing all the files that had just been copied. * guix/store/deduplication.scm (copy-file/deduplicate): New procedure. * tests/store-deduplication.scm ("copy-file/deduplicate"): New test. * guix/build/store-copy.scm (populate-store): Add #:deduplicate? parameter and honor it. * tests/gexp.scm ("gexp->derivation, store copy"): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/image.scm (initialize-root-partition): Pass #:deduplicate? to 'populate-store'. Pass #:deduplicate? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise. * gnu/build/install.scm (populate-single-profile-directory): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/linux-initrd.scm (build-initrd): Likewise. * guix/scripts/pack.scm (self-contained-tarball)[import-module?]: New procedure. [build]: Pass it as an argument to 'source-module-closure'. * guix/scripts/pack.scm (squashfs-image)[build]: Wrap in 'with-extensions'. * gnu/system/linux-initrd.scm (expression->initrd)[import-module?]: New procedure. [builder]: Pass it to 'source-module-closure'. * gnu/system/install.scm (cow-store-service-type)[import-module?]: New procedure. Pass it to 'source-module-closure'.
* database: Remove #:reset-timestamps? from 'register-items'.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | | The assumption now is that the caller took care of resetting timestamps and permissions. * guix/store/database.scm (register-items): Remove #:reset-timestamps? parameter and the call to 'reset-timestamps'. (register-path): Adjust accordingly and add call to 'reset-timestamps'. * gnu/build/image.scm (register-closure): Remove #:reset-timestamps? parameter to 'register-items'. * gnu/build/vm.scm (register-closure): Likewise. * guix/nar.scm (finalize-store-file): Adjust accordingly. * guix/scripts/pack.scm (store-database)[build]: Likewise.
* store-copy: 'populate-store' resets timestamps.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | | | | Until now, 'populate-store' would reset permissions but not timestamps, so callers would resort to going through an extra directory traversal to reset timestamps. * guix/build/store-copy.scm (reset-permissions): Remove. (copy-recursively): New procedure. (populate-store): Pass #:keep-permissions? to 'copy-recursively'. Remove call to 'reset-permissions'. * tests/gexp.scm ("gexp->derivation, store copy"): In BUILD-DRV, check whether 'populate-store' canonicalizes permissions and timestamps. * gnu/build/image.scm (initialize-root-partition): Pass #:reset-timestamps? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise.
* nar: Deduplicate files right as they are restored.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | This avoids having to traverse and re-read the files that we have just restored, thereby reducing I/O. * guix/serialization.scm (dump-file): New procedure. (restore-file): Add #:dump-file parameter and honor it. * guix/store/deduplication.scm (tee, dump-file/deduplicate): New procedures. * guix/nar.scm (restore-one-item): Pass #:dump-file to 'restore-file'. (finalize-store-file): Pass #:deduplicate? #f to 'register-items'. * tests/nar.scm <top level>: Call 'setenv' to set "NIX_STORE".
* serialization: 'restore-file' sets canonical timestamp and permissions.Ludovic Courtès2020-12-15
| | | | | | | | | | | * guix/serialization.scm (restore-file): Set the permissions and mtime of FILE. * guix/nar.scm (finalize-store-file): Pass #:reset-timestamps? #f to 'register-items'. * tests/nar.scm (rm-rf): Add 'chmod' calls to ensure files are writable. ("write-file + restore-file with symlinks"): Ensure every file in OUTPUT passes 'canonical-file?'. * tests/guix-archive.sh: Run "chmod -R +w" before "rm -rf".
* serialization: 'fold-archive' notifies about directory processing completion.Ludovic Courtès2020-12-15
| | | | | | | | | * guix/serialization.scm (fold-archive): Call PROC with a 'directory-complete tag when done with a directory. (restore-file): Handle it. * guix/scripts/archive.scm (list-contents): Likewise. * guix/scripts/challenge.scm (archive-contents): Likewise. * tests/nar.scm ("write-file-tree + fold-archive"): Adjust accordingly.
* offload: Print warning in context.Julien Lepiller2020-12-15
| | | | | * guix/scripts/offload.scm (build-machine): Add `location` field. (build-machine-system): Print location with warning.
* scripts: discover: Remove file locks.Mathieu Othacehe2020-12-13
| | | | | | | | * guix/scripts/discover.scm (call-with-read-file-lock, with-read-file-lock): Remove them. (write-publish-file): Use "with-atomic-file-output" instead of "with-file-lock". (read-substitute-urls): Remove file lock.
* download: Update ImageMagick mirror list.Marius Bakke2020-12-13
| | | | | | * guix/download.scm (%mirrors): Remove defunct ImageMagick mirrors, update URLs for directory structure changes (/releases instead of /legacy). Move official site last.
* import/cran: Abort with error message when recursive import fails.Ricardo Wurmus2020-12-12
| | | | | | | | | Previously, after a failed recursive import "guix import" would signal success. * guix/import/cran.scm (cran->guix-package): Raise a condition when all repositories have been exhausted. * guix/scripts/import/cran.scm (guix-import-cran): Handle errors.
* self: Remove the empty string from '%load-extensions'.Ludovic Courtès2020-12-11
| | | | * guix/self.scm (guix-command): Set '%load-extensions'.
* self: Move Guile early in the module search path.Ludovic Courtès2020-12-11
| | | | | | | | | Until now, Guile modules would first be searched for in MODULE-DIRECTORY, then in each $GUILE_LOAD_PATH entry, and finally in Guile itself. * guix/self.scm (guix-command): Make GUILE the second entry in the %LOAD-PATH and %LOAD-COMPILED-PATH.
* avahi: Ignore local services.Mathieu Othacehe2020-12-10
| | | | | * guix/avahi.scm (avahi-browse-service-thread): Add "ignore-local?" argument and honor it.
* guix: Add globstar support.Giacomo Leidi2020-12-09
| | | | | | | | * guix/glob.scm (string->sglob) (glob-match?): Add globstar support. * tests/glob.scm: Update accordingly. Signed-off-by: Jelle Licht <jlicht@fsfe.org>
* import/utils: Fix conditional.Ricardo Wurmus2020-12-09
| | | | | | | This is a follow-up to commit 45584061a9ebe961e2be08ee94c3fe8ad74e2713. * guix/import/utils.scm (package->definition): Use EQ? instead of = to compare truthiness; use ELSE instead of (#T).
* import: cran: Update the Bioconductor version to 3.12.Roel Janssen2020-12-09
| | | | | * guix/import/cran.scm (%bioconductor-version): Set to 3.12. * guix/build-system/r.scm (bioconductor-uri): Update to 3.12.
* import: opam: Adjust test to latest 'opam->guix-package' changes.Ludovic Courtès2020-12-08
| | | | | | | | This is a followup to a8dccd4bdc1e58219d4ba08fe1649bf0b8325f44, which broke the test. * guix/import/opam.scm (get-opam-repository): Prevent inlining. * tests/opam.scm ("opam->guix-package"): Mock 'get-opam-repository'.
* substitute: Cache and reuse connections while substituting.Ludovic Courtès2020-12-08
| | | | | | | | | | | | | | | | | | | That way, when fetching a series of substitutes from the same server(s), the connection is reused instead of being closed/opened for each substitutes, which saves on network round trips and TLS handshakes. * guix/http-client.scm (http-fetch): Add #:keep-alive? and honor it. * guix/progress.scm (progress-report-port): Add #:close? parameter and honor it. * guix/scripts/substitute.scm (at-most): Return the tail as a second value. (fetch): Add #:port and #:keep-alive? and honor them. (%max-cached-connections): New variable. (open-connection-for-uri/cached, call-with-cached-connection): New procedures. (with-cached-connection): New macro. (process-substitution): Wrap 'fetch' call in 'with-cached-connection'. Pass #:close? to 'progress-report-port'.
* daemon: Run 'guix substitute --substitute' as an agent.Ludovic Courtès2020-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids spawning one substitute process per substitution. * nix/libstore/build.cc (class Worker)[substituter]: New field. [outPipe, logPipe, pid]: Remove. (class SubstitutionGoal)[expectedHashStr, status, substituter]: New fields. (SubstitutionGoal::timedOut): Adjust to check 'substituter'. (SubstitutionGoal::tryToRun): Remove references to 'outPipe' and 'logPipe'. Run "guix substitute --substitute" as an 'Agent'. Send the request with 'writeLine'. (SubstitutionGoal::finished): Likewise. (SubstitutionGoal::handleChildOutput): Change to fill in 'expectedHashStr' and 'status'. (SubstitutionGoal::handleEOF): Call 'wakeUp' unconditionally. (SubstitutionGoal::~SubstitutionGoal): Adjust to check 'substituter'. * guix/scripts/substitute.scm (process-substitution): Write "success\n" to stdout upon success. (%error-to-file-descriptor-4?): New variable. (guix-substitute): Set 'current-error-port' to file descriptor 4 unless (%error-to-file-descriptor-4?) is false. Remove "--substitute" arguments. Loop reading line from stdin. * tests/substitute.scm <top level>: Call '%error-to-file-descriptor-4?'. (request-substitution): New procedure. ("substitute, no signature") ("substitute, invalid hash") ("substitute, unauthorized key") ("substitute, authorized key") ("substitute, unauthorized narinfo comes first") ("substitute, unsigned narinfo comes first") ("substitute, first narinfo is unsigned and has wrong hash") ("substitute, first narinfo is unsigned and has wrong refs") ("substitute, two invalid narinfos") ("substitute, narinfo with several URLs"): Adjust to new "guix substitute --substitute" calling convention.
* daemon: Use 'Agent' to spawn 'guix substitute --query'.Ludovic Courtès2020-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | * nix/libstore/local-store.hh (RunningSubstituter): Remove. (LocalStore)[runningSubstituter]: Change to unique_ptr<Agent>. [setSubstituterEnv, didSetSubstituterEnv]: Remove. [getLineFromSubstituter, getIntLineFromSubstituter]: Take an 'Agent'. * nix/libstore/local-store.cc (LocalStore::~LocalStore): Remove reference to 'runningSubstituter'. (LocalStore::setSubstituterEnv, LocalStore::startSubstituter): Remove. (LocalStore::getLineFromSubstituter): Adjust to 'run' being an 'Agent'. (LocalStore::querySubstitutablePaths): Spawn substituter agent if needed. Adjust to 'Agent' interface. (LocalStore::querySubstitutablePathInfos): Likewise. * nix/libstore/build.cc (SubstitutionGoal::tryToRun): Remove call to 'setSubstituterEnv' and add 'setenv' call for "_NIX_OPTIONS" instead. (SubstitutionGoal::finished): Remove 'readLine' call for 'dummy'. * guix/scripts/substitute.scm (%allow-unauthenticated-substitutes?): Remove second argument to 'make-parameter'. (process-query): Call 'warn-about-missing-authentication' when (%allow-unauthenticated-substitutes?) is #t. (guix-substitute): Wrap body in 'parameterize'. Set 'guix-warning-port' too. No longer exit when 'substitute-urls' returns the empty list. No longer print newline initially. * tests/substitute.scm (test-quit): Parameterize 'current-error-port' to account for the port changes in 'guix-substitute'.
* database: Remove unnecessary module imports.Ludovic Courtès2020-12-08
| | | | | * guix/store/database.scm: Remove unnecessary imports added in 4b9eecd322e566783369795ebea63a479b51f486.
* guix: opam: Add coq support in the importer.Julien Lepiller2020-12-08
| | | | | | | * guix/import/opam.scm (get-opam-repository): Add support for coq repositories. (ocaml-name->guix-name): Properly name coq package. * doc/guix.texi (Invoking guix import): Document it.
* guix: opam: Add --repo argument to importer.Julien Lepiller2020-12-08
| | | | | | | | * guix/scripts/import/opam.scm (guix-import-opam): Pass --repo argument to recursive and non-recursive importers. * guix/import/opam.scm (get-opam-repository): Select proper repository location depending on a new repo argument. (opam->guix-package): Use get-opam-repository in the procedure body.
* guix: opam: Pass default repository to recursive importer.Julien Lepiller2020-12-08
| | | | | | | * guix/import/opam.scm (opam->guix-package): Rename #:repository key to #:repo. (opam-recursive-import): Pass #:repo keyword. * tests/opam.scm (opam->guix-package): Rename #:repository to #:repo.
* guix: opam: Filter implicit inputs.Julien Lepiller2020-12-08
| | | | | * guix/import/opam.scm (opam->guix-package, depends->inputs): Filter out implicit inputs.
* guix: opam: Remove stray `pk'.Julien Lepiller2020-12-08
| | | | * guix/import/opam.scm (opam->guix-package): Remove stray `pk'.
* ci: Add "evaluation" method.Mathieu Othacehe2020-12-07
| | | | * guix/ci.scm (evaluation): New procedure.
* ci: Add evaluation field to build record.Mathieu Othacehe2020-12-07
| | | | * guix/ci.scm (<build>): Add "evaluation" field.
* profiles: Delete duplicate manifest entries in packages->manifest.Leo Prikler2020-12-07
| | | | | | | * gnu/profiles.scm (packages->manifest): Delete duplicate entries. * tests/profiles.scm ("packages->manifest, no duplicates"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* profiles: Remove duplicates in manifest transactions.Leo Prikler2020-12-07
| | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/23874>. Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>. * guix/profiles.scm (manifest-transaction-effects): Delete duplicates in install and remove. Let multiple upgrades and downgrades shadow previous transactions of the same kind. * tests/profiles.scm ("manifest-transaction-effects no double install or upgrades") ("manifest-transaction-effects no double downgrade") ("manifest-transaction-effects no double removal"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* ui: Handle multiword and empty $PAGER values.Tobias Geerinckx-Rice2020-12-05
| | | | | | | * guix/ui.scm (call-with-paginated-output-port): Empty PAGER values disable paging. Non-empty ones are split into command arguments. Reported by Daniel Brooks <db48x@db48x.net>.
* pull: Accept no non-option arguments.Tobias Geerinckx-Rice2020-12-05
| | | | | * guix/scripts/pull.scm (guix-pull): LEAVE if any non-option arguments were passed.
* scripts: discover: Check for cache file existence.Mathieu Othacehe2020-12-05
| | | | | | Fixes: https://issues.guix.gnu.org/45045. * guix/scripts/discover.scm (read-substitute-urls): Check for file existence.
* git: 'reference-available?' handles short commit IDs.Ludovic Courtès2020-12-04
| | | | | | | | | | Reported by Simon Tournier on #guix. Until now 'reference-available?' would always return #f when passed a short commit ID. * guix/git.scm (reference-available?): Call 'object-lookup-prefix' when COMMIT is shorter than 40 characters.
* import: crate: Skip tests when Guile-Semver is missing.Ludovic Courtès2020-12-04
| | | | | | | | * guix/import/crate.scm: Add comment for the 'module-autoload!' calls. * tests/crate.scm (have-guile-semver?): New variable. ("crate->guix-package", "cargo-recursive-import") ("cargo-recursive-import-hoors-existing-packages"): Skip when HAVE-GUILE-SEMVER? is false.
* scripts: substitute: Fix discover option.Mathieu Othacehe2020-12-04
| | | | | | The discover option can be unset or set to "yes/no". Handle both cases. * guix/scripts/substitute.scm (%local-substitute-urls): Fix discover option.
* import/cran: Do not attempt to generate definitions for failed imports.Ricardo Wurmus2020-12-04
| | | | | * guix/scripts/import/cran.scm (guix-import-cran): Remove failed imports from list of packages to define.
* import/cran: Fix calls to CRAN->GUIX-PACKAGE.Ricardo Wurmus2020-12-04
| | | | | * guix/import/cran.scm (cran->guix-package, latest-bioconductor-release): Invoke CRAN->GUIX-PACKAGE with #:REPO keyword argument.
* build-system: Add chicken-build-system.raingloom2020-12-03
| | | | | | | | | * guix/build-system/chicken.scm: New file. * guix/build/chicken-build-system.scm: New file. * Makefile.am: Add them. * doc/guix.texi: Document it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* self: Factorize package dependency enumeration.Ludovic Courtès2020-12-03
| | | | | * guix/self.scm (transitive-package-dependencies): New procedure. (compiled-guix)[dependencies]: Use it.
* gnu: guile-semver: Switch to Guile 3.0.Ludovic Courtès2020-12-03
| | | | | | * gnu/packages/guile-xyz.scm (guile-semver)[inputs]: Use GUILE-3.0. (guile3.0-semver): Define in terms of 'deprecated-package'. (guile2.2-semver): New variable.
* import: crate: Use existing package satisfying semver requirement.Hartmut Goebel2020-12-02
| | | | | | | | | | | | | | | | | | | | If a package satisfying the dependency's semver requirement already exists, use it. Prior to this change the highest version matching the semver requirement was used (and imported in case it was not defined as package already). When resolving a dependency (now done in `sort-map-dependencies`), first search for a package matching the semver requirement and only if this fails reach out for a crate. * guix/import/crate.scm (crate->guix-package)[find-package-version]: New function. [dependency-name+version]: New function. [sort-map-dependencies]: Use it instead of lambda function. * tests/crate.scm (test-doctool-crate, test-doctool-dependencies): New variables. ("self-test …", "cargo-recursive-import-hoors-existing-packages"): New tests.
* import: crate: Trim version for names after left-most non-zero part.Hartmut Goebel2020-12-02
| | | | | | | | | | | | | | This complies to how versions are matched for caret requirements in crates: An update is allowed if the new version number does not modify the left-most non-zero digit in the major, minor, patch grouping. * guix/import/crate.scm (version->semver-prefix): New function. (make-crate-sexp)[format-inputs]: Use it. (make-crate-sexp): Use it to pass shorter version to package->definition. * guix/import/utils.scm (package->definition): Change optional parameter APPEND-VERSION? into APPEND-VERSION?/STRING. If it is a string, append its value to name. * tests/crate.scm: Adjust tests accordingly.