Age | Commit message (Expand) | Author |
2022-01-10 | utils: Fix wrap-script argument handling....* 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 <maxim.cournoyer@gmail.com>
| Brendan Tildesley |
2021-07-25 | build: utils: Trim leading slash from search-input-file input....Make sure that both:
(search-input-file inputs "/bin/sh") and (search-input-file inputs "bin/sh")
are supported.
* guix/build/utils (search-input-file): Trim leading slash character from
FILE.
| Mathieu Othacehe |
2021-07-08 | utils: Add 'search-input-directory'....* guix/build/utils.scm (search-input-directory): New procedure.
* doc/guix.texi (Build Utilities): Document it next to
'search-input-file'. Tweak wording.
| Ludovic Courtès |
2021-06-04 | utils: Define ‘search-input-file’ procedure....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->/gnu/store/.../bin/sh,
python->/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: <https://issues.guix.gnu.org/47869>
Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| Maxime Devos |
2021-06-04 | utils: Allow overriding the shell interpreter in ‘wrap-program’....Previously, when creating new wrappers, 'wrap-program' would search
for an interpreter to use in PATH. However, this is incorrect when
cross-compiling. Allow overriding the shell interpreter to use,
via an optional keyword argument #:sh.
In time, when all users of 'wrap-program' have been corrected,
this keyword argument can be made mandatory.
* guix/build/utils.scm (wrap-program): Introduce a #:sh keyword
argument, defaulting to (which "sh"). Use this keyword argument.
Partially-Fixes: <https://issues.guix.gnu.org/47869>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| Maxime Devos |
2021-04-22 | utils: wrap-program: Refuse to wrap .X-real files....* guix/build/utils.scm (wrap-program): Error if wrap-program was
mistakenly passed a .X-real file. This prevents and forces us to fix
cases where a double wrapped ..X-real-real file is created, such as can
be seen with: "find /gnu/ -iname '.*-real-real'".
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| Brendan Tildesley |
2021-04-22 | utils: Rename 'wrapper?' to 'wrapped-program?'....* guix/build/utils.scm (wrap-program): The wrapper? procedure is
incorrectly named as it actually checks to see if prog is the
original program that was moved, not the wrapper.
* guix/build/python-build-system: (wrap): Use renamed wrapped-program?.
* gnu/packages/ebook.scm (calibre)[arguments]: Likewise.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| Brendan Tildesley |
2021-01-26 | build-systems/gnu: Allow unpacking/repacking more kind of files....Before this change, only plain directories, tar or zip archives were supported
as the source of a package for the GNU build system; anything else would cause
the unpack phase to fail. Origins relying on snippets would suffer from the
same problem.
This change adds the support to use files of the following extensions: .gz,
.Z, .bz2, .lz, and .xz, even when they are not tarballs. Files of unknown
extensions are treated as uncompressed files and supported as well.
* guix/packages.scm (patch-and-repack): Only add the compressor utility to the
PATH when the file is compressed. Bind more inputs in the mlet, and use them
for decompressing single files. Adjust the decompression and compression
routines.
[decompression-type]: Remove nested variable.
* guix/build/utils.scm (compressor, tarball?): New procedures. Move
%xz-parallel-args to the new 'compression helpers' section.
* tests/packages.scm: Add tests. Add missing copyright year for Jan.
* guix/build/gnu-build-system.scm (first-subdirectory): Return #f when no
sub-directory was found.
(unpack): Support more file types, including uncompressed plain files.
| Maxim Cournoyer |
2021-01-26 | utils: Add NIX_STORE_DIR as a candidate for the value of the store directory....On the daemon side, nixStore gets set to the environment variable
NIX_STORE_DIR, else the environment variable NIX_STORE else the compile time
macro NIX_STORE_DIR (see the Settings::processEnvironment method in
nix/libstore/globals.cc). When creating a build environment, it sets
NIX_STORE with the value computed as described above. Hence, it's safer to
look for both NIX_STORE_DIR and NIX_STORE in (guix build utils), so that it
works in any context (build context or external context).
* guix/build/utils.scm (%store-directory): Consider both NIX_STORE_DIR and
NIX_STORE as environment variables.
| Maxim Cournoyer |
2021-01-08 | utils: Allow text substitution even in the presence of NUL characters....Fixes <https://issues.guix.gnu.org/30116>.
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 <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
| Mark H Weaver |
2020-12-13 | utils: 'copy-recursively' keeps symlink mtime when #:keep-mtime? is true....* guix/build/utils.scm (copy-recursively): In the "leaf" procedure, call
'set-file-time' also on symlinks.
| Ludovic Courtès |
2020-12-13 | utils: 'set-file-time' passes AT_SYMLINK_NOFOLLOW....* guix/build/utils.scm (AT_SYMLINK_NOFOLLOW): New variable.
(set-file-time): Use it.
| Ludovic Courtès |
2020-11-19 | utils: Add #:keep-permissions? parameter to 'copy-recursively'....* guix/build/utils.scm (copy-recursively): Add #:keep-permissions? and
honor it.
* doc/guix.texi (Build Utilities): Adjust accordingly.
| Ludovic Courtès |
2020-11-19 | utils: Add #:copy-file parameter to 'copy-recursively'....* guix/build/utils.scm (copy-recursively): Add #:copy-file and honor it.
* doc/guix.texi (Build Utilities): Adjust accordingly.
| Ludovic Courtès |
2020-11-19 | utils: 'copy-recursively' keeps directory mtime when #:keep-mtime? is true....Fixes <https://bugs.gnu.org/44741>.
* guix/build/utils.scm (copy-recursively): Move 'set-file-time' call
from 'down' to 'up'.
| Ludovic Courtès |
2020-11-17 | utils: 'wrap-script' doesn't pass a non-literal string to 'format'....Reported by Vagrant Cascadian <vagrant@debian.org>
in <https://bugs.gnu.org/44626>.
* guix/build/utils.scm (wrap-script): Use 'display' instead of passing a
non-literal string to 'format'.
| Ludovic Courtès |
2020-10-08 | packages, scripts, utils: Enable multi-threaded xz compression....xz compression is slow; using the multi-thread mode of xz can make it more
than 6 times faster, for example when compressing the large linux-libre
source.
* guix/build/utils.scm (%xz-parallel-args): New procedure.
* guix/packages.scm (patch-and-repack): Specify the required above xz
arguments by setting the XZ_DEFAULTS environment variable.
* guix/scripts/pack.scm (%compressors, bootstrap-xz): Modify the commands
Gexps so they do not need to be quoted. This allows lazily evaluating the
arguments on the builder's side. Specify the required xz arguments.
(self-contained-tarball): Do not quote the compressor command value.
(docker-image): Likewise.
* guix/utils.scm (decompressed-port, compressed-port)
(compressed-output-port): Specify the required above xz arguments.
| Maxim Cournoyer |
2020-10-08 | utils: Do not raise exceptions in delete-file-recursively....This makes it so that delete-file-recursively honors its docstring, which says
it should "report but ignore errors".
Fixes <https://issues.guix.gnu.org/43366>.
* guix/build/utils.scm (warn-on-error): New syntax.
(delete-file-recursively): Use it to catch exceptions and print warning
messages.
Reported-by: Fredrik Salomonsson <plattfot@gmail.com>
| Maxim Cournoyer |
2020-09-19 | utils: Add 'call-with-temporary-output-file'....* guix/utils.scm: Re-export 'call-with-temporary-output-file'.
(call-with-temporary-output-file): Move to...
* guix/build/utils.scm (call-with-temporary-output-file): ... here.
| Ludovic Courtès |
2020-09-10 | utils: 'dump-port' has an optional 'len' parameter....* guix/build/utils.scm (dump-port): Add optional 'len' parameter and
honor it.
| Ludovic Courtès |
2020-05-25 | build: substitute*: Fix typo in example....* guix/build/utils.scm (substitute*): Fix typo in example in docstring,
use consistent variable names.
| Efraim Flashner |
2020-02-17 | utils: Change 'patch-shebang' to not try to patch Rust source files....* guix/build/utils.scm (patch-shebang): Match only absolute paths.
| Danny Milosavljevic |
2020-01-30 | guix: Fix missing export for make-desktop-entry-file....* guix/build/utils.scm: Export make-desktop-entry-file.
| Pierre Neidhardt |
2019-10-19 | guix: Add helper for generating desktop entry files....* guix/build/utils.scm (make-desktop-entry-file): New procedure.
| Pierre Neidhardt |
2019-06-17 | utils: Add 'invoke/quiet'....* gnu/build/bootloader.scm (G_): Remove.
(open-pipe-with-stderr, invoke/quiet): Move to...
* guix/build/utils.scm: ... here. Use 'let-values' instead of
'define-values' because Guile 2.0 (the bootstrap Guile) doesn't know
about 'define-values'.
* po/guix/POTFILES.in: Remove gnu/build/bootloader.scm, and add
guix/build/utils.scm.
* tests/build-utils.scm: Remove import of (gnu build bootloader).
| Ludovic Courtès |
2019-02-08 | guix: Add wrap-script....* guix/build/utils.scm (wrap-script): New procedure.
(&wrap-error): New condition.
(wrap-error?, wrap-error-program, wrap-error-type): New procedures.
* tests/build-utils.scm ("wrap-script, simple case", "wrap-script, with
encoding declaration", "wrap-script, raises condition"): New tests.
| Ricardo Wurmus |
2019-01-29 | build-system/gnu: Report invocation errors in a human-friendly way....* guix/build/utils.scm (report-invoke-error): New procedure.
* guix/build/gnu-build-system.scm (gnu-build): Guard against
'invoke-error?'.
| Ludovic Courtès |
2019-01-29 | utils: Switch to the new 'setvbuf' API....* guix/build/utils.scm (setvbuf) [(and guile-2 (not guile-2.2))]: New
procedure.
(remove-store-references): Use the 2.2 'setvbuf' API style.
* guix/build/gnu-build-system.scm (gnu-build): Likewise.
| Ludovic Courtès |
2018-11-25 | build-system: python: Do not double wrap executables....* guix/build/python-build-system.scm (wrap): Only wrap executables that have
not already been wrapped.
* guix/build/utils.scm (wrapper?): New function.
| Arun Isaac |
2018-08-20 | utils: Generate valid substitutions in 'wrap-program'....* guix/build/utils.scm (wrap-program)[export-variable]: Generate valid bash
substitutions when using custom separators.
| Jelle Licht |
2018-03-16 | utils: invoke: Raise exceptions using SRFI-34 and SRFI-35....* guix/build/utils.scm (&invoke-error): New condition type.
(invoke-error?, invoke-error-program, invoke-error-arguments)
(invoke-error-exit-status, invoke-error-term-signal)
(invoke-error-stop-signal): New exported procedures.
(invoke): Raise exceptions using SRFI-34 and SRFI-35.
* guix/ui.scm (call-with-error-handling): Add a guard clause
for &invoke-error conditions.
| Mark H Weaver |
2018-03-11 | utils: Add 'false-if-file-not-found'....* guix/build/utils.scm (false-if-file-not-found): New macro.
| Ludovic Courtès |
2017-09-05 | guix: Fix Guile current-processor-count deprecation warnings....When current-processor-count is used without (ice-9 threads) being used, Guile
complains with the following warning:
Import (ice-9 threads) to have access to `current-processor-count'.
* guix/build/utils.scm: Use (ice-9 threads).
| Mathieu Othacehe |
2017-06-01 | utils: Add helper for invoking programs....* guix/build/utils.scm (invoke): New variable.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
| Danny Milosavljevic |
2017-05-26 | utils: Re-export 'delete'....* guix/build/utils.scm: Reexport 'delete' binding.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
| Sergei Trofimovich |
2017-01-26 | utils: Add helper method to make files writable....* gnu/build/activation.scm (make-file-writable): Move this to ...
* guix/build/utils.scm (make-file-writable): ... here. Export it.
* guix/build/gnu-build-system.scm (strip): Use it.
| Marius Bakke |
2017-01-26 | utils: Add 'gzip-file?' and 'reset-gzip-timestamp'....* guix/build/utils.scm (%gzip-magic-bytes): New variable.
(gzip-file?, reset-gzip-timestamp): New procedures.
| Ludovic Courtès |
2017-01-23 | search-paths: Allow specs with #f as their separator....This adds support for single-entry search paths.
Fixes <http://bugs.gnu.org/25422>.
Reported by Leo Famulari <leo@famulari.name>.
* guix/search-paths.scm (<search-path-specification>)[separator]:
Document as string or #f.
(evaluate-search-paths): Add case for SEPARATOR as #f.
(environment-variable-definition): Handle SEPARATOR being #f.
* guix/build/utils.scm (list->search-path-as-string): Add case for
SEPARATOR as #f.
(search-path-as-string->list): Likewise.
* guix/build/profiles.scm (abstract-profile): Likewise.
* tests/search-paths.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* tests/packages.scm ("--search-paths with single-item search path"):
New test.
* gnu/packages/version-control.scm (git)[native-search-paths](separator):
New field.
| Ludovic Courtès |
2016-09-07 | utils: 'wrap-program' produces only one wrapper file....* guix/build/utils.scm (wrap-program)[wrapper-file-name]
[next-wrapper-number, wrapper-target]: Remove.
[wrapped-file, already-wrapped?]: New variables.
[last-line]: New procedure.
Use it to append to PROG when a wrapper already exists.
* tests/build-utils.scm ("wrap-program, one input, multiple calls"):
Adjust the list of files to delete.
| Ludovic Courtès |
2016-08-10 | utils: Fix 'modify-phases' docstring....* guix/build/utils.scm (modify-phases): Fix the documentation string.
| Taylan Ulrich Bayırlı/Kammer |
2015-10-29 | utils: Have search-path-as-list pattern search for directories....* guix/build/utils.scm (search-path-as-list)[pattern]: Check requested file
type. Check pattern against directory names.
* guix/search-paths.scm (evaluate-search-paths)[pattern]: Remove symlink hack.
| Eric Bavier |
2015-10-03 | utils: Add 'every*'....* guix/build/gnu-build-system.scm (every*): Move to...
* guix/build/utils.scm (every*): ... here. New procedure.
| Ludovic Courtès |
2015-09-06 | utils: find-files: Add DIRECTORIES? and FAIL-ON-ERROR? arguments....* guix/build/utils.scm (find-files): Add DIRECTORIES? and FAIL-ON-ERROR?
keyword arguments.
| Mark H Weaver |
2015-08-30 | utils: Move 'package-name->name+version' to (guix build utils)....* guix/utils.scm (package-name->name+version): Move to...
* guix/build/utils.scm (package-name->name+version): ... here. New
procedure.
* guix/build/emacs-build-system.scm (package-name->name+version):
Remove.
| Ludovic Courtès |
2015-08-30 | utils: Add 'strip-store-file-name'....* guix/build/utils.scm (strip-store-file-name): New procedure.
* guix/build/emacs-build-system.scm (store-directory->name-version):
Remove. Update callers to use 'strip-store-file-name'.
* gnu/packages/gcc.scm (make-libstdc++-doc)[arguments]: Use
'strip-store-file-name' instead of 'string-drop'.
| Ludovic Courtès |
2015-08-29 | utils: Add 'install-file'....* guix/build/utils.scm (install-file): New procedure.
| Ludovic Courtès |
2015-04-06 | utils: 'find-files' does not follow symlinks by default....Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <sleep_walker@suse.cz>.
* guix/build/utils.scm (find-files): Add #:stat parameter. Pass it as
last argument to 'file-system-fold'.
| Ludovic Courtès |
2015-04-05 | gremlin: Ignore non-store file names in RUNPATH and warn about them....* guix/build/gremlin.scm (validate-needed-in-runpath)[runpath]:
Add (filter absolute-file-name? ...).
Emit a warning when RUNPATH file names that do not match
'store-file-name?'. Change format of error message to begin with file
name.
* guix/build/utils.scm (store-file-name?): New procedure.
| Ludovic Courtès |
2015-04-01 | utils: Make the second 'find-files' argument optional....* guix/build/utils.scm (find-files): Make 'pred' optional.
| Ludovic Courtès |
2015-03-31 | utils: 'find-files' takes an arbitrary predicate as its second argument....* guix/build/utils.scm (file-name-predicate): New procedure.
(find-files): Rename second parameter to 'pred'. When 'pred' is not a
procedure, call 'file-name-predicate'. Use PRED instead of
'regexp-exec' in the leaf procedure.
| Ludovic Courtès |