Skip to content

Commit

Permalink
build: Auto-compile tests.
Browse files Browse the repository at this point in the history
With this change, tests run in 46s instead of 230s on my x86_64 laptop
when using ‘guix build -f guix.scm’.

* build-aux/guile.am (.scm.go): Set GUILE_AUTO_COMPILE=0.
* Makefile.am (TESTS_ENVIRONMENT): Set GUILE_AUTO_COMPILE=1 and
XDG_CACHE_HOME.
* guix.scm (guile-fibers)[arguments]: Remove.
  • Loading branch information
civodul committed Nov 17, 2024
1 parent 1237050 commit 45fa498
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 8 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ TESTS += \
tests/concurrent-web-server.scm
endif

TESTS_ENVIRONMENT=top_srcdir="$(abs_top_srcdir)" ./env $(GUILE) -s
# Tests are calibrated to be compiled (they're much slower when
# interpreted) so make sure they can be auto-compiled upon 'make
# check'.
TESTS_ENVIRONMENT = \
top_srcdir="$(abs_top_srcdir)" \
XDG_CACHE_HOME="$(abs_top_builddir)/tests" \
GUILE_AUTO_COMPILE=1 \
"$(top_builddir)/env" $(GUILE) -s

EXTRA_DIST += \
$(bin_SCRIPTS) \
Expand Down
2 changes: 1 addition & 1 deletion build-aux/guile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
SUFFIXES = .scm .go
.scm.go:
$(AM_V_GEN) $(top_builddir)/env \
$(AM_V_GEN) GUILE_AUTO_COMPILE=0 $(top_builddir)/env \
$(GUILE_TOOLS) compile $(GUILE_TARGET) -L "$(abs_top_srcdir)" \
$(GUILE_WARNINGS) -o "$@" "$<"
8 changes: 0 additions & 8 deletions guix.scm
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@
"texinfo" "gettext-minimal"))))
(inputs
(list (S "guile")))
(arguments
`(#:phases (modify-phases %standard-phases
(add-before 'configure 'bootstrap
(lambda _
(zero? (system* "./autogen.sh"))))
(add-before 'configure 'setenv
(lambda _
(setenv "GUILE_AUTO_COMPILE" "0"))))))
(synopsis "Lightweight concurrency facility for Guile")
(description
"Fibers is a Guile library that implements a a lightweight concurrency
Expand Down

0 comments on commit 45fa498

Please sign in to comment.