facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.44k stars 990 forks source link

Builds fail for 2.8 and 2.8.1 on OSX #9

Closed dsummersl closed 10 years ago

dsummersl commented 10 years ago

When I attempt to compile watchman I get stack traces like the following:

brew: superenv removed: -Werror -g -O2 -Wall -Wextra -Wdeclaration-after-statement -g -gdwarf-2
cc -DHAVE_CONFIG_H -I.  -I./thirdparty/jansson -I./thirdparty/jansson -Werror -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -g -O2 -I/usr/local/Cellar/pcre/8.33/include -Wall -Wextra -Wdeclaration-after-statement -g -gdwarf-2 -fno-omit-frame-pointer -c -o watchman-rules.o `test -f 'rules.c' || echo './'`rules.c
brew: superenv removed: -Werror -g -O2 -Wall -Wextra -Wdeclaration-after-statement -g -gdwarf-2
root.c:1018:15: error: use of undeclared identifier 'k'
      memset(&k, 0, sizeof(k));
              ^
/usr/include/secure/_string.h:76:21: note: expanded from macro 'memset'
  ((__darwin_obsz0 (dest) != (size_t) -1)                               \
                    ^
/usr/include/secure/_common.h:38:55: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                      ^
root.c:1018:15: error: use of undeclared identifier 'k'
      memset(&k, 0, sizeof(k));
              ^
/usr/include/secure/_string.h:77:30: note: expanded from macro 'memset'
   ? __builtin___memset_chk (dest, val, len, __darwin_obsz0 (dest))     \
                             ^
root.c:1018:15: error: use of undeclared identifier 'k'
      memset(&k, 0, sizeof(k));
              ^
/usr/include/secure/_string.h:78:27: note: expanded from macro 'memset'
   : __inline_memset_chk (dest, val, len))
                          ^
root.c:1019:15: error: use of undeclared identifier 'k'
      EV_SET(&k, dir->wd, EVFILT_VNODE, EV_ADD|EV_CLEAR,
              ^
/usr/include/sys/event.h:105:29: note: expanded from macro 'EV_SET'
        struct kevent *__kevp__ = (kevp);       \
                                   ^
root.c:1024:32: error: use of undeclared identifier 'k'
      if (kevent(root->kq_fd, &k, 1, NULL, 0, 0)) {
                               ^
root.c:1116:1: error: function declared in block scope cannot have 'static' storage class
static void spawn_command(w_root_t *root,
^
root.c:1119:41: error: expected ';' at end of declaration
    struct watchman_rule_match *matches)
                                        ^
                                        ;
root.c:1974:1: error: function declared in block scope cannot have 'static' storage class
static bool root_check_restrict(const char *watch_path)
^
root.c:1974:56: error: expected ';' at end of declaration
static bool root_check_restrict(const char *watch_path)
                                                       ^
                                                       ;
root.c:2468:1: error: expected '}'

^
root.c:935:1: note: to match this '{'
{
^
10 errors generated.
make[1]: *** [watchman-root.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
/

I am able to compile 2.6 - 2.7 fine.

wez commented 10 years ago

Sadpanda. @sid0 I've got a couple of tweaks that make it compile again, but I think more work is needed.

wez commented 10 years ago

Resolved by f26c51de940c3457ce072cf571a947098976093c, tagged 2.8.2 in 05c378fb072ee25c58440602c1406eb4fc267344