This was suggested on several occasions, notably
<https://bugs.gnu.org/24544>.
* gnu/packages/ld-wrapper.in (%allow-impurities?): Default to #t and
parse the value of 'GUIX_LD_WRAPPER_ALLOW_IMPURITIES'.
* guix/build/gnu-build-system.scm (set-paths): Set
'GUIX_LD_WRAPPER_ALLOW_IMPURITIES'.
Suggested by Mark H Weaver <mhw@netris.org>.
* guix/build/gnu-build-system.scm (dump-file-contents): New procedure.
(%test-suite-log-regexp): New variable.
(check): Add #:test-suite-log-regexp. Catch 'invoke-error?' and call
'dump-file-contents' upon error.
This is a followup to commit 9a87649c86.
* guix/build/gnu-build-system.scm (strip)[strip-dir]: If an invoke error
occurs, issue a warning and continue to the next file. This restores the
tolerance of stripping errors prior to commit 9a87649.
Suggested by Dave Love <fx@gnu.org>.
* guix/build-system/gnu.scm (%license-file-regexp): New variable.
(gnu-build): Add #:license-file-regexp and use it.
(gnu-cross-build): Likewise.
* guix/build/gnu-build-system.scm (%license-file-regexp): New variable.
(install-license-files): New procedure.
(%standard-phases): Add it.
The compress-documentation phase was breaking recursive symbolic links used
for manuals, which was made visible by the `find-files' call in the recently
added `manual-database' profile hook. See <http://bugs.gnu.org/26771>.
* guix/build/gnu-build-system.scm (compress-documentation)
[points-to-symbolic-link?]: New procedure.
[maybe-compress-directory]: Use `points-to-symbolic-link?' to filter out
symbolic links that shouldn't be retargetted, and re-order the calls to
`retarget-symlink' and `documentation-compressor'.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* 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.
This avoids a situation where the "debug" output would contain separate
(and different) .debug files for "libfoo.so" and "libfoo.so.0.0", even
though "libfoo.so" is actually a symlink to "libfoo.so.0.0".
* guix/build/gnu-build-system.scm (strip): Remove 'file-exists?' call in
'for-each' lambda. Pass a predicate to 'find-files' to restrict the
result to regular files.
This is a followup to 13a9feb5b64fd819eaed38a17da0284bbe2b8d9.
* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove call
to 'remove'. Pass a second argument to 'find-files' to filter out
symlinks; pass #:stat lstat.
(patch-generated-file-shebangs): Likewise, and also filter out
non-executable files.
This fixes a bug whereby the choice between stripping 'libfoo.so.0.1.2'
and stripping 'libfoo.so' (the symlink) would be non-deterministic.
* guix/build/gnu-build-system.scm (strip)[strip-dir]: Use 'find-files'
instead of 'file-system-fold' so that files are picked in deterministic
order.
This phase is inherited by other build systems, which ensures
'SOURCE_DATE_EPOCH' is always set in practice.
* guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): Remove.
(%standard-phases): Don't add it.
* guix/build/gnu-build-system.scm (set-SOURCE-DATE-EPOCH): New
procedure.
(%standard-phases): Add it.
(gnu-build): Remove 'setenv' call for "SOURCE_DATE_EPOCH".
This is a followup to 3eb34c6.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Use
"--enable-deterministic-archives" instead of "-D" to work around
Binutils bug <https://sourceware.org/bugzilla/show_bug.cgi?id=17671>.
* guix/build/gnu-build-system.scm (strip): Likewise.
* guix/build/gnu-build-system.scm (gnu-build)[elapsed-time]: New
procedure.
Use it, and use (current-time time-monotonic) instead
of (gettimeofday). Show one digit after the comma for the elapsed
time.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Accept #:build
keyword argument. Pass it to 'gnu-build' on the build side.
* guix/build/gnu-build-system.scm (configure): Accept #:build keyword
argument. Unless it is false, pass --build to configure.
Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <tcech@suse.cz>.
* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove files
that don't pass 'file-exists?'.
(patch-generated-file-shebangs): Likewise.
* guix/build/gnu-build-system.scm (gnu-build): Leave
%DEFAULT-PORT-CONVERSION-STRATEGY unchanged when 'string->bytevector'
fails to convert to ISO-8859-1. This is an attempt to work around the
build failures at <http://hydra.gnu.org/build/263002>.
Suggested by Mark H Weaver.
* guix/build/gnu-build-system.scm (gnu-build): Set
%DEFAULT-PORT-CONVERSION-STRATEGY to 'error.
* guix/packages.scm (patch-and-repack)[builder]: Likewise.
Suggested by Mark H Weaver.
* guix/build/utils.scm (locale-category->string): New procedure.
* guix/build/gnu-build-system.scm (install-locale): Add 'setenv' call.
* guix/build/gnu-build-system.scm (install-locale): New procedure.
(%standard-phases): Add it.
* guix/build-system/gnu.scm (gnu-build): Add #:locale and pass it to
the build script.
(gnu-cross-build): Likewise.
Fixes <http://bugs.gnu.org/19866>.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/build/gnu-build-system.scm (unpack): Use 'unzip' when SOURCE ends
in '.zip'.
* guix/build/utils.scm (patch-/usr/bin/file): New procedure.
* guix/build/gnu-build-system.scm (patch-usr-bin-file): Rewrite using
it. Patch all the files returned by 'find-files' that are executable.
* gnu/packages/gawk.scm (gawk)[arguments]: Remove use of 'substitute*'
for 'extension/configure'.
Fixes <http://bugs.gnu.org/18895>.
* guix/build/gnu-build-system.scm (patch-shebangs): Add #:inputs
parameter. Remove 'bindirs'. Add 'bin-directories',
'output-bindirs', and 'input-bindirs'. Use them instead of (getenv
"PATH") to as the argument to 'patch-shebang'.
This is a followup to 856ae5e. See <http://hydra.gnu.org/build/180506>
for an example of build failure.
* guix/build/gnu-build-system.scm (strip): Add #:archive-strip-flags
parameter. Use it when (ar-file? path).
* guix/build-system/gnu.scm (gnu-build): Add #:archive-strip-flags
parameter and pass it down.
* gnu/packages/commencement.scm (gcc-boot0)[arguments]: Add
#:strip-flags.
* gnu/packages/base.scm (glibc)[arguments]: Likewise.
This saves 19% on the 'bin' directory of Coreutils, and certainly
helpful for things like Git's 'libexec' directory.
* guix/build-system/gnu.scm (gnu-build): Change default value for
#:strip-flags to '("--strip-all").
* guix/build/gnu-build-system.scm (strip): Ditto.
* gnu/packages/linux.scm (linux-libre)[arguments]: Add #:strip-flags.
Partly fixes <http://bugs.gnu.org/18033>.
* guix/build/utils.scm (search-path-as-list): Rename 'sub-directories'
parameter to 'files'. Add #:type parameter and honor it.
(set-path-environment-variable): Likewise. Pass #:type to
'search-path-as-list'.
* guix/packages.scm (search-path-specification->sexp): Add 'directory as
the last item of the tuple.
* guix/build/gnu-build-system.scm (set-paths): Add 'type' to search-path
pattern. Pass #:type to 'set-path-environment-variable'.
* guix/build/gnu-build-system.scm (strip): Check whether 'file-exists?'
before calling 'elf-file?' and 'ar-file?'. This should fix build
failures in the presence of dangling symlinks, as in
<http://hydra.gnu.org/build/167521/nixlog/1/raw>.