Commit Graph

26 Commits

Author SHA1 Message Date
Ludovic Courtès 03d76577b9
tests: Make builds less expensive.
The switch to the reduced bootstrap broke build time assumptions made by
tests, notably the assumption that GNU-MAKE-BOOT0 was cheap to build.
This commit adjusts this to make these tests cheaper.

* gnu/packages/bootstrap.scm (%bootstrap-inputs-for-tests): New variable.
* guix/tests.scm (gnu-make-for-tests): New variable.
* tests/guix-environment.sh: Use GNU-MAKE-FOR-TESTS instead of
GNU-MAKE-BOOT0.  Remove test with FINDUTILS-BOOT0.
* tests/guix-package-net.sh (boot_make): Use GNU-MAKE-FOR-TESTS.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/profiles.scm ("profile-derivation relative symlinks, two entries"):
Likewise.
* tests/union.scm (%bootstrap-inputs): Remove.
("union-build"): Use %BOOTSTRAP-INPUTS-FOR-TESTS instead of
%BOOTSTRAP-INPUTS.
2019-06-14 21:57:39 +02:00
Jan Nieuwenhuizen c362904485
bootstrap: %bootstrap-inputs+toolchain: Replace %bootstrap-inputs.
* gnu/packages/commencement.scm (%bootstrap-inputs+toolchain): : New procedure
replacing %bootstrap-inputs to prepare for Mes bootstrap.  Update users.
* tests/union.scm (%bootstrap-inputs): New variable: set to
%bootstrap-inputs+toolchain.
2018-09-23 09:46:25 +02:00
Jan Nieuwenhuizen a2b2070b67
bootstrap: %bootstrap-inputs: Wrap input lists into thunks.
* gnu/packages/bootstrap.scm (%bootstrap-inputs): Change to procedure.  Update
users; prepares for Mes bootstrap.
* gnu/packages/commencement.scm (%boot0-inputs, %boot1-inputs, %boot2-inputs,
%boot3-inputs, %boot4-inputs, %boot5-inputs, %boot-6-inputs): Change to
procedure.  Update users.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths): Make a
procedure, filter on package?.  Update users.
2018-09-22 22:40:12 +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
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
Huang Ying addce19e2d
union: Add create-all-directories? parameter to 'union-build'.
* guix/build/union.scm (union-build): Add create-all-directories? keyword
parameter.
* tests/union.scm ("union-build #:create-all-directories? #t"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-03-26 12:53:48 +02:00
Mathieu Lirzin a9edb211e7 build: Add a Guile custom test driver using SRFI-64.
Before that '.log' files for scheme tests were fragmented and not
included in test-suite.log.  This unifies the semantics of SRFI-64 API
with Automake test suite.

* build-aux/test-driver.scm: New file.
* Makefile.am (SCM_LOG_DRIVER, AM_SCM_LOG_DRIVER_FLAGS): New variables.
(SCM_LOG_COMPILER, AM_SCM_LOG_FLAGS): Delete variables.
(AM_TESTS_ENVIRONMENT): Set GUILE_AUTO_COMPILE to 0.
* test-env.in: Silence guix-daemon.
* doc/guix.texi (Running the Test Suite): Describe how to display the
detailed results.  Bug reports require only 'test-suite.log' file.
* tests/base32.scm, tests/build-utils.scm, tests/builders.scm,
tests/challenge.scm, tests/cpan.scm, tests/cpio.scm, tests/cran.scm,
tests/cve.scm, tests/derivations.scm, tests/elpa.scm,
tests/file-systems.scm, tests/gem.scm, tests/gexp.scm,
tests/gnu-maintenance.scm, tests/grafts.scm, tests/graph.scm,
tests/gremlin.scm, tests/hackage.scm, tests/hash.scm,
tests/import-utils.scm, tests/lint.scm, tests/monads.scm, tests/nar.scm,
tests/packages.scm, tests/pk-crypto.scm, tests/pki.scm,
tests/profiles.scm, tests/publish.scm, tests/pypi.scm,
tests/records.scm, tests/scripts-build.scm, tests/scripts.scm,
tests/services.scm, tests/sets.scm, tests/size.scm, tests/snix.scm,
tests/store.scm, tests/substitute.scm, tests/syscalls.scm,
tests/system.scm, tests/ui.scm, tests/union.scm, tests/upstream.scm,
tests/utils.scm: Don't exit at the end of test groups.
* tests/containers.scm: Likewise.  Use 'test-skip' instead of exiting
with error code 77.
2016-04-03 14:19:09 +02:00
Ludovic Courtès 12d720fd1a tests: Factorize the network reachability test.
* guix/tests.scm (network-reachable?): New procedure.
* tests/builders.scm (network-reachable?): Remove.
  Replace references to it with calls to the new 'network-reachable?'
  procedure.
* tests/derivations.scm (%coreutils): Use 'network-reachable?' instead
  of 'getaddrinfo'.
* tests/packages.scm: Likewise.
* tests/union.scm: Likewise.
2015-02-24 00:01:34 +01:00
Ludovic Courtès c1bc358f29 Factorize test suite support in (guix tests).
* guix/tests.scm: New file.
* Makefile.am (noinst_DATA): New variable.
  (GOBJECTS): Add guix/tests.go.
* tests/builders.scm (%store): Use 'open-connection-for-tests'
  from (guix tests).
* tests/derivations.scm: Likewise.
* tests/monads.scm: Likewise.
* tests/packages.scm: Likewise.
* tests/profiles.scm: Likewise.
* tests/union.scm: Likewise.
* tests/gexp.scm: Likewise.
  (guile-for-build): Remove.  Use (%guile-for-build) instead.
* tests/nar.scm (make-random-bytevector, %seed, random-text): Remove.
  (populate-file): Change 'make-random-bytevector' to 'random-bytevector'.
  Use (guix tests).
* tests/store.scm (%seed, random-text): Remove.
  Use (guix tests).
2014-08-23 22:33:04 +02:00
Ludovic Courtès a53a9aed93 tests: Add 'union-build' test for <http://bugs.gnu.org/17083>.
* tests/union.scm ("union-build with symlink to directory"): New test.
2014-04-02 23:08:44 +02:00
Mark H Weaver 1212999868 union: Rewrite to be faster; handle symlink/directory conflicts.
* guix/build/union.scm: Rewrite; only 'file=?' remains unchanged.  Remove
  'tree-union' and 'delete-duplicate-leaves' exports.  Merge inputs in a
  breadth-first fashion.  Follow symlinks for purposes of making decisions
  about the merge.

* tests/union.scm: Remove tests of 'tree-union' and 'delete-duplicate-leaves'.
2014-04-02 15:31:46 -04:00
Ludovic Courtès dd1a5a152c derivations: Use more keyword parameters for 'build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): Turn 'system' and
  'inputs' into keyword parameters.
  Adjust callers accordingly.
* gnu/system/linux.scm, gnu/system/vm.scm, guix/build-system/cmake.scm,
  guix/build-system/gnu.scm, guix/build-system/perl.scm,
  guix/build-system/python.scm, guix/build-system/trivial.scm,
  guix/download.scm, guix/packages.scm, guix/profiles.scm,
  guix/scripts/pull.scm, tests/derivations.scm, tests/guix-build.sh,
  tests/monads.scm, tests/store.scm, tests/union.scm: Adjust users of
  'build-expression->derivation' and 'derivation-expression'
  accordingly.
* doc/guix.texi (Derivations): Adjust 'build-expression->derivation'
  documentation accordingly.
  (The Store Monad): Likewise for 'derivation-expression'.
2013-12-04 16:07:53 +01:00
Ludovic Courtès 127ed6a9dd tests: Adjust to bootstrap tarball updates.
Reported by Mark H. Weaver <mhw@netris.org>.

* tests/packages.scm ("package-source-derivation, snippet"): Change to
  "guile-2.0.9.tar.xz".
* tests/union.scm ("union-build"): Check or include/c++ being a symlink.
2013-11-16 22:10:03 +01:00
Ludovic Courtès 59688fc4b5 derivations: 'derivation' and related procedures return a single value.
* guix/derivations.scm (derivation->output-path,
  derivation->output-paths): New procedures.
  (derivation-path->output-path): Use 'derivation->output-path'.
  (derivation-path->output-paths): Use 'derivation->output-paths'.
  (derivation): Accept 'derivation?' objects as inputs.  Return a single
  value.
  (build-derivations): New procedure.
  (compiled-modules): Use 'derivation->output-paths'.
  (build-expression->derivation)[source-path]: Add case for when the
  input matches 'derivation?'.
  [prologue]: Accept 'derivation?' objects in INPUTS.
  [mod-dir, go-dir]: Use 'derivation->output-path'.
* guix/download.scm (url-fetch): Adjust to the single-value return.
* guix/packages.scm (package-output): Use 'derivation->output-path'.
* guix/scripts/build.scm (guix-build): When the argument is
  'derivation-path?', pass it through 'read-derivation'.
  Use 'derivation-file-name' to print out the .drv file names, and to
  register them.  Use 'derivation->output-path' instead of
  'derivation-path->output-path'.
* guix/scripts/package.scm (roll-back): Adjust to the single-value
  return.
  (guix-package): Use 'derivation->output-path'.
* guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?'
  objects instead of .drv file names.
* gnu/system/grub.scm (grub-configuration-file): Use
  'derivation->output-path' instead of 'derivation-path->output-path'.
* gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise.
* tests/builders.scm, tests/derivations.scm, tests/packages.scm,
  tests/store.scm, tests/union.scm: Adjust to the new calling
  convention.
* doc/guix.texi (Defining Packages, The Store, Derivations): Adjust
  accordingly.
2013-09-18 18:49:53 +02:00
Ludovic Courtès 43dd92024a union: Don't traverse sub-directories only found in one element of the union.
This significantly reduces I/O when building profiles, especially with
lots of package-specific sub-directories (such as 'share/emacs/24.3',
'texmf', etc.)

* guix/build/union.scm (union-build)[file-tree](others-have-it?): New
  procedure.  Use it in the 'enter?' parameter of 'file-system-fold';
  change 'skip' parameter accordingly.
* tests/union.scm ("union-build"): Ensure that 'include' is a symlink
  and 'bin' is a directory.
2013-09-02 23:04:25 +02:00
Ludovic Courtès 6211223021 union: Delete duplicates when passed the same input several times.
* guix/build/union.scm (union-build): Prepend "." to the result of
  `union-tree', to match the expectations of `delete-duplicate-leaves'.
  Don't do mkdir when SUBDIR is ".".
* tests/union.scm ("union-build"): Keep duplicates in %BOOTSTRAP-INPUTS.
2013-02-06 23:04:10 +01:00
Ludovic Courtès 0bdba772ca Augment `.dir-locals.el'.
* .dir-locals.el: Add more Scheme settings.
* guix-build.in, tests/base32.scm, tests/build-utils.scm,
  tests/builders.scm, tests/derivations.scm, tests/packages.scm,
  tests/snix.scm, tests/store.scm, tests/union.scm, tests/utils.scm:
  Remove redundant Emacs local variable settings.
2013-02-01 13:16:45 +01:00
Ludovic Courtès 1ffa7090b9 distro: Change the module name space to (gnu ...).
* distro: Rename to...
* gnu: ... this.  Update module names accordingly.
* Makefile.am: Adjust accordingly.
* po/POTFILES.in: Likewise.
* distro.scm: Search for files under /gnu/packages instead of
  /distro/packages.
* gnu/packages/base.scm (ld-wrapper-boot3): Likewise.
2013-01-18 01:07:31 +01:00
Ludovic Courtès 01e354eb83 Merge branch 'core-updates'
Conflicts:
	guix/build/union.scm
2013-01-11 16:01:49 +01:00
Ludovic Courtès b2d58cd80a union: Detect collisions, and delete duplicate leaves.
* guix/build/union.scm (delete-duplicate-leaves): New procedure.
  (union-build)[leaf=?, resolve-collision]: New procedures.
  Use `delete-duplicate-leaves' on the result of `tree-union'.
* tests/union.scm ("delete-duplicate-leaves, default",
  "delete-duplicate-leaves, file names"): New tests.
2013-01-09 22:10:06 +01:00
Ludovic Courtès 4050e5d6cf Merge branch 'master' into core-updates
Conflicts:
	build-aux/download.scm
	distro/packages/autotools.scm
	distro/packages/base.scm
	distro/packages/bootstrap.scm
	distro/packages/lsh.scm
	distro/packages/make-bootstrap.scm
	distro/packages/ncurses.scm
	distro/packages/perl.scm
	tests/derivations.scm
	tests/union.scm
2013-01-06 17:33:02 +01:00
Ludovic Courtès 233e76769a Update license headers.
Change all license headers, except guix/build/* and ld-wrapper.scm, with
this code:

  (use-modules (guix build utils)
	       (srfi srfi-1))

  (fluid-set! %default-port-encoding "UTF-8")

  (substitute* (remove (lambda (f)
			 (or (string-contains f ".tar.")
			     (string-contains f ".git/")
			     (string-contains f ".so")
			     (string-suffix? ".o" f)
			     (string-suffix? ".a" f)
			     (string-suffix? ".go" f)
			     (string-suffix? ".pdf" f)
			     (string-suffix? ".png" f)
			     (string-suffix? ".info" f)
			     (equal? (basename f) "guix-daemon")
			     (equal? (basename f) "nix-setuid-helper")
			     (string-contains f "nix-upstream/")
			     (string-contains f "distro/packages/bootstrap/")))
		       (find-files "." "\\.[a-z]+$"))
    (("^([[:graph:]]+) This file is part of Guix." _ comment-start)
     (string-append comment-start " This file is part of GNU Guix."))
    (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start)
     (string-append comment-start
		    " GNU Guix --- Functional package management for GNU\n"))
    (("^([[:graph:]]+) Guix is " _ comment-start)
     (string-append comment-start " GNU Guix is "))
    (("^([[:graph:]]+) along with Guix." _ comment-start)
     (string-append comment-start " along with GNU Guix."))
    (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start)
     (string-append comment-start " Copyright ©")))

Change headers using C-style comments manually.
2013-01-06 00:47:50 +01:00
Ludovic Courtès 97d3998e7a tests: Adjust to not rely on /bin/sh.
* tests/derivations.scm (%bash): New variable.
  Replace occurrences of "/bin/sh" by %BASH.
* tests/union.scm ("union-build"): Delete duplicates from
  %BOOTSTRAP-INPUTS.
2013-01-02 01:04:37 +01:00
Ludovic Courtès ad1ebab379 tests: Skip network-dependent tests when the network is unreachable.
* tests/builders.scm (network-reachable?): New variable.
  ("url-fetch", "gnu-build"): Skip unless NETWORK-REACHABLE?.
* tests/derivations.scm (%coreutils): Check for network access.
  ("build-expression->derivation with one input"): Skip when %COREUTILS
  is #f.
* tests/guix-package.sh: Skip installation of GNU Make when the network
  is unreachable.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/union.scm ("union-build"): Likewise.
2012-12-13 22:06:45 +01:00
Ludovic Courtès 18633d4f35 distro: Move bootstrap packages to (distro packages bootstrap).
* distro/packages/base.scm (glibc-dynamic-linker, %bootstrap-guile,
  bootstrap-origin, package-from-tarball, %bootstrap-base-url,
  %bootstrap-coreutils&co, %bootstrap-binutils, %bootstrap-glibc,
  %bootstrap-gcc, %bootstrap-inputs, package-with-bootstrap-guile): Move
  to ...
* distro/packages/bootstrap.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* tests/builders.scm: Use (distro packages bootstrap).
  (%bootstrap-guile): Remove.
* tests/packages.scm: Likewise.
* tests/union.scm: Likewise, and remove @@ to access %bootstrap-inputs.
* tests/derivations.scm: Use (distro packages bootstrap) and remove @@
  to access %bootstrap-coreutils&co.
* HACKING (When the platform is supported by Nixpkgs): Update
  accordingly.
2012-11-04 22:04:41 +01:00
Ludovic Courtès c8c88afaa1 Add (guix build union).
* guix/build/union.scm, tests/union.scm: New files.
* Makefile.am (MODULES): Add `guix/build/union.scm'.
  (TESTS): Add `tests/union.scm'.
2012-10-29 22:39:46 +01:00