Subject: RE: bug#45821: Emacs UDP support on Windows

From: Alex Matei <[email-masked]>
Date: Mon, 2 Jan 2023 00:47:12 +0000

Updates on the UDP patch behavior:

  *   I got confused during my validation by 2 things:
     *   ‘dns-query’ works even without your patch changes => it is not a good test ❌
        *   One test that worked for me was using ‘(make-network-process :name "udp-socket1" :remote '[127 0 0 1 1500] :type 'datagram)’
           *   If returns ‘(error "Unsupported connection type")’ if UDP is disabled ❌ , or the process if UDP is allowed✅

     *   The original patch doesn’t include the #define for ‘WORKING_SELECT_EMULATION’, and I had to manually add this define to my emacs build (via 'CFLAGS= -O0 -g3 -DWORKING_SELECT_EMULATION' )
        *   That’s why I got confused about the patch working initially , since my assumption was that if ‘dns-query’ works => UDP works as expected😉and I didn’t even consider that I was required to set up some more flags..

❌ Indeed, TLS is broken -> Eww to https://www.gnu.org<https://www.gnu.org/> fails to load the page ( see attached image – Emacs instance on the left, compiled with UDP patch, didn’t load gnu.org while on the right side- default Emacs build for 28.1 opens it without any issues)

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: Alex Matei<mailto:[email-masked]>
Sent: Sunday, January 1, 2023 3:01 PM
To: Robert Pluim<mailto:[email-masked]>
Cc: [email-masked]<mailto:[email-masked]>
Subject: RE: bug#45821: Emacs UDP support on Windows

Wanted to bring an update:

  *   ✅I have managed to build emacs for Windows and run it, and so far I wasn’t able to see any issues with Eww or `dns-query`
     *   Can you recommend some extensive selfhosting options so I can try to repro any TLS issues?
     *   What tests are there to run? How can I easily do this?

Wanted to share some thoughts as someone coming for the first time to Emacs development:

  *   Can we make the documentation for developing for Emacs more discoverable? Maybe with a markdown / .org README?
     *   Are we allowed to update the README with more up-to date information, on the series of MYSYS packages needed to be downloaded, and potentially with links to blog posts that describe the process in
  *   Can we add sections about creating/ applying patches to the README?
     *   I had a bit of work to discover how  `git am` works , and the whole business of email patches, etc.
        *   It would be great if all of this will be part of the original README
  *   Where can I find more information about logging from C code?
     *   Ideally I would like to compile Emacs with some new C functions, and then easily observe the behavior of these functions
        *   Logging is the most useful thing to have, before you can think of advanced debugging, and having an easy way (with examples) for you to send logs somewhere (preferably Emacs) would be great
        *   Sure, debugger is great but that has the overhead of you getting used to GDB, etc.. (saw some documentation on EmacsWiki)
        *   I am curious what people do? Do they write to a stream and then pipe it to a file, and monitor it, or how do they get feedback from the C code they wrote?

Best,
Alex

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: Robert Pluim<mailto:[email-masked]>
Sent: Wednesday, May 4, 2022 5:32 AM
To: Alex Matei<mailto:[email-masked]>
Cc: [email-masked]<mailto:[email-masked]>
Subject: Re: bug#45821: Emacs UDP support on Windows

>>>>> On Wed, 4 May 2022 11:50:02 +0000, Alex Matei <[email-masked]> said:

    Alex> Thanks Robert!
    Alex> I would like to give it a shot! How can I get started and have the patch applied?
    Alex> I imagine I would need to build Emacs myself and manually apply the patch? Or is it a branch / commit that I can use?

Yes, you'd need a git checkout of Emacs, to apply the patch, and then
build and test the result. There are build instructions for MS-Windows
in nt/INSTALL and nt/INSTALL.W64 in the Emacs source tree.

`dns-query' can be used to test UDP, and M-x eww can test TCP and TLS
(and thereʼs the test suite as well).

Once itʼs all working, post the updated patch here in the bug and it
will get reviewed.

Good luck!

Robert
--