Commit Graph

12 Commits (master)

Author SHA1 Message Date
Ludovic Courtès 845c44012c
guix build: '--with-commit' makes recursive checkouts.
This was an omission from commit
024a6bfba9.

* guix/scripts/build.scm (transform-package-source-commit): Add
'recursive?' field to SOURCE.
* tests/scripts-build.scm ("options->transformation, with-branch")
("options->transformation, with-commit"): New tests.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 14328b81a2
guix build: Transformation options match packages by spec.
This allows us to combine several transformations on a given package, in
particular '--with-git-url' and '--with-branch'.

Previously transformations would ignore each other since they would all
take (specification->package SOURCE) as their replacement source,
compare it by identity, which doesn't work if a previous transformation
has already changed SOURCE.

* guix/scripts/build.scm (evaluate-replacement-specs): Adjust to produce
an alist as expected by 'package-input-rewriting/spec', with a package
spec as the first element of each pair.
(evaluate-git-replacement-specs): Likewise.
(transform-package-inputs):  Adjust accordingly and use
'package-input-rewriting/spec'.
(transform-package-inputs/graft): Likewise.
(transform-package-source-branch, transform-package-source-commit): Use
'package-input-rewriting/spec'.
(transform-package-source-git-url): Likewise, and adjust the
REPLACEMENTS alist accordingly.
(options->transformation): Iterate over OPTS instead of over
%TRANSFORMATIONS.  Invoke transformations one by one.
* tests/scripts-build.scm ("options->transformation, with-input"):
Adjust test to compare packages by name rather than by identity.
("options->transformation, with-git-url + with-branch"): New test.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 880916ac52
guix build: Add '--with-git-url'.
* guix/scripts/build.scm (%not-equal): New variable.
(evaluate-git-replacement-specs): Use it instead of local variable
'not-equal'.
(transform-package-source-git-url): New procedure.
(%transformations): Add 'with-git-url'.
(%transformation-options, show-transformation-options-help): Add
'--with-git-url'.
* tests/scripts-build.scm ("options->transformation, with-git-url"):
New test.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 3e30cdf1c3
guix build: Support '--with-source=PACKAGE@VERSION=URI'.
* guix/scripts/build.scm (numeric-extension?, tarball-base-name): New
procedures, formerly in 'package-with-source'.
(transform-package-source)[new-sources]: Look for '=' in URI.  Each
element of the list of now a (PKG VERSION SOURCE) tuple.
Pass VERSION to 'package-with-source'.
(package-with-source): Add 'version' parameter and honor it.
* tests/scripts-build.scm ("options->transformation, with-source, PKG=URI")
("options->transformation, with-source, PKG@VER=URI"): New tests.
* doc/guix.texi (Package Transformation Options): Document the new
forms.
2017-12-23 00:05:05 +01:00
Ludovic Courtès 904c6c42eb
tests: Adjust to the addition of a new Coreutils version.
* tests/scripts-build.scm ("options->transformation, with-input"): Use
'specification->package' rather than refer to Coreutils by its
variable.  This is a followup to e162050dfc.
2017-04-21 22:53:59 +02:00
Ludovic Courtès 7c247809ef
guix build: '--with-source' overrides the 'replacement' of a package.
* guix/scripts/build.scm (package-with-source): Set 'replacement' to #f.
* tests/scripts-build.scm ("options->transformation, with-source,
replacement"): New test.
2016-12-21 23:48:14 +01:00
Ludovic Courtès 0d7034ca4f
tests: Fix typo in 'with-graft' transformation test.
This is a followup to 645b9df858.

* tests/scripts-build.scm ("options->transformation, with-graft"): Use
'with-graft', not 'with-input'.
2016-10-19 15:54:10 +02:00
Ludovic Courtès 645b9df858
guix build: Add '--with-graft'.
* guix/scripts/build.scm (transform-package-inputs/graft): New procedure.
(%transformations): Add 'with-graft'.
(%transformation-options): Likewise.
(show-transformation-options-help): Document it.
* tests/scripts-build.scm ("options->transformation, with-graft"): New
test.
* doc/guix.texi (Package Transformation Options): Document it.
2016-10-17 23:59:02 +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 9a2a20052a guix build: '--with-source' correctly matches versioned file names.
* guix/scripts/build.scm: Use the right 'package-name->name+version'
procedure.  Fixes a regression introduced in
1b846da8c3.
* tests/scripts-build.scm ("options->transformation, with-source, with
version"): New test.
2016-03-23 23:43:50 +01:00
Ludovic Courtès 47c0f92c37 guix build: Add '--with-input'.
* guix/scripts/build.scm (transform-package-inputs): New procedure.
(%transformations): Add it.
(%transformation-options, show-transformation-options-help): Add
--with-input.
* tests/scripts-build.scm ("options->transformation, with-input"):
("options->transformation, with-input, no matches"): New tests.
* tests/guix-build.sh: Add tests.
* doc/guix.texi (Package Transformation Options): Document it.
2016-02-01 08:59:13 +01:00
Ludovic Courtès 629a064f32 guix build: Transformations operate on single objects.
* guix/scripts/build.scm (transform-package-source): Return a procedure
that expects a single object rather than a list of packages.
(options->transformation): Rewrite to precompute the list of applicable
transformations and to return a procedure that expects a single object
rather than a list of objects.
(options->derivations): Adjust accordingly.
* tests/scripts-build.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2016-02-01 08:59:13 +01:00