crew fails to build on Solaris

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Oct 11 14:16:00 UTC 2007


On 2007-10-11 16:50, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> The crew repository no longer builds on Solaris 10:
>
> % s10:/home/gker/hg/mercurial/build> sudo python setup.py install
> % [...]
> % building 'mercurial.osutil' extension
> % cc -DNDEBUG -O -xcode=pic32 -I/opt/local/include/python2.4 \
> %   -c mercurial/osutil.c -o build/temp.solaris-2.10-i86pc-2.4/mercurial/osutil.o
> % cc: Warning: illegal option -xcode=pic32
> % "mercurial/osutil.c", line 191: undefined struct/union member: dd_fd
> % cc: acomp failed for mercurial/osutil.c
> % error: command 'cc' failed with exit status 2
> % s10:/home/gker/hg/mercurial/build> hg tip
> % changeset:   5453:9d77f2b47eb7
> % tag:         tip
> % user:        Benoit Boissinot <benoit.boissinot at ens-lyon.org>
> % date:        Thu Oct 11 12:16:55 2007 +0200
> % summary:     fix UnboundLocalError, refactor a bit
> %
> % s10:/home/gker/hg/mercurial/build>
>
> Where is AT_SYMLINK_NOFOLLOW defined during the build process of
> Mercurial?  I can't find any obvious location by grepping...
>
> % s10:/home/gker/hg/mercurial/build> ggrep -r AT_SYMLINK_NOFOLLOW .
> % ./mercurial/osutil.c:#ifdef AT_SYMLINK_NOFOLLOW
> % ./mercurial/osutil.c:#ifdef AT_SYMLINK_NOFOLLOW
> % ./mercurial/osutil.c:           ret = fstatat(dfd, name, stp, AT_SYMLINK_NOFOLLOW);
> % s10:/home/gker/hg/mercurial/build>

Removing dirfd() on Solaris builds fixes things here for me, but I am
not sure if this is the Right(TM) thing to do:

%%%
diff -r 9d77f2b47eb7 mercurial/osutil.c
--- a/mercurial/osutil.c	Thu Oct 11 12:16:55 2007 +0200
+++ b/mercurial/osutil.c	Thu Oct 11 17:15:05 2007 +0300
@@ -16,10 +16,6 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
-
-#if defined(__sun)
-#define dirfd(dir) ((dir)->dd_fd)
-#endif
 
 struct listdir_stat {
 	PyObject_HEAD
@@ -187,7 +183,7 @@ static PyObject *statfiles(PyObject *lis
 	int ret;
 	ssize_t i;
 	ssize_t size = PyList_Size(list);
-#ifdef AT_SYMLINK_NOFOLLOW
+#if defined(AT_SYMLINK_NOFOLLOW) && !defined(sun)
 	int dfd = dirfd(dir);
 #endif
 
@@ -213,7 +209,7 @@ static PyObject *statfiles(PyObject *lis
 			PyTuple_SET_ITEM(elt, 2, py_st);
 		}
 
-#ifdef AT_SYMLINK_NOFOLLOW
+#if defined(AT_SYMLINK_NOFOLLOW) && !defined(sun)
 		ret = fstatat(dfd, name, stp, AT_SYMLINK_NOFOLLOW);
 #else
 		ret = lstat(path, stp);
%%%



More information about the Mercurial-devel mailing list