The home page for the package had changed.
* tests/texlive.scm ("texlive->guix-package"): Match the home-page and
synopsis inexactly to avoid future similar breakages.
* guix/scripts/environment.scm (show-environment-options-help)
(%options): Add '--nesting'.
(options/resolve-packages): Handle it.
(launch-environment/container): Add #:nesting? and honor it.
[nesting-mappings]: New procedure.
(guix-environment*): Add support for '--nesting'.
* guix/scripts/shell.scm (profile-cached-gc-root): Special-case
'nesting?'.
* tests/guix-environment-container.sh: Test it.
* doc/guix.texi (Invoking guix shell): Document it.
This changes the 'custom-serializer' field into a generic
'extra-args' field that can be extended to support new literals.
Within extra-args, the literals 'sanitizer' and 'serializer' allow
for user-defined sanitization and serialization procedures respectively.
The 'empty-serializer' was also added as a literal to be used as before.
To prevent confusion between the new “explicit” style of specifying
a sanitizer, and the old “implicit” style, the latter has been
deprecated, and a warning is issued if it is encountered.
* gnu/services/configuration.scm (define-configuration-helper):
Rename 'custom-serializer' to 'extra-args'. Add support for literals
'sanitizer', 'serializer' and 'empty-serializer'. Rename procedure
'field-sanitizer' to 'default-field-sanitizer' to avoid syntax clash.
Only define default field sanitizers if user-defined ones are absent.
(normalize-extra-args): New variable.
(<configuration-field>)[sanitizer]: New field.
* doc/guix.texi (Complex Configurations): Document the newly added
literals.
* tests/services/configuration.scm: Add tests for the new literals.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
For the atftp package added in the preceeding commit, lint produced this
warning:
gnu/packages/networking.scm:2924:5: atftp@0.8.0:
URI https://git.code.sf.net/p/atftp/code not reachable:
404 ("Not Found")
Thanks to Sergey Trofimov for suggesting a fix! [1]
[1] https://issues.guix.gnu.org/62156#3
It was implemented here, and the warning disappeared.
* guix/lint.scm (check-source): Append "/info/refs" to git-reference-url.
Co-authored-by: Sergey Trofimov <sarg@sarg.org.ru>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* tests/guix-home.sh: Reorder NIX_STORE_DIR variable definition to
prevent guix from crashing due to missing /gnu/store.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The primary motivation is to support things like:
guix build guix --with-input=guile=guile-next
without triggering a rebuild of (@@ (gnu packages commencement)
guile-final) and similar things.
It is also consistent with package name resolution on the command line:
a package that cannot be named cannot be replaced.
* guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is
hidden, return it as-is.
* tests/packages.scm ("package-input-rewriting/spec, hidden package"):
New test.
* doc/guix.texi (Defining Package Variants): Update.
(Package Transformation Options): Update '--with-input' example.
* guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'.
* tests/packages.scm: Test it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://issues.guix.gnu.org/61013>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.
* guix/read-print.scm (pretty-print-with-comments)[starts-with-line-comment?]:
New procedure.
Use it when printing a list.
* tests/read-print.scm: Add two tests.
Fixes <https://issues.guix.gnu.org/61853>.
Fixes a regression introduced in
68380db4c4, whereby the tarball's root
entry is now read-only, due to the creation of "profile-directory" in
the store.
* tests/guix-pack.sh: Remove and recreate $test_directory before
transformation option test.
* tests/guix-pack-relocatable.sh: Add "chmod +w $test_directory" lines
before attempts to write to it.
Commit 68380db4c4 moved from
'gexp->derivation', which as a side effect, would lead tests to require
a "world rebuild"--specifically, they'd have to build (default-guile).
This was mitigated by 68775338a5, but that
change introduced another regression.
* guix/scripts/pack.scm (populate-profile-root): Define 'bootstrap?'.
Pass #:guile to 'computed-file', with a value depending on 'bootstrap?'.
* tests/pack.scm ("self-contained-tarball + localstatedir")
("docker-image + localstatedir", "squashfs-image + localstatedir")
("deb archive with symlinks and control files")
("rpm archive can be installed/uninstalled"): Use a <profile> record
instead of a derivation.
* guix/rpm.scm: New file.
* guix/scripts/pack.scm (rpm-archive): New procedure.
(%formats): Register it.
(show-formats): Add it.
(guix-pack): Register supported extra-options for the rpm format.
* tests/pack.scm (rpm-for-tests): New variable.
("rpm archive can be installed/uninstalled"): New test.
* tests/rpm.scm: New test.
* doc/guix.texi (Invoking guix pack): Document it.
Fixes <https://issues.guix.gnu.org/61156>.
* gnu/build/linux-container.scm (container-excursion): Add extra call to
'primitive-fork' and invoke THUNK in the child process.
* tests/containers.scm ("container-excursion"): Remove extra
'primitive-fork' call, now unnecessary.
("container-excursion*, /proc"): New test.
* gnu/build/linux-container.scm (container-excursion): Return the raw
status value.
* tests/containers.scm ("container-excursion, same namespaces"): Add
'status:exit-val' call.
* guix/scripts/container/exec.scm (guix-container-exec): Correctly
handle the different cases.
Previously this test would fail when HOME=/homeless-shelter and said
directory cannot be created.
* tests/guix-refresh.sh: Pass '--keyring' together with '-u'.
This is a followup to 8aeccc6240.
* guix/transformations.scm (package-with-upstream-version): New procedure.
(transform-package-latest)[package-with-latest-upstream]: Remove.
Use 'package-with-upstream-version' instead.
(transform-package-version): New procedure.
(%transformations, %transformation-options)
(show-transformation-options-help/detailed): Add '-with-version'.
* tests/transformations.scm ("options->transformation, with-version"):
New test.
* doc/guix.texi (Package Transformation Options): Document '--with-version'.
(Defining Package Variants): Mention it.
Fixes <https://issues.guix.gnu.org/60566> where even if "--preserve='^PATH$'"
was passed to 'guix shell' it would be replaced by just the FHS directories
when '--emulate-fhs' was also set.
* gnu/scripts/environment.scm (launch-environment): Add the FHS directories to
$PATH rather than overriding $PATH completely.
* tests/guix-environment-container.sh: Test that FHS directories are in $PATH
in the container and that $PATH can be preserved.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix/read-print.scm (%special-non-extended-symbols): New variable.
(symbol->display-string): New procedure.
(pretty-print-with-comments): Use it in lieu of 'string->symbol'.
* tests/read-print.scm: Add test.
* nix/libutil/hash.cc (parseHash): Show the hash algorithm name and
expected size in the error message.
* tests/derivations.scm ("fixed-output derivation, invalid hash size"):
New test.
Reported by Stephen Paul Weber <singpolyma@singpolyma.net> at
<https://lists.gnu.org/archive/html/guix-devel/2023-01/msg00035.html>.
* guix/derivations.scm (read-derivation)[outputs->alist]: Treat the
empty hash case as non-fixed-output whether or not the hash algorithm is
the empty string, and preserve the hash algorithm in <derivation-output>.
* tests/derivations.scm ("'download' built-in builder, no fixed-output hash")
("fixed-output-derivation?, no hash", "read-derivation with hash = #f"): New tests.
* gnu/home/services.scm (environment-variable-shell-definitions): Add support
for file-likes and gexps.
* tests/guix-home.sh: Add SHELL environment variable and test its value. Add
BUILDHOSTTIME environment variable.
* gnu/home/services.scm (<literal-string>): New record type.
(environment-variable-shell-definitions): Split 'shell-quote' into
'quote-string' and 'shell-double-quote'. Add 'shell-single-quote'.
Add clause for 'literal-string' records.
* tests/guix-home.sh: Test it.
* doc/guix.texi (Essential Home Services): Document it.
The regression was introduce with commit
a274a6a1ac ("upstream-updater: Rename record
field.")
* tests/tests/gnu-maintenance.scm: ("latest-html-release, scheme-less URIs",
"latest-html-release, no signature", "latest-html-release, signature"):
Replace upstream-updater-latest by upstream-updater-import.
Reported-by: Ricardo Wurmus <rekado@elephly.net>
* tests/import-utils.scm ("recursive-import", "recursive-import: skip false
packages (toplevel)", "recursive-import: skip false packages (dependency)"):
Do not try to match all arguments.
An example:
(match-record obj <my-type>
(field1 (field2 custom-var-name) field3)
...)
* guix/records.scm (match-record-inner): Add support for the new syntax.
* tests/records.scm ("match-record, simple"): Add a simple test case for the
new syntax.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The next commits will make the functions, which are currently importing the
latest version of a package, change into importing the latest or a given
version of the package (for those updaters supporting specifying a version).
Thus the name ‘latest‘ is no longer appropriate.
* guix/upstream.scm (upstream-updater) Rename field [latest] to
[import]. (lookup-updater, package-latest-release) Adjust fieldname
accordingly.
* guix/gnu-maintenance.scm (%gnu-updater, %gnu-ftp-updater,
%savannah-updater, %sourceforge-updater, %xorg-updater,
%kernel.org-updater, %generic-html-updater),
guix/import/cpan.scm (%cpan-updater),
guix/import/cran.scm (%cran-updater, %bioconductor-updater),
guix/import/crate.scm (%crate-updater),
guix/import/egg.scm (%egg-updater),
guix/import/elpa.scm (%elpa-updater),
guix/import/gem.scm (%gem-updater),
guix/import/git.scm (%generic-git-updater),
guix/import/github.scm (%github-updater),
guix/import/gnome.scm (%gnome-updater),
guix/import/hackage.scm (%hackage-updater),
guix/import/hexpm.scm (%hexpm-updater),
guix/import/kde.scm (%kde-updater),
guix/import/launchpad.scm (%launchpad-updater),
guix/import/minetest.scm (%minetest-updater),
guix/import/opam.scm (%opam-updater),
guix/import/pypi.scm (%pypi-updater),
guix/import/stackage.scm (%stackage-updater),
tests/import-github.scm (found-sexp)
tests/transformations.scm ("options->transformation, with-latest"):
Adjust fieldname accordingly.
Fixes <https://issues.guix.gnu.org/60202>.
Reported by Christopher Baines <mail@cbaines.net>.
* tests/cpio.scm (%test-file): New variable.
("file->cpio-header + write-cpio-header + read-cpio-header"): Use it.
Skip test when the inode number of %TEST-FILE is too big.
With commit bbcd06e56c, the command
"guix package -s '^fileutils$'" would match the 'ocaml-fileutils'
package, because its 'package-upstream-name*' is "fileutils". Work
around it.
Reported by Vagrant Cascadian.
* tests/guix-package.sh: Change "fileutils" example to use a different
package name.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>
in <https://issues.guix.gnu.org/50892>.
* guix/pki.scm (public-keys->acl): Add call to 'delete-duplicates'.
* tests/pki.scm ("public-keys->acl deduplication"): New test.
* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile'
instead of 'dump-port'.
* tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"):
New test.
This allows 'match-record' to be more efficient (field offsets are
computed at compilation time) and to report unknown fields at
macro-expansion time.
* guix/records.scm (map-fields): New macro.
(define-record-type*)[rtd-identifier]: New procedure.
Define TYPE as a macro and use a separate identifier for the RTD.
(lookup-field, match-record-inner): New macros.
(match-record): Rewrite in terms of 'match-error-inner'.
* tests/records.scm ("match-record, simple")
("match-record, unknown field"): New tests.
* gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file'
local variable to 'main-log-file'.
* gnu/services/getmail.scm (serialize-getmail-configuration-file): Move
after <getmail-configuration-file> definition.
The regression was introduce with commit
c7793b82ef ("gnu: raspberry-pi: Add a
bootloader-chain for the Raspberry Pi and os examples.") due to the examples
needing to be built for the aarch64-linux system.
* tests/guix-system.sh: Invoke guix system build with '--system=aarch64-linux'
to build the Raspberry Pi systems.
This allows 'match-record' to be more efficient (field offsets are
computed at compilation time) and to report unknown fields at
macro-expansion time.
* guix/records.scm (map-fields): New macro.
(define-record-type*)[rtd-identifier]: New procedure.
Define TYPE as a macro and use a separate identifier for the RTD.
(lookup-field, match-record-inner): New macros.
(match-record): Rewrite in terms of 'match-error-inner'.
* tests/records.scm ("match-record, simple")
("match-record, unknown field"): New tests.
* gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file'
local variable to 'main-log-file'.
* gnu/services/getmail.scm (serialize-getmail-configuration-file): Move
after <getmail-configuration-file> definition.
Previously, '+' was supported only via special cases for deprecated
GNU identifiers like 'GPL-N+'. This commit adds support
for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'.
Strictly speaking, '+' is an operator, not part of the SPDX license
identifier, but it is useful to handle it here.
* guix/import/utils.scm (spdx-string->license): Support '+' operator.
* tests/import-utils.scm ("spdx-string->license"): Test it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
SPDX specifies that license identifiers (unlike the 'AND', 'OR', and
'WITH' operators) are matched case-insensitively.
* guix/import/utils.scm (%spdx-license-identifiers): New variable.
(spdx-string->license): Search in '%spdx-license-identifiers' using
'string-ci=?'.
* tests/import-utils.scm ("spdx-string->license"): New test.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix/scripts/pack.scm (%options): Extract symlink parsing logic to...
(symlink-spec-option-parser): ... here.
(self-contained-tarball/builder): Add a comment mentioning why a relative file
name is used for the link target.
* guix/scripts/environment.scm (show-environment-options-help): Document new
--symlink option.
(%default-options): Add default value for symlinks.
(%options): Register new symlink option.
(launch-environment/container): Add #:symlinks argument and extend doc, and
create symlinks using evaluate-populate-directive.
(guix-environment*): Pass symlinks arguments to launch-environment/container.
* doc/guix.texi (Invoking guix shell): Document it.
* tests/guix-shell.sh: Add a --symlink (negative) test.
* tests/guix-environment-container.sh: Add tests.
* guix/gnu-maintenance.scm (%alpha-tarball-rx): Add "." before
"(alpha|beta|...)".
* tests/gnu-maintenance.scm ("release-file?"): Add test for Valgrind.
Fixes <https://issues.guix.gnu.org/55968>.
Reported by Maxime Devos <maximedevos@telenet.be>.
* guix/grafts.scm (%graft-with-utf8-locale?): New parameter.
(graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New
variables.
[build]: Use 'set-utf8-locale'.
* tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set
'%graft-with-utf8-locale?' to #f.
Fixes <https://issues.guix.gnu.org/58861>.
Previously the order of the options giving to 'guix shell' could mean that the
'glibc-for-fhs' package included with the '--emulate-fhs' option would not
appear in the container. For example, using the development option with a
package using the 'gnu-build-system', e.g. 'guix shell -CFD hello', would
include the regular 'glibc' package. The option ordered mattered: 'guix shell
-CD hello -F' would include the expected 'glibc-for-fhs'. We fix this by
having 'glibc-for-fhs' added to the package list just before calling
'options-with-caching' so the option order given by the user does not matter.
* guix/scripts/shell.scm (%options): Move the '--emulate-fhs' (expression
. ...) component from here...
(parse-args): ... to here.
* tests/guix-environment-container.sh: Add a test to check that
'glibc-for-fhs' is in the container even when 'glibc' is included in the 'guix
shell' package list.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
These modules would use (guix grafts) just to access '%graft?' and
related bindings, which are now in (guix store).
* gnu/ci.scm,
guix/gexp.scm,
guix/lint.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/deploy.scm,
guix/scripts/environment.scm,
guix/scripts/home.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/pull.scm,
guix/scripts/size.scm,
guix/scripts/system.scm,
guix/scripts/weather.scm,
tests/builders.scm,
tests/channels.scm,
tests/cpan.scm,
tests/derivations.scm,
tests/gexp.scm,
tests/graph.scm,
tests/guix-daemon.sh,
tests/monads.scm,
tests/pack.scm,
tests/packages.scm,
tests/profiles.scm,
tests/system.scm: Remove #:use-module (guix grafts).
Previously, starting with commit
efa578ecae, 'update-cached-checkout' would
return the OID of the annotated tag the tag points to. With this change
it returns the OID of the commit object in all cases.
* guix/git.scm (resolve-reference): In the 'tag' case, call
'tag-target-id' and 'tag-lookup' when OID designates an annotated tag.
* tests/git.scm ("update-cached-checkout, tag"): New test.
Previously, using 'guix shell -CF coreutils' twice (such that the
profile is cache) would result in:
guix shell: error: '--profile' cannot be used with package options
This patch fixes it by moving argument handling to (guix scripts shell),
before 'options-with-caching' is called.
* guix/scripts/environment.scm (show-environment-options-help)
(%options): Remove '--emulate-fhs'.
(guix-environment*): Pass OPTS as-is to 'options/resolve-packages'.
* guix/scripts/shell.scm (show-help, %options): Add '--emulate-fhs'.
Add the (expression . ...) component to RESULT right from the argument
handler.
* tests/guix-environment-container.sh: Change '--emulate-fhs' tests to
use 'guix shell' instead of 'guix environment'.
* guix/scripts/environment.scm (show-environment-options-help, %options): Add
'--emulate-fhs'.
(setup-fhs): New procedure. Setup for the Filesystem Hierarchy Standard (FHS)
container. Defines and uses FHS-SYMLINKS and LINK-CONTENTS to create FHS
expected directories and creates /etc/ld.so.conf.
(launch-environment): Add 'emulate-fhs?' key and implement it to set $PATH and
generate /etc/ld.so.cache before calling COMMAND.
(launch-environment/container): Add 'emulate-fhs?' and 'setup-hook' keys and
implement them. Define and use FHS-MAPPINGS, to set up additional bind mounts
in the container to follow FHS expectations.
(guix-environment*): Add glibc-for-fhs to the container packages when
'emulate-fhs?' key is in OPTS.
* doc/guix.texi (Invoking guix shell): Document '--emulate-fhs'.
(Invoking guix environment): Document '--emulate-fhs'.
* tests/guix-environment-container.sh: Add tests for '--emulate-fhs'.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This is written in such a way that the type check turns into a no-op at
macro-expansion time for trivial cases:
> ,optimize (validate-license gpl3+)
$18 = gpl3+
> ,optimize (validate-license (list gpl3+ gpl2+))
$19 = (list gpl3+ gpl2+)
* guix/packages.scm (valid-license-value?, validate-license): New
macros.
(<package>)[license]: Add 'sanitize' option.
(&package-license-error): New error condition type.
* tests/packages.scm ("license type checking"): New test.
The '--with-source' option is the first one that was implemented, and
it's the only one that would operate only on leaf packages rather than
traversing the dependency graph. This change makes it consistent with
the rest of the transformation options.
* guix/transformations.scm (evaluate-source-replacement-specs): New
procedure.
(transform-package-source): Rewrite using it.
* tests/transformations.scm ("options->transformation, with-source, no
matches"): Rewrite since we no longer get a warning.
("options->transformation, with-source, in depth"): New test.
* doc/guix.texi (Package Transformation Options): Adjust examples.
* guix/import/print.scm (package->code): Quasiquote properties.
* tests/print.scm (pkg-with-properties, pkg-with-properties-source):
New variables.
("package with properties"): New test
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/import/utils.scm (alist->package): Process properties field in input
data and include it in the generated package.
* tests/import-utils.scm ("alist->package with properties"): New test.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://issues.guix.gnu.org/57978>
Reported by Attila Lendvai <attila@lendvai.name>.
Previously, if a narinfo was available but its corresponding nar was
missing (for instance because the narinfo was cached and the server
became unreachable in the meantime), 'guix substitute --substitute'
would try to download the nar from its preferred location and abort when
that fails. This change forces one retry with each of the URLs.
* guix/scripts/substitute.scm (download-nar): Do not catch
'http-get-error?' exceptions.
(system-error?, network-error?, process-substitution/fallback): New
procedures.
(process-substitution): Call 'process-substitution/fallback' upon
'network-error?'.
* tests/substitute.scm ("substitute, first URL has narinfo but lacks nar, second URL unauthorized")
("substitute, first URL has narinfo but nar is 404, both URLs authorized")
("substitute, first URL has narinfo but nar is 404, one URL authorized")
("substitute, narinfo is available but nar is missing"): New tests.
* tests/substitute.scm (%unroutable-substitute-url): New variable.
("query narinfo signed with authorized key, unroutable URL first")
("substitute, authorized key, first substitute URL is unroutable"): New
tests.
* guix/scripts/home/import.scm (manifest+configuration-files->code):
Insert calls to 'comment' and 'vertical-space'.
(import-manifest): Use 'pretty-print-with-comments/splice' instead of a
loop on 'pretty-print'.
* tests/home-import.scm (remove-recursively): New procedure.
(eval-test-with-home-environment): Use it.
Previously (home-environment (services ...)) would not be considered a
"newline form". This fixes it.
* guix/read-print.scm (newline-form?): Use 'vhash-foldq*' instead of
'vhash-assq' and iterate over candidates.
* tests/read-print.scm: Add test.
* guix/import/gem.scm: (rubygems-fetch, gem->guix-package)
(gem-recursive-import): Fix to fetch the specified version of the gem.
* guix/scripts/import/gem.scm (show-help): Update the help message.
(guix-import-gem): Modify so the version number to be passed to subsequent
procedures.
* tests/gem.scm: Add tests.
* doc/guix.texi (Invoking guix import): Document.
Signed-off-by: Christopher Baines <mail@cbaines.net>
This is a followup to 95a03aa5c5. Since
that commit, merely evaluating 'vm-image.tmpl' would trigger the build
of 'current-guix' so skip it.
* tests/guix-system.sh: Do not try to build 'vm-image.tmpl'.
Previously, 'guix shell' for example would leak the socket that's
connected to the daemon.
* guix/store.scm (open-unix-domain-socket, open-inet-socket): Pass
SOCK_CLOEXEC to 'socket'.
* tests/guix-shell.sh: Add test.
Previously, the pretty-printer would unconditionally leave everything
but double-quotes and backslashes unescaped when rendering a string.
With this change, the previous behavior only applies to forms listed in
%NATURAL-WHITESPACE-STRING-FORMS.
* guix/read-print.scm (%natural-whitespace-string-forms): New variable.
(printed-string): New procedure.
(pretty-print-with-comments): Use it instead of 'escaped-string'.
* tests/read-print.scm: Add test.
Fixes <https://issues.guix.gnu.org/57090>.
Reported by Christopher Rodriguez <yewscion@gmail.com>.
* guix/read-print.scm (%symbols-followed-by-octal-integers)
(%symbols-followed-by-hexadecimal-integers): New variables.
* guix/read-print.scm (integer->string): New procedure.
(pretty-print-with-comments): Use it.
* tests/read-print.scm: Add test.
* gnu/services/lightdm.scm: New service.
* tests/services/lightdm.scm: Test it.
* doc/guix.texi (X Window): Document it.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register it.
Co-authored-by: L p R n d n <guix@lprndn.info>
Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
The new value of %unset-value sticks out more when something goes wrong, and
is also more unique; i.e. easier to search for.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* gnu/home/services/ssh.scm (serialize-address-family): Use the public API of
the maybe infrastructure.
* gnu/services/file-sharing.scm (serialize-maybe-string): Use maybe-value.
(serialize-maybe-file-object): Use maybe-value-set?.
* gnu/services/getmail.scm (getmail-retriever-configuration): Don't use
internals in unset field declarations.
(getmail-destination-configuration): Ditto.
* gnu/services/messaging.scm (raw-content?): Use maybe-value-set?.
(prosody-configuration): Use %unset-value.
* gnu/services/telephony.scm (jami-shepherd-services): Use maybe-value-set?.
(archive-name->username): Use maybe-value-set?.
* tests/services/configuration.scm ("maybe type, no default"): Use
%unset-value.
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Fixes <https://issues.guix.gnu.org/57093>.
Reported by Mohammed AMAR-BENSABER <renken@shione.net>.
Previously 'read-with-comments' would enter an infinite loop.
* guix/read-print.scm (read-with-comments)[missing-closing-paren-error]:
New procedure.
Call it when 'loop' as called from 'liip' returns EOF.
* tests/read-print.scm ("read-with-comments: missing closing paren"):
New test.
The regression was introduced with a2b89a3319,
and introduce a risk that 'unset leaks to serialized configuration files.
* tests/services/configuration.scm (maybe-symbol): New type.
(config-with-maybe-symbol): New configuration.
("symbol maybe value serialization, unspecified"): New test.
Reported-by: Attila Lendvai <attila@lendvai.name>
* guix/read-print.scm (%not-newline): New variable.
(print-multi-line-comment): New procedure.
(pretty-print-with-comments): Use it.
* tests/read-print.scm ("pretty-print-with-comments, multi-line
comment"): New test.
This lets users use three leading semicolons, for instance, in top-level
comments.
* guix/read-print.scm (canonicalize-comment): Add INDENT parameter and
honor it.
(pretty-print-with-comments): Change default value of #:format-comment.
Call FORMAT-COMMENT with INDENT as the second argument.
* tests/read-print.scm: Adjust test accordingly.
* guix/read-print.scm (read-with-comments): Add #:blank-line? and honor it.
(read-with-comments/sequence, pretty-print-with-comments/splice): New
procedures.
* tests/read-print.scm (test-pretty-print/sequence): New macro.
Add tests using it.
* guix/read-print.scm (<page-break>, page-break?, page-break)
(char-set:whitespace-sans-page-break): New variables.
(space?): New procedure.
(read-vertical-space): Use it.
(read-until-end-of-line): New procedure.
(read-with-comments): Add #\page case.
(pretty-print-with-comments): Add 'page-break?' case.
* tests/read-print.scm ("read-with-comments: top-level page break"): New
test.
Add round-trip test with page break within an sexp.
* guix/read-print.scm (<vertical-space>, vertical-space?)
(vertical-space, vertical-space-height): New variables.
(combine-vertical-space, canonicalize-vertical-space)
(read-vertical-space): New procedures.
(read-with-comments): Use it in the #\newline case.
(pretty-print-with-comments): Add #:format-vertical-space and honor it.
Add case for 'vertical-space?'.
* guix/scripts/style.scm (format-package-definition): Pass
#:format-vertical-space to 'object->string*'.
* tests/read-print.scm ("read-with-comments: list with blank line")
("read-with-comments: list with multiple blank lines")
("read-with-comments: top-level blank lines")
("pretty-print-with-comments, canonicalize-vertical-space"): New tests.
Add a couple of additional round-trip tests.
Previously this test would produce a file containing blank lines between
inputs.
* tests/style.scm ("input labels, modify-inputs and margin comment"):
Remove trailing newlines in replacement strings of 'substitute*'
expression.
Fixes <https://issues.guix.gnu.org/56799>.
This partially reverts 8cb1a49a39.
Rationale: *unspecified* cannot be serialized thus used as a G-Expression
input, which is problematic/inconvenient when using deeply nested records. As
an example, jami-service-type was broken when using partially defined
<jami-account> records.
* gnu/services/configuration.scm (define-maybe-helper): Check against the
'unset symbol.
(normalize-field-type+def): Adjust value to 'unset.
(define-configuration-helper): Use 'unset as the default value thunk.
* gnu/services/file-sharing.scm (serialize-maybe-string): Check against the
'unset symbol.
(serialize-maybe-file-object): Likewise.
* gnu/services/messaging.scm (define-all-configurations): Use 'unset as
value.
(raw-content?): Check against 'unset symbol.
(prosody-configuration)[http-max-content-size]: Default to 'unset.
[http-external-url]: Likewise.
[mod-muc]: Likewise.
[raw-content]: Likewise.
* gnu/services/networking.scm (opendht-configuration): Adjust documentation.
* gnu/services/telephony.scm (jami-shepherd-services): Replace *undefined*
with the 'unset symbol.
* tests/services/configuration.scm ("maybe type, no default"): Check against
the 'unset symbol.
* doc/guix.texi: Regenerate the opendht-configuration,
openvpn-client-configuration and openvpn-server-configuration documentation.
Fixes <https://issues.guix.gnu.org/54469>.
Reported by Maxime Devos <maximedevos@telenet.be>.
* gnu/home/services.scm (environment-variable-shell-definitions): New
procedure, with code formerly in 'serialize-posix-env-vars'.
(environment-variables->setup-environment-script): Change
"setup-environment" from 'mixed-text-file' to 'computed-file', and use
'environment-variable-shell-definitions'.
* tests/guix-home.sh: Test it.
* gnu/home/services/shells.scm (serialize-posix-env-vars): Delegate to
'environment-variable-shell-definitions'.
Fixes <https://issues.guix.gnu.org/56540>.
Until now, environment variable values were emitted unquoted, producing
invalid shell code if the value contains spaces for example.
* gnu/home/services/shells.scm (serialize-posix-env-vars): Define
'shell-quote' procedure in staged code and use it for #$value.
* tests/guix-home.sh: Add test for PS1 variable with a value containing
spaces.
* tests/build-emacs-utils.scm
("emacs-batch-script: raise &emacs-batch-error on failure"): More loosely
match expected error string, which differs between Emacs 27 and Emacs 28.