Commit Graph

141 Commits

Author SHA1 Message Date
John Soo 0cdc13ce43
guix build: Expose log-url for third parties.
* guix/scripts/build.scm (log-url): Expose it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-11-13 18:11:30 +01:00
Ludovic Courtès f68b3ba12d
guix build: Move transformation options to (guix transformations).
* guix/transformations.scm: New file.
* tests/scripts-build.scm: Rename to...
* tests/transformations.scm: ... this.
* Makefile.am (MODULES): Add 'guix/transformations.scm'.
(SCM_TESTS): Adjust to rename.
* guix/scripts/build.scm (numeric-extension?)
(tarball-base-name, <downloaded-file>, download-to-store*)
(compile-downloaded-file, package-with-source)
(transform-package-source, evaluate-replacement-specs)
(transform-package-inputs, transform-package-inputs/graft)
(%not-equal, package-git-url, evaluate-git-replacement-specs)
(transform-package-source-branch, transform-package-source-commit)
(transform-package-source-git-url, package-dependents/spec)
(package-toolchain-rewriting, transform-package-toolchain)
(transform-package-with-debug-info, transform-package-tests)
(%transformations, transformation-procedure, %transformation-options)
(show-transformation-options-help, options->transformation)
(package-transformations): Move to (guix transformations).
* guix/scripts/environment.scm: Adjust accordingly.
* guix/scripts/graph.scm: Likewise.
* guix/scripts/install.scm: Likewise.
* guix/scripts/pack.scm: Likewise.
* guix/scripts/package.scm: Likewise.
* guix/scripts/upgrade.scm: Likewise.
* po/guix/POTFILES.in: Add 'guix/transformations.scm'.
2020-10-31 23:16:43 +01:00
Ludovic Courtès 1ae33664a6
guix build: 'options->transformation' no longer takes a 'store' parameter.
* guix/scripts/build.scm (transform-package-source)
(transform-package-inputs, transform-package-inputs/graft)
(transform-package-source-branch, transform-package-source-commit)
(transform-package-source-git-url, transform-package-toolchain)
(transform-package-with-debug-info, transform-package-tests): Remove
'store' parameter.
(options->transformation, options->derivations): Adjust accordingly.
* guix/scripts/environment.scm (options/resolve-packages): Likewise.
* guix/scripts/graph.scm (guix-graph): Likewise.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (transaction-upgrade-entry): Likewise.
(process-actions): Likewise.
* tests/scripts-build.scm ("options->transformation, no transformations")
("options->transformation, with-source, replacement"):
Adjust tests.
("options->transformation, with-source")
("options->transformation, with-source, with version")
("options->transformation, with-source, PKG=URI"): Use 'lower-object' to
compute the store file name of the source.
("options->transformation, with-source, no matches"): Remove
'with-store' and adjust accordingly.
("options->transformation, with-input"): Likewise.
("options->transformation, with-graft"): Likewise.
("options->transformation, with-branch"): Likewise.
("options->transformation, with-commit"): Likewise.
("options->transformation, with-git-url"): Likewise.
("options->transformation, with-git-url + with-branch"): Likewise.
("options->transformation, with-c-toolchain"): Likewise.
("options->transformation, with-c-toolchain twice"): Likewise.
("options->transformation, with-c-toolchain, no effect"): Likewise.
("options->transformation, with-debug-info"): Likewise.
("options->transformation, without-tests"): Likewise.
2020-10-31 23:16:43 +01:00
Ludovic Courtès e72cc79263
guix build: Remove unnecessary (replacement #f).
* guix/scripts/build.scm (package-with-source): Remove 'replacement'
field, which is innate since d5ec5ed719.
2020-10-31 23:16:43 +01:00
Ludovic Courtès 139c4ac199
guix build: 'package-with-source' no longer takes a 'store' parameter.
* guix/scripts/build.scm (<downloaded-file>): New record type.
(download-to-store*): New variable.
(compile-downloaded-file): New procedure.
(package-with-source): Remove 'store' parameter.  Use 'downloaded-file'
instead of 'download-to-store'.
(transform-package-source): Adjust accordingly.
2020-10-31 23:16:42 +01:00
Ludovic Courtès 6701f64f73
guix build: Move package transformation options behind '--help-transform'.
This change declutters the '--help' output.

* guix/scripts/build.scm (show-build-options-help)
(%standard-build-options): Add '--help-transform'.
(show-transformation-options-help): Make private.
(show-help): Remove call to 'show-transformation-options-help'.
* guix/scripts/build.scm (show-help): Likewise.
* guix/scripts/environment.scm (show-help): Likewise.
* guix/scripts/graph.scm (show-help): Likewise.
* guix/scripts/install.scm (show-help): Likewise.
* guix/scripts/pack.scm (show-help): Likewise.
* guix/scripts/package.scm (show-help): Likewise.
* guix/scripts/upgrade.scm (show-help): Likewise.
* doc/guix.texi (Package Transformation Options): Mention '--help-transform'.
2020-10-20 16:30:16 +02:00
Ludovic Courtès 6aeda81602
guix build: Add '--with-debug-info'.
* guix/scripts/build.scm (transform-package-with-debug-info): New
procedure.
(%transformations): Add 'with-debug-info'.
(%transformation-options, show-transformation-options-help): Add
'--with-debug-info'.
* tests/scripts-build.scm ("options->transformation, with-debug-info"):
New test.
* doc/guix.texi (Package Transformation Options): Document
'--with-debug-info'.
(Installing Debugging Files): Introduce sections.  Remove bit about
eventual "opt-out" since this is not happening.  Document
'--with-debug-info' under "Rebuilding with Debugging Info".
2020-10-20 16:30:16 +02:00
Ludovic Courtès abd7a47461
guix build: Add '--with-c-toolchain'.
* guix/scripts/build.scm (package-dependents/spec)
(package-toolchain-rewriting, transform-package-toolchain): New procedures.
(%transformations): Add it.
(%transformation-options, show-transformation-options-help): Add
'--with-c-toolchain'.
* tests/scripts-build.scm (depends-on-toolchain?): New procedure.
("options->transformation, with-c-toolchain")
("options->transformation, with-c-toolchain twice")
New test.
("options->transformation, with-c-toolchain, no effect"): New tests.
* doc/guix.texi (Package Transformation Options): Document it.
2020-10-12 18:23:47 +02:00
Ludovic Courtès ad54a73bb8
guix build: Record package transformations in manifest entries.
With this change, package transformation options used while building a
manifest are saved in the metadata of the manifest entries.

* guix/scripts/build.scm (transformation-procedure): New procedure.
(options->transformation)[applicable]: Use it.  Change to a list of
key/value/proc tuples instead of key/proc pairs.
[package-with-transformation-properties, tagged-object]: New
procedures.  Use them.
(package-transformations, manifest-entry-with-transformations): New
procedures.
* guix/scripts/pack.scm (guix-pack)[with-transformations]: New
procedure.
Use it.
* guix/scripts/package.scm (process-actions)[transform-entry]: Use it.
* tests/guix-package-aliases.sh: Add test.
2020-10-02 23:28:09 +02:00
Julien Lepiller e75443d4f2
guix build: Add a hint for unspecified value.
* guix/scripts/build.scm (options->things-to-build): Add a hint when we
cannot build something.
2020-09-29 15:15:25 +02:00
Ludovic Courtès f458cfbcc5
guix build: Add '--without-tests'.
* guix/scripts/build.scm (transform-package-tests): New procedure.
(%transformations, %transformation-options)
show-transformation-options-help): Add it.
* tests/scripts-build.scm ("options->transformation, without-tests"):
New test.
* doc/guix.texi (Package Transformation Options): Document it.
2020-09-27 21:32:09 +02:00
zimoun 620681534a
guix: scripts: build: Mention 'PACKAGE' in '--with-source' option.
* guix/scripts/build.scm (show-transformation-options-help): Mention 'PACKAGE'
in '--with-source' option.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-09-21 23:14:43 +02:00
Ludovic Courtès 3794ce93be
scripts: Use 'define-command' and have 'guix help' use that.
This changes 'guix help' to print a short synopsis for each command and
to group commands by category.

* guix/scripts.scm (synopsis, category): New variables.
(define-command-categories, define-command): New macros.
(%command-categories): New variable.
* guix/ui.scm (<command>): New record type.
(source-file-command): New procedure.
(command-files): Return absolute file names.
(commands): Return a list of <command> records.
(show-guix-help)[display-commands, category-predicate]: New procedures.
Display commands grouped in three categories.
* guix/scripts/archive.scm (guix-archive): Use 'define-command'.
* guix/scripts/authenticate.scm (guix-authenticate): Likewise.
* guix/scripts/build.scm (guix-build): Likewise.
* guix/scripts/challenge.scm (guix-challenge): Likewise.
* guix/scripts/container.scm (guix-container): Likewise.
* guix/scripts/copy.scm (guix-copy): Likewise.
* guix/scripts/deploy.scm (guix-deploy): Likewise.
* guix/scripts/describe.scm (guix-describe): Likewise.
* guix/scripts/download.scm (guix-download): Likewise.
* guix/scripts/edit.scm (guix-edit): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/gc.scm (guix-gc): Likewise.
* guix/scripts/git.scm (guix-git): Likewise.
* guix/scripts/graph.scm (guix-graph): Likewise.
* guix/scripts/hash.scm (guix-hash): Likewise.
* guix/scripts/import.scm (guix-import): Likewise.
* guix/scripts/install.scm (guix-install): Likewise.
* guix/scripts/lint.scm (guix-lint): Likewise.
* guix/scripts/offload.scm (guix-offload): Likewise.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/perform-download.scm (guix-perform-download): Likewise.
* guix/scripts/processes.scm (guix-processes): Likewise.
* guix/scripts/publish.scm (guix-publish): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
* guix/scripts/refresh.scm (guix-refresh): Likewise.
* guix/scripts/remove.scm (guix-remove): Likewise.
* guix/scripts/repl.scm (guix-repl): Likewise.
* guix/scripts/search.scm (guix-search): Likewise.
* guix/scripts/show.scm (guix-show): Likewise.
* guix/scripts/size.scm (guix-size): Likewise.
* guix/scripts/substitute.scm (guix-substitute): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* guix/scripts/time-machine.scm (guix-time-machine): Likewise.
* guix/scripts/upgrade.scm (guix-upgrade): Likewise.
* guix/scripts/weather.scm (guix-weather): Likewise.
2020-09-10 12:27:24 +02:00
Ludovic Courtès 898e6d0a07
scripts: Pass #:verbosity to 'build-notifier'.
* guix/scripts/archive.scm (guix-archive): Pass #:verbosity to
'build-notifier'.
* guix/scripts/build.scm (guix-build): Likewise.
* guix/scripts/copy.scm (guix-copy): Likewise.
* guix/scripts/deploy.scm (guix-deploy): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (guix-package*): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
* guix/scripts/system.scm (verbosity-level): New procedure.
(process-action): Pass #:verbosity to 'build-notifier'.
(guix-system): Use 'verbosity-level' for 'with-status-verbosity'.
2020-08-03 17:18:37 +02:00
Ricardo Wurmus f87e563201
scripts/build: options->things-to-build: Handle .json files.
* guix/scripts/build.scm (options->things-to-build): Handle files that end on
.json.
2020-04-16 23:41:52 +02:00
Ludovic Courtès 131f50cdc9
'--dry-run' no longer implies '--no-grafts'.
* guix/scripts/archive.scm (%options): "dry-run" option no longer adds
'graft? #f to RESULT.
* guix/scripts/environment.scm (%options): Likewise.
* guix/scripts/pack.scm (%options): Likewise.
* guix/scripts/package.scm (%options): Likewise.
* guix/scripts/pull.scm (%options): Likewise.
* guix/scripts/system.scm (%options): Likewise.
2020-03-29 15:32:18 +02:00
Ludovic Courtès 1213ea9bd9
guix build: Use 'map/accumulate-builds'.
* guix/scripts/build.scm (options->derivations): Use
'map/accumulate-builds' instead of 'append-map'.
2020-03-29 15:32:17 +02:00
Ludovic Courtès 62195b9a8f
guix build: Use 'with-build-handler'.
Fixes <https://bugs.gnu.org/28310>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/scripts/build.scm (guix-build): Wrap 'parameterize' in
'with-build-handler'.  Remove explicit call to 'show-what-to-build'.
Call 'build-derivations' regardless of whether OPTS contains 'dry-run?'.
2020-03-22 12:42:51 +01:00
Ludovic Courtès f42f39ad68
guix build: Parameterize '%graft?' upfront.
* guix/scripts/build.scm (guix-build): Add 'graft?' variable and
parameterize %GRAFT?.
2020-03-05 16:33:37 +01:00
Ludovic Courtès 5a675b2c67
guix build: Allow non-package objects in manifest.
* guix/scripts/build.scm (options->things-to-build)[manifest->packages]:
Remove.
Inline map of 'manifest-entry-item'.
* tests/guix-build.sh: Add test for "guix build -m" with non-package object.
2020-03-05 16:33:37 +01:00
Marius Bakke 11415d3506
guix build: Add '--manifest' option.
* guix/scripts/build.scm (show-help): Document --manifest argument.
(options->things-to-build): When given a manifest, evaluate all the entries.
* tests/guix-build.sh: Add test for --manifest.
* doc/guix.texi (Additional Build Options): Mention --manifest.
* etc/completion/bash/guix: Complete file name if 'guix build' argument is
-m.
2020-02-14 17:49:26 +01:00
Ludovic Courtès 09238d618a
guix build, archive, graph: Disable absolute file port name canonicalization.
This avoids an 'lstat' storm.  Specifically:

  ./pre-inst-env strace -c guix build -nd libreoffice

goes from 1,711 to 214 'lstat' calls.

* guix/scripts/build.scm (options->things-to-build): When SPEC matches
'derivation-path?', call 'canonicalize-path'.
(guix-build): Remove 'with-fluids' for %FILE-PORT-NAME-CANONICALIZATION.
* guix/scripts/archive.scm (guix-archive): Remove 'with-fluids' for
%FILE-PORT-NAME-CANONICALIZATION.
* guix/scripts/graph.scm (guix-graph): Likewise.
2020-01-24 23:56:42 +01:00
Ludovic Courtès 7a0836cffd
More module autoload changes.
This is a followup to 6a7c4636d4.

* guix/scripts/build.scm: Adjust #:autoload clauses.
* guix/scripts/gc.scm: Likewise.
2020-01-07 12:25:09 +01:00
Ludovic Courtès 6a7c4636d4
Adjust module autoloads.
In Guile < 2.9.7, autoloading a module would give you access to all its
bindings.  In future versions, autoloading a module gives access only to
the listed bindings, as per #:select (see <https://bugs.gnu.org/38895>).

This commit adjusts autoloads to the new semantics, allowing Guix to be
built with Guile 2.9.7/2.9.8.

* guix/build/download.scm <top level>: Remove call to 'module-autoload!'.
(load-gnutls): New procedure.
(tls-wrap): Call it.
* guix/git.scm <top level>: Remove call to 'module-autoload!'.
(load-git-submodules): New procedure.
(update-submodules): Call it instead of 'resolve-interface'.
* gnu/bootloader/grub.scm: Replace #:autoload with #:use-module.
* gnu/packages.scm: Likewise.
* gnu/packages/ssh.scm: Likewise.
* gnu/packages/tex.scm: Likewise.
* gnu/services/cuirass.scm: Likewise.
* gnu/services/mcron.scm: Likewise.
* guix/lint.scm: Augment list of bindings in #:autoload.
* guix/scripts/build.scm: Likewise.
* guix/scripts/gc.scm: Likewise.
* guix/scripts/pack.scm: Likewise.
* guix/scripts/publish.scm: Likewise.
* guix/scripts/pull.scm: Likewise.
* guix/utils.scm: Remove unnecessary #:autoload clauses; replace one
of them with #:use-module.
2020-01-06 16:31:54 +01:00
Ludovic Courtès 2ce08a5d79
guix build: '--keep-failed' implies '--no-offload'.
* guix/scripts/build.scm (set-build-options-from-command-line): Pass
 #:offload? #f when 'keep-failed? is true.
* doc/guix.texi (Common Build Options): Document it.
2019-11-26 00:16:36 +01:00
Ludovic Courtès 7f44ab48f9
Use 'offload?' instead of 'build-hook?' internally.
* guix/scripts/archive.scm (%default-options): Replace 'build-hook?'
with 'offload?'.
* guix/scripts/build.scm (set-build-options-from-command-line): Pass
 #:offload? instead of #:use-build-hook?.
(%standard-build-options): Use the 'offload? key instead of 'build-hook?.
(%default-options): Replace 'build-hook?' with 'offload?'.
* guix/scripts/copy.scm (%default-options): Likewise.
* guix/scripts/deploy.scm (%default-options): Likewise.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
* guix/scripts/system.scm (%default-options): Likewise.
* guix/scripts/time-machine.scm (%default-options): Likewise.
* guix/store.scm (set-build-options): Have #:use-build-hook? default
to *unspecified*.  Add #:offload?.  Add call to 'warn-about-deprecation'
when #:use-build-hook? is specified.
2019-11-26 00:16:36 +01:00
Ludovic Courtès dc209d5a5d
guix build, daemon: Rename "--no-build-hook" to "--no-offload".
This is a followup to bc69ea2d60.

* guix/scripts/build.scm (show-build-options-help): Rename
"--no-build-hook" to "--no-offload".
(%standard-build-options): Likewise, and warn when "--no-build-hook" is
passed.
* nix/nix-daemon/guix-daemon.cc (options): Add "--no-offload" and mark
"--no-build-hook" as hidden.
* guix/scripts/offload.scm: Adjust comment.
* doc/guix.texi (Invoking guix-daemon, Common Build Options): Replace
"--no-build-hook" with "--no-offload".
* etc/completion/fish/guix.fish, etc/completion/zsh/_guix: Adjust
accordingly.
2019-11-26 00:16:36 +01:00
Ludovic Courtès 9c9982dc0c
guix build: Handle "guix build /….drv" correctly for non-existent derivations.
This lets the daemon substitute missing derivations, as in the example
at <https://bugs.gnu.org/38226>, instead of failing with ENOENT.

* guix/scripts/build.scm (options->things-to-build): In the
'derivation-path?' case, don't fail when 'read-derivation-from-file'
raises to ENOENT; return the empty list in that case.
(guix-build): Add non-existent '.drv' files to ITEMS.
Pass ITEMS in addition to DRV to 'build-derivations'.
* tests/guix-build.sh: Add test.
2019-11-17 23:14:54 +01:00
Ludovic Courtès b1b27f284f
guix build: Remove obsolete TODO.
* guix/scripts/build.scm (set-build-options-from-command-line): Remove
obsolete TODO comment.
2019-10-25 12:13:00 +02:00
Ludovic Courtès b3673e9917
guix build: Warn when '--keep-failed' is passed to a remote daemon.
* guix/scripts/build.scm (set-build-options-from-command-line): When
OPTS has 'keep-failed?' set, check whether STORE is connected over
AF_UNIX and warn when it's not.
2019-10-25 12:13:00 +02:00
Ludovic Courtès 4d04bc50d2
guix build: '--with-commit' recognizes "v[0-9]" tags.
* guix/scripts/build.scm (transform-package-source-commit)[replace]:
Special case COMMIT that starts with "v[0-9]".
2019-07-26 11:21:36 +02:00
Ludovic Courtès 92359aed40
guix build: '--log-file' no longer returns several log files.
Fixes a regression introduced in
9353b199c1 whereby something like:

  guix build --log-file $(guix build -d guile)

would return two log files.  This led to a failure of 'tests/guix-build.sh'.

* guix/scripts/build.scm (guix-build): Filter out derivation file names
from ITEMS.
2019-06-23 19:53:03 +02:00
Ludovic Courtès 0f2d9c3290
guix build: Use 'warning' for warnings.
* guix/scripts/build.scm (options->derivations): Use 'warning' instead
of 'format'.
2019-06-23 19:53:03 +02:00
Ludovic Courtès 9353b199c1
guix build: '--log-file' looks for build logs of equivalent derivations.
Previously, '--log-file' would look for log files only for the current
derivation, and thus wouldn't find log files of equivalent derivations
that produce the same output.

* guix/scripts/build.scm (guix-build) <log-file?>: Replace
'derivation-file-name' by 'derivation->output-path'.
2019-06-18 16:25:09 +02:00
Ludovic Courtès 45d41c035e
guix build: Gracefully handle invalid '--with-git-url' specs.
* guix/scripts/build.scm (transform-package-source-git-url): Add case
for when 'string-split' does not return exactly two elements.
2019-05-14 12:11:05 +02:00
Ludovic Courtès 757e633d57
build: Change default substitute server to "ci.guix.gnu.org".
* config-daemon.ac: Replace "ci.guix.info" with "ci.guix.gnu.org".
* doc/guix.texi (SUBSTITUTE-SERVER): Likewise.
* etc/substitutes/ci.guix.gnu.org.pub: New file.
* Makefile.am (dist_pkgdata_DATA): Add it.
* guix/scripts/build.scm (%default-log-urls): Update.
* guix/scripts/substitute.scm (%default-substitute-urls): Likewise.
* guix/store.scm (%default-substitute-urls): Likewise.
* guix/self.scm (miscellaneous-files): Add "ci.guix.gnu.org".
2019-05-01 11:05:47 +02:00
Ludovic Courtès ea261dea0c
guix build: Accept multiple '-s' options.
* guix/scripts/build.scm (%default-options): Remove 'system'.
(%options) <--system>: Keep previous occurrences of 'system in RESULT.
(options->derivations)[system]: Remove.
[systems, things-to-build]: New variables.
[compute-derivation]: New procedure.
Iterate on all of SYSTEMS to compute the derivations of THINGS-TO-BUILD.
* tests/guix-build.sh: Add test for one and multiple '-s' flags.
* doc/guix.texi (Additional Build Options): Document this behavior.
2019-04-19 17:46:40 +02:00
Ludovic Courtès 4aea820f09
guix build: Fix relative file name canonicalization for '--root'.
Fixes <https://bugs.gnu.org/35271>.
Reported by rendaw <7e9wc56emjakcm@s.rendaw.me>.

* guix/scripts/build.scm (register-root): When ROOT is a relative file
name, append the basename of ROOT, not ROOT itself.
* tests/guix-build.sh: Add test.
2019-04-15 16:57:12 +02:00
Ludovic Courtès d831b19079
guix build: '--with-branch' strips slashes from the version string.
This fixes things like:

  guix build glibc \
    --with-git-url=glibc=git://sourceware.org/git/glibc.git \
    --with-branch=glibc=release/2.25/master

whereby slashes would before go straight to the 'version' field, leading
to an invalid store file name.

* guix/scripts/build.scm (transform-package-source-branch)[replace]:
Replace slashes with hyphens in BRANCH when building the version
string.
2019-03-17 22:55:01 +01:00
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 0c0ff42a24
guix build: Factorize 'package-git-url'.
* guix/scripts/build.scm (package-git-url): New procedure.
(evaluate-git-replacement-specs): Use it.
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 2637cfd7a4
Avoid name clash with 'build' from (guix store) and (guix status).
Since commit 976ef2d978, (guix status)
exports 'build', which clashes with 'build' from (guix store).

* build-aux/run-system-tests.scm: Select 'with-status-verbosity'
from (guix status).
* guix/scripts/archive.scm: Likewise.
* guix/scripts/build.scm: Likewise.
* guix/scripts/copy.scm: Likewise.
* guix/scripts/environment.scm: Likewise.
* guix/scripts/pack.scm: Likewise.
* guix/scripts/package.scm: Likewise.
* guix/scripts/pull.scm: Likewise.
* guix/scripts/system.scm: Likewise.
2019-02-11 23:23:28 +01:00
Ludovic Courtès 024a6bfba9
guix build: '--with-branch' & co. fetch submodules.
* guix/scripts/build.scm (transform-package-source-branch)[replace]: Add
'recursive?' field to the new package.
2019-02-08 10:41:13 +01:00
Ludovic Courtès f1de676ea8
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for.  The new option provides a consistent way to choose
whether or not to display the build log.

* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
 #:verbosity.
(%standard-build-options): Change "verbosity" to "debug".  Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.  Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-11 12:14:38 +01:00
Ludovic Courtès ec651f2562
guix build: Honor '--system' for file-like objects and gexps.
Fixes a bug whereby "guix build -f file.scm -s SYSTEM" would not honor
SYSTEM when 'file.scm' returns a gexp or a file-like object.

* guix/scripts/build.scm (options->derivations): Pass #:system to
'run-with-store' in the 'file-like?' and 'gexp?' cases.
2019-01-05 00:08:04 +01:00
Ludovic Courtès 0a5fa004f7
build: Default to https://ci.guix.info for substitutes.
* config-daemon.ac (guix_substitute_urls): Always default to
"https://ci.guix.info".
* doc/guix.texi (SUBSTITUTE-SERVER): Switch to ci.guix.info.
* guix/scripts/build.scm (%default-log-urls): Likewise.
* guix/scripts/substitute.scm (%default-substitute-urls): Likewise.
* guix/store.scm (%default-substitute-urls): Likewise.
2018-12-04 10:57:56 +01:00
Ludovic Courtès b18f7234aa
guix build: Add '--with-commit'.
* guix/git.scm (<git-checkout>)[commit]: New field.
(git-checkout-compiler): Honor it.
* guix/scripts/build.scm (evaluate-git-replacement-specs): Add 'proc'
parameter and honor it.
(transform-package-source-branch)[replace]: New procedure.
Adjust 'evaluate-git-replacement-specs' accordingly.
(transform-package-source-commit): New procedure.
(%transformations, %transformation-options)
(show-transformation-options-help): Add 'with-commit'.
* tests/guix-build-branch.sh: Add test.
* doc/guix.texi (Package Transformation Options): Document it.
2018-11-30 17:03:04 +01:00
Ludovic Courtès 96915a448c
guix build: Add '--with-branch' transformation option.
* guix/scripts/build.scm (evaluate-git-replacement-specs)
(transform-package-source-branch): New procedures.
(%transformations, %transformation-options): Add 'with-branch'.
(show-transformation-options-help): Likewise.
* tests/guix-build-branch.sh: New file.
* Makefile.am (SH_TESTS): Add it.
* doc/guix.texi (Package Transformation Options): Document it.
2018-11-30 17:03:04 +01:00