unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tze Chian Kam <tze.chian.kam@gmail.com>
Cc: 71853@debbugs.gnu.org
Subject: bug#71853: 29.4; `kill-compilation` does not kill compilation process on Windows
Date: Wed, 03 Jul 2024 14:17:06 +0300	[thread overview]
Message-ID: <86h6d6bu8d.fsf@gnu.org> (raw)
In-Reply-To: <CABodVWVOx3tUPDodvqGWeAY_G0+GfHeGtTmnohb26305nc6U=Q@mail.gmail.com> (message from Tze Chian Kam on Wed, 3 Jul 2024 13:26:32 +1000)

> From: Tze Chian Kam <tze.chian.kam@gmail.com>
> Date: Wed, 3 Jul 2024 13:26:32 +1000
> Cc: 71853@debbugs.gnu.org
> 
> > > It is a MSYS2 build of Python.
> >
> > So it's not a native Windows executable, I think, and this could well
> > explain what you see.  What does typing the below display?
> >
> >   M-: (w32-application-type (executable-find "python")) RET
> 
> I get "w32-native".

I guess our detection of MSYS applications needs some update?  Can you
show the list of DLLs that your MSYS2 python.exe depends on?  If you
have GNU Binutils installed, the following command should show that:

  objdump -x /path/to/python.exe | fgrep "DLL Name"

> > Also, does setting w32-start-process-share-console to a non-nil value
> > help with interrupting the MSYS2 Python?
> 
> Yes, it does.

So I guess that version of Python is incompatible with the default
method of interrupting sub-processes that Emacs on Windows uses.  It
is known that some programs need such a special handling on Windows.

> > Some kind of buffering problem, I guess?  Try invoking "python -u" to
> > get unbuffered stdout.
> 
> This will work. However, I tested on another C program and the problem
> still occurs, meaning that my Emacs is buffering everything for some
> reason.

It isn't Emacs, it's the OS.  Emacs on Windows uses pipes to talk to
sub-processes, and pipes are buffered.  You need to fflush in your
program.  This is a known issue without any general solution.

So, bottom line, I see no bug here, only known limitations of handling
sub-processes on MS-Windows.





  reply	other threads:[~2024-07-03 11:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-30  2:57 bug#71853: 29.4; `kill-compilation` does not kill compilation process on Windows Tze Chian Kam
2024-06-30  9:07 ` Eli Zaretskii
     [not found]   ` <CABodVWXdfXUhjhJNb13hcndALq+7A+L8VBODod7vBbD77DW5Vg@mail.gmail.com>
2024-06-30 17:53     ` Eli Zaretskii
2024-07-01  2:53       ` Tze Chian Kam
2024-07-01 11:27         ` Eli Zaretskii
2024-07-02  6:26           ` Tze Chian Kam
2024-07-02  6:36             ` Tze Chian Kam
2024-07-02 12:43               ` Eli Zaretskii
2024-07-02 12:41             ` Eli Zaretskii
2024-07-03  3:26               ` Tze Chian Kam
2024-07-03 11:17                 ` Eli Zaretskii [this message]
2024-07-04  4:30                   ` Tze Chian Kam
2024-07-04  6:18                     ` Eli Zaretskii
2024-07-20  9:50                       ` Eli Zaretskii

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86h6d6bu8d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71853@debbugs.gnu.org \
    --cc=tze.chian.kam@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).