Commit Graph

814 Commits

Author SHA1 Message Date
Ludovic Courtès 2225d56a14
profiles: Correctly deal with etc/ being a relative symlink.
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.
2018-09-11 00:14:58 +02:00
Ludovic Courtès f8121329b1
syscalls: Report lack of a libc symbol as ENOSYS.
* guix/build/syscalls.scm (syscall->procedure): Throw to 'system-error
with ENOSYS when NAME cannot be found.
2018-09-10 17:47:52 +02:00
Ludovic Courtès 93c333895a
grafts: Add (guix build debug-link) and use it.
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.
2018-08-24 18:01:05 +02:00
Ludovic Courtès e4297aa8b9
grafts: Add high-level 'graft' procedure on the build side.
* guix/build/graft.scm (graft): New procedure.
* guix/grafts.scm (graft-derivation/shallow)[build]: Use it instead of
inline code.
2018-08-24 17:57:56 +02:00
Marius Bakke 1af575f04d
Merge branch 'master' into staging 2018-07-28 18:34:59 +02:00
Marius Bakke 94eb59fb4a
build-system/meson: Remove RUNPATH workarounds.
* guix/build-system/meson.scm (default-patchelf): Remove.
(lower)[build-inputs]: Remove PATCHELF.
(meson-build): Don't delete 'fix-runpath' phase on armhf.
* guix/build/meson-build-system.scm (configure): Add "--c_link_args" and
  "-cpp_link_args" instead of setting LDFLAGS.
(meson-build): Don't apply 'fix-runpath' phase.
2018-07-28 14:54:18 +02:00
Danny Milosavljevic 8376f10a30
ruby-build-system: Make phase "replace-git-ls-files" handle more cases.
* guix/build/ruby-build-system.scm (replace-git-ls-files): Modify.
2018-07-24 22:55:38 +02:00
Ludovic Courtès 2a3b1b3235
build-system: Add 'guile-build-system'.
* guix/build-system/guile.scm, guix/build/guile-build-system.scm: New
files.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'guile-build-system'.
2018-07-23 12:25:31 +02:00
Leo Famulari 82549f2328
build-system/go: Use invoke instead of system*.
* guix/build/go-build-system.scm (unpack, build): Use invoke.
(install-source): Unconditionally return #t.
(check): Use invoke and unconditionally return #t.
2018-07-19 19:12:54 -04:00
Julien Lepiller 79d4d47b99
guix: ant-build-system: Reorder before generating INDEX.LIST.
* guix/build/ant-build-system.scm (%standard-phases): Add
reorder-jar-content phase.
2018-07-19 19:46:31 +02:00
Christopher Baines 0d354666d3
ruby-build-system: Error or return #t from all phases.
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.
2018-07-15 22:19:39 +01:00
Marius Bakke 49b6dc2b4e
Merge branch 'staging' 2018-07-13 00:25:45 +02:00
Danny Milosavljevic a59b0fa2d7
build-system/haskell: Make phases fail on error.
* guix/build/haskell-build-system.scm (configure): Make it fail on error.
(run-setuphs): Make it fail on error.
2018-07-11 02:45:53 +02:00
Ludovic Courtès f03df3ee75
profiles: Factorize 'manifest-search-paths'.
* guix/profiles.scm (manifest-search-paths): New procedure.
(profile-derivation)[builder]: Use it.
* guix/build/profiles.scm (build-etc/profile): Remove $PATH.
2018-07-11 00:52:36 +02:00
Marius Bakke 873325b030
Merge branch 'master' into staging 2018-07-08 23:58:22 +02:00
Ludovic Courtès 25c7ff6a3e
syscalls: Define AT_SYMLINK_NOFOLLOW et al.
* guix/build/syscalls.scm (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR)
(AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, AT_EMPTY_PATH): New variables.
* tests/syscalls.scm ("utime with AT_SYMLINK_NOFOLLOW"): New test.
2018-07-03 17:50:04 +02:00
Mark H Weaver 2c8ac3641a
gnu: java: Return #t from all phases and snippets.
* guix/build/java-utils.scm (ant-build-javadoc): Use invoke; return #t.
* guix/build/ant-build-system.scm (generate-jar-indices): Return #t and
remove vestigal plumbing.
* gnu/packages/java.scm (classpath-bootstrap, ant-bootstrap, classpath-devel)
(icedtea-6, icedtea-7, java-plexus-sec-dispatcher, ant/java8, clojure)
(java-classpathx-servletapi, java-swt, java-qdox-1.12, java-hamcrest-core)
(java-plexus-archiver, java-plexus-sec-dispatcher, java-modello-plugins-xml)
(java-asm, java-commons-collections, java-commons-bsf, java-slf4j-api)
(java-slf4j-api, java-slf4j-simple, java-stringtemplate-3)
(java-stringtemplate, antlr3, antlr3-3.3, antlr3-3.1, java-ops4j-base-lang)
(java-ops4j-pax-tinybundles, java-ops4j-pax-exam-core-spi)
(java-fasterxml-jackson-core, java-fasterxml-jackson-databind)
(java-fasterxml-jackson-modules-base-jaxb, java-ecj-3, java-ecj-3.5)
(java-fasterxml-jackson-dataformat-yaml, java-woodstox-core)
(java-fasterxml-jackson-dataformat-xml, java-testng, java-jnacl)
(java-bouncycastle, java-powermock-core, java-powermock-modules-junit4)
(java-jansi-native, java-jansi, java-commons-httpclient, java-commons-vfs)
(java-apache-ivy, java-janino, java-logback-core): Return #t from all phases
and snippets, use invoke where appropriate, and remove vestigial plumbing.
2018-06-28 03:55:37 -04:00
Mark H Weaver 0e6cce2e01
meson-build-system: Return #t from all phases.
* guix/build/meson-build-system.scm (configure, build, check, install):
(fix-runpath): Use 'invoke' and return #t from all phases.
2018-06-28 03:55:34 -04:00
Marius Bakke 0106d6b40d
Merge branch 'master' into staging 2018-06-19 17:02:16 +02:00
Ricardo Wurmus b194da0d68
build-system/waf: Use invoke.
* guix/build/waf-build-system.scm (call-waf): Use "invoke" and unconditionally
return #t.
2018-06-19 10:48:14 +02:00
Ludovic Courtès 870677cbb8
compile: Work around non-thread-safe module autoloading.
* guix/build/compile.scm <top level>: Set 'try-module-autoload' when
running on Guile < 2.2.4.
2018-06-18 23:19:51 +02:00
Gábor Boskovits 90ea1006a8
guix: ant-build-system: Use manifest task to create manifest.
* guix/build/ant-build-system.scm (default-build.xml): Use manifest task
to create manifest file instead of a custom echo task.
2018-06-18 17:08:32 +02:00
Marius Bakke 6969c4de44
Merge branch 'master' into staging 2018-06-18 15:29:38 +02:00
Ricardo Wurmus d7ee90fe90
build-system/ant: Unconditionally return #t in build phases.
* guix/build/ant-build-system.scm (unpack, build, strip-jar-timestamps, check,
install): Use invoke.

Signed-off-by: Gábor Boskovits <boskovits@gmail.com>
2018-06-16 20:51:32 +02:00
Ludovic Courtès 31a63be878
database: Add 'register-items'.
* 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'.
2018-06-14 11:17:00 +02:00
Ludovic Courtès 6892f0a247
store-copy: 'read-reference-graph' returns a list of records.
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.
2018-06-14 11:16:58 +02:00
Ricardo Wurmus babeea3f9f
build-system/r: Use invoke.
* guix/build/r-build-system.scm (invoke-r): Use invoke.
(pipe-to-r): Raise invoke-error on non-zero return value.
(check): Unconditionally return #t.
2018-05-31 13:24:17 +02:00
Mark H Weaver 0661758e13
Merge branch 'master' into core-updates 2018-05-21 13:22:32 -04:00
Ludovic Courtès 827c56515e
union: Do not warn about harmless collisions.
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.
2018-05-17 10:48:37 +02:00
Mark H Weaver 539bf8f2c0
Merge branch 'master' into core-updates 2018-05-17 01:00:50 -04:00
Ludovic Courtès e00ade3fb8
profiles: Optionally use relative file names for symlink targets.
* 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.
2018-05-10 14:53:57 +02:00
Ludovic Courtès dac1c97d13
union: Add 'relative-file-name'.
* guix/build/union.scm (%not-slash): New variable.
(relative-file-name): New procedure.
* tests/union.scm (test-relative-file-name): New macro and tests.
2018-05-10 14:53:56 +02:00
Danny Milosavljevic 3766aa921b
build-system: android-ndk: Let upstream install header files.
* guix/build/android-ndk-build-system.scm (install): Don't install header
files ourselves.
2018-05-10 01:06:22 +02:00
Danny Milosavljevic 9ed36cd3d6
build-system: android-ndk: Support unit tests.
* guix/build-system/android-ndk.scm (android-ndk-build): Add googletest.
* guix/build/android-ndk-build-system.scm (check): Check whether tests are
enabled.  Run root-level tests as well.
2018-05-10 01:06:22 +02:00
Danny Milosavljevic 436515cdb8
build: Add the Android NDK build-system.
* guix/build-system/android-ndk.scm: New file.
* guix/build/android-ndk-build-system.scm: New file.
* Makefile.am: Add them.
2018-05-09 19:16:04 +02:00
Danny Milosavljevic d6ac4d42ba
guix: ant-build-system: End "configure" phase with #t.
* guix/build/ant-build-system.scm (configure): End with #t.
2018-05-06 20:49:20 +02:00
Danny Milosavljevic bc65332a38
guix: ant-build-system: Create INDEX.LIST.
Fixes <https://bugs.gnu.org/31374>.

* guix/build/ant-build-system.scm (generate-jar-indices): New procedure.
(%standard-phases)[generate-jar-indices]: New phase.
2018-05-06 19:39:54 +02:00
Marius Bakke 12bd588346
Merge branch 'master' into core-updates 2018-05-06 15:56:24 +02:00
Maxim Cournoyer c1b4ad2e6e
build: emacs-utils: Fail when byte compilation fails.
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>
2018-05-03 21:48:59 +05:30
Ludovic Courtès 27e810c3e8
compile: Exit when an exception is thrown.
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.
2018-05-01 16:01:39 +02:00
Marius Bakke a9fe3882b9
Merge branch 'master' into staging 2018-04-25 15:53:41 +02:00
Mark H Weaver c52872bfc4
Merge branch 'master' into core-updates 2018-04-21 05:02:52 -04:00
Maxim Cournoyer facc0a96a1
build-system: emacs: Add improved check phase.
* guix/build-system/emacs.scm (emacs-build): Add #:test-command keyword
argument. Remove #:configure-flags and #:test-target keyword arguments.
* guix/build/emacs-build-system.scm (check): New procedure.
(%standard-phases): Register check phase after the build phase.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
2018-04-20 00:49:53 +05:30
Maxim Cournoyer 8a8fa82e72
build-system: emacs: Replace system* with invoke.
* 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>
2018-04-20 00:49:53 +05:30
Maxim Cournoyer b5904fcc34
build-system: emacs: Search all inputs for Emacs Lisp directories.
* 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>
2018-04-20 00:49:47 +05:30
Marius Bakke 5d904d63f4
Merge branch 'master' into staging 2018-04-16 18:15:28 +02:00
Marius Bakke 538d6d025c
build-system/meson: Don't override LDFLAGS if already set.
* guix/build/meson-build-system.scm (configure): Test for LDFLAGS before
adding ours.

(cherry picked from commit 611c27db2a)
2018-04-15 14:45:56 +02:00
Mark H Weaver f89aa1521a
Merge branch 'master' into core-updates 2018-04-10 00:42:22 -04:00
Ludovic Courtès e40aa54e98
union: Allow callers to choose the collision resolution policy.
* 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.
2018-04-08 17:41:08 +02:00
Marius Bakke 611c27db2a
build-system/meson: Don't override LDFLAGS if already set.
* guix/build/meson-build-system.scm (configure): Test for LDFLAGS before
adding ours.
2018-04-02 02:22:23 +02:00