You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Show unexpected stderr in umask panic message
Because `gix_testtools::umask()` is only suitable for use in tests,
where signaling an error with a panic is typically acceptable, it
panics rather than returning an `Error` to indicate errors. To
avoid leading to the use of a potentially inaccurate umask value,
it treats as an error any departure from the typical output of
the `umask` command: in addition to treating a nonzero exit status
as an error, it also treats anything it cannot strictly parse on
stdout as an error, as well as anything at all written to stderr as
an error. The latter is to avoid a situation where a warning is
printed that is could be significant to some umask use cases.
Warnings from `umask` are rare, as well as from the shell that is
used as an intermediary for running the command (since no external
`umask` command need exist and, often, does not) when it is used
just to run `umask`. When they do occur, they are sometimes from
the dynamic linker, such as a warning about a shared library listed
in the `LD_PRELOAD` environment variable that cannot be used by
the shell program. To understand and distinguish such errors, it is
useful to show the text that was sent to stderr, since tests are
sometimes run in environments that are nontrivial to reproduce
otherwise. For example, running tests with `cross` produces an
environment that is not in all respects the same as what one gets
with `docker exec -it <container>`, even if `<container>` is the
same still-running container being used to run the tests.
This modifies `gix_testtools::umask()` so that when it panics due
anything being written to stderr, it shows what was written.
0 commit comments