unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* draft patch to import gnulib's filemode module into Emacs
@ 2011-02-20 11:17 Paul Eggert
  2011-02-20 12:42 ` Eli Zaretskii
  2011-02-20 12:43 ` How many more gnulib imports? (was: draft patch to import gnulib's filemode module into Emacs) Eli Zaretskii
  0 siblings, 2 replies; 19+ messages in thread
From: Paul Eggert @ 2011-02-20 11:17 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 6453 bytes --]

Here's a draft patch to import gnulib's filemode module
into Emacs.

The following parts of this may affect the Windows build:

* src/filemode.c is renamed to lib/filemode.c in the usual
  way for imports from gnulib.  There's also a new file
  lib/filemode.h that src/dired.c now includes.

* lib/sys/stat.h is built on hosts whose <sys/stat.h> has problems.
  I expect that Windows <sys/stat.h> does not have these problems,
  so this part can be ignored.

* src/config.in has two new symbols that I expect can be left alone
  on Windows but thought I'd mention them.  They are HAVE_DECL_STRMODE
  (for a BSD-style strmode function) and HAVE_ST_DM_MODE
  (for a Cray-style dm_mode member of struct stat).

* Some other symbols are added to src/config.in.  If <sys/stat.h> is OK
  is OK on Windows then you can safely ignore these symbols.  They
  are STAT_MACROS_BROKEN and nlink_t.

Here are the handwritten parts of the patch.  I'm attaching the full
patch, including the autogenerated files, in compressed format.

=== modified file '.bzrignore'
--- .bzrignore	2011-02-20 08:48:52 +0000
+++ .bzrignore	2011-02-20 10:51:50 +0000
@@ -42,6 +42,7 @@
 lib/c++defs.h
 lib/getopt.h
 lib/stdlib.h
+lib/sys/
 lib/time.h
 lib/unistd.h
 lib/warn-on-use.h

=== modified file 'ChangeLog'
--- ChangeLog	2011-02-20 08:48:52 +0000
+++ ChangeLog	2011-02-20 10:51:50 +0000
@@ -1,5 +1,20 @@
 2011-02-20  Paul Eggert  <eggert@cs.ucla.edu>
 
+	Import filemode module from gnulib.
+	* .bzrignore: Add lib/sys/.
+	* Makefile.in (GNULIB_MODULES): Add filemode.
+	* lib/Makefile.am (MOSTLYCLEANDIRS): New macro.
+	* lib/filemode.c: Renamed from src/filemode.c and regenerated
+	from gnulib.  This adds support for some more file types, e.g.,
+	Cray DMF migrated files.
+	* lisp/emacs-lisp/find-gc.el (find-gc-source-files): Remove filemode.c.
+	* lib/filemode.h, lib/sys_stat.in.h, m4/filemode.m4, m4/st_dm_mode.m4:
+	* m4/sys_stat_h.m4: New files, generated from gnulib.
+	* aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
+	Regenerate.
+
+2011-02-20  Paul Eggert  <eggert@cs.ucla.edu>
+
 	Import crypto/md5 and stdint modules from gnulib.
 	* aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
 	Regenerate.

=== modified file 'Makefile.in'
--- Makefile.in	2011-02-18 08:07:03 +0000
+++ Makefile.in	2011-02-20 10:51:50 +0000
@@ -331,7 +331,8 @@
 # $(gnulib_srcdir) (relative to $(srcdir) and should have build tools
 # as per $(gnulib_srcdir)/DEPENDENCIES.
 GNULIB_MODULES = \
-  crypto/md5 dtoastr getloadavg getopt-gnu ignore-value mktime strftime
+  crypto/md5 dtoastr filemode getloadavg getopt-gnu \
+  ignore-value mktime strftime
 GNULIB_TOOL_FLAGS = \
  --import --no-changelog --no-vc-files --makefile-name=gnulib.mk
 sync-from-gnulib: $(gnulib_srcdir)

=== modified file 'lib/Makefile.am'
--- lib/Makefile.am	2011-02-06 22:13:03 +0000
+++ lib/Makefile.am	2011-02-20 10:51:50 +0000
@@ -1,5 +1,6 @@
 BUILT_SOURCES =
 EXTRA_DIST =
+MOSTLYCLEANDIRS =
 MOSTLYCLEANFILES =
 noinst_LIBRARIES =
 

=== modified file 'lisp/emacs-lisp/find-gc.el'
--- lisp/emacs-lisp/find-gc.el	2011-01-25 04:08:28 +0000
+++ lisp/emacs-lisp/find-gc.el	2011-02-20 10:51:50 +0000
@@ -55,7 +55,7 @@
     "term.c" "cm.c" "emacs.c" "keyboard.c" "macros.c"
     "keymap.c" "sysdep.c" "buffer.c" "filelock.c"
     "insdel.c" "marker.c" "minibuf.c" "fileio.c"
-    "dired.c" "filemode.c" "cmds.c" "casefiddle.c"
+    "dired.c" "cmds.c" "casefiddle.c"
     "indent.c" "search.c" "regex.c" "undo.c"
     "alloc.c" "data.c" "doc.c" "editfns.c"
     "callint.c" "eval.c" "fns.c" "print.c" "lread.c"

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2011-02-20 08:48:52 +0000
+++ src/ChangeLog	2011-02-20 10:53:22 +0000
@@ -1,5 +1,15 @@
 2011-02-20  Paul Eggert  <eggert@cs.ucla.edu>
 
+	Import filemode module from gnulib.
+	* Makefile.in (base_obj): Remove filemode.o, as it's now in ../lib.
+	* deps.mk (dired.o): Depend on ../lib/filemode.h, too.
+	(filemode.o): Remove; this is now in ../lib.
+	* dired.c: Include <filemode.h>.
+	(filemodestring): Remove now-redundant decl.
+	* config.in: Regenerate.
+
+2011-02-20  Paul Eggert  <eggert@cs.ucla.edu>
+
 	Import crypto/md5 and stdint modules from gnulib.
 	* Makefile.in (base_obj): Remove md5.o, since this file
 	is in lib now.

=== modified file 'src/Makefile.in'
--- src/Makefile.in	2011-02-20 08:48:52 +0000
+++ src/Makefile.in	2011-02-20 10:53:22 +0000
@@ -347,7 +347,7 @@
 	cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
 	emacs.o keyboard.o macros.o keymap.o sysdep.o \
 	buffer.o filelock.o insdel.o marker.o \
-	minibuf.o fileio.o dired.o filemode.o \
+	minibuf.o fileio.o dired.o \
 	cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
 	alloc.o data.o doc.o editfns.o callint.o \
 	eval.o floatfns.o fns.o font.o print.o lread.o \

=== modified file 'src/deps.mk'
--- src/deps.mk	2011-02-19 09:51:59 +0000
+++ src/deps.mk	2011-02-20 10:53:22 +0000
@@ -73,7 +73,7 @@
 dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h)
 dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \
    coding.h regex.h systime.h blockinput.h atimer.h composite.h \
-   ../lib/unistd.h globals.h
+   ../lib/filemode.h ../lib/unistd.h globals.h
 dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \
    window.h buffer.h termchar.h termopts.h termhooks.h cm.h \
    disptab.h indent.h $(INTERVALS_H) nsgui.h ../lib/unistd.h \
@@ -98,7 +98,6 @@
    commands.h globals.h ../lib/unistd.h
 filelock.o: filelock.c buffer.h character.h coding.h systime.h composite.h \
    ../lib/unistd.h lisp.h globals.h $(config_h)
-filemode.o: filemode.c $(config_h)
 font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
    font.h lisp.h globals.h $(config_h) buffer.h composite.h fontset.h \
    xterm.h nsgui.h msdos.h

=== modified file 'src/dired.c'
--- src/dired.c	2011-02-16 15:02:50 +0000
+++ src/dired.c	2011-02-20 10:53:22 +0000
@@ -54,6 +54,8 @@
 #include <sys/dir.h>
 #include <sys/stat.h>
 
+#include <filemode.h>
+
 #define DIRENTRY struct direct
 
 extern DIR *opendir (char *);
@@ -82,9 +84,6 @@
 						  struct re_registers *,
 						  Lisp_Object, int, int);
 
-/* From filemode.c.  Can't go in Lisp.h because of `stat'.  */
-extern void filemodestring (struct stat *, char *);
-
 /* if system does not have symbolic links, it does not have lstat.
    In that case, use ordinary stat instead.  */
 

[-- Attachment #2: filemode-patch1.txt.gz --]
[-- Type: application/x-gzip, Size: 30537 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: draft patch to import gnulib's filemode module into Emacs
  2011-02-20 11:17 draft patch to import gnulib's filemode module into Emacs Paul Eggert
@ 2011-02-20 12:42 ` Eli Zaretskii
  2011-02-20 17:18   ` Paul Eggert
  2011-02-20 12:43 ` How many more gnulib imports? (was: draft patch to import gnulib's filemode module into Emacs) Eli Zaretskii
  1 sibling, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-20 12:42 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Date: Sun, 20 Feb 2011 03:17:52 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> Here's a draft patch to import gnulib's filemode module
> into Emacs.

Thanks.

> * lib/sys/stat.h is built on hosts whose <sys/stat.h> has problems.
>   I expect that Windows <sys/stat.h> does not have these problems,
>   so this part can be ignored.

Actually, no, it cannot be ignored.  The new filemode.c uses the
S_*GRP and S_*OTH macros, which are not defined on Windows.  (The
previous version of filemode.c didn't use these macros.)  And that's
just at first glance, without throwing the file at the compiler.

The Windows build uses an Emacs-private version of sys/stat.h in
nt/inc (the one supplied by the Windows runtime does not allow to
return meaningful inode numbers), so we will need to add the missing
stuff to that header, and bypass lib/sys/stat.h.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* How many more gnulib imports? (was: draft patch to import gnulib's filemode module into Emacs)
  2011-02-20 11:17 draft patch to import gnulib's filemode module into Emacs Paul Eggert
  2011-02-20 12:42 ` Eli Zaretskii
@ 2011-02-20 12:43 ` Eli Zaretskii
  2011-02-20 15:56   ` How many more gnulib imports? Christoph
  2011-02-20 17:46   ` Paul Eggert
  1 sibling, 2 replies; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-20 12:43 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Paul,

Could you perhaps publish the full list of the modules you plan on
eventually importing from gnulib?  This is becoming an activity that
eats up a lot of my resources lately, and the fact that each such
import breaks the Windows build doesn't allow me the freedom to choose
the moment when I fix the problem, because others are waiting
impatiently for the fix.

With all the people queuing up to help, I might just need to figure
out how many days off I will need to take to support this, and for how
long.

TIA



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 12:43 ` How many more gnulib imports? (was: draft patch to import gnulib's filemode module into Emacs) Eli Zaretskii
@ 2011-02-20 15:56   ` Christoph
  2011-02-20 16:13     ` Christoph
  2011-02-20 17:46   ` Paul Eggert
  1 sibling, 1 reply; 19+ messages in thread
From: Christoph @ 2011-02-20 15:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Paul Eggert, emacs-devel

On 2/20/2011 5:43 AM, Eli Zaretskii wrote:

> Could you perhaps publish the full list of the modules you plan on
> eventually importing from gnulib?

This would definitely be nice to have.

> With all the people queuing up to help, I might just need to figure
> out how many days off I will need to take to support this, and for how
> long.

I have been monitoring how the last couple of changes were fixed. Since 
I am not an expert with the Emacs build system it takes me a little bit 
longer to figure things out, but I am learning.

In regards to the md5 change, I think I have a patch to fix the Windows 
build. I will send it for review once my bootstrap finishes and I see 
everything works. Shouldn't be too long.

Christoph



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 15:56   ` How many more gnulib imports? Christoph
@ 2011-02-20 16:13     ` Christoph
  2011-02-20 17:28       ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Christoph @ 2011-02-20 16:13 UTC (permalink / raw)
  Cc: Eli Zaretskii, Paul Eggert, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

On 2/20/2011 8:56 AM, I wrote:

> In regards to the md5 change, I think I have a patch to fix the Windows
> build. I will send it for review once my bootstrap finishes and I see
> everything works. Shouldn't be too long.

Find the patch fixing the Windows build for including lib/md5.c attached.

Christoph

[-- Attachment #2: md5-fix-v1.txt --]
[-- Type: text/plain, Size: 2429 bytes --]

=== modified file 'lib/makefile.w32-in'
--- lib/makefile.w32-in	2011-01-31 19:36:08 +0000
+++ lib/makefile.w32-in	2011-02-20 15:49:09 +0000
@@ -27,7 +27,8 @@
 	     $(BLD)/getopt.$(O)  \
 	     $(BLD)/getopt1.$(O) \
 	     $(BLD)/strftime.$(O) \
-	     $(BLD)/time_r.$(O)
+	     $(BLD)/time_r.$(O) \
+	     $(BLD)/md5.$(O)
 
 #
 # Build the library
@@ -93,6 +94,14 @@
 	$(EMACS_ROOT)/src/m/intel386.h \
 	$(EMACS_ROOT)/src/config.h
 
+$(BLD)/md5.$(O) : \
+	$(EMACS_ROOT)/lib/md5.c \
+	$(EMACS_ROOT)/src/s/ms-w32.h \
+	$(EMACS_ROOT)/src/m/intel386.h \
+	$(EMACS_ROOT)/src/config.h \
+	$(EMACS_ROOT)/nt/inc/sys/stat.h \
+	$(EMACS_ROOT)/lib/md5.h
+    
 # The following dependencies are for supporting parallel builds, where
 # we must make sure $(BLD) exists before any compilation starts.
 #

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2011-02-20 08:48:52 +0000
+++ src/ChangeLog	2011-02-20 16:08:30 +0000
@@ -1,3 +1,8 @@
+2011-02-20  Christoph Scholtes <cschol2112@gmail.com>
+
+	* makefile.w32-in: Remove md5.$(O).
+	($(BLD)/md5.$(O)): Remove prerequisites.
+
 2011-02-20  Paul Eggert  <eggert@cs.ucla.edu>
 
 	Import crypto/md5 and stdint modules from gnulib.

=== modified file 'src/makefile.w32-in'
--- src/makefile.w32-in	2011-02-09 20:50:17 +0000
+++ src/makefile.w32-in	2011-02-20 15:43:20 +0000
@@ -81,7 +81,6 @@
 	$(BLD)/lread.$(O)		\
 	$(BLD)/macros.$(O)		\
 	$(BLD)/marker.$(O)		\
-	$(BLD)/md5.$(O)                 \
 	$(BLD)/minibuf.$(O)		\
 	$(BLD)/w32.$(O)			\
 	$(BLD)/w32heap.$(O)		\
@@ -221,7 +220,7 @@
 	syntax.c bytecode.c \
 	process.c callproc.c unexw32.c \
 	region-cache.c sound.c atimer.c \
-	doprnt.c intervals.c textprop.c composite.c md5.c
+	doprnt.c intervals.c textprop.c composite.c
 SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
   xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o
 obj = $(GLOBAL_SOURCES:.c=.o)
@@ -843,6 +842,7 @@
 	$(EMACS_ROOT)/nt/inc/nl_types.h \
 	$(EMACS_ROOT)/nt/inc/unistd.h \
 	$(EMACS_ROOT)/nt/inc/sys/time.h \
+    $(EMACS_ROOT)/lib/md5.h \
 	$(LISP_H) \
 	$(SRC)/atimer.h \
 	$(SRC)/blockinput.h \
@@ -856,7 +856,6 @@
 	$(SRC)/intervals.h \
 	$(SRC)/keyboard.h \
 	$(SRC)/keymap.h \
-	$(SRC)/md5.h \
 	$(SRC)/systime.h \
 	$(SRC)/w32gui.h \
 	$(SRC)/window.h
@@ -1135,11 +1134,6 @@
 	$(SRC)/buffer.h \
 	$(SRC)/character.h
 
-$(BLD)/md5.$(O) : \
-	$(SRC)/md5.c \
-	$(CONFIG_H) \
-	$(SRC)/md5.h
-
 $(BLD)/menu.$(O) : \
 	$(SRC)/menu.c \
 	$(CONFIG_H) \


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: draft patch to import gnulib's filemode module into Emacs
  2011-02-20 12:42 ` Eli Zaretskii
@ 2011-02-20 17:18   ` Paul Eggert
  2011-02-21 17:58     ` Paul Eggert
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Eggert @ 2011-02-20 17:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

My filemode patch had a problem, in that it relied on an implicit
function declaration on many hosts.  The following patch fixes this.

=== modified file 'src/dired.c'
--- src/dired.c	2011-02-20 10:53:22 +0000
+++ src/dired.c	2011-02-20 17:14:24 +0000
@@ -54,8 +54,6 @@
 #include <sys/dir.h>
 #include <sys/stat.h>
 
-#include <filemode.h>
-
 #define DIRENTRY struct direct
 
 extern DIR *opendir (char *);
@@ -63,6 +61,8 @@
 
 #endif /* HAVE_DIRENT_H */
 
+#include <filemode.h>
+
 #ifdef MSDOS
 #define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0)
 #else




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 16:13     ` Christoph
@ 2011-02-20 17:28       ` Eli Zaretskii
  2011-02-20 17:54         ` Christoph
  2011-02-20 23:32         ` Christoph
  0 siblings, 2 replies; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-20 17:28 UTC (permalink / raw)
  To: Christoph; +Cc: emacs-devel

> Date: Sun, 20 Feb 2011 09:13:37 -0700
> From: Christoph <cschol2112@googlemail.com>
> CC: Eli Zaretskii <eliz@gnu.org>, Paul Eggert <eggert@cs.ucla.edu>, 
>  emacs-devel@gnu.org
> 
> On 2/20/2011 8:56 AM, I wrote:
> 
> > In regards to the md5 change, I think I have a patch to fix the Windows
> > build. I will send it for review once my bootstrap finishes and I see
> > everything works. Shouldn't be too long.
> 
> Find the patch fixing the Windows build for including lib/md5.c attached.

Thanks.  Please install this in the repository as soon as you can.

However, this change will only work with MinGW, since it has stdint.h.
To make it work with MSVC, we need to add nt/inc/stdint.h, and make
lib/md5.$(O) depend on it.  For MinGW, nt/inc/stdint.h could just say
"#include_next <stdint.h>" (conditioned on __GNUC__ being non-zero).
Otherwise, it should include the minimum needed for md5.c to compile.
Paul said a few messages ago that all that's needed for now is this:

   typedef unsigned int uint32_t;

Could you please commit such a followup change, after you test it (see
below)?  If not, I will get to it in due time.

To test this change (assuming you don't have MSVC -- neither do I,
btw), rename MinGW's stdint.h in the MinGW include directory, create
an nt/inc/stdint.h that has just the above 1 line, and then try
building with MinGW.  Any compilation error/warning you see probably
means that more stuff needs to be added to nt/inc/stdint.h.

Thanks a lot for your help.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 12:43 ` How many more gnulib imports? (was: draft patch to import gnulib's filemode module into Emacs) Eli Zaretskii
  2011-02-20 15:56   ` How many more gnulib imports? Christoph
@ 2011-02-20 17:46   ` Paul Eggert
  2011-02-20 17:54     ` Eli Zaretskii
  1 sibling, 1 reply; 19+ messages in thread
From: Paul Eggert @ 2011-02-20 17:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 02/20/2011 04:43 AM, Eli Zaretskii wrote:
> Could you perhaps publish the full list of the modules you plan on
> eventually importing from gnulib?

There's one other obvious candidate: the regex module.
This would be the trickiest case, as glibc, gnulib, and Emacs
have diverged the most in this area.  It may be better to
leave those sleeping dogs lie.

I haven't surveyed the less-obvious candidates yet.
Some possibilities include alignof, alloca, assert,
backupfile, base64, xalloc, and verify, but this isn't
a complete list.

If you'd like an upper bound, coreutils uses 613 gnulib
modules, 224 of them directly and the rest brought in
as dependencies.  But I expect that Emacs would need
far fewer than that!



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 17:28       ` Eli Zaretskii
@ 2011-02-20 17:54         ` Christoph
  2011-02-20 18:54           ` Eli Zaretskii
  2011-02-20 23:32         ` Christoph
  1 sibling, 1 reply; 19+ messages in thread
From: Christoph @ 2011-02-20 17:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks.  Please install this in the repository as soon as you can.

I don't think I have commit access to the repository. What is involved
to get commit access? I didn't see anything on the emacswiki page about
that, except that it talks about a Savannah user name.

Maybe for this patch another developer can commit for me?

> However, this change will only work with MinGW, since it has stdint.h.

[...]

> Could you please commit such a followup change, after you test it (see
> below)?  If not, I will get to it in due time.

Yes, I will have a look at this later today or tomorrow.

> Thanks a lot for your help.

No problem.

Christoph



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 17:46   ` Paul Eggert
@ 2011-02-20 17:54     ` Eli Zaretskii
  2011-02-20 18:06       ` Paul Eggert
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-20 17:54 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Date: Sun, 20 Feb 2011 09:46:56 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: emacs-devel@gnu.org
> 
> I haven't surveyed the less-obvious candidates yet.
> Some possibilities include alignof, alloca, assert,
> backupfile, base64, xalloc, and verify, but this isn't
> a complete list.

Are there any known problems in these that would require them to be
imported?  (AFAIU, all those imported till now were originally from
gnulib, but fell behind with time.)  Just importing for the sake of it
doesn't seem to be a productive use of our time.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 17:54     ` Eli Zaretskii
@ 2011-02-20 18:06       ` Paul Eggert
  0 siblings, 0 replies; 19+ messages in thread
From: Paul Eggert @ 2011-02-20 18:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

> Are there any known problems in these that would require them to be
> imported?

Well, like I said, I haven't had time to survey them, and I
can't really answer that without time for analysis, but here
are a couple of things off the top of my head.

Emacs has several problems internally with integer overflow,
such that things will crash when they get too large.  The problems
are rare now but will become more important as memories get larger.
That is why I mentioned xalloc and verify (and regex too for that
matter; gnulib regex has several fixes in this area).

Emacs and other GNU packages create backup file names, in ways that
are supposed to be compatible, but which have diverged with time.
They should be compatible, and this may require some
changes to gnulib and to Emacs, hopefully all upward-compatible.
That is why I mentioned backupfile.

(I am not suggesting these changes simply for the fun of it,
believe me.  :-)



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 17:54         ` Christoph
@ 2011-02-20 18:54           ` Eli Zaretskii
  0 siblings, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-20 18:54 UTC (permalink / raw)
  To: Christoph; +Cc: emacs-devel

> From: Christoph <cschol2112@googlemail.com>
> Cc: emacs-devel@gnu.org
> Date: Sun, 20 Feb 2011 10:54:08 -0700
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Thanks.  Please install this in the repository as soon as you can.
> 
> I don't think I have commit access to the repository. What is involved
> to get commit access?

Keep contributing patches, and let time do its thing.  TIA

> Maybe for this patch another developer can commit for me?

I did that.  Please note that your original patch lacked a couple of
final strokes (I added them).

> > However, this change will only work with MinGW, since it has stdint.h.
> 
> [...]
> 
> > Could you please commit such a followup change, after you test it (see
> > below)?  If not, I will get to it in due time.
> 
> Yes, I will have a look at this later today or tomorrow.

Thanks!



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 17:28       ` Eli Zaretskii
  2011-02-20 17:54         ` Christoph
@ 2011-02-20 23:32         ` Christoph
  2011-02-21 16:00           ` Christoph
  2011-02-21 19:05           ` Eli Zaretskii
  1 sibling, 2 replies; 19+ messages in thread
From: Christoph @ 2011-02-20 23:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

Hi Eli

On 2/20/2011 10:28 AM, Eli Zaretskii wrote:

> However, this change will only work with MinGW, since it has stdint.h.
> To make it work with MSVC, we need to add nt/inc/stdint.h, and make
> lib/md5.$(O) depend on it.  For MinGW, nt/inc/stdint.h could just say
> "#include_next<stdint.h>" (conditioned on __GNUC__ being non-zero).
> Otherwise, it should include the minimum needed for md5.c to compile.
> Paul said a few messages ago that all that's needed for now is this:
>
>     typedef unsigned int uint32_t;
>
> Could you please commit such a followup change, after you test it (see
> below)?  If not, I will get to it in due time.

See attached patch.

> To test this change (assuming you don't have MSVC -- neither do I,
> btw), rename MinGW's stdint.h in the MinGW include directory, create
> an nt/inc/stdint.h that has just the above 1 line, and then try
> building with MinGW.  Any compilation error/warning you see probably
> means that more stuff needs to be added to nt/inc/stdint.h.

I tested it as follows:

Renamed MinGWs stdint.h to _stdint.h. Verified mingw32-make fails 
because it cannot find stdint.h. Changed line "#ifdef __GNUC__" in 
nt/inc/stdint.h to "#ifndef __GNUC__" to force it to execute #else 
branch. mingw32-make clean, mingw32-make compiles without errors or 
warnings. Then, of course I changed the line back to "#ifdef __GNUC__" 
before creating the patch. :)

Christoph


[-- Attachment #2: stdint-v1.txt --]
[-- Type: text/plain, Size: 2595 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2011-02-20 21:09:45 +0000
+++ ChangeLog	2011-02-20 23:27:44 +0000
@@ -1,3 +1,11 @@
+2011-02-20  Christoph Scholtes  <cschol2112@gmail.com>
+
+	* lib/makefile.w32-in: ($(BLD)/md5.$(O)): Added dependency on
+	$(EMACS_ROOT)/nt/inc/stdint.h.
+
+	* nt/inc/stdint.h: Added to support compilation with tool chains
+	that do not have stdint.h (e.g. MSVC).
+
 2011-02-20  Eli Zaretskii  <eliz@gnu.org>
 
 	* lib/makefile.w32-in ($(BLD)/md5.$(O)): Don't depend on

=== modified file 'lib/makefile.w32-in'
--- lib/makefile.w32-in	2011-02-20 21:09:45 +0000
+++ lib/makefile.w32-in	2011-02-20 23:22:42 +0000
@@ -99,6 +99,7 @@
 	$(EMACS_ROOT)/src/s/ms-w32.h \
 	$(EMACS_ROOT)/src/m/intel386.h \
 	$(EMACS_ROOT)/src/config.h \
+	$(EMACS_ROOT)/nt/inc/stdint.h \
 	$(EMACS_ROOT)/lib/md5.h
 
 # The following dependencies are for supporting parallel builds, where

=== modified file 'nt/ChangeLog'
--- nt/ChangeLog	2011-02-09 20:50:17 +0000
+++ nt/ChangeLog	2011-02-20 23:28:51 +0000
@@ -1,3 +1,8 @@
+2011-02-20  Christoph Scholtes  <cschol2112@gmail.com>
+
+	* inc/stdint.h: Added to support compilation with tool chains that
+	do not have stdint.h (e.g. MSVC).
+
 2011-02-09  Eli Zaretskii  <eliz@gnu.org>
 
 	* makefile.w32-in (bootstrap-nmake, bootstrap-gmake): Make the

=== added file 'nt/inc/stdint.h'
--- nt/inc/stdint.h	1970-01-01 00:00:00 +0000
+++ nt/inc/stdint.h	2011-02-20 23:11:14 +0000
@@ -0,0 +1,34 @@
+/* Replacement stdint.h file for building GNU Emacs on Windows.
+
+Copyright (C) 2011  Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NT_STDINT_H_
+#define _NT_STDINT_H_
+
+#ifdef __GNUC__
+# include_next <stdint.h> /* use stdint.h if available */
+#else
+
+/* Minimum definitions to allow compilation with tool chains where
+   stdint.h is not available, e.g. Microsoft Visual Studio. */
+
+typedef unsigned int uint32_t;
+
+#endif
+
+#endif /* _NT_STDINT_H_ */


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 23:32         ` Christoph
@ 2011-02-21 16:00           ` Christoph
  2011-02-21 19:05           ` Eli Zaretskii
  1 sibling, 0 replies; 19+ messages in thread
From: Christoph @ 2011-02-21 16:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Paul Eggert, emacs-devel

On 2/20/2011 5:43 AM, Eli Zaretskii wrote:

> Could you perhaps publish the full list of the modules you plan on
> eventually importing from gnulib?

This would definitely be nice to have.

> With all the people queuing up to help, I might just need to figure
> out how many days off I will need to take to support this, and for how
> long.

I have been monitoring how the last couple of changes were fixed. Since
I am not an expert with the Emacs build system it takes me a little bit
longer to figure things out, but I am learning.

In regards to the md5 change, I think I have a patch to fix the Windows
build. I will send it for review once my bootstrap finishes and I see
everything works. Shouldn't be too long.

Christoph



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: draft patch to import gnulib's filemode module into Emacs
  2011-02-20 17:18   ` Paul Eggert
@ 2011-02-21 17:58     ` Paul Eggert
  0 siblings, 0 replies; 19+ messages in thread
From: Paul Eggert @ 2011-02-21 17:58 UTC (permalink / raw)
  To: emacs-devel

Further testing didn't reveal any problems with the filemode
patch, so I committed it to the trunk.  The Windows builds
will need minor tweaking to get working again, as discussed
earlier.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-20 23:32         ` Christoph
  2011-02-21 16:00           ` Christoph
@ 2011-02-21 19:05           ` Eli Zaretskii
  2011-02-21 19:10             ` Christoph
  2011-02-21 20:21             ` Eli Zaretskii
  1 sibling, 2 replies; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-21 19:05 UTC (permalink / raw)
  To: Christoph; +Cc: emacs-devel

> Date: Sun, 20 Feb 2011 16:32:08 -0700
> From: Christoph <cschol2112@googlemail.com>
> CC: emacs-devel@gnu.org
> 
> > However, this change will only work with MinGW, since it has stdint.h.
> > To make it work with MSVC, we need to add nt/inc/stdint.h, and make
> > lib/md5.$(O) depend on it.  For MinGW, nt/inc/stdint.h could just say
> > "#include_next<stdint.h>" (conditioned on __GNUC__ being non-zero).
> > Otherwise, it should include the minimum needed for md5.c to compile.
> > Paul said a few messages ago that all that's needed for now is this:
> >
> >     typedef unsigned int uint32_t;
> >
> > Could you please commit such a followup change, after you test it (see
> > below)?  If not, I will get to it in due time.
> 
> See attached patch.

Thanks.  I will commit it as soon as the Windows build is fixed (it
became broken due to the import of filemode.c from gnulib).

Please note that nt/inc/stdint.h you sent has DOS EOLs.  We generally
use Unix EOLs, except in DOS/Windows batch files.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-21 19:05           ` Eli Zaretskii
@ 2011-02-21 19:10             ` Christoph
  2011-02-21 20:19               ` Eli Zaretskii
  2011-02-21 20:21             ` Eli Zaretskii
  1 sibling, 1 reply; 19+ messages in thread
From: Christoph @ 2011-02-21 19:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 2/21/2011 12:05 PM, Eli Zaretskii wrote:

> Thanks.  I will commit it as soon as the Windows build is fixed (it
> became broken due to the import of filemode.c from gnulib).

OK. I am taking a stab on fixing the latest filemode issues right now. 
If you are too, please let me know.

> Please note that nt/inc/stdint.h you sent has DOS EOLs.  We generally
> use Unix EOLs, except in DOS/Windows batch files.

Sorry about that. I will pay attention to that next time.

Christoph



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-21 19:10             ` Christoph
@ 2011-02-21 20:19               ` Eli Zaretskii
  0 siblings, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-21 20:19 UTC (permalink / raw)
  To: Christoph; +Cc: emacs-devel

> Date: Mon, 21 Feb 2011 12:10:49 -0700
> From: Christoph <cschol2112@googlemail.com>
> CC: emacs-devel@gnu.org
> 
> On 2/21/2011 12:05 PM, Eli Zaretskii wrote:
> 
> > Thanks.  I will commit it as soon as the Windows build is fixed (it
> > became broken due to the import of filemode.c from gnulib).
> 
> OK. I am taking a stab on fixing the latest filemode issues right now. 
> If you are too, please let me know.

I did that a few minutes ago, and committed the changes.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How many more gnulib imports?
  2011-02-21 19:05           ` Eli Zaretskii
  2011-02-21 19:10             ` Christoph
@ 2011-02-21 20:21             ` Eli Zaretskii
  1 sibling, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2011-02-21 20:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cschol2112, emacs-devel

> Date: Mon, 21 Feb 2011 21:05:55 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> > See attached patch.
> 
> Thanks.  I will commit it as soon as the Windows build is fixed (it
> became broken due to the import of filemode.c from gnulib).

Done.



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-02-21 20:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-20 11:17 draft patch to import gnulib's filemode module into Emacs Paul Eggert
2011-02-20 12:42 ` Eli Zaretskii
2011-02-20 17:18   ` Paul Eggert
2011-02-21 17:58     ` Paul Eggert
2011-02-20 12:43 ` How many more gnulib imports? (was: draft patch to import gnulib's filemode module into Emacs) Eli Zaretskii
2011-02-20 15:56   ` How many more gnulib imports? Christoph
2011-02-20 16:13     ` Christoph
2011-02-20 17:28       ` Eli Zaretskii
2011-02-20 17:54         ` Christoph
2011-02-20 18:54           ` Eli Zaretskii
2011-02-20 23:32         ` Christoph
2011-02-21 16:00           ` Christoph
2011-02-21 19:05           ` Eli Zaretskii
2011-02-21 19:10             ` Christoph
2011-02-21 20:19               ` Eli Zaretskii
2011-02-21 20:21             ` Eli Zaretskii
2011-02-20 17:46   ` Paul Eggert
2011-02-20 17:54     ` Eli Zaretskii
2011-02-20 18:06       ` Paul Eggert

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).