Skip to content

Commit

Permalink
Update for test release of emacs-26.1.92-3
Browse files Browse the repository at this point in the history
Add patch to disable timerfd on buggy cygwin releases (3.0.0 and
3.0.1).
  • Loading branch information
kbrow1i committed Mar 10, 2019
1 parent 57d651f commit 3eb72f9
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 25 deletions.
61 changes: 61 additions & 0 deletions 0001-Use-a-runtime-test-for-timerfd-on-Cygwin-Bug-34618.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From fd6932c4c87a20ad3e019755c60e3fc1c322ef37 Mon Sep 17 00:00:00 2001
From: Ken Brown <[email protected]>
Date: Sat, 9 Mar 2019 17:06:54 -0500
Subject: [PATCH] Use a runtime test for timerfd on Cygwin (Bug#34618)

* src/atimer.c [HAVE_TIMERFD] (have_buggy_timerfd): New
function.
(init_atimer) Use it.
---
src/atimer.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/atimer.c b/src/atimer.c
index d36c4f1f5a..8387b8aa0e 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -28,7 +28,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */

#ifdef HAVE_TIMERFD
#include <errno.h>
-# include <sys/timerfd.h>
+#include <sys/timerfd.h>
+# ifdef CYGWIN
+# include <sys/utsname.h>
+# endif
#endif

#ifdef MSDOS
@@ -557,13 +560,28 @@ Return t if all self-tests are passed, nil otherwise. */)

#endif /* ENABLE_CHECKING */

+/* Cygwin has the timerfd interface starting with release 3.0.0, but
+ it is buggy until release 3.0.2. */
+#ifdef HAVE_TIMERFD
+static bool
+have_buggy_timerfd (void)
+{
+# ifdef CYGWIN
+ struct utsname name;
+ return uname (&name) < 0 || strverscmp (name.release, "3.0.2") < 0;
+# else
+ return false;
+# endif
+}
+#endif
+
void
init_atimer (void)
{
#ifdef HAVE_ITIMERSPEC
# ifdef HAVE_TIMERFD
/* Until this feature is considered stable, you can ask to not use it. */
- timerfd = (egetenv ("EMACS_IGNORE_TIMERFD") ? -1 :
+ timerfd = (egetenv ("EMACS_IGNORE_TIMERFD") || have_buggy_timerfd () ? -1 :
timerfd_create (CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC));
# endif
if (timerfd < 0)
--
2.17.0

31 changes: 18 additions & 13 deletions announce.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
From cygwin-announce-emacs-26.1-2 Mon May 28 13:43:41 2018
From cygwin-announce-emacs-26.1.92-3 Sun Mar 10 11:34:38 2019
From: Ken Brown <[email protected]>
To: [email protected]
Date: Mon, 28 May 2018 13:43:41 -0400
Message-Id: <20180528134341.968[email protected]>
Subject: emacs 26.1-2
Date: Sun, 10 Mar 2019 11:34:38 -0400
Message-Id: <20190310113438.42921[email protected]>
Subject: emacs 26.1.92-3 (TEST)

The following packages have been uploaded to the Cygwin distribution:
The following packages have been uploaded to the Cygwin distribution
as test releases:

* emacs-common-26.1-2
* emacs-26.1-2
* emacs-X11-26.1-2
* emacs-w32-26.1-2
* emacs-lucid-26.1-2
* emacs-26.1.92-3
* emacs-common-26.1.92-3
* emacs-X11-26.1.92-3
* emacs-w32-26.1.92-3
* emacs-lucid-26.1.92-3

Emacs is a powerful, customizable, self-documenting, modeless text
editor. Emacs contains special code editing features, a scripting
language (elisp), and the capability to read mail, news, and more
without leaving the editor.

This is an update to the latest upstream release. Browse the NEWS
file ('C-h n' within emacs) for changes since the last release.
This is a pretest for the upcoming release of emacs-26.2. Browse the
NEWS file ('C-h n' within emacs) for changes since the last release,
although this is not yet complete.

This build uses the timerfd functions that were introduced in
cygwin-3.0.0, so it will not run on earlier releases of Cygwin. And
it will not run well on Cygwin releases prior to cygwin-3.0.3, which
contains fixes for some timer-related bugs.

CYGWIN NOTES
============
Expand Down Expand Up @@ -83,4 +89,3 @@ CYGWIN NOTES

Ken Brown
Cygwin's Emacs maintainer

20 changes: 8 additions & 12 deletions emacs.cygport
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME="emacs"
VERSION=26.1.90
RELEASE=1
VERSION=26.1.92
RELEASE=3

HOMEPAGE="http://www.gnu.org/software/emacs/"
CATEGORY="Editors Interpreters"
Expand All @@ -19,7 +19,7 @@ emacs_w32_SUMMARY="Emacs binaries using the native Windows GUI"

DESCRIPTION="Emacs is a powerful, customizable, self-documenting, modeless text
editor. Emacs contains special code editing features, a scripting
language (elisp), and the capability to read mail, news and more without
language (elisp), and the capability to read mail, news, and more without
leaving the editor."

emacs_DESCRIPTION="${DESCRIPTION}
Expand Down Expand Up @@ -61,8 +61,7 @@ emacs_w32_REQUIRES="emacs-common"

# SRC_URI="mirror://gnu/emacs/emacs-${VERSION}.tar.xz"

# SRC_URI="ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-${VERSION}-rc1.tar.xz"
SRC_URI="ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-${VERSION}.tar.xz"
SRC_URI="https://alpha.gnu.org/gnu/emacs/pretest/emacs-${VERSION}.tar.xz"

# Can generate a source tarball by running './make-dist --snapshot
# --xz --tests' in git repo. Note: It’s possible to have an
Expand Down Expand Up @@ -91,6 +90,7 @@ SRC_URI+="
PATCH_URI="nonbootstrap_static_heap.patch"
PATCH_URI+=" bt.patch"
PATCH_URI+=" 0001-Add-battery-support-to-all-Cygwin-builds.patch"
PATCH_URI+=" 0001-Use-a-runtime-test-for-timerfd-on-Cygwin-Bug-34618.patch"

DOCS="README.Cygwin"

Expand Down Expand Up @@ -168,18 +168,14 @@ src_compile() {
cd ${B}
cygconf --with-x=no
cygmake
mkdir build-w32
mkdir build-w32 build-lucid build-gtk
cd build-w32
cygconf --with-w32
cygmake
cd ..
mkdir build-lucid
cd build-lucid
cd ../build-lucid
cygconf --with-x-toolkit=lucid
cygmake
cd ..
mkdir build-gtk
cd build-gtk
cd ../build-gtk
cygconf
cygmake
}
Expand Down

0 comments on commit 3eb72f9

Please sign in to comment.