1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-12 10:00:46 +02:00
Commit graph

439 commits

Author SHA1 Message Date
Maxim Cournoyer
9f0ae51ce5
Refine regexp in update-guix-package.scm script.
* build-aux/update-guix-package.scm (%guix-git-repo-push-url-regexp): Refine
regexp.

Change-Id: I562bad8f654fb797a6f0ddc5bf94feba203cb732
2025-06-25 23:00:59 +09:00
Reepca Russelstein
c659f977bb
daemon: add seccomp filter for slirp4netns.
The container that slirp4netns runs in should already be quite difficult to do
anything malicious in beyond basic denial of service or sending of network
traffic.  There is, however, one hole remaining in the case in which there is
an adversary able to run code locally: abstract unix sockets.  Because these
are governed by network namespaces, not IPC namespaces, and slirp4netns is in
the root network namespace, any process in the root network namespace can
cooperate with the slirp4netns process to take over its user.

To close this, we use seccomp to block the creation of unix-domain sockets by
slirp4netns.  This requires some finesse, since slirp4netns absolutely needs
to be able to create other types of sockets - at minimum AF_INET and AF_INET6

Seccomp has many, many pitfalls.  To name a few:

1. Seccomp provides you with an "arch" field, but this does not uniquely
   determine the ABI being used; the actual meaning of a system call number
   depends on both the number (which is often the result of ORing a related
   system call with a flag for an alternate ABI) and the architecture.

2. Seccomp provides no direct way of knowing what the native value for the
   arch field should be; the user must do configure/compile-time testing for
   every architecture+ABI combination they want to support.  Amusingly enough,
   the linux-internal header files have this exact information
   (SECCOMP_ARCH_NATIVE), but they aren't sharing it.

3. The only system call numbers we naturally have are the native ones in
   asm/unistd.h.  __NR_socket will always refer to the system call number for
   the target system's ABI.

4. Seccomp can only manipulate 32-bit words, but represents every system call
   argument as a uint64.

5. New system call numbers with as-yet-unknown semantics can be added to the
   kernel at any time.

6. Based on this comment in arch/x86/entry/syscalls/syscall_32.tbl:

   # 251 is available for reuse (was briefly sys_set_zone_reclaim)

   previously-invalid system call numbers may later be reused for new system
   calls.

7. Most architecture+ABI combinations have system call tables with many gaps
   in them.  arm-eabi, for example, has 35 such gaps (note: this is just the
   number of distinct gaps, not the number of system call numbers contained in
   those gaps).

8. Seccomp's BPF filters require a fully-acyclic control flow graph.
   Any operation on a data structure must therefore first be fully
   unrolled before it can be run.

9. Seccomp cannot dereference pointers.  Only the raw bits provided to the
   system calls can be inspected.

10. Some architecture+ABI combos have multiplexer system calls.  For example,
    socketcall can perform any socket-related system call.  The arguments to
    the multiplexed system call are passed indirectly, via a pointer to user
    memory.  They therefore cannot be inspected by seccomp.

11. Some valid system calls are not listed in any table in the kernel source.
    For example, __ARM_NR_cacheflush is an "ARM private" system call.  It does
    not appear in any *.tbl file.

12. Conditional branches are limited to relative jumps of at most 256
    instructions forward.

13. Prior to Linux 4.8, any process able to spawn another process and call
    ptrace could bypass seccomp restrictions.

To address (1), (2), and (3), we include preprocessor checks to identify the
native architecture value, and reject all system calls that don't use the
native architecture.

To address (4), we use the AC_C_BIGENDIAN autoconf check to conditionally
define WORDS_BIGENDIAN, and match up the proper portions of any uint64 we test
for with the value in the accumulator being tested against.

To address (5) and (6), we use system call pinning.  That is, we hardcode a
snapshot of all the valid system call numbers at the time of writing, and
reject any system call numbers not in the recorded set.  A set is recorded for
every architecture+ABI combo, and the native one is chosen at compile-time.
This ensures that not only are non-native architectures rejected, but so are
non-native ABIs.  For the sake of conciseness, we represent these sets as sets
of disjoint ranges.  Due to (7), checking each range in turn could add a lot
of overhead to each system call, so we instead binary search through the
ranges.  Due to (8), this binary search has to be fully unrolled, so we do
that too.

It can be tedious and error-prone to manually produce the syscall ranges by
looking at linux's *.tbl files, since the gaps are often small and
uncommented.  To address this, a script, build-aux/extract-syscall-ranges.sh,
is added that will produce them given a *.tbl filename and an ABI regex (some
tables seem to abuse the ABI field with strange values like "memfd_secret").
Note that producing the final values still requires looking at the proper
asm/unistd.h file to find any private numbers and to identify any offsets and
ABI variants used.

(10) used to have no good solution, but in the past decade most architectures
have gained dedicated system call alternatives to at least socketcall, so we
can (hopefully) just block it entirely.

To address (13), we block ptrace also.

* build-aux/extract-syscall-ranges.sh: new script.
* Makefile.am (EXTRA_DIST): register it.
* config-daemon.ac: use AC_C_BIGENDIAN.
* nix/libutil/spawn.cc (setNoNewPrivsAction, addSeccompFilterAction): new
  functions.
* nix/libutil/spawn.hh (setNoNewPrivsAction, addSeccompFilterAction): new
  declarations.
  (SpawnContext)[setNoNewPrivs, addSeccompFilter]: new fields.
* nix/libutil/seccomp.hh: new header file.
* nix/libutil/seccomp.cc: new file.
* nix/local.mk (libutil_a_SOURCES, libutil_headers): register them.
* nix/libstore/build.cc (slirpSeccompFilter, writeSeccompFilterDot):
  new functions.
  (spawnSlirp4netns): use them, set seccomp filter for slirp4netns.

Change-Id: Ic92c7f564ab12596b87ed0801b22f88fbb543b95
Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
2025-06-24 10:07:58 -04:00
Maxim Cournoyer
05afc4a72a
build: Update push URL regexp for 'update-guix-package' script.
* build-aux/update-guix-package.scm
(%savannah-guix-git-repo-push-url-regexp): Rename to...
(%guix-git-repo-push-url-regexp): Update regexp.
(find-origin-remote): Adjust accordingly.

Change-Id: I3e6f1a1fb0b6921f7c263e9b93a47ac602b92f0d
2025-06-09 15:39:42 +09:00
Sergey Trofimov
7fef609df1
build: Require scripts/guix in pre-inst-env.
* Makefile.am: Make scripts/guix depend on local guile.
* build-aux/pre-inst-env.in: Require scripts/guix.

Change-Id: Ib248da80a1e8215c4c5e6c485ade41a893ac0fd5
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-06-02 11:20:22 +02:00
Ludovic Courtès
2f65438eba
tests: Run in a chroot and unprivileged user namespaces.
* build-aux/test-env.in: Pass ‘--disable-chroot’ only when unprivileged
user namespace support is lacking and warn in that case.
* tests/store.scm ("build-things, check mode"): Use ‘gettimeofday’
rather than a shared file as a source of entropy.
("symlink is symlink")
("isolated environment", "inputs are read-only")
("inputs cannot be remounted read-write")
("build root cannot be made world-readable")
("/tmp, store, and /dev/{null,full} are writable")
("network is unreachable"): New tests.
* tests/processes.scm ("client + lock"): Skip when
‘unprivileged-user-namespace-supported?’ returns true.

Change-Id: I3b3c3ebdf6db5fd36ee70251d07b893c17ca1b84
2025-03-26 17:57:44 +01:00
Reepca Russelstein
f125143d64
build: Restrict access to daemon socket in tests.
With the weak isolation available to the test daemon, it is essential to
disallow untrusted access to it, as otherwise another local user can gain our
user's credentials easily.

* build-aux/test-env.in: ensure the daemon-socket directory is freshly-created
  with 0700 permissions.

Change-Id: I742f70fc6fc28e5b4dc88d590eef3daf1b964670
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-10-24 14:50:09 +02:00
Christopher Baines
d82ac48b07
guix: channels: Enable specifiying available builtin builders.
When computing channel instance derivations.

This is useful when you want to generate compatible derivations that can be
run with a daemon that potentially doesn't support builtin builders that the
daemon you're using to generate the derivations has.

I'm looking at this in particular because I want to use this in the data
service, since it provides substitutes for derivations, and since these can be
built on other machines, it's useful to control which builtin builders they
depend on.

Fixes: <https://issues.guix.gnu.org/67250>.

* build-aux/build-self.scm (build-program): Accept
 #:built-in-builders and pass along to port->connection or
open-connection as approriate.
(build): Accept and pass on #:built-in-builders.
* guix/channels.scm (build-from-source, build-channel-instance,
channel-instance-derivations, channel-instances->manifest,
channel-instances->derivation): Accept and pass on
 #:built-in-builders.

Change-Id: I315c990de66c6f7dca25a859165a5568abe385ea
2024-07-18 11:18:29 +01:00
Janneke Nieuwenhuizen
2b8a2a6e72
maint: Generate doc/version[-LANG].texi using `mdate-from-git.scm'.
This replaces Automake's `build-aux/mdate-sh' with our own
`build-aux/mdate-from-git.scm' to use reproducible timestamps from Git
instead.

* build-aux/mdate-from-git.scm: New script.
* bootstrap: Use it to replace build-aux/mdate-sh.
* Makefile.am (EXTRA_DIST): Add it.

Change-Id: I17d0a7de9ffea397129c0db1728f86e28a4e245f
2024-04-19 16:45:41 +02:00
Janneke Nieuwenhuizen
f83b5274c8
maint: Support `make doc-pot-update' from a tarball.
* build-aux/xgettext.scm: Move setting of environment variables to shell
header.
(main): Use SOURCE_DATE_EPOCH as fallback for timestamp.  This fixes running
from a tarball.
* Makefile.am (EXTRA_DIST): Add it.

Change-Id: Ic487587b22495868fd2a21545a13dc9e3458299c
2024-04-19 16:45:41 +02:00
Janneke Nieuwenhuizen
e5dda412c2
maint: Fix header.
* build-aux/xgettext.scm: Add `Guix' parts to header.

Change-Id: I4fb03b8b0588f0482bcb1a095518b6751d111031
2024-04-14 11:41:41 +02:00
Janneke Nieuwenhuizen
6c63c36677
maint: Use xgettext.scm wrapper to create .PO files reproducibly.
* build-aux/xgettext.scm: New script.
* po/guix/Makevars (XGETTEXT): Set it.
(XGETTEXT_OPTIONS): Add --xgettext option to `real' xgettext.
* po/packages/Makevars (XGETTEXT): Set it.
(XGETTEXT_OPTIONS): Add --xgettext option to `real' xgettext.

Change-Id: I71b6b843970090f765f46ac346b92a346560e3f0
2024-04-14 10:29:11 +02:00
Tomas Volf
6702118c94
build: test-driver.scm: Set mode.
Emacs auto-detects the build-aux/test-driver.scm as sh-mode, due to the
shebang.  So override the auto-detection using a local variable forcing
scheme-mode.

* build-aux/test-driver.scm: Set mode to scheme.

Change-Id: I07f12656dba5fb7b52447b94569307a2a605ffc1
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2024-01-05 00:31:36 -05:00
Janneke Nieuwenhuizen
3c6b6941a2
maint: Add 'etc/hurd-manifest.scm'.
* build-aux/cuirass/hurd-manifest.scm: Move to...
* etc/hurd-manifest.scm: ...here.
* Makefile.am (EXTRA_DIST): Update accordingly.
2023-08-21 10:45:45 +02:00
Janneke Nieuwenhuizen
9dfda9e1a0
cuirass: Update hurd-manifest with newly supported packages.
* build-aux/cuirass/hurd-manifest.scm: Include full build of python-minimal
and gettext-minimal (no longer without-tests).  Add grub-minimal, grub,
guix-without-tests and guile-3.0 (no longer delete it from guix dependencies).
2023-07-25 15:48:42 +02:00
Ludovic Courtès
d90bd5642a
cuirass: Create just as many threads as needed.
* build-aux/cuirass/evaluate.scm (command-line): Change second argument
to 'n-par-for-each'.
2022-05-26 11:41:05 +02:00
Ludovic Courtès
98a6642298
cuirass: Fork inferior processes before creating threads.
Works around <https://issues.guix.gnu.org/55441#12>.

Start from commit bd86bbd300,
'open-inferior' uses 'primitive-fork' instead of 'open-pipe*'.  As a
result, child process could potentially hang before calling 'execl' due
to undefined behavior when forking a multi-threaded process.

* build-aux/cuirass/evaluate.scm <top level>: Call 'open-inferior'
before 'n-par-for-each'.
2022-05-26 11:41:05 +02:00
Ludovic Courtès
598f7289db
cuirass: Close each inferior upon completion.
* build-aux/cuirass/evaluate.scm <top level>: Add 'close-inferior' call.
2022-05-20 18:46:07 +02:00
Attila Lendvai
9ebc9ca070
tests: Move keys into ./tests/keys/ and add a third ed25519 key.
The third key will be used in an upcoming commit.

Rename public keys to .pub.

* guix/tests/gnupg.scm (%ed25519-3-public-key-file): New variable.
(%ed25519-3-secret-key-file): New variable.
(%ed25519-2-public-key-file): Renamed from %ed25519bis-public-key-file.
(%ed25519-2-secret-key-file): Renamed from %ed25519bis-secret-key-file.
* tests/keys/ed25519-3.key: New file.
* tests/keys/ed25519-3.sec: New file.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-12-22 10:53:19 +01:00
Tobias Geerinckx-Rice
5c1ba739d4
build-self: Help users to submit useful bug reports.
* build-aux/build-self.scm (build): Request the ‘COMPLETE output’.
2021-11-27 00:49:53 +01:00
Julien Lepiller
0623138ffa
maint: Factorize po xref translation.
This ensures we use the same method in "make" as in "guix/self.scm".

* Makefile.am: Build guix/build/po.scm.
* build-aux/convert-xref.scm: New file.
* doc/local.mk (xref_command): Use it.
* guix/self.scm (translate-cross-references): Move it...
* guix/build/po.scm: Parse comments and flags separately to find fuzzy
flags.
(translate-cross-references): ...here.
(parse-tree->assoc): Ignore fuzzy entries.
2021-10-17 18:26:44 +02:00
Ludovic Courtès
ef82ba9dd9
build: Makefile splits Scheme compilation in four steps.
Fixes <https://bugs.gnu.org/48963>.
Reported by Julien Lepiller <julien@lepiller.eu>.

This reduces peak memory consumption to something less unreasonable.

* Makefile.am (make-go): Depend on 'make-*-go' targets; remove body.
(guile-compilation-rule): New function.
(MODULES_CORE, MODULES_PACKAGES, MODULES_SYSTEM, MODULES_CLI): New
variables.
<top level>: Call 'guile-compilation-rule' 4 times.
* build-aux/compile-all.scm <top level>: Expect "--total" and
"--processed".  Take them into account when displaying progress
reports.
2021-06-23 23:35:27 +02:00
Ludovic Courtès
003728cfab
build: Remove Guile 2.2 workaround.
* build-aux/compile-all.scm <top level>: Remove Guile 2.2 workaround.
2021-06-18 14:18:06 +02:00
Maxim Cournoyer
b7cbca221f
Merge branch 'version-1.3.0' 2021-05-11 22:42:59 -04:00
Maxim Cournoyer
ed2d4d52dd
maint: update-NEWS: Sort packages prior writing to the data file.
* build-aux/update-NEWS.scm (main): Sort packages.
2021-05-10 13:48:02 -04:00
Timothy Sample
fbc2a52a32
download: Use Disarchive as a last resort.
This is a fixed version of 66b14dccdd,
which was reverted in e74250c3c5.

* guix/download.scm (%disarchive-mirrors): New variable.
(%disarchive-mirror-file): New variable.
(built-in-download): Add 'disarchive-mirrors' keyword argument and
pass its value along to the 'builtin:download' derivation.
(url-fetch): Pass '%disarchive-mirror-file' to 'built-in-download'.
* guix/scripts/perform-download.scm (perform-download): Read
Disarchive mirrors from the environment and pass them to
'url-fetch'.
* guix/build/download.scm (disarchive-fetch/any): New procedure.
(url-fetch): Add 'disarchive-mirrors' keyword argument, use it to
make a list of URIs, and use the new procedure to fetch the file if
all other methods fail.
* build-aux/build-self.scm (build-program)[select?]: Exclude '(guix
build download)'.
* guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-json' to
the list of extensions.
2021-04-29 11:24:48 -04:00
Ludovic Courtès
c59cc2383d
import: Remove Nix importer.
This importer has suffered from bitrot and no longer works with current
Nix and Nixpkgs.  See <https://bugs.gnu.org/32339> and
<https://bugs.gnu.org/36255>.

* guix/import/snix.scm, guix/scripts/import/nix.scm,
tests/snix.scm: Remove.
* Makefile.am (MODULES, SCM_TESTS): Remove them.
* guix/scripts/import.scm (importers): Remove "nix".
* build-aux/test-env.in: Remove NIXPKGS variable.
* configure.ac: Remove '--with-nixpkgs' option.
* doc/guix.texi (Invoking guix import): Remove bit about "guix import
nix".
* etc/completion/fish/guix.fish: Likewise.
2021-04-25 14:34:09 +02:00
Maxim Cournoyer
18dc8c6f0f
build-aux: Relax the regexp used to match NEWS sections.
A number of packages doesn't really make sense in the name of the section to
be substituted.  This change allows using simply '*** new packages' instead of
'*** 1999 new packages', for example, and have the update-NEWS.scm script
update it.

* build-aux/update-NEWS.scm (write-packages-added) <regexp>: Do not care about
leading white space in the name of the section.
2021-04-23 21:32:46 -04:00
Ludovic Courtès
d95168321f
import: Remove Nix importer.
This importer has suffered from bitrot and no longer works with current
Nix and Nixpkgs.  See <https://bugs.gnu.org/32339> and
<https://bugs.gnu.org/36255>.

* guix/import/snix.scm, guix/scripts/import/nix.scm,
tests/snix.scm: Remove.
* Makefile.am (MODULES, SCM_TESTS): Remove them.
* guix/scripts/import.scm (importers): Remove "nix".
* build-aux/test-env.in: Remove NIXPKGS variable.
* configure.ac: Remove '--with-nixpkgs' option.
* doc/guix.texi (Invoking guix import): Remove bit about "guix import
nix".
* etc/completion/fish/guix.fish: Likewise.
2021-04-20 12:13:16 +02:00
Ludovic Courtès
a81a19930b
build-self: Take care of the spinner in the parent process.
This simplifies code and mostly ensures we don't print a spinner while
there's build activity going on.

* build-aux/build-self.scm (build-program): Remove 'spin' and
'call-with-new-thread' call from "compute-guix-derivation" body.  Remove
"Computing Guix derivation" message.
(proxy): Pass extra argument to 'select'.  Display a spinner when
'select' returns empty lists.
(build): Print "Computing Guix derivation" message here.
2021-04-01 14:58:55 +02:00
Ludovic Courtès
1c10c2751a
build-self: Forward sub-process build output to (current-build-output-port).
Fixes <https://bugs.gnu.org/41930>.

* build-aux/build-self.scm (build-program): Add extra 'build-output'
parameter.  Interpret it as a socket name and connect to it; use it as
the CURRENT-BUILD-OUTPUT-PORT.
(proxy): New procedure.
(build): Open a named socket.  Accept connections and call 'proxy' on it.
2021-04-01 14:58:55 +02:00
Ludovic Courtès
ef2b9322fa
build-self: Silent Guile warnings while computing the derivation.
In particular, silence the Guile-Git autoload warnings introduced by
c1940fde43.

* build-aux/build-self.scm (build-program): Wrap 'guix-derivation' call
in 'parameterize'.
2021-03-19 21:44:36 +01:00
Mathieu Othacehe
76bea3f8bc
ci: Remove hydra support.
This removes hydra support to use Cuirass as the only continuous integration
system.

* build-aux/hydra/gnu-system.scm: Remove it.
* build-aux/hydra/guix-modular.scm: Ditto.
* build-aux/hydra/guix.scm: Ditto.
* build-aux/cuirass/hydra-to-cuirass.scm: Ditto.
* Makefile.am (EXTRA_DIST): Update it.
(hydra-jobs.scm): Remove it.
(cuirass-jobs.scm): Update it.
* build-aux/hydra/evaluate.scm: Move it to ...
* build-aux/cuirass/evaluate.scm: ... here.
* build-aux/cuirass/guix-modular.scm: Remove it.
* build-aux/cuirass/gnu-system.scm: Ditto.
* guix/packages.scm (%hydra-supported-systems): Rename it to ...
(%cuirass-supported-systems): ... this variable.
* build-aux/check-final-inputs-self-contained: Adapt it.
* etc/release-manifest.scm: Ditto.
* gnu/ci.scm (package->alist): Remove it.
(derivation->job): New procedure.
(package-job, package-cross-job, cross-jobs, image-jobs, system-test-jobs,
tarball-jobs): Use it.
(guix-jobs): New procedure.
(hydra-jobs): Rename it to ...
(cuirass-jobs): ... this procedure.
2021-03-10 08:49:48 +01:00
Ludovic Courtès
316fc2acbb
channels: Record 'guix' channel metadata in (guix config).
Partially fixes <https://bugs.gnu.org/45896>.

* guix/config.scm.in (%channel-metadata): New variable.
* guix/describe.scm (channel-metadata): Use it.
(current-channels): New procedure.
(current-profile-entries): Clarify docstring.
* guix/self.scm (compiled-guix): Add #:channel-metadata and pass it to
'make-config.scm'.
(make-config.scm): Add #:channel-metadata and define '%channel-metadata'
in the generated file.
(guix-derivation): Add #:channel-metadata and pass it to 'compiled-guix'.
* guix/channels.scm (build-from-source): Replace 'name', 'source', and
'commit' parameters with 'instance'.  Pass #:channel-metadata to BUILD.
(build-channel-instance): Adjust accordingly.
* build-aux/build-self.scm (build-program): Add #:channel-metadata
and pass it to 'guix-derivation'.
(build): Add #:channel-metadata and pass it to 'build-program'.
* guix/scripts/describe.scm (display-profile-info): Add optional
'channels' parameter.  Pass it to 'display-profile-content'.
(display-profile-content): Add optional 'channels' parameter and honor
it.  Iterate on CHANNELS rather than on the manifest entries of
PROFILE.
(guix-describe): When PROFILE is #f, call 'current-channels' and pass it
to 'display-profile-info', unless it returns the empty list.
2021-02-04 09:23:39 +01:00
Maxim Cournoyer
5e652e94a9
build: Add a --show-duration option to the SCM test-driver.
* build-aux/test-driver.scm (script-version): Update.
(show-help): Document it.
(%options): Add the 'show-duration' option.
(test-runner-gnu): Pass as a new argument.
[test-cases-start-time]: New inner variable.
[test-on-test-begin-gnu]: New hook, used to record the start time.
[test-on-test-end-gnu]: Conditionally print elapsed time.  Record it as the
optional metadata in the test result file (.trs).
* doc/guix.texi (Running the Test Suite): Document it.
2021-02-02 00:28:49 -05:00
Ludovic Courtès
aedbc5ff32
guix package: Add '--export-channels'.
* guix/channels.scm (sexp->channel): Export.
* guix/describe.scm: Use (guix channels).
(manifest-entry-provenance): New procedure.
* guix/scripts/package.scm (channel=?, export-channels): New
procedures.
(show-help, %options): Add '--export-channels'.
(process-query): Honor it.
* build-aux/build-self.scm (build-program)[select?]: Exclude (guix
channels) to account for the (guix describe) change above.
* doc/guix.texi (Invoking guix package): Document it.
2021-02-01 17:32:35 +01:00
Maxim Cournoyer
26a66d0fea
build: test-driver.scm: Allow running as a standalone script.
* build-aux/test-driver.scm: Add an exec-based shebang and set the script
executable bit.
(main): Insert a newline after the version string is printed with --version.
2021-01-31 22:28:46 -05:00
Maxim Cournoyer
93a628c4e4
build: test-driver.scm: Add a new '--errors-only' option.
* build-aux/test-driver.scm (show-help): Add the help text for the
new '--errors-only' option.
(%options): Add the errors-only option.
(test-runner-gnu): Add the errors-only? parameter and update doc.  Move the
logging of the test data after the test has completed, so a choice can be made
whether to keep it or discard it based on the value of the test result.
(main): Pass the errors-only? option to the driver.
* doc/guix.texi (Running the Test Suite): Document the new option.
2021-01-31 22:28:46 -05:00
Maxim Cournoyer
a1ea2acb37
build: test-driver.scm: Add test cases filtering options.
* build-aux/test-driver.scm (show-help): Add help text for the new --select
and --exclude options.
(%options): Add the new select and exclude options.
(test-runner-gnu): Pass them to the test runner.  Update doc.
(test-match-name*, test-match-name*/negated, %test-match-all): New variables.
(main): Compute the test specifier based on the values of the new options and
apply it to the current test runner when running the test file.
* doc/guix.texi (Running the Test Suite): Document the new options.
2021-01-31 22:28:37 -05:00
Maxim Cournoyer
346210b1b2
build: test-driver.scm: Enable colored test results by default.
The Automake parallel test harness does its own smart detection of the
terminal color capability and always provides the --color-tests argument to
the driver.  This change defaults the --color-tests argument to true when the
test driver is run on its own (not via Automake).

* build-aux/test-driver.scm (main): Set the default value of the --color-tests
argument to true when it's not explicitly provided.
2021-01-31 22:23:41 -05:00
Maxim Cournoyer
13f299b2c9
build: test-driver.scm: Make output redirection optional.
This makes it easier (and less surprising) for users to experiment with the
custom Scheme test driver directly.  The behavior is unchanged from Automake's
point of view.

* build-aux/test-driver.scm (main): Make the --log-file and --trs-file
arguments optional and update doc.  Only open, redirect and close a port to a log file when
the --log-file option is provided.  Only open and close a port to a trs file
when the --trs-file option is provided.
(test-runner-gnu): Set OUT-PORT parameter default value to the current output
port.  Set the TRS-PORT parameter default value to a void port.  Update doc.
2021-01-31 22:23:41 -05:00
Maxim Cournoyer
3de898b43c
maint: update-guix-package: Optionally add sources to store.
Following discussions in <https://issues.guix.gnu.org/43893>, keeping a copy
of the updated package source is desirable when generating a release.

* build-aux/update-guix-package.scm (version-controlled?): Remove variable.
(call-with-temporary-git-worktree): Renamed from
'with-temporary-git-worktree'.  Update doc.  Do not change directory
implicitly.  Define as a procedure, not a syntax.
(keep-source-in-store): New procedure.
(main): Adjust to use with call-with-temporary-git-worktree.  Add the sources
to the store when GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set.  Exit gracefully
when FIND-ORIGIN-REMOTE returns #f.
(%savannah-guix-git-repo-push-url-regexp): Adjust match for a potential colon
separator.
* Makefile.am (GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT): Adjust.
* .dir-locals.el (scheme-mode): Remove entry for with-temporary-git-worktree.
* doc/contributing.texi (Updating the Guix Package): Update doc.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-11-12 09:23:27 -05:00
Maxim Cournoyer
13a3b9c748
maint: update-guix-package: Include the git.sv.gnu.org alias.
* build-aux/update-guix-package.scm (%savannah-guix-git-repo-push-url): Rename
to...
(%savannah-guix-git-repo-push-url-regexp): ...this.  Add the 'sv' alternative
to 'savannah' and the (push) suffix in the URL regexp.
(find-origin-remote): Adjust accordingly.

Reported-by: Ludovic Courtès <ludo@gnu.org>
2020-10-25 15:14:31 -04:00
Maxim Cournoyer
5800d2aae2
maint: update-guix-package: Prevent accidentally breaking guix pull.
Fixes <https://issues.guix.gnu.org/43893>.

This changes the 'update-guix-package' tool so that it:

1. Always uses a clean checkout to compute the hash of the updated 'guix'
package.
2. Ensures the commit used in the updated 'guix' package definition has already
been pushed upstream.

* build-aux/update-guix-package.scm (%savannah-guix-git-repo-push-url): New
variable.
(with-input-pipe-to-string, with-temporary-git-worktree): New syntaxes.
(find-origin-remote, git-add-worktree): New procedures.
(commit-already-pushed?): New predicate.
(main): Check the commit used has already been pushed upstream and compute the
hash from a clean checkout.
* doc/contributing.texi (Updating the Guix Package): Document it.
* .dir-locals.el (scheme-mode): Fix indentation of with-temporary-git-worktree.
2020-10-19 14:02:53 -04:00
Jan (janneke) Nieuwenhuizen
fdbf8a7a75
cuirass: Add hurd-manifest.
* build-aux/cuirass/hurd-manifest.scm: New file.
2020-10-04 14:04:14 +02:00
Mathieu Othacehe
c5cf45e906
ci: Add log and outputs keys.
Add 'log and 'outputs properties to hydra objects. This way Cuirass won't
have to go through every derivation to add those properties.

* gnu/ci.scm (package->alist, image-jobs, system-test-jobs, tarball-jobs): Add
'log and 'outputs properties.
* build-aux/hydra/guix-modular.scm (build-job): Ditto.
2020-10-01 18:39:41 +02:00
Mathieu Othacehe
3ca014d1df
ci: Add nix-name and system keys.
Add 'nix-name and 'system properties to hydra objects. This way Cuirass won't
have to go through every derivation to add those properties.

* gnu/ci.scm (package->alist, image-jobs, system-test-jobs, tarball-jobs): Add
'nix-name and 'system properties.
* build-aux/hydra/guix-modular.scm (build-job): Ditto.
2020-10-01 11:46:53 +02:00
Ludovic Courtès
d7965b58d2
build: Remove references to the 'nix-hash' program.
* configure.ac: Remove check for 'nix-hash'.
* tests/base32.scm (%nix-hash, %have-nix-hash?): Remove.
("sha256 & bytevector->nix-base32-string"): Remove test.
* build-aux/pre-inst-env.in: Do not set 'NIX_HASH' environment
variable.
2020-08-29 16:24:17 +02:00
Mathieu Othacehe
4c0c65acfa
Use "guile-zlib" and "guile-lzlib" instead of (guix config).
* Makefile.am (MODULES): Remove guix/zlib.scm and guix/lzlib.scm,
(SCM_TESTS): remove tests/zlib.scm, tests/lzlib.scm.
* build-aux/build-self.scm (make-config.scm): Remove unused %libz variable.
* configure.ac: Remove LIBZ and LIBLZ variables and check instead for
Guile-zlib and Guile-lzlib.
* doc/guix.texi ("Requirements"): Remove zlib requirement and add Guile-zlib
and Guile-lzlib instead.
* gnu/packages/package-management.scm (guix)[native-inputs]: Add "guile-zlib"
and "guile-lzlib",
[inputs]: remove "zlib" and "lzlib",
[propagated-inputs]: ditto,
[arguments]: add "guile-zlib" and "guile-lzlib" to Guile load path.
* guix/config.scm.in (%libz, %liblz): Remove them.
* guix/lzlib.scm: Remove it.
* guix/man-db.scm: Use (zlib) instead of (guix zlib).
* guix/profiles.scm (manual-database): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
* guix/scripts/publish.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib),
(string->compression-type, effective-compression): do not check for zlib and
lzlib availability.
* guix/scripts/substitute.scm (%compression-methods): Do not check for lzlib
availability.
* guix/self.scm (specification->package): Add "guile-zlib" and "guile-lzlib"
and remove "zlib" and "lzlib",
(compiled-guix): remove "zlib" and "lzlib" arguments and add guile-zlib and
guile-lzlib to the dependencies, also do not pass "zlib" and "lzlib" to
"make-config.scm" procedure,
(make-config.scm): remove "zlib" and "lzlib" arguments as well as %libz and
%liblz variables.
* guix/utils.scm (lzip-port): Use (lzlib) instead of (guix lzlib) and do not
check for lzlib availability.
* guix/zlib.scm: Remove it.
* m4/guix.m4 (GUIX_LIBZ_LIBDIR, GUIX_LIBLZ_FILE_NAME): Remove them.
* tests/lzlib.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib), and do not check for zlib and lzlib availability.
* tests/publish.scm: Ditto.
* tests/substitute.scm: Do not check for lzlib availability.
* tests/utils.scm: Ditto.
* tests/zlib.scm: Remove it.
2020-08-24 13:35:24 +02:00
Ludovic Courtès
96bf434c70
maint: Remove 'build-aux/git-authenticate.scm'.
* Makefile.am (channel_intro_commit, channel_intro_signer): New
variables.
(authenticate): Use it.
(EXTRA_DIST): Remove 'build-aux/git-authenticate.scm'.
* build-aux/git-authenticate.scm: Remove.
2020-07-11 12:33:10 +02:00
Ludovic Courtès
619972f7b5
maint: "make authenticate" behaves like 'guix pull' by default.
* build-aux/git-authenticate.scm (%use-historical-authorizations?)
(%introductory-commit): New variables.
* build-aux/git-authenticate.scm (git-authenticate): Use pass the empty
list as #:default-authorizations when %USE-HISTORICAL-AUTHORIZATIONS? is
false.
2020-06-16 16:10:47 +02:00