<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix/tests/build-utils.scm, branch master</title>
<subtitle>Transactional package manager, declarative GNU/Linux distribution, reproducible deployment tool, and more! https://guix.gnu.org</subtitle>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/'/>
<entry>
<title>Reapply "Update Maxim's email address."</title>
<updated>2025-09-18T04:44:12+00:00</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim@guixotic.coop</email>
</author>
<published>2025-09-18T03:25:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=10482f731e6def20df23caa9cd0b9ab428f52a50'/>
<id>10482f731e6def20df23caa9cd0b9ab428f52a50</id>
<content type='text'>
This reverts commit a7db92d9b389cbe565395523882c34c6eff2c21a, this time with
the more careful command, to avoid a world rebuild:

grep -rl --exclude-dir=build --exclude-dir=patches --exclude=ld-wrapper.in \
  --exclude=sitecustomize.py --exclude=guix-emacs.el maxim.cournoyer@gmail.com |
  xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g'

Change-Id: I0871f5cf9ace79e34e78e24154d0da6ea95a3a91
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit a7db92d9b389cbe565395523882c34c6eff2c21a, this time with
the more careful command, to avoid a world rebuild:

grep -rl --exclude-dir=build --exclude-dir=patches --exclude=ld-wrapper.in \
  --exclude=sitecustomize.py --exclude=guix-emacs.el maxim.cournoyer@gmail.com |
  xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g'

Change-Id: I0871f5cf9ace79e34e78e24154d0da6ea95a3a91
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Update Maxim's email address."</title>
<updated>2025-09-18T03:07:31+00:00</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim@guixotic.coop</email>
</author>
<published>2025-09-18T03:04:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=a7db92d9b389cbe565395523882c34c6eff2c21a'/>
<id>a7db92d9b389cbe565395523882c34c6eff2c21a</id>
<content type='text'>
This reverts commit d0d87a744d724b7e7d5ac013c586039652087bb3. Oops! This
caused a world rebuild.

Change-Id: I25fff644b2b61d0ee93d69b457b04c72b5b74d15
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d0d87a744d724b7e7d5ac013c586039652087bb3. Oops! This
caused a world rebuild.

Change-Id: I25fff644b2b61d0ee93d69b457b04c72b5b74d15
</pre>
</div>
</content>
</entry>
<entry>
<title>Update Maxim's email address.</title>
<updated>2025-09-17T23:05:19+00:00</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim@guixotic.coop</email>
</author>
<published>2025-09-17T23:03:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=d0d87a744d724b7e7d5ac013c586039652087bb3'/>
<id>d0d87a744d724b7e7d5ac013c586039652087bb3</id>
<content type='text'>
The change was automated via:

  git grep -l maxim.cournoyer@gmail.com |
    xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g'

* .mailmap: New entry.

Change-Id: Iaa88b1e51c94159c49138fb43910badb990eb169
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The change was automated via:

  git grep -l maxim.cournoyer@gmail.com |
    xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g'

* .mailmap: New entry.

Change-Id: Iaa88b1e51c94159c49138fb43910badb990eb169
</pre>
</div>
</content>
</entry>
<entry>
<title>build: utils: Raise error in modify-phases upon missing key.</title>
<updated>2024-08-31T08:42:06+00:00</updated>
<author>
<name>Carlo Zancanaro</name>
<email>carlo@zancanaro.id.au</email>
</author>
<published>2023-05-20T13:05:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=994fbc0ac6c6efcb385cbd6ef7b9073b7571ac93'/>
<id>994fbc0ac6c6efcb385cbd6ef7b9073b7571ac93</id>
<content type='text'>
* guix/build/utils.scm (alist-cons-before)
(alist-cons-after): Error with a match failure if the
reference is not found, instead of appending to the alist.
* tests/build-utils.scm: Update tests to match the new behavior.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Change-Id: I3044b101bd06231d5cd55a544ac1009e6ce6f9a0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/build/utils.scm (alist-cons-before)
(alist-cons-after): Error with a match failure if the
reference is not found, instead of appending to the alist.
* tests/build-utils.scm: Update tests to match the new behavior.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Change-Id: I3044b101bd06231d5cd55a544ac1009e6ce6f9a0
</pre>
</div>
</content>
</entry>
<entry>
<title>utils: Fix wrap-script argument handling.</title>
<updated>2022-01-10T16:44:29+00:00</updated>
<author>
<name>Brendan Tildesley</name>
<email>mail@brendan.scot</email>
</author>
<published>2021-04-29T10:33:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=7f8a896c5f3ecde60a19f244d5a407ec1033a08d'/>
<id>7f8a896c5f3ecde60a19f244d5a407ec1033a08d</id>
<content type='text'>
* guix/build/utils.scm (wrap-script):
Don't add (car cl) one too many times, cl its self contains it's car.
Split the aguments string with string-tokenize to avoid leaving an empty
string argument when there should be none. These two bugs seemed to
be partially cancelling each other out so that scripts still worked when
ran with no arguments.

* tests/build-utils.scm: Adjust wrap-script to above changes.
Add two tests to ensure the command line arguments appear identical to a
script and its wrapped version.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/build/utils.scm (wrap-script):
Don't add (car cl) one too many times, cl its self contains it's car.
Split the aguments string with string-tokenize to avoid leaving an empty
string argument when there should be none. These two bugs seemed to
be partially cancelling each other out so that scripts still worked when
ran with no arguments.

* tests/build-utils.scm: Adjust wrap-script to above changes.
Add two tests to ensure the command line arguments appear identical to a
script and its wrapped version.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>utils: Define ‘search-input-file’ procedure.</title>
<updated>2021-06-04T20:34:26+00:00</updated>
<author>
<name>Maxime Devos</name>
<email>maximedevos@telenet.be</email>
</author>
<published>2021-05-31T16:36:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=5378edeab4e90f9dec6ae9bc5706a4ac790294b7'/>
<id>5378edeab4e90f9dec6ae9bc5706a4ac790294b7</id>
<content type='text'>
The procedure ‘which’ from (guix build utils)
is used for two different purposes:

  1. for finding the absolute file name of a binary
     that needs to run during the build process

  2. for finding the absolute file name of a binary,
     for the target system (as in --target=TARGET),
     e.g. for substituting sh-&gt;/gnu/store/.../bin/sh,
     python-&gt;/gnu/store/.../bin/python.

When compiling natively (target=#f in Guix parlance),
this is perfectly fine.

However, when cross-compiling, there is a problem.
"which" looks in $PATH for binaries.  That's good for purpose (1),
but incorrect for (2), as the $PATH contains binaries from native-inputs
instead of inputs.

This commit defines a ‘search-input-file’ procedure. It functions
like 'which', but instead of searching in $PATH, it searches in
the 'inputs' of the build phase, which must be passed to
‘search-input-file’ as an argument. Also, the file name must
include "bin/" or "sbin/" as appropriate.

* guix/build/utils.scm (search-input-file): New procedure.
* tests/build-utils.scm
  ("search-input-file: exception if not found")
  ("search-input-file: can find if existent"): Test it.
* doc/guix.texi (File Search): Document it.

Partially-Fixes: &lt;https://issues.guix.gnu.org/47869&gt;
Co-Authored-By: Ludovic Courtès &lt;ludo@gnu.org&gt;
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The procedure ‘which’ from (guix build utils)
is used for two different purposes:

  1. for finding the absolute file name of a binary
     that needs to run during the build process

  2. for finding the absolute file name of a binary,
     for the target system (as in --target=TARGET),
     e.g. for substituting sh-&gt;/gnu/store/.../bin/sh,
     python-&gt;/gnu/store/.../bin/python.

When compiling natively (target=#f in Guix parlance),
this is perfectly fine.

However, when cross-compiling, there is a problem.
"which" looks in $PATH for binaries.  That's good for purpose (1),
but incorrect for (2), as the $PATH contains binaries from native-inputs
instead of inputs.

This commit defines a ‘search-input-file’ procedure. It functions
like 'which', but instead of searching in $PATH, it searches in
the 'inputs' of the build phase, which must be passed to
‘search-input-file’ as an argument. Also, the file name must
include "bin/" or "sbin/" as appropriate.

* guix/build/utils.scm (search-input-file): New procedure.
* tests/build-utils.scm
  ("search-input-file: exception if not found")
  ("search-input-file: can find if existent"): Test it.
* doc/guix.texi (File Search): Document it.

Partially-Fixes: &lt;https://issues.guix.gnu.org/47869&gt;
Co-Authored-By: Ludovic Courtès &lt;ludo@gnu.org&gt;
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>utils: Allow text substitution even in the presence of NUL characters.</title>
<updated>2021-01-08T19:10:33+00:00</updated>
<author>
<name>Mark H Weaver</name>
<email>mhw@netris.org</email>
</author>
<published>2021-01-07T20:15:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=485ac28235bf8775914b905060266b09629c1bac'/>
<id>485ac28235bf8775914b905060266b09629c1bac</id>
<content type='text'>
Fixes &lt;https://issues.guix.gnu.org/30116&gt;.

Before this change, the presence of a NUL character on a line meant that
the (glibc) regexp engine used by Guile would either 1. stop scanning the
string or 2. crash with the error "string contains #\\nul character",
depending on the locale used.

This change works around this limitation by first replacing the NUL character
by an unused Unicode code point, doing the substitution, then reverting the
replacement.

* guix/build/utils.scm (unused-private-use-code-point)
(replace-char): New procedures.
(substitute): Make use of the above procedures to work around the NUL
character regexp engine limitation.
* tests/build-utils.scm: Add tests.

Co-authored-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;https://issues.guix.gnu.org/30116&gt;.

Before this change, the presence of a NUL character on a line meant that
the (glibc) regexp engine used by Guile would either 1. stop scanning the
string or 2. crash with the error "string contains #\\nul character",
depending on the locale used.

This change works around this limitation by first replacing the NUL character
by an unused Unicode code point, doing the substitution, then reverting the
replacement.

* guix/build/utils.scm (unused-private-use-code-point)
(replace-char): New procedures.
(substitute): Make use of the above procedures to work around the NUL
character regexp engine limitation.
* tests/build-utils.scm: Add tests.

Co-authored-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Properly deal with build directories containing '~'.</title>
<updated>2020-11-16T10:21:42+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2020-11-16T10:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=977eb5d023cfdf8e336f1896480eea9cef5c04e9'/>
<id>977eb5d023cfdf8e336f1896480eea9cef5c04e9</id>
<content type='text'>
Fixes &lt;https://bugs.gnu.org/44626&gt;.
Reported by Vagrant Cascadian &lt;vagrant@debian.org&gt;.

* tests/build-utils.scm ("wrap-script, simple case"): Pass
SCRIPT-CONTENTS to 'display' rather than 'format'.
* gnu/services/base.scm (file-system-&gt;shepherd-service-name)
[valid-characters, mount-point]: New variables.
Filter out invalid store file name characters from the mount point of
FILE-SYSTEM.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;https://bugs.gnu.org/44626&gt;.
Reported by Vagrant Cascadian &lt;vagrant@debian.org&gt;.

* tests/build-utils.scm ("wrap-script, simple case"): Pass
SCRIPT-CONTENTS to 'display' rather than 'format'.
* gnu/services/base.scm (file-system-&gt;shepherd-service-name)
[valid-characters, mount-point]: New variables.
Filter out invalid store file name characters from the mount point of
FILE-SYSTEM.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Avoid unnecessary use of 'mock'.</title>
<updated>2019-11-25T23:16:35+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2019-11-24T19:48:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=f5698dfb87df1132ca5c73a8ed7f75f63c07669f'/>
<id>f5698dfb87df1132ca5c73a8ed7f75f63c07669f</id>
<content type='text'>
* tests/build-utils.scm ("wrap-script, simple case"): Use the real
'which' instead of mocking it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/build-utils.scm ("wrap-script, simple case"): Use the real
'which' instead of mocking it.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Avoid (catch 'srfi-34 …) form.</title>
<updated>2019-11-25T23:16:35+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2019-11-24T19:47:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=1d64afbdc0644a2be8bd2ad157085731e212ab74'/>
<id>1d64afbdc0644a2be8bd2ad157085731e212ab74</id>
<content type='text'>
* tests/build-utils.scm ("wrap-script, raises condition"): Use 'guard'
instead of "catch 'srfi-34".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/build-utils.scm ("wrap-script, raises condition"): Use 'guard'
instead of "catch 'srfi-34".
</pre>
</div>
</content>
</entry>
</feed>
