From: Eli Zaretskii <eliz@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Shell quoting in Eshell (was: eshell-batch-file)
Date: Sat, 15 Jun 2024 22:10:01 +0300 [thread overview]
Message-ID: <86y176rpiu.fsf@gnu.org> (raw)
In-Reply-To: <8826aea7-75dd-c147-3dd1-93489038a1ac@gmail.com> (message from Jim Porter on Sat, 15 Jun 2024 11:36:57 -0700)
> Date: Sat, 15 Jun 2024 11:36:57 -0700
> Cc: emacs-devel@gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
>
> > Why do we expect to see "killed" or "interrupt" in this case?
>
> Eshell intends to print the exit message from the process sentinel of
> the tail process here (unless the message starts with "finished" or
> "exited"). After thinking this over, I realized that the test failure
> you encountered was actually a race condition: Eshell tries to kill all
> the processes in the pipeline, which -- if Eshell is fast enough --
> sends a signal to the tail process, making us print the exit message.
> However, if Eshell is slow, the tail process might exit on its own
> before we can signal it, leading to no message.
>
> I've now fixed this test so that we check that there are zero or one
> exit messages (the old code was too lenient in some regards).
The test succeeds, thanks.
> I think the only remaining thing to do here is to figure out why you
> needed to change 'eshell-command-result--equal'. I imagine this is
> because I made a mistake somewhere with case normalization (my guess is
> in the globbing tests). Hopefully it's just a problem with the tests,
> but it could be that there's a bug hiding in Eshell proper.
I don't see how you could fix this in the tests, since this is a basic
problem with comparing file names on MS-Windows. See below.
> Could you try the diff below and report back the failures when you get a
> chance?
Here:
Test esh-cmd-test/which/plain/external-program backtrace:
signal(ert-test-failed (((should (eshell-command-result--equal comma
ert-fail(((should (eshell-command-result--equal command (eshell-test
(if (unwind-protect (setq value-7 (apply fn-5 args-6)) (setq form-de
(let (form-description-9) (if (unwind-protect (setq value-7 (apply f
(let ((value-7 'ert-form-evaluation-aborted-8)) (let (form-descripti
(let* ((fn-5 #'eshell-command-result--equal) (args-6 (condition-case
(let ((eshell-module-loading-messages nil)) (let* ((fn-5 #'eshell-co
(let ((ert--infos (cons (cons "Command logs: " #'eshell-get-debug-lo
eshell-command-result-equal("which sh" "d:/usr/MSYS/bin/sh.exe\n")
#f(lambda () [t] (let* ((fn-167 #'executable-find) (args-168 (condit
#f(compiled-function () #<bytecode 0xc12a3827bbdeed7>)()
handler-bind-1(#f(compiled-function () #<bytecode 0xc12a3827bbdeed7>
ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
ert-run-test(#s(ert-test :name esh-cmd-test/which/plain/external-pro
ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
command-line-1(("-L" ";." "-l" "ert" "--eval" "(setq treesit-extra-l
command-line()
normal-top-level()
Test esh-cmd-test/which/plain/external-program condition:
Command logs: command: "which sh"
(ert-test-failed
((should
(eshell-command-result--equal command
(eshell-test-command-result command)
result))
:form
(eshell-command-result--equal "which sh"
#("D:/usr/MSYS/bin/sh.exe\n" 22 23
(field command-output front-sticky
... rear-nonsticky
... insert-in-front-hooks ...))
"d:/usr/MSYS/bin/sh.exe\n")
:value nil :explanation
(nonequal-result (command "which sh")
(result #("D:/usr/MSYS/bin/sh.exe\n" 22 23 ...))
(expected "d:/usr/MSYS/bin/sh.exe\n"))))
FAILED 59/66 esh-cmd-test/which/plain/external-program (0.003953 sec) at lisp/eshell/esh-cmd-tests.el:538
IOW: you run "which SOMETHING" and pretend to know how it will
capitalize the drive letter.
next prev parent reply other threads:[~2024-06-15 19:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-09 6:11 eshell-batch-file Eli Zaretskii
2024-06-09 18:55 ` eshell-batch-file Jim Porter
2024-06-09 19:06 ` eshell-batch-file Eli Zaretskii
2024-06-09 19:15 ` Shell quoting in Eshell (was: eshell-batch-file) Eli Zaretskii
2024-06-09 20:07 ` Jim Porter
2024-06-09 22:37 ` Jim Porter
2024-06-15 9:38 ` Eli Zaretskii
2024-06-15 18:36 ` Jim Porter
2024-06-15 19:10 ` Eli Zaretskii [this message]
2024-06-15 20:06 ` Jim Porter
2024-06-16 5:21 ` Eli Zaretskii
2024-06-16 5:57 ` Jim Porter
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=86y176rpiu.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=jporterbugs@gmail.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.