Commit Graph

132 Commits

Author SHA1 Message Date
John Soo e783cd51ba
pack: Expose some bindings for third-party use.
* guix/scripts/pack.scm (compressor-name, compressor-extension,
compressor-command, %compressors, %formats): Export.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-11-13 18:10:11 +01:00
Ludovic Courtès 4db90a6c15
pack: Do not include the host (guix config).
* guix/scripts/pack.scm (store-database)[build]: Import a
synthetic (guix config).
2020-11-05 16:13:50 +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
Eric Bavier 4184998c70
guix: pack: Only wrap executable files.
* guix/scripts/pack.scm (wrapped-package)<build>: Build wrappers for
executable files and symlink others.
* tests/guix-pack-relocatable.sh: Test relocatable example of mixed
executable and non-executable files.
2020-10-30 10:00:35 -05:00
Eric Bavier a73896425e
guix: pack: Fix offset calculation for store directory mount point.
Fixes wrapping of non-package things, where the target store directory may
differ in length from the original.

* guix/scripts/pack.scm (wrapped-package)<build-wrapper>: Define
WRAPPER_PROGRAM macro with wrapper's file name.
* gnu/packages/aux-files/run-in-namespace.c (main): Offset index by len of
that file name.
2020-10-30 10:00:29 -05: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 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
Ludovic Courtès 58abd58739
pack: Work around ld.so bug that affects the "fakechroot" engine.
Fixes <https://bugs.gnu.org/43491>.

* guix/scripts/pack.scm (wrapped-package): Use (runpath program) instead
of (runpath #$(audit-module)).
2020-10-01 12:45:38 +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
Ludovic Courtès c6c0d5a22c
pack: "fakechroot" execution engine can load its audit module.
Fixes <https://bugs.gnu.org/42558>.

Until now, loading 'pack-audit.so' in a truly non-Guix environment would
usually fail because 'pack-audit.so' depends on 'libgcc_s.so' and
'libc.so', none of which could be found.

Furthermore, the test was not working as expected: the trick

  unshare -mrf sh -c 'mount -t tmpfs none /gnu ; ...'

would allow the fakechroot engine to make its store available as
/gnu/store as a result of another bug.

* gnu/packages/aux-files/run-in-namespace.c (relocated_search_path): New
function.
(exec_with_loader): Pass "--library-path" to the loader.
* guix/scripts/pack.scm (wrapped-package)[build](runpath): New procedure.
(elf-loader-compile-flags): Pass "-DLOADER_AUDIT_RUNPATH".
* tests/guix-pack-relocatable.sh: Remove 'STORE_PARENT'.
(run_without_store): New function.  Erase $NIX_STORE_DIR instead of
$STORE_PARENT.
Use 'run_without_store' throughout.
2020-07-28 14:41:04 +02:00
Ludovic Courtès a553892215
pack: '-R' applies to propagated inputs too.
Fixes <https://bugs.gnu.org/42510>.

* guix/scripts/pack.scm (wrapped-manifest-entry): Recurse on
'dependencies' field.
* tests/guix-pack-relocatable.sh: Add test.
2020-07-24 14:21:30 +02:00
Ludovic Courtès b3802495f6
pack: Build the store database under a UTF-8 locale.
Fixes <https://bugs.gnu.org/42389>.
Reported by branjam4@gmail.com.

* guix/scripts/pack.scm (store-database)[build]: Add calls to 'setenv'
and 'setlocale'.
* tests/pack.scm ("self-contained-tarball + localstatedir, UTF-8 file
names"): New test.
2020-07-20 23:25:09 +02:00
Ludovic Courtès 181e0dddd6
pack: 'self-contained-tarball' runs derivation in a UTF-8local.
* guix/scripts/pack.scm (self-contained-tarball)
[set-utf8-locale]: New variable.
[build]: Use it.
* tests/pack.scm ("self-contained-tarball"): Use a <profile> record
instead of 'profile-derivation'.
2020-07-20 23:25:09 +02:00
Ludovic Courtès 4f060bf2fe
pack: Dereference symlinks when looking for executables.
Fixes <https://bugs.gnu.org/42127>.
Reported by Andrius Štikonas <andrius@stikonas.eu>.

* guix/scripts/pack.scm (wrapped-package)[build]: Add trailing slash to
the arguments to 'find-files'.
2020-06-30 00:18:28 +02:00
Ludovic Courtès 97a46055ca
database: 'register-items' takes an open database.
* guix/store/database.scm (store-database-directory)
(store-database-file): New procedures.
(call-with-database): Add call to 'mkdir-p'.
(register-items): Add 'db' parameter and remove #:state-directory and #:schema.
(register-path): Use 'store-database-file' and 'with-database', and
parameterize SQL-SCHEMA.
* gnu/build/image.scm (register-closure): Likewise.
* gnu/build/vm.scm (register-closure): Likewise.
* guix/scripts/pack.scm (store-database)[build]: Likewise.
2020-06-18 14:48:17 +02:00
Tobias Geerinckx-Rice 38ee8f7dba
pack: Add zstd compressor.
* guix/scripts/pack.scm (%compressors): Add zstd.
* doc/guix.texi (Invoking guix pack): Document it.
2020-06-16 13:35:33 +02:00
Ludovic Courtès 6456232164
pack: Add relocation via ld.so and fakechroot.
* gnu/packages/aux-files/run-in-namespace.c (HAVE_EXEC_WITH_LOADER): New
macro.
(bind_mount): Rename to...
(mirror_directory): ... this.  Add 'firmlink' argument and use it
instead of calling mkdir/open/close/mount directly.
(bind_mount, make_symlink): New functions.
(exec_in_user_namespace): Adjust accordingly.
(exec_with_loader) [HAVE_EXEC_WITH_LOADER]: New function.
(exec_performance): New function.
(engines): Add them.
* guix/scripts/pack.scm (wrapped-package)[fakechroot-library]
[audit-module]: New procedures.
[audit-source]: New variable.
[build](elf-interpreter, elf-loader-compile-flags): New procedures.
(build-wrapper): Use them.
* tests/guix-pack-relocatable.sh: Test with
'GUIX_EXECUTION_ENGINE=fakechroot'.
* doc/guix.texi (Invoking guix pack): Document the 'performance' and
'fakechroot' engines.
* gnu/packages/aux-files/pack-audit.c: New file.
* Makefile.am (AUX_FILES): Add it.
2020-05-14 17:21:27 +02:00
Ludovic Courtès a89df83c79
pack: Do not cross-compile the image building tools.
Until now, something like:

  guix pack -f docker --target=arm-linux-gnueabihf

would attempt to cross-compile tar.

* guix/scripts/pack.scm (self-contained-tarball): Pass #:target to
'gexp->derivation'.
(squashfs-image): Use #+ instead of #$ for ARCHIVER.  Use 'file-append'
instead of 'string-append'.  Pass #:target to 'gexp->derivation'.
(docker-image): Likewise.
2020-05-14 17:21:27 +02:00
Marius Bakke 8bf8cd9b85
Merge branch 'master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/backup.scm
	gnu/packages/emacs-xyz.scm
	gnu/packages/guile.scm
	gnu/packages/lisp.scm
	gnu/packages/openldap.scm
	gnu/packages/package-management.scm
	gnu/packages/web.scm
	gnu/packages/xorg.scm
2020-04-30 23:47:49 +02:00
Ludovic Courtès 45c84c8f6f
pack: Use a declarative profile.
* guix/scripts/pack.scm (guix-pack): Use a declarative profile instead
of 'profile-derivation'.
2020-04-26 22:49:48 +02:00
Marius Bakke 2778302399
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/check.scm
	gnu/packages/cross-base.scm
	gnu/packages/gimp.scm
	gnu/packages/java.scm
	gnu/packages/mail.scm
	gnu/packages/sdl.scm
	gnu/packages/texinfo.scm
	gnu/packages/tls.scm
	gnu/packages/version-control.scm
2020-04-08 13:00:50 +02:00
Ludovic Courtès f7b5b8cd45
pack: Pass the cross-compilation target to 'run-with-store'.
This ensures '%current-target-system' is correctly bound upfront, which
some packages rely on.

* guix/scripts/pack.scm (guix-pack): Pass #:target to 'run-with-store'.
2020-04-03 23:06:43 +02:00
Marius Bakke ae0badf5bb
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/admin.scm
	gnu/packages/commencement.scm
	gnu/packages/guile.scm
	gnu/packages/linux.scm
	gnu/packages/package-management.scm
	gnu/packages/pulseaudio.scm
	gnu/packages/web.scm
2020-03-30 12:17:33 +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
Marius Bakke 18af687037
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/icu4c.scm
	gnu/packages/man.scm
	gnu/packages/python-xyz.scm
	guix/scripts/environment.scm
	guix/scripts/pack.scm
	guix/scripts/package.scm
	guix/scripts/pull.scm
	guix/store.scm
2020-03-27 00:12:15 +01:00
Ludovic Courtès 53c594cb3f
pack: Do not store extended attributes in squashfs images.
* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): Pass "-no-xattrs".
2020-03-24 16:56:19 +01:00
Ludovic Courtès 5f5e9a5cd6
pack: Use 'with-build-handler'.
* guix/scripts/pack.scm (guix-pack): 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 d8e98e853c
scripts: Refer to (default-guile) instead of 'guile-2.2'.
This is a followup to b6bee63bed.

* guix/scripts/environment.scm (guix-environment): Use (default-guile)
instead of (canonical-package guile-2.2) when parameterizing
'%guile-for-build'.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (guix-package*): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2020-03-17 15:36:58 +01:00
Ludovic Courtès 24fb0dc0ab
pack: Do not create a squashfs "recovery file".
Reported by Josh Marshall <Josh.Marshall@jax.org>.

* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): Always pass
"-no-recovery".
2020-03-13 17:33:38 +01:00
Ludovic Courtès b829864d74
pack: Make bit-reproducible squashfs images.
Reported by Josh Marshall <Josh.Marshall@jax.org>.

* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): Always pass
"-all-time", "-mkfs-time", "-force-uid", and "-force-gid" to 'mksquashfs'.
2020-03-13 17:33:37 +01:00
Ludovic Courtès b24ec85451
pack: Factorize 'mksquashfs' invocations.
* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): New
procedure.
Replace instances of (invoke "mksquashfs" ...) with (mksquashfs ...).
2020-03-13 17:33:37 +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 975183a1c4
pack: Save provenance information when using '--manifest'.
* guix/scripts/pack.scm (guix-pack)[manifest-from-args]: Remove
'provenance', and add 'with-provenance' procedure.  Wrap 'cond' form in
'with-provenance'.
2019-12-29 18:24:54 +01:00
Ludovic Courtès 8a705ae4c6
profiles: Add 'map-manifest-entries'.
* guix/scripts/pack.scm (map-manifest-entries): Move to...
* guix/profiles.scm (map-manifest-entries): ... here.
2019-12-29 18:24:54 +01:00
Ricardo Wurmus 3c45b53ec9
gnu: Remove squashfs-tools-next.
* gnu/packages/compression.scm (squashfs-tools-next): Remove variable.
* guix/scripts/pack.scm (squashfs-image, guix-pack): Use squashfs-tools.
* tests/pack.scm: Use squashfs-tools.
2019-12-26 12:29:44 +01:00
Ludovic Courtès dc995fcd5a
pack: Clarify the /bin/sh requirement for Singularity.
* guix/scripts/pack.scm (squashfs-image)[symlinks*]: New variable.
[build]: Use it instead of SYMLINKS.
(guix-pack): Emit a warning and a hint when "bash" and "bash-minimal"
are missing and PACK-FORMAT is 'squashfs.
* doc/guix.texi (Invoking guix pack): Document the /bin/sh requirement
for Singularity.
2019-12-10 20:56:05 +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 ca541f9ce6
pack: Allow multiple '--manifest' options.
* guix/scripts/pack.scm (guix-pack): Collect 'manifest' options, and
concatenate the resulting manifests.
* tests/guix-pack.sh: Test it.
* doc/guix.texi (Invoking guix pack): Document it.
2019-11-22 15:07:59 +01:00
Ludovic Courtès a2e661e95f
pack: Add "--derivation".
* guix/scripts/pack.scm (%options, show-help): Add "--derivation".
(guix-pack): Honor it.
* tests/guix-pack.sh: Test it.
* doc/guix.texi (Invoking guix pack): Document it.
2019-11-21 11:48:30 +01:00
Ludovic Courtès 9ff87bb996
Merge branch 'master' into core-updates 2019-09-17 16:27:15 +02:00
Ludovic Courtès 0074844366
pack: Provide a meaningful "repository name" for Docker.
Previously, images produced by 'guix pack -f docker' would always show
up as "profile" in the output of 'docker images'.  With this change,
'docker images' shows a name constructed from the packages found in the
image--e.g., "bash-coreutils-grep-sed".

* guix/docker.scm (canonicalize-repository-name): New procedure.
(generate-tag): Remove.
(manifest): Add optional 'tag' parameter and honor it.
(repositories): Likewise.
(build-docker-image): Add #:repository parameter and pass it to
'manifest' and 'repositories'.
* guix/scripts/pack.scm (docker-image)[build]: Compute 'tag' and pass it
as #:repository to 'build-docker-image'.
2019-09-16 10:25:31 +02:00
Ludovic Courtès 9bbaf2ae72
pack: Add packages in the order in which they appear on the command line.
* guix/scripts/pack.scm (guix-pack)[manifest-from-args](packages):
Reverse order of packages taken from OPTS.
2019-09-16 10:25:16 +02:00
Mark H Weaver 0481289cbc
Merge branch 'master' into core-updates 2019-08-29 17:19:18 -04:00
Ludovic Courtès 7979a287f8
pack: Create /tmp in Docker images.
Fixes <https://bugs.gnu.org/37161>.

* guix/scripts/pack.scm (docker-image)[build]: Add a 'directory' entry
for "/tmp" to DIRECTIVES.
* tests/pack.scm ("docker-image + localstatedir"): Test the presence of /tmp.
* gnu/tests/docker.scm (run-docker-test)["Load docker image and run
it"]: Test the presence and permission bits of "/tmp".
2019-08-27 12:20:44 +02:00
Ludovic Courtès 2b7c89f4fc
docker: Take a list of directives instead of a list of symlinks.
* guix/docker.scm (symlink-source, topmost-component): Remove.
(directive-file): New procedure.
(build-docker-image): Remove #:symlinks and add #:extra-files.
Make a sub-directory "extra" and call 'evaluate-populate-directive' for
EXTRA-FILES in that directory.
* guix/scripts/pack.scm (docker-image)[build](symlink->directives,
directives): New procedures.
Pass #:extra-files instead of #:symlinks to 'build-docker-image'.
2019-08-27 12:20:44 +02:00
Ludovic Courtès b908fcd8c0
pack: '-R' honors the requested output.
Fixes <https://bugs.gnu.org/36925>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

* guix/scripts/pack.scm (wrapped-package): Add 'output*' parameter.
[build]: Define 'input' and 'target'; use them instead of #$package and
 #$output, respectively.
(wrapped-manifest-entry): New procedure.
(map-manifest-entries): Call PROC directly.
(guix-pack): Pass WRAPPED-MANIFEST-ENTRY to 'map-manifest-entries'.
2019-08-23 18:41:49 +02:00
Marius Bakke 6a2e54236e
Merge branch 'master' into core-updates 2019-07-31 14:28:56 +02:00
Ludovic Courtès 81c3dc3224
maint: Switch to Guile-JSON 3.x.
Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on
until now: it maps JSON dictionaries to alists (instead of hash tables),
and JSON arrays to vectors (instead of lists).  This commit is about
adjusting all the existing code to this new mapping.

* m4/guix.m4 (GUIX_CHECK_GUILE_JSON): New macro.
* configure.ac: Use it.
* doc/guix.texi (Requirements): Mention the Guile-JSON version.
* guix/git-download.scm (git-fetch)[guile-json]: Use GUILE-JSON-3.
* guix/import/cpan.scm (string->license): Expect vectors instead of
lists.
(module->dist-name): Use 'json-fetch' instead of 'json-fetch-alist'.
(cpan-fetch): Likewise.
* guix/import/crate.scm (crate-fetch): Likewise, and call 'vector->list'
for DEPS.
* guix/import/gem.scm (rubygems-fetch): Likewise.
* guix/import/json.scm (json-fetch-alist): Remove.
* guix/import/pypi.scm (pypi-fetch): Use 'json-fetch' instead of
'json-fetch-alist'.
(latest-source-release, latest-wheel-release): Call 'vector->list' on
RELEASES.
* guix/import/stackage.scm (stackage-lts-info-fetch): Use 'json-fetch'
instead of 'json-fetch-alist'.
(lts-package-version): Use 'vector->list'.
* guix/import/utils.scm (hash-table->alist): Remove.
(alist->package): Pass 'vector->list' on the inputs fields, and default
to the empty vector.
* guix/scripts/import/json.scm (guix-import-json): Remove call to
'hash-table->alist'.
* guix/swh.scm (define-json-reader): Expect pair? or null? instead of
hash-table?.
[extract-field]: Use 'assoc-ref' instead of 'hash-ref'.
(json->branches): Use 'map' instead of 'hash-map->list'.
(json->checksums): Likewise.
(json->directory-entries, origin-visits): Call 'vector->list' on the
result of 'json->scm'.
* tests/import-utils.scm ("alist->package with dependencies"): New test.
* gnu/installer.scm (build-compiled-file)[builder]: Use GUILE-JSON-3.
* gnu/installer.scm (installer-program)[installer-builder]: Likewise.
* gnu/installer/locale.scm (iso639->iso639-languages): Use 'assoc-ref'
instead of 'hash-ref', and pass vectors through 'vector->list'.
(iso3166->iso3166-territories): Likewise.
* gnu/system/vm.scm (system-docker-image)[build]: Use GUILE-JSON-3.
* guix/docker.scm (manifest, config): Adjust for Guile-JSON 3.
* guix/scripts/pack.scm (docker-image)[build]: Use GUILE-JSON-3.
* guix/import/github.scm (fetch-releases-or-tags): Update docstring.
(latest-released-version): Use 'assoc-ref' instead of 'hash-ref'.  Pass
the result of 'fetch-releases-or-tags' to 'vector->list'.
* guix/import/launchpad.scm (latest-released-version): Likewise.
2019-07-25 00:16:41 +02:00