Fixes <https://bugs.gnu.org/32686>.
Reported by Oleg Pykhalov <go.wigust@gmail.com>.
* guix/build/profiles.scm (ensure-writable-directory): Add #:symlink.
[absolute?]: New procedure.
[unsymlink]: Use it to determine how to resolve readlink's result.
(build-profile): Pass SYMLINK to 'ensure-writable-directory'.
* tests/profiles.scm ("profile-derivation when etc/ is a relative symlink"):
New test.
Fixes <https://bugs.gnu.org/19973>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/build/debug-link.scm: New file.
* guix/build/graft.scm (%graft-hooks): New variable.
(graft): Add #:hooks and honor it.
* guix/grafts.scm (graft-derivation/shallow): Add (guix build
debug-link) and (guix elf) to #:modules.
* tests/debug-link.scm: New file.
* Makefile.am (MODULES): Add guix/build/debug-link.scm.
(SCM_TESTS): Add tests/debug-link.scm.
Previously, if the tests didn't pass, the check phase would evaluate to #f,
but the package would be built sucessfully. This changes all the phases to
raise exceptions if errors are encountered, and return #t otherwise.
This involves using invoke rather than system*, so that exceptions are raised
if the program exits with a status other than 0, and also returning #t at the
end of functions.
* gnu/build/ruby-build-system.scm (unpack): Use invoke rather than system*,
and return #t at the end.
(build, check): Use invoke rather than system*.
(install): Remove the use of "and", and rewrite the error handling to raise an
exception.
(wrap): Return #t.
* guix/profiles.scm (manifest-search-paths): New procedure.
(profile-derivation)[builder]: Use it.
* guix/build/profiles.scm (build-etc/profile): Remove $PATH.
* guix/build/store-copy.scm (store-info): Export.
* guix/store/database.scm (register-items): New procedure.
(register-path): Implement in terms of 'register-items'.
* gnu/build/install.scm (register-closure): Use 'register-items' instead
of 'for-each' and 'register-path'.
The previous implementation of 'read-reference-graph' was good enough
for many use cases, but it discarded the graph structure, which is
useful information in some cases.
* guix/build/store-copy.scm (<store-info>): New record type.
(read-reference-graph): Rewrite to return a list of <store-info>.
(closure-size, populate-store): Adjust accordingly.
* gnu/services/base.scm (references-file): Adjust accordingly.
* gnu/system/vm.scm (system-docker-image): Likewise.
* guix/scripts/pack.scm (squashfs-image, docker-image): Likewise.
* tests/gexp.scm ("gexp->derivation #:references-graphs"): Likewise.
Until now we'd get pointless messages like:
warning: collision encountered:
/gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache
/gnu/store/…-inkscape-0.92.3/share/icons/hicolor/icon-theme.cache
warning: choosing /gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache
* guix/build/union.scm (%harmless-collisions): New variable.
(warn-about-collision): Honor it.
* guix/build/union.scm (symlink-relative): New procedure.
* guix/build/profiles.scm: Re-export it.
(build-profile): Add #:symlink and pass it to 'union-build'.
* guix/profiles.scm (profile-derivation): Add #:relative-symlinks?.
Pass #:symlink to 'build-profile'.
* tests/profiles.scm ("profile-derivation relative symlinks, one entry")
("profile-derivation relative symlinks, two entries"): New tests.
* guix/build/union.scm (%not-slash): New variable.
(relative-file-name): New procedure.
* tests/union.scm (test-relative-file-name): New macro and tests.
Fixes <https://bugs.gnu.org/31374>.
* guix/build/ant-build-system.scm (generate-jar-indices): New procedure.
(%standard-phases)[generate-jar-indices]: New phase.
Byte compilation failures were ignored prior to this change.
* guix/build/emacs-utils.scm (emacs-byte-compile-directory): Fail when there
are compilation errors.
Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
Previously we could end up with only a subset of the modules built.
Fixes <https://bugs.gnu.org/31329>.
* guix/build/compile.scm (call/exit-on-exception): New procedure.
(exit-on-exception): New macro.
(compile-files): Use it.
* guix/build/emacs-utils.scm: Use (guix build utils) for invoke.
(emacs-batch-eval, emacs-batch-edit-file): Replace system* with invoke.
* guix/build/emacs-build-system.scm (make-autoloads): No need to return #t
explicitly since emacs-generate-autoloads now uses invoke.
Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
* guix/build/emacs-build-system.scm (set-emacs-load-path): Include Emacs Lisp
directories from all inputs. Also, add the unpacked source directory to
EMACSLOADPATH.
(emacs-inputs, emacs-inputs-directories, emacs-input->el-directory,
emacs-inputs-el-directories): Remove.
(%standard-phases): Move set-emacs-load-path phase to after unpack phase.
Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
* guix/build/union.scm (warn-about-collision): New procedure.
(union-build): Add #:resolve-collision.
[resolve-collisions]: Call it.
* tests/union.scm ("union-build collision first & last"): New test.