Commit Graph

12 Commits

Author SHA1 Message Date
Ludovic Courtès 38302bd939
compile: Report the name of the file that cannot be compiled.
Fixes <https://bugs.gnu.org/36640>.
Reported by Robert Vollmert <rob@vllmrt.net>.

* guix/build/compile.scm (call/exit-on-exception): Add 'file' parameter
and honor it.
(exit-on-exception): Likewise.
(compile-files): Pass FILE to 'exit-on-exception'.
2019-07-15 10:00:12 +02:00
Ludovic Courtès e429566fbb
build: Use '-Wshadowed-toplevel' only when supported.
* guix/build/compile.scm (supported-warning-type?): New procedure.
(%warnings): Remove 'unsupported-warning', though removing it doesn't
make any difference.  Define 'optional', and use it to determine whether
to include 'shadowed-toplevel'.
2019-07-12 23:54:19 +02:00
Ludovic Courtès 77c2899cd4
compile: Enable 'shadowed-toplevel' warning.
* guix/build/compile.scm (%warnings): Add 'shadowed-toplevel'.
2019-06-25 17:41:24 +02:00
Ludovic Courtès b2cddc6fb1
compile: Adjust for Guile 3.
* guix/build/compile.scm (%default-optimizations): Adjust to the new
names in Guile 2.9.2.
2019-06-02 01:38:36 +02:00
Ludovic Courtès c498aaaf11
compile: Let compiler warnings through during the load phase.
Previous warnings and errors such as those raised by (guix records)
would not be displayed during the load phase.

* guix/build/compile.scm (load-files): Remove 'parameterize' around
'resolve-interface' call.
(compile-files)[build]: Move 'with-fluids' for *CURRENT-WARNING-PREFIX*
to...
<top level>: ... here.
2019-01-22 23:04:05 +01:00
Ludovic Courtès a65177a657
maint: Remove 'cond-expand' forms for Guile 2.0.
Note: Leave 'cond-expand' forms used in the build-side modules that can
run on %BOOTSTRAP-GUILE, which is currently Guile 2.0.

* guix/build/compile.scm: Move 'use-modules' clause from 'cond-expand'
to 'define-module' form.
(%default-optimizations): Remove 'cond-expand'.
* guix/build/download.scm (tls-wrap): Remove 'cond-expand'.
* guix/build/syscalls.scm: Remove 'cond-expand' form around
'%set-automatic-finalization-enabled?!' and
'without-automatic-finalization'.
* guix/inferior.scm (port->inferior): Remove 'cond-expand'.
* guix/scripts/pack.scm (wrapped-package)[build]: Remove 'cond-expand'.
* guix/status.scm (build-event-output-port): Remove 'cond-expand'.
* guix/store.scm (open-inet-socket): Remove 'cond-expand'.
* guix/ui.scm (install-locale): Remove 'cond-expand'.
* tests/status.scm ("current-build-output-port, UTF-8 + garbage"):
Remove 'cond-expand'.
* tests/store.scm ("current-build-output-port, UTF-8 + garbage"):
Remove 'cond-expand'.
2019-01-09 14:47:53 +01: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
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
Ludovic Courtès a5792deca5
compile: Put an upper bound on the number of workers.
* guix/build/compile.scm (compile-files): Don't use more than 8 workers.
2017-11-20 23:42:55 +01:00
Ludovic Courtès c9405c461b
compile: Fix VPATH builds.
Fixes <https://bugs.gnu.org/29091>.
Reported by Eric Bavier <bavier@cray.com>.

* guix/build/compile.scm (relative-file): New procedure.
(load-files): Use it before calling 'file-name->module-name'.
(compile-files): Likewise before calling 'scm->go'.
* guix/build/pull.scm (build-guix): Remove 'with-directory-excursion'
and file name hack from ce33c3af76.
Pass OUT to 'all-scheme-files'.
2017-11-07 00:12:10 +01:00
Ludovic Courtès 7a51c78c6e
discovery: Move 'file-name->module-name' to (guix modules).
* guix/discovery.scm (file-name->module-name): Move to...
* guix/modules.scm (file-name->module-name): ... here.
* guix/build/compile.scm: Use (guix modules) instead of (guix discovery).
2017-10-22 22:09:00 -07:00
Ludovic Courtès 2890ad332f
build: Factorize module compilation in (guix build compile).
* guix/build/compile.scm: New file.
* Makefile.am (MODULES): Add it.
* build-aux/compile-all.scm: Use it.
(warnings, file->module, load-module-file)
(%default-optimizations, %lightweight-optimizations)
(optimization-options, compile-file*): Remove.
<top level>: Use 'compile-files'.
* guix/build/pull.scm (%default-optimizations)
(%lightweight-optimizations, optimization-options): Remove.
(build-guix): Rewrite as a call to 'compile-files'.
* guix/discovery.scm (file-name->module-name): Export.
2017-10-22 22:09:00 -07:00