summaryrefslogtreecommitdiff
path: root/guix
AgeCommit message (Collapse)Author
2021-07-18Merge branch 'master' into core-updatesLudovic Courtès
2021-07-18build: pack: Mute error output when checking if tar supports --sort.Maxim Cournoyer
* guix/build/pack.scm (tar-base-options) [tar-supports-sort?]: Redirect error output to void.
2021-07-18pack: Streamline how files are included in tarballs.Maxim Cournoyer
Thanks to Guillem Jover <guillem@debian.org> on the OFTC's #debian-dpkg channel for helping with troubleshooting. Letting GNU Tar recursively walk the complete files hierarchy side-steps the risks associated with providing a list of file names: 1. Duplicated files in the archive (recorded as hard links by GNU Tar) 2. Missing parent directories. The above would cause dpkg to malfunction, for example by aborting early and skipping triggers when there were missing parent directories. * guix/scripts/pack.scm (self-contained-tarball/builder): Do not call POPULATE-SINGLE-PROFILE-DIRECTORY, which creates extraneous files such as /root. Instead, call POPULATE-STORE and INSTALL-DATABASE-AND-GC-ROOTS individually to more precisely generate the file system. Replace the list of files by the current directory, "." and streamline the way options are passed. * gnu/system/file-systems.scm (reduce-directories): Remove procedure. * tests/file-systems.scm ("reduce-directories"): Remove test.
2021-07-18pack/deb: Add default section and priority fields to the control file.Maxim Cournoyer
These fields, while optional per dpkg, are required by other tools such as reprepro, commonly used to generate apt repositories. * guix/scripts/pack.scm (debian-archive): Set the control file section field to 'misc' and the priority field to 'optional'.
2021-07-18pack: Allow embedding custom control files in deb packs.Maxim Cournoyer
* guix/scripts/pack.scm (self-contained-tarball/builder) [extra-options]: New argument. (self-contained-tarball, squashfs-image, docker-image) (debian-archive): Likewise. Remove two TODO comments. Document EXTRA-OPTIONS. Use the custom control files when provided. (%deb-format-options): New variable. (show-deb-format-options, show-deb-format-options/detailed): New procedures. (%options): Register new options. (show-help): Augment with new usage. (guix-pack): Validate and propagate new argument values. * doc/guix.texi (Invoking guix pack)[deb]: Document how to list advanced options. Add an example. * tests/pack.scm (deb archive...): Provide extra-options to the debian-archive procedure, and validate that the provided files are embedded in the pack.
2021-07-18import: go: Fix indentation.Maxim Cournoyer
* guix/import/go.scm: Fix indentation.
2021-07-18import: go: Upgrade go.mod parser.Sarah Morgensen
Upgrade the go.mod parser to handle the full go.mod spec, and to gracefully handle unexpected/malformed syntax. Restructure parser usage, making the parse tree available for other uses. guix/import/go.scm (parse-go.mod): Parse using (ice-9 peg) instead of regex matching for more robustness. Return a list of directives. (go.mod-directives): New procedure. (go.mod-requirements): Likewise. (go-module->guix-package): Use it. (%go.mod-replace-directive-rx): Remove unused variable. tests/go.scm (testing-parse-mod): Adjust accordingly. (go.mod-requirements) (fixture-go-mod-unparseable) (fixture-go-mod-retract) (fixture-go-mod-strings): New variables. ("parse-go.mod: simple") ("parse-go.mod: comments and unparseable lines") ("parse-go.mod: retract") ("parse-go.mod: raw strings and quoted strings") ("parse-go.mod: complete"): New tests. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-07-17import: go: Handle multiple go-import meta tags.Sarah Morgensen via Guix-patches via
* guix/import/go.scm (fetch-module-meta-data): Parse all go-import meta tags and return the first 'module-meta' with a matching import prefix. [go-import->module-meta]: Extract parsing into new procedure. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-07-17import: go: Fix parsing of pkg.go.dev licenses after site update.Sarah Morgensen via Guix-patches via
* guix/import/go.scm (go-package-licenses): Find license names in 'h2 // div // *text*' elements rather than 'h2 // *text*' elements. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-07-16ci: Properly construct URLs.Hartmut Goebel
Implement a new function "api-url", which constructs URLs using relative URI and "resolve-uri-reference" (which implements the algorithm specified in RFC 3986 section 5.2.2) for building the URL, instead of just appending strings. This avoids issued if the server-url ends with a slash. Since "api-url" uses URI-objects, it makes sense to also construct the query-part of the URL here. For this "api-url" accepts optional key-value-pairs. New function "json-api-fetch" is a wrapper using "api-url". * guix/ci.scm (api-url): New function. (build): Use it. (json-api-fetch): New function. (queued-builds, latest-builds, evaluation, latest-evaluations, evaluation-jobs: Use it.
2021-07-16substitutes: Properly construct URLs.Hartmut Goebel
Use relative URIs and "resolve-uri-reference" (which implements the algorithm specified in RFC 3986 section 5.2.2) for building the URL, instead of just appending strings. This avoids issued if the cache-url ends with a slash. * guix/substitutes.scm (narinfo-request): Use resolve-uri-reference for constructing the url.
2021-07-16substitute: Fix handling of short option "-h".Hartmut Goebel
The short option was listed in the help-text, but not recognized.
2021-07-15ui: Improve output appearance when listing generations.Steve Sprang
* guix/ui.scm (display-profile-content-diff): Use pretty-print-table to format output. (display-profile-content): Likewise. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-07-15package: Improve output appearance when listing packages.Steve Sprang
* guix/scripts/package.scm (process-query): Use pretty-print-table when listing installed and available packages. Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-07-15utils: Add a procedure for pretty printing tabular data.Steve Sprang
* guix/utils.scm (pretty-print-table): New procedure. Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-07-14build-system/meson: Support cross-compilation.Maxime Devos
For cross-compilation, meson needs to be passed a ‘cross file’ with information on the architecture, CPU type, endianness and operating system, and the name of the cross-compiler binaries. The new module (guix build meson-configuration) has some utilities for writing these cross files, used by 'make-cross-file' in a G-exp. The values for the cross file are generated by 'make-machine-alist' and 'make-binaries-alist'. 'make-machine-alist' and 'make-binaries-alist' live on the host side, such that new architectures and operating systems can be added without causing rebuilds for old architectures. All operating systems and targets supported by Guix are theoretically supported, but only aarch64-linux-gnu, powerpc64le-linux-gnu and arm-linux-gnueabihf have been tested. i686-linux-gnu has also been tested with a previous version of this patch series but required some changes to 'cross-base.scm'. This has been tested with: $ ./pre-inst-env guix build glib --target=TARGET * guix/build/meson-configuration.scm (write-section-header): New procedure. (write-assignment): New procedure. (write-assignments): New procedure. * guix/build-system/meson.scm (target-hurd?): New predicate. (make-machine-alist): New procedure. (make-binaries-alist): New procedure. (make-cross-file): New procedure. (meson-cross-build): New procedure. (lower)[build-inputs]: Add standard cross packages when cross-compiling. Do not include regular 'inputs' when cross-compiling. (lower)[host-inputs]: Include 'inputs' when cross-compiling. (lower)[target-inputs]: Add cross packages when cross-compiling. (lower)[build]: Call 'meson-cross-build' instead of 'cross-build' when cross-compiling. (lower)[target]: Set it. (lower)[private-keywords]: Do not remove #:target when cross-compiling. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14packages: Define this-package-input and this-package-native-input.Maxime Devos
These macros are intended to be used in build phases. More precisely, (assoc-ref %build-inputs "input") can be replaced by #$(this-package-input "input") or #+(this-package-native-input "native-input") as appropriate. * guix/packages.scm (package-input, package-native-input): New (unexported) procedures. (this-package-input, this-package-native-input): New macros. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14utils: Define a target-x86-32? and target-x86-64? predicate.Maxime Devos
* guix/utils.scm (target-x86-32?, target-x86-64?): New predicates. * tests/utils.scm ("target-x86-32?", "target-x86-64?"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14utils: Give 'target-mingw?' a docstring.Maxime Devos
target-hurd? and target-linux? have docstrings, but target-mingw? doesn't. * guix/utils.scm (target-mingw?): Add a docstring. Reported-By: Mathieu Othacehe <othacehe@gnu.org> Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14utils: Define 'target-hurd?' predicate.Maxime Devos
It behaves similarily to the other target-...? procedures. The usage of hurd-triplet? / target-hurd? in libgc appears incorrect to me, as (%current-system) is normally never false. * gnu/packages/hurd.scm (hurd-triplet?): Move to ... * guix/util.scm (target-hurd?): ... here, let its argument default to (%current-target-system) or (%current-system), and write a docstring. * gnu/packages/hurd.scm (hurd-target?, hurd-system?): Use target-hurd? instead of hurd-triplet?. * gnu/packages/bdw-gc.scm (libgc): Likewise. * gnu/packages/cross-base.scm (cross-libc)[arguments]<#:configure-flags>: Likewise. (cross-libc)[arguments]<#:phases>: Likewise. (cross-libc)[arguments]<#:native-inputs>: Likewise. * gnu/packages/make-boostrap.scm (%glibc-stripped)[inputs]: Likewise. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14utils: Define 'target-linux?' predicate.Maxime Devos
* guix/utils.scm (target-linux?): New predicate. * tests/utils.scm ("target-linux?"): Test it. ("target-mingw?"): Also test ‘target-mingw?’. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-13lint: Check for leading whitespace in description.Brice Waegeneire
* guix/lint.scm (check-description-style): Check for leading whitespace. * tests/lint.scm: ("description: leading whitespace"): New test.
2021-07-11import: elpa: Emit new-style package inputs.Ludovic Courtès
* guix/import/elpa.scm (elpa-package->sexp)[dependencies]: Turn into a list of symbols. [maybe-inputs]: Wrap in 'list' instead of 'quasiquote'.
2021-07-11import: print: Emit new-style package inputs when possible.Ludovic Courtès
* guix/import/print.scm (redundant-input-labels?): New procedure. (package->code)[package-lists->code]: Rename to... [inputs->code]: ... this. When 'redundant-input-labels?' returns true, emit label-less inputs. Adjust callers to new name. * tests/print.scm (pkg-with-inputs): Adjust accordingly.
2021-07-11import: cran: Emit new-style package inputs.Ludovic Courtès
* guix/import/cran.scm (format-inputs): Emit symbols or 'specification->package' calls. (maybe-inputs): Wrap in 'list' instead of 'quasiquote'. * tests/cran.scm ("description->package"): Adjust accordingly.
2021-07-11import: pypi: Emit new-style package inputs.Ludovic Courtès
* guix/import/pypi.scm (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'. (compute-inputs)[requirement->package-name/sort]: Return a list of symbols. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels"): Adjust accordingly.
2021-07-11packages: 'hidden-package' inherits the original package location.Ludovic Courtès
* guix/packages.scm (hidden-package): Inherit 'location' from P.
2021-07-11Add 'guix style'.Ludovic Courtès
* guix/scripts/style.scm, tests/style.scm: New files. * Makefile.am (MODULES, SCM_TESTS): Add them. * po/guix/POTFILES.in: Add 'guix/scripts/style.scm'. * doc/guix.texi (Invoking guix style): New node. (package Reference): Reference it. (Invoking guix lint): Likewise.
2021-07-11utils: 'edit-expression' copies part of the original source map.Ludovic Courtès
* guix/utils.scm (source-location-key/stamp): New procedure. (go-to-location): Use it. (move-source-location-map!): New procedure. (edit-expression): Call it.
2021-07-11utils: 'edit-expression' modifies the file only if necessary.Ludovic Courtès
* guix/utils.scm (edit-expression): Check whether STR* equals STR.
2021-07-11utils: Add 'go-to-location' with source location caching.Ludovic Courtès
* guix/utils.scm (%source-location-map): New variable. (go-to-location): New procedure. (edit-expression): Use it instead of custom loop. * guix/packages.scm (package-field-location)[goto]: Remove. Use 'go-to-location' instead of 'goto'.
2021-07-11utils: 'edit-expression' no longer leaks file ports.Ludovic Courtès
* guix/utils.scm (edit-expression): Use 'call-with-input-file' to make sure IN gets closed.
2021-07-11packages: Add 'modify-inputs'.Ludovic Courtès
* guix/packages.scm (inputs-sans-labels, replace-input): New procedures. (prepend, replace, modify-inputs): New macros. * doc/guix.texi (Defining Package Variants): Document 'modify-inputs'. * dir-locals.el: Add 'modify-inputs' and its keywords.
2021-07-11packages: Add 'lookup-package-input' & co.Ludovic Courtès
* guix/packages.scm (lookup-input, lookup-package-input) (lookup-package-native-input, lookup-package-propagated-input) (lookup-package-direct-input): New procedures. * doc/guix.texi (package Reference): Document them.
2021-07-11lint: Add 'input-labels' checker.Ludovic Courtès
* guix/lint.scm (check-input-labels): New procedure. (%local-checkers): Add 'input-labels' checker. * tests/lint.scm ("input labels: no warnings") ("input labels: one warning"): New tests. * doc/guix.texi (Invoking guix lint): Mention it.
2021-07-11packages: Allow inputs to be plain package lists.Ludovic Courtès
* guix/packages.scm (add-input-label, sanitize-inputs): New procedures. (<package>)[inputs, propagated-inputs, native-inputs]: Add 'sanitize' property. * doc/guix.texi (Defining Packages, package Reference): (Defining Package Variants): Adjust examples accordingly. * tests/packages.scm ("transaction-upgrade-entry, zero upgrades, propagated inputs") ("transaction-upgrade-entry, grafts") ("package-transitive-inputs") ("package-transitive-supported-systems") ("package-closure") ("supported-package?") ("package-derivation, inputs deduplicated") ("package-transitive-native-search-paths") ("package-grafts, indirect grafts") ("package-grafts, indirect grafts, propagated inputs") ("package-grafts, same replacement twice") ("package-grafts, dependency on several outputs") ("replacement also grafted") ("package->bag, sensitivity to %current-target-system") ("package->bag, propagated inputs") ("package->bag, sensitivity to %current-system") ("package-input-rewriting/spec, identity") ("package-input-rewriting, identity"): Use the label-less input style.
2021-07-11records: Support field sanitizers.Ludovic Courtès
* guix/records.scm (make-syntactic-constructor): Add #:sanitizers. [field-sanitizer]: New procedure. [wrap-field-value]: Honor F's sanitizer. (define-record-type*)[field-sanitizer]: New procedure. Pass #:sanitizer to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & sanitize") ("define-record-type* & sanitize & thunked"): New tests.
2021-07-09self: Remove stale comment about "mmap(PROT_NONE) failed" crash.Ludovic Courtès
This crash was fixed by 0aef94e7bcbd272720f14c5343f74da5201ef90a, itself a followup to 47d48f0c43c13c0b43bc3e37b6239efd4bf2f74c. * guix/self.scm (translate-texi-manuals)[build]: Remove reference to the PROT_NONE bug.
2021-07-09Revert "self: Build translated manuals with a single process."Ludovic Courtès
This reverts commit af2d6ec092c98ac5f32d8e9e182a141e1268805b, which the parent commit makes unnecessary.
2021-07-08utils: Add 'search-input-directory'.Ludovic Courtès
* guix/build/utils.scm (search-input-directory): New procedure. * doc/guix.texi (Build Utilities): Document it next to 'search-input-file'. Tweak wording.
2021-07-08build-system/gnu: patch-shebangs: Also patch shebangs in "/libexec".Maxime Devos
Shebangs in "/bin" and "/sbin" subdirectories are currently patched by patch-shebangs. But shebangs in "/libexec" currently aren't, even though they occasionally need to be. E.g. when using wrap-program on an executable in "libexec" without an explicit #:sh when cross-compiling. * guix/build/gnu-build-system.scm (patch-shebangs): Add "/libexec" to 'bin-directories'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-07self: Build translated manuals with a single process.Maxim Cournoyer
Works around <https://issues.guix.gnu.org/47428>. * guix/self.scm (translate-texi-manuals): Set parallel-job-count to 1.
2021-07-07Revert "syscalls: 'terminal-dimension' ignores EPERM."Tobias Geerinckx-Rice
This reverts commit 17a102332a253f0e3b1f511fa7bda2094264a77c. See <https://github.com/koverstreet/bcachefs/pull/277>.
2021-07-07lint: Lint usages of 'wrap-program' without a "bash" input.Maxime Devos
When using 'wrap-program', "bash" (or "bash-minimal") should be in inputs. Otherwise, when cross-compiling, 'wrap-program' will use a native bash instead of the cross bash and the 'patch-shebangs' won't be able to correct this. Tobias Geerinckx-Rice is added to the copyright lines because a part of the "straw-viewer" package definition is included. This linter detects 365 problematic package definitions at time of writing. * guix/lint.scm (report-wrap-program-error): New procedure. (check-wrapper-inputs): New linter. (%local-checkers)[wrapper-inputs]: Add the new linter. ("explicit #:sh argument to 'wrap-program' is acceptable") ("'check-wrapper-inputs' detects 'wrap-program' without \"bash\" in inputs") ("'check-wrapper-inputs' detects 'wrap-qt-program' without \"bash\" in inputs") ("\"bash\" in 'inputs' satisfies 'check-wrapper-inputs'") ("\"bash-minimal\" in 'inputs' satisfies 'check-wrapper-inputs'") ("'cut' doesn't hide bad usages of 'wrap-program'") ("bogus phase specifications don't crash the linter"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-07lint: Define some procedures for analysing code in phases.Maxime Devos
* guix/lint.scm (check-optional-tests): Extract logic for extracting the phases from a package to ... (find-phase-deltas): ... here, and ... (report-bogus-phase-deltas): ... here. (check-optional-tests)[check-check-procedure]: Extract code for extracting the procedure body to ... (find-procedure-body) ... here. (find-phase-procedure): New procedure. (report-bogus-phase-procedure): New procedure. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-05guix: docker: Ensure repository name length limits are met.Maxim Cournoyer
* guix/docker.scm (canonicalize-repository-name): Fix typo in doc. Capture repository name length limits and ensure they are met, by either truncating or padding the normalized name. Reported-by: Ludovic Courtès <ludo@gnu.org>
2021-07-05guix: opam: Allow for whitespace at the start of an opam file.Julien Lepiller
* guix/import/opam.scm (records): Accept whitespace at the beginning.
2021-07-05build-system/trivial: Honor build inputs when cross-compiling.Ludovic Courtès
Fixes a regression introduced in 7d873f194ca69d6096d28d7a224ab78e83e34fe1 whereby host inputs would be missing altogether from '%build-inputs', which broke cross-compilation. * guix/build-system/trivial.scm (trivial-cross-build): Append HOST-INPUTS to the 'with-build-variables' argument.
2021-07-05tests: Unset NIX_STORE_DIR when running external tests.Ludovic Courtès
This is a followup to cfcead2e515c0dae02127e5a76496463898be6b6 and 47a6a938c3c4d0bbe7b6a3c64ff75d7bfb2f24fb, which made (guix packages) dependent on the value of NIX_STORE_DIR. * guix/tests.scm (call-with-external-store): Unset NIX_STORE_DIR before calling PROC.
2021-07-05build-system/gnu: Define '%build-inputs' when cross-compiling.Ludovic Courtès
Reported by Maxime Devos. * guix/build-system/gnu.scm (gnu-cross-build)[builder]: Define '%build-inputs' as it existed before 7d873f194ca69d6096d28d7a224ab78e83e34fe1.