unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Skyler Ferris via Guix-patches via <guix-patches@gnu.org>
To: 70001@debbugs.gnu.org
Subject: [bug#70001] [PATCH] gnu: reprotest: Add missing propogated inputs
Date: Mon, 25 Mar 2024 19:12:52 +0000	[thread overview]
Message-ID: <7893aa6e-886b-4e74-999f-886a8ea0166b@protonmail.com> (raw)

Hello,

This patch adds some propagated inputs to the reprotest package so that 
most tests can run in a pure shell. I observed some issues running this 
package in a pure shell when reviewing issue 69991 (which updates 
diffoscope). Some of the new propagated inputs have already been listed 
as native inputs, but I did not remove them under the assumption that 
these programs are actually needed for the build machine. There are 3 
tests which still do not work in a pure shell.

The fileordering and user_group tests both require setuid programs. Both 
require fusermount and user_group requires sudo. I do not think it is 
possible to make these tests work within a pure shell because a package 
cannot provide setuid programs (only an operating system can).

The domain_host test does not work in a pure shell due to a dependency 
on a program named domainname. I was unable to locate a package which 
provides this command. The closest I could find is the inetutils package 
which provides dnsdomainname but I do not think this is sufficient for 
the test to run correctly. The domainname command is used in 
reprotest/build.py line 243:

```python
_ = _.prepend_to_build_command(*"unshare -r --uts".split(),
     "sh", "-ec", r"""
     hostname {1}
     domainname "{2}"
     """.format(build.aux_tree, hostname, domainname) + '"$@"', "-")
```

It looks to me like this is trying to set both the hostname and the 
domainname, which makes sense if it wants to test for these settings as 
a cause of non-determinism. The hostname command supports setting, but 
the dnsdomainname command only supports retrieving the domain name.

Additionally, this patch adds a new build phase to call fusermount3 
instead of fusermount, which is the name of the command provided by 
Guix's fuse package. This does not make it work in a pure shell but it 
does make it work in an operating system that provides the suid version 
of the binary.


Summary:

Tests working in pure shell:

- aslr
- build_path
- environment
- exec_path
- home
- kernel
- locales
- num_cpus
- time
- timezone
- umask

Tests work with appropriate suid programs provided:

- fileordering
- user_group

Tests that do not work on any Guix system:

- domain_host

To try reprotest in a pure shell, create the following makefile in an 
empty directory:

```make
destination:
     echo foo > destination

clean:
     rm -f destination
```

Then, run the following command to try the working tests. If you want to 
see the test report a problem you will need to change the recipe to be 
non-deterministic. For example, use `date` instead of `echo foo` in 
order to see the time test report a problem. Note that make is an 
additional package in the shell because this is the build system that 
happens to be used, but it would not make sense to add this as a 
mandatory input to the package because some people might use reprotest 
without using make. If you remove one of the propagated inputs then at 
least one of these tests will crash, with the exception of findutils and 
diffoscope which are used by reprotest outside the context of a specific 
test (to get the hashes of multiple files and display diffs to the user, 
respectively).

```shell
guix shell --pure reprotest make -- bash -c 'cd /tmp/test && reprotest 
"make clean && make" destination --variations="+environment, 
+build_path, +kernel, +aslr, +num_cpus, +time, +home, +locales, 
+exec_path, +timezone, +umask"'
```

You can try the suid-dependent tests with the same Makefile. The sudo 
and fuse-2 packages need to be installed; the default %setuid-programs 
variable includes the relevant binaries. Remove the `--pure` flag from 
the shell invocation and change the `--variations` flag in the reprotest 
variations to have the value `"+fileordering, +user_group"`.

Regards,
Skyler






             reply	other threads:[~2024-03-25 19:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 19:12 Skyler Ferris via Guix-patches via [this message]
2024-03-25 19:16 ` [bug#70001] [PATCH] gnu: reprotest: Add missing propogated inputs Skyler Ferris via Guix-patches via
2024-03-26  6:02 ` Vagrant Cascadian
2024-03-26 19:57   ` Skyler Ferris via Guix-patches via
2024-03-26 20:06     ` Skyler Ferris via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7893aa6e-886b-4e74-999f-886a8ea0166b@protonmail.com \
    --to=guix-patches@gnu.org \
    --cc=70001@debbugs.gnu.org \
    --cc=skyvine@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).