From: Jeff King <peff@peff•net>
To: Ivan Ivanov <qmastery16@gmail•com>
Cc: "brian m. carlson" <sandals@crustytoothpaste•net>, git@vger•kernel.org
Subject: Re: Test "t0300-credentials" is failing on Arch/Artix: asks to enter the Username/Password in an infinite loop
Date: Thu, 5 Mar 2026 23:38:21 -0500 [thread overview]
Message-ID: <20260306043821.GA3465674@coredump.intra.peff.net> (raw)
In-Reply-To: <CAAaskFC0WETe7NaEfznW-h53Huee2sLLAQYWBA3moLpeULhtcA@mail.gmail.com>
On Fri, Mar 06, 2026 at 05:14:12AM +0300, Ivan Ivanov wrote:
> Brian, thank you very much for checking my logs: indeed, unfortunately
> my system is Arch-based so we can't compare it directly with
> Debian/rules. Thank you for an idea about /dev/shm , although I would
> like to clarify that while it *might* be what is failing this
> particular test - the causes of failure at .out files are different as
> we could see by the prior 0300/0301/0302 and some future tests (could
> share more logs if needed). But the external appearance of these
> errors (Username/Password prompts) is similar to a user and that may
> indicate some common pattern between the problems, i.e. maybe there is
> some extra shell precaution needed on some systems (although I'm a bit
> puzzled why my distro's packager seemingly didn't have such an issue).
The inability to exec scripts in the test directory is the cause of all
of the username/password prompts. What's supposed to happen is:
1. The test script creates a script called "askpass" in the temporary
test directory, and sets its executable bit. That script just
returns a dummy response on its stdout.
2. It then sets the GIT_ASKPASS variable to point to that askpass
script.
3. When Git needs a username/password, it tries (and this is in the
git_prompt() function prompt.c):
a. It runs the askpass program specified by $GIT_ASKPASS.
b. If that doesn't return a password, it prompts on the terminal
using either getpass() or by opening /dev/tty directly
(depending on your platform).
Since we've set $GIT_ASKPASS, we expect it to stop at 3a, returning that
value.
But on your system, running askpass doesn't work (I agree with brian's
guess that it is probably because /dev/shm is mounted with noexec). And
so we jump to 3b, prompting on the terminal. If you just hit enter, then
it will not get the expected value; while it may keep running, it's not
going to work. If you manually typed the same response there that
askpass would have provided, the test would probably succeed.
But of course that's silly. The right solution is to use a temporary
directory that allows execution of scripts. And I would expect there to
be a ton of other test failures, too, as many of the tests write helper
scripts and such.
The culprit is the use of --root=/dev/shm here in the package config:
https://gitlab.archlinux.org/archlinux/packaging/packages/git/-/blob/main/PKGBUILD?ref_type=heads#L71
It's reasonable to point it at a RAM disk (Git's test suite does a lot
of file I/O that gets thrown away, so running on a RAM disk can be much
faster). But it has to be a fully capable filesystem, not one mounted
with noexec. You might want to alert the package maintainer.
-Peff
PS There's one other related tidbit I noticed. These days we have a
$GIT_TERMINAL_PROMPT variable that tells Git not to access the
terminal at all. If that were set to "0" then the broken tests would
not prompt you at all. They'd still be _broken_, because askpass
would not give the result they expected, but at least they wouldn't
spam your terminal with prompts.
It might be worth putting GIT_TERMINAL_PROMPT=0 in test-lib.sh, just
to prevent accidental breakage from becoming too annoying. We didn't
do it when t0300 and friends were written because GIT_TERMINAL_PROMPT
didn't exist back then.
next prev parent reply other threads:[~2026-03-06 4:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 0:42 Test "t0300-credentials" is failing on Arch/Artix: asks to enter the Username/Password in an infinite loop Ivan Ivanov
2026-03-06 1:05 ` Ivan Ivanov
2026-03-06 1:23 ` brian m. carlson
2026-03-06 1:44 ` Ivan Ivanov
2026-03-06 1:59 ` brian m. carlson
2026-03-06 2:14 ` Ivan Ivanov
2026-03-06 2:19 ` Ivan Ivanov
2026-03-06 4:38 ` Jeff King [this message]
2026-03-06 14:14 ` Ivan Ivanov
2026-03-06 16:01 ` Jeff King
2026-03-06 17:36 ` Ivan Ivanov
2026-03-06 21:17 ` brian m. carlson
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260306043821.GA3465674@coredump.intra.peff.net \
--to=peff@peff$(echo .)net \
--cc=git@vger$(echo .)kernel.org \
--cc=qmastery16@gmail$(echo .)com \
--cc=sandals@crustytoothpaste$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox