Watchdog: 'pip install watchdog' fails on macOS 10.15.2 Catalina

Created on 29 Jan 2020  路  23Comments  路  Source: gorakhargosh/watchdog

pip install watchdog fails after I upgraded to macOS 10.15.2 with this error:

    Complete output (202 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.5
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/watchmedo.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/version.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/events.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/unicode_paths.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/compat.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/win32stat.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/dirsnapshot.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/delayed_queue.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/platform.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/bricks.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/echo.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/fsevents.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/inotify.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/api.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/inotify_buffer.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/winapi.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/read_directory_changes.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/kqueue.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/inotify_c.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/polling.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/fsevents2.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog/tricks
    copying src/watchdog/tricks/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/tricks
    running egg_info
    writing top-level names to src/watchdog.egg-info/top_level.txt
    writing requirements to src/watchdog.egg-info/requires.txt
    writing src/watchdog.egg-info/PKG-INFO
    writing entry points to src/watchdog.egg-info/entry_points.txt
    writing dependency_links to src/watchdog.egg-info/dependency_links.txt
    reading manifest file 'src/watchdog.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.h' under directory 'src'
    writing manifest file 'src/watchdog.egg-info/SOURCES.txt'
    running build_ext
    building '_watchdog_fsevents' extension
    creating build/temp.macosx-10.14-x86_64-3.5
    creating build/temp.macosx-10.14-x86_64-3.5/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -DWATCHDOG_VERSION_STRING="0.10.0" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=10 -DWATCHDOG_VERSION_BUILD=0 -I/Users/ericvanegmond/.pyenv/versions/3.5.3/include/python3.5m -c src/watchdog_fsevents.c -o build/temp.macosx-10.14-x86_64-3.5/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Werror -Wextra -fPIC -Wno-error=unused-command-line-argument
    In file included from src/watchdog_fsevents.c:22:
    In file included from /Users/ericvanegmond/.pyenv/versions/3.5.3/include/python3.5m/Python.h:25:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:64:
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:137:9: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
            int     (* _Nullable _close)(void *);
                       ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:93:16: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
            unsigned char   *_base;
                            ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:93:16: note: insert '_Nullable' if the pointer may be null
            unsigned char   *_base;
                            ^
                              _Nullable
.
.
.
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:391:44: note: insert '_Nullable' if the pointer may be null
                     fpos_t (* _Nullable)(void *, fpos_t, int),
                                               ^
                                                _Nullable
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:391:44: note: insert '_Nonnull' if the pointer should never be null
                     fpos_t (* _Nullable)(void *, fpos_t, int),
                                               ^
                                                _Nonnull
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:392:25: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
                     int (* _Nullable)(void *));
                            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------

Any suggestions on how to resolve this?
So far I've tried removing and reinstalling both xcode and command line tools which hasn't helped. Not sure what else to try here.

bug

Most helpful comment

Thanks for your continuous effort, @BoboTiG!

I tested f87d1cf3eb79c308ff7b8eca8cc74ad51385f58d and everything is working fine! 馃憤

Obtaining file:///Users/keimlink/projects/watchdog
Collecting pathtools>=0.1.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/e7/7f/470d6fcdf23f9f3518f6b0b76be9df16dcc8630ad409947f8be2eb0ed13a/pathtools-0.1.2.tar.gz
Collecting pyobjc-framework-Cocoa>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/7f/fa/5b2f6ae289e98471676dde3887b7d78f5166cbd7bd99943506abd76b2bd0/pyobjc_framework_Cocoa-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting pyobjc-framework-FSEvents>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/1f/2c/18237d753ca6a4f6e09e043941aafd244c047c27dfd544e8dd1a71d800eb/pyobjc_framework_FSEvents-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting PyYAML>=3.10 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz
Collecting argh>=0.24.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/06/1c/e667a7126f0b84aaa1c56844337bf0ac12445d1beb9c8a6199a7314944bf/argh-0.26.2-py2.py3-none-any.whl
Collecting pyobjc-core>=6.1 (from pyobjc-framework-Cocoa>=4.2.2->watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/73/2c/e90c0bb97a455bfe1ec7f8ad6ddfdd8fe55ece448566487242354a4401f6/pyobjc_core-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Installing collected packages: pathtools, pyobjc-core, pyobjc-framework-Cocoa, pyobjc-framework-FSEvents, PyYAML, argh, watchdog
  Running setup.py install for pathtools ... done
  Running setup.py install for PyYAML ... done
  Running setup.py develop for watchdog
Successfully installed PyYAML-5.3 argh-0.26.2 pathtools-0.1.2 pyobjc-core-6.1 pyobjc-framework-Cocoa-6.1 pyobjc-framework-FSEvents-6.1 watchdog

This is the output of ./.venv/bin/watchmedo --help:

usage: watchmedo [-h] [--version] {tricks-from,tricks,tricks-generate-yaml,generate-tricks-yaml,log,shell-command,auto-restart} ...

positional arguments:
  {tricks-from,tricks,tricks-generate-yaml,generate-tricks-yaml,log,shell-command,auto-restart}
    tricks-from (tricks)
                        Subcommand to execute tricks from a tricks configuration file. :param args: Command line argument options.
    tricks-generate-yaml (generate-tricks-yaml)
                        Subcommand to generate Yaml configuration for tricks named on the command line. :param args: Command line argument options.
    log                 Subcommand to log file system events to the console. :param args: Command line argument options.
    shell-command       Subcommand to execute shell commands in response to file system events. :param args: Command line argument options.
    auto-restart        Subcommand to start a long-running subprocess and restart it on matched events. :param args: Command line argument options.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

Copyright 2011 Yesudeep Mangalapilly <[email protected]>.
Copyright 2012 Google, Inc.

Licensed under the terms of the Apache license, version 2.0. Please see
LICENSE in the source code for more information.

All 23 comments

Could you alter the setup.py to add this line-Wno-nullability-completeness in extra_compile_args?
It is not an error related to watchdog, but a feature from Catalina ... See golang/go#35247 and the fix https://go-review.googlesource.com/c/go/+/205457/

On macOS 10.11.6 there is a similar problem (with Python 3.8.1):

Obtaining file:///Users/keimlink/projects/watchdog
Requirement already satisfied: pathtools>=0.1.1 in ./.venv/lib/python3.8/site-packages (from watchdog==0.10.0) (0.1.2)
Requirement already satisfied: pyobjc-framework-Cocoa>=4.2.2 in ./.venv/lib/python3.8/site-packages (from watchdog==0.10.0) (6.1)
Requirement already satisfied: pyobjc-framework-FSEvents>=4.2.2 in ./.venv/lib/python3.8/site-packages (from watchdog==0.10.0) (6.1)
Requirement already satisfied: PyYAML>=3.10 in ./.venv/lib/python3.8/site-packages (from watchdog==0.10.0) (5.3)
Requirement already satisfied: argh>=0.24.1 in ./.venv/lib/python3.8/site-packages (from watchdog==0.10.0) (0.26.2)
Requirement already satisfied: pyobjc-core>=6.1 in ./.venv/lib/python3.8/site-packages (from pyobjc-framework-Cocoa>=4.2.2->watchdog==0.10.0) (6.1)
Installing collected packages: watchdog
  Found existing installation: watchdog 0.10.0
    Uninstalling watchdog-0.10.0:
      Successfully uninstalled watchdog-0.10.0
  Running setup.py develop for watchdog
    ERROR: Command errored out with exit status 1:
     command: /Users/keimlink/projects/watchdog/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/keimlink/projects/watchdog/setup.py'"'"'; __file__='"'"'/Users/keimlink/projects/watchdog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /Users/keimlink/projects/watchdog/
    Complete output (59 lines):
    running develop
    running egg_info
    writing src/watchdog.egg-info/PKG-INFO
    writing dependency_links to src/watchdog.egg-info/dependency_links.txt
    writing entry points to src/watchdog.egg-info/entry_points.txt
    writing requirements to src/watchdog.egg-info/requires.txt
    writing top-level names to src/watchdog.egg-info/top_level.txt
    reading manifest file 'src/watchdog.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.h' under directory 'src'
    writing manifest file 'src/watchdog.egg-info/SOURCES.txt'
    running build_ext
    building '_watchdog_fsevents' extension
    creating build
    creating build/temp.macosx-10.11-x86_64-3.8
    creating build/temp.macosx-10.11-x86_64-3.8/src
    ccache /usr/bin/cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -DWATCHDOG_VERSION_STRING="0.10.0" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=10 -DWATCHDOG_VERSION_BUILD=0 -I/Users/keimlink/projects/watchdog/.venv/include -I/Users/keimlink/.pyenv/versions/3.8.1/include/python3.8 -c src/watchdog_fsevents.c -o build/temp.macosx-10.11-x86_64-3.8/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Werror -Wextra -fPIC -Wno-error=unused-command-line-argument
    src/watchdog_fsevents.c:196:28: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if (((callback_result) == ((void*)0)))
             ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:196:28: note: remove extraneous parentheses around the comparison to silence this warning
        if (((callback_result) == ((void*)0)))
            ~                  ^            ~
    src/watchdog_fsevents.c:196:28: note: use '=' to turn this equality comparison into an assignment
        if (((callback_result) == ((void*)0)))
                               ^~
                               =
    src/watchdog_fsevents.c:376:18: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if (((value) == ((void*)0)))
             ~~~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:376:18: note: remove extraneous parentheses around the comparison to silence this warning
        if (((value) == ((void*)0)))
            ~        ^            ~
    src/watchdog_fsevents.c:376:18: note: use '=' to turn this equality comparison into an assignment
        if (((value) == ((void*)0)))
                     ^~
                     =
    src/watchdog_fsevents.c:434:18: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if (((value) == ((void*)0)))
             ~~~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:434:18: note: remove extraneous parentheses around the comparison to silence this warning
        if (((value) == ((void*)0)))
            ~        ^            ~
    src/watchdog_fsevents.c:434:18: note: use '=' to turn this equality comparison into an assignment
        if (((value) == ((void*)0)))
                     ^~
                     =
    src/watchdog_fsevents.c:501:18: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if (((value) == ((void*)0))) {
             ~~~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:501:18: note: remove extraneous parentheses around the comparison to silence this warning
        if (((value) == ((void*)0))) {
            ~        ^            ~
    src/watchdog_fsevents.c:501:18: note: use '=' to turn this equality comparison into an assignment
        if (((value) == ((void*)0))) {
                     ^~
                     =
    4 errors generated.
    error: command 'ccache' failed with exit status 1
    ----------------------------------------
  Rolling back uninstall of watchdog
  Moving to /Users/keimlink/projects/watchdog/.venv/bin/watchmedo
   from /private/var/folders/0h/m440_ddd4qv8ps6hg0pfxnbm0000gn/T/pip-uninstall-dnnqcrg7/watchmedo
  Moving to /Users/keimlink/projects/watchdog/.venv/lib/python3.8/site-packages/watchdog.egg-link
   from /private/var/folders/0h/m440_ddd4qv8ps6hg0pfxnbm0000gn/T/pip-uninstall-v8maatdz/watchdog.egg-link
ERROR: Command errored out with exit status 1: /Users/keimlink/projects/watchdog/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/keimlink/projects/watchdog/setup.py'"'"'; __file__='"'"'/Users/keimlink/projects/watchdog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

I could fix it with this change:

diff --git a/setup.py b/setup.py
index 59f54f3..8fc6255 100644
--- a/setup.py
+++ b/setup.py
@@ -62,6 +62,7 @@ if get_platform().startswith('macosx'):
                 '-Wall',
                 '-Werror',
                 '-Wextra',
+                '-Wno-parentheses-equality',
                 '-fPIC',

                 # required w/Xcode 5.1+ and above because of '-mno-fused-madd'

But removing -Werror from extra_compile_args (introduced in 350d9f46720337fb197aaeb30884239cba2dc6d7) also solves the problem:

diff --git a/setup.py b/setup.py
index 59f54f3..0849565 100644
--- a/setup.py
+++ b/setup.py
@@ -60,7 +60,6 @@ if get_platform().startswith('macosx'):
                 '-std=c99',
                 '-pedantic',
                 '-Wall',
-                '-Werror',
                 '-Wextra',
                 '-fPIC',

Since I have no experience with C I'm unable to tell which is the right way to fix this.

I wonder why this is the first time someone reports those issues 馃

I will simply fix the code, thanks for the report @keimlink :)

I wonder why this is the first time someone reports those issues 馃

350d9f46720337fb197aaeb30884239cba2dc6d7 is part of #467, which is part of release 0.10.0.

So I would guess that before 0.10.0 -Werror wasn't used, so these warnings were not enabled.

@keimlink could you try to install the version from that branch: https://github.com/gorakhargosh/watchdog/tree/fix-use-sys-platform?

Unfortunately the problem still exists in the fix-use-sys-platform branch.

Complete output:

Obtaining file:///Users/keimlink/projects/watchdog
Collecting pathtools>=0.1.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/e7/7f/470d6fcdf23f9f3518f6b0b76be9df16dcc8630ad409947f8be2eb0ed13a/pathtools-0.1.2.tar.gz
Collecting pyobjc-framework-Cocoa>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/7f/fa/5b2f6ae289e98471676dde3887b7d78f5166cbd7bd99943506abd76b2bd0/pyobjc_framework_Cocoa-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting pyobjc-framework-FSEvents>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/1f/2c/18237d753ca6a4f6e09e043941aafd244c047c27dfd544e8dd1a71d800eb/pyobjc_framework_FSEvents-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting PyYAML>=3.10 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz
Collecting argh>=0.24.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/06/1c/e667a7126f0b84aaa1c56844337bf0ac12445d1beb9c8a6199a7314944bf/argh-0.26.2-py2.py3-none-any.whl
Collecting pyobjc-core>=6.1 (from pyobjc-framework-Cocoa>=4.2.2->watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/73/2c/e90c0bb97a455bfe1ec7f8ad6ddfdd8fe55ece448566487242354a4401f6/pyobjc_core-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Installing collected packages: pathtools, pyobjc-core, pyobjc-framework-Cocoa, pyobjc-framework-FSEvents, PyYAML, argh, watchdog
  Running setup.py install for pathtools ... done
  Running setup.py install for PyYAML ... done
  Running setup.py develop for watchdog
    ERROR: Command errored out with exit status 1:
     command: /Users/keimlink/projects/watchdog/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/keimlink/projects/watchdog/setup.py'"'"'; __file__='"'"'/Users/keimlink/projects/watchdog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /Users/keimlink/projects/watchdog/
    Complete output (59 lines):
    running develop
    running egg_info
    writing src/watchdog.egg-info/PKG-INFO
    writing dependency_links to src/watchdog.egg-info/dependency_links.txt
    writing entry points to src/watchdog.egg-info/entry_points.txt
    writing requirements to src/watchdog.egg-info/requires.txt
    writing top-level names to src/watchdog.egg-info/top_level.txt
    reading manifest file 'src/watchdog.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.h' under directory 'src'
    writing manifest file 'src/watchdog.egg-info/SOURCES.txt'
    running build_ext
    building '_watchdog_fsevents' extension
    creating build
    creating build/temp.macosx-10.11-x86_64-3.8
    creating build/temp.macosx-10.11-x86_64-3.8/src
    ccache /usr/bin/cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -DWATCHDOG_VERSION_STRING="0.10.1" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=10 -DWATCHDOG_VERSION_BUILD=1 -I/Users/keimlink/projects/watchdog/.venv/include -I/Users/keimlink/.pyenv/versions/3.8.1/include/python3.8 -c src/watchdog_fsevents.c -o build/temp.macosx-10.11-x86_64-3.8/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Werror -Wextra -fPIC -Wno-error=unused-command-line-argument -Wno-nullability-completeness
    src/watchdog_fsevents.c:190:26: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if ((callback_result == ((void*)0)))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:190:26: note: remove extraneous parentheses around the comparison to silence this warning
        if ((callback_result == ((void*)0)))
            ~                ^            ~
    src/watchdog_fsevents.c:190:26: note: use '=' to turn this equality comparison into an assignment
        if ((callback_result == ((void*)0)))
                             ^~
                             =
    src/watchdog_fsevents.c:370:16: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if ((value == ((void*)0)))
             ~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:370:16: note: remove extraneous parentheses around the comparison to silence this warning
        if ((value == ((void*)0)))
            ~      ^            ~
    src/watchdog_fsevents.c:370:16: note: use '=' to turn this equality comparison into an assignment
        if ((value == ((void*)0)))
                   ^~
                   =
    src/watchdog_fsevents.c:428:16: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if ((value == ((void*)0)))
             ~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:428:16: note: remove extraneous parentheses around the comparison to silence this warning
        if ((value == ((void*)0)))
            ~      ^            ~
    src/watchdog_fsevents.c:428:16: note: use '=' to turn this equality comparison into an assignment
        if ((value == ((void*)0)))
                   ^~
                   =
    src/watchdog_fsevents.c:495:16: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if ((value == ((void*)0))) {
             ~~~~~~^~~~~~~~~~~~~
    src/watchdog_fsevents.c:495:16: note: remove extraneous parentheses around the comparison to silence this warning
        if ((value == ((void*)0))) {
            ~      ^            ~
    src/watchdog_fsevents.c:495:16: note: use '=' to turn this equality comparison into an assignment
        if ((value == ((void*)0))) {
                   ^~
                   =
    4 errors generated.
    error: command 'ccache' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/keimlink/projects/watchdog/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/keimlink/projects/watchdog/setup.py'"'"'; __file__='"'"'/Users/keimlink/projects/watchdog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Steps to reproduce:

  1. git checkout fix-use-sys-platform
  2. pyenv local 3.8.1
  3. python -m venv .venv
  4. .venv/bin/python -m pip install -e .[watchmedo]

I orce-pushed on the same branch. Could you have another try please? Sorry to ask you that :)

@BoboTiG thanks for your work here!

I am having the same issue mentioned above, with the exception that I am using pipenv to manage my dependencies, and am using python 3.7.1 on MacOS 10.15.3 (released yesterday, but I had the same issue on 10.15.2).

I am able to repro by cloning and building master branch. Unfortunately, I am still encountering the same issue when building the fix-use-sys-platform branch.

Note: I have another project that also depends on watchdog 0.10.0 and I have no trouble installing and I cannot explain why.

@BoboTiG I tried installing with your fix branch, but still results in the same errors unfortunately.
pip install git+https://github.com/gorakhargosh/watchdog.git@fix-use-sys-platform

Collecting git+https://github.com/gorakhargosh/watchdog.git@fix-use-sys-platform
  Cloning https://github.com/gorakhargosh/watchdog.git (to revision fix-use-sys-platform) to /private/var/folders/tg/_7_j2gqx2c3b102j8cfvzm980000gn/T/pip-req-build-i6j_kf0w
  Running command git clone -q https://github.com/gorakhargosh/watchdog.git /private/var/folders/tg/_7_j2gqx2c3b102j8cfvzm980000gn/T/pip-req-build-i6j_kf0w
  Running command git checkout -b fix-use-sys-platform --track origin/fix-use-sys-platform
  Switched to a new branch 'fix-use-sys-platform'
  Branch 'fix-use-sys-platform' set up to track remote branch 'fix-use-sys-platform' from 'origin'.
.
.
.
  Complete output (118 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-x86_64-3.5
  creating build/lib.macosx-10.14-x86_64-3.5/watchdog
  copying src/watchdog/watchmedo.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
  copying src/watchdog/version.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
  copying src/watchdog/events.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
  copying src/watchdog/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
  creating build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/unicode_paths.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/compat.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/win32stat.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/dirsnapshot.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/delayed_queue.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/platform.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/bricks.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  copying src/watchdog/utils/echo.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
  creating build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/fsevents.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/inotify.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/api.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/inotify_buffer.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/winapi.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/read_directory_changes.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/kqueue.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/inotify_c.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/polling.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  copying src/watchdog/observers/fsevents2.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
  creating build/lib.macosx-10.14-x86_64-3.5/watchdog/tricks
  copying src/watchdog/tricks/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/tricks
  running egg_info
  creating src/watchdog.egg-info
  writing src/watchdog.egg-info/PKG-INFO
  writing requirements to src/watchdog.egg-info/requires.txt
  writing dependency_links to src/watchdog.egg-info/dependency_links.txt
  writing top-level names to src/watchdog.egg-info/top_level.txt
  writing entry points to src/watchdog.egg-info/entry_points.txt
  writing manifest file 'src/watchdog.egg-info/SOURCES.txt'
  reading manifest file 'src/watchdog.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.h' under directory 'src'
  writing manifest file 'src/watchdog.egg-info/SOURCES.txt'
  running build_ext
  building '_watchdog_fsevents' extension
  creating build/temp.macosx-10.14-x86_64-3.5
  creating build/temp.macosx-10.14-x86_64-3.5/src
  clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-nonnull -Wno-nonnull -DWATCHDOG_VERSION_STRING="0.10.1" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=10 -DWATCHDOG_VERSION_BUILD=1 -I/Users/ericvanegmond/.pyenv/versions/3.5.3/include/python3.5m -c src/watchdog_fsevents.c -o build/temp.macosx-10.14-x86_64-3.5/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Werror -Wextra -fPIC -Wno-error=unused-command-line-argument -Wno-nullability-completeness
  In file included from src/watchdog_fsevents.c:22:
  In file included from /Users/ericvanegmond/.pyenv/versions/3.5.3/include/python3.5m/Python.h:25:
  In file included from /usr/local/include/stdio.h:64:
  /usr/local/include/_stdio.h:137:9: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
          int     (* _Nullable _close)(void *);
                     ^
  /usr/local/include/_stdio.h:138:9: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
          int     (* _Nullable _read) (void *, char *, int);
                     ^
  /usr/local/include/_stdio.h:139:12: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
          fpos_t  (* _Nullable _seek) (void *, fpos_t, int);
                     ^
  /usr/local/include/_stdio.h:140:9: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
          int     (* _Nullable _write)(void *, const char *, int);
                     ^
  In file included from src/watchdog_fsevents.c:22:
  In file included from /Users/ericvanegmond/.pyenv/versions/3.5.3/include/python3.5m/Python.h:25:
  /usr/local/include/stdio.h:385:25: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
                   int (* _Nullable)(void *, char *, int),
                          ^
  /usr/local/include/stdio.h:386:25: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
                   int (* _Nullable)(void *, const char *, int),
                          ^
.
.
.
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/ericvanegmond/.pyenv/versions/3.5.3/envs/foo/bin/python3.5 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tg/_7_j2gqx2c3b102j8cfvzm980000gn/T/pip-req-build-i6j_kf0w/setup.py'"'"'; __file__='"'"'/private/var/folders/tg/_7_j2gqx2c3b102j8cfvzm980000gn/T/pip-req-build-i6j_kf0w/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tg/_7_j2gqx2c3b102j8cfvzm980000gn/T/pip-record-butiqh4x/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ericvanegmond/.pyenv/versions/3.5.3/envs/foo/include/site/python3.5/watchdog Check the logs for full command output.

OK we will finally get that fixed!
Please, tell me that this is fixed on the fix-use-sys-platform branch 馃 (I force pushed)

I noticed this a while ago but actually ignored since I had a version installed before the upgrade that still works. I tried fix-use-sys-platform branch with pip install . and it didn't work as well as of now.

Update: this is the output https://gist.github.com/erickmendonca/dbeca2d5edb2a45dc01c28436da14294

Unfortunately same error even with the latest updates on the fix-use-sys-platform branch.

OK, I removed -Werror completely, there is no way we lost more time on that ...
Do you confirm this is fixed now? (And so sorry for taking so much of your times.)

Thanks for your continuous effort, @BoboTiG!

I tested f87d1cf3eb79c308ff7b8eca8cc74ad51385f58d and everything is working fine! 馃憤

Obtaining file:///Users/keimlink/projects/watchdog
Collecting pathtools>=0.1.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/e7/7f/470d6fcdf23f9f3518f6b0b76be9df16dcc8630ad409947f8be2eb0ed13a/pathtools-0.1.2.tar.gz
Collecting pyobjc-framework-Cocoa>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/7f/fa/5b2f6ae289e98471676dde3887b7d78f5166cbd7bd99943506abd76b2bd0/pyobjc_framework_Cocoa-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting pyobjc-framework-FSEvents>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/1f/2c/18237d753ca6a4f6e09e043941aafd244c047c27dfd544e8dd1a71d800eb/pyobjc_framework_FSEvents-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting PyYAML>=3.10 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz
Collecting argh>=0.24.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/06/1c/e667a7126f0b84aaa1c56844337bf0ac12445d1beb9c8a6199a7314944bf/argh-0.26.2-py2.py3-none-any.whl
Collecting pyobjc-core>=6.1 (from pyobjc-framework-Cocoa>=4.2.2->watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/73/2c/e90c0bb97a455bfe1ec7f8ad6ddfdd8fe55ece448566487242354a4401f6/pyobjc_core-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Installing collected packages: pathtools, pyobjc-core, pyobjc-framework-Cocoa, pyobjc-framework-FSEvents, PyYAML, argh, watchdog
  Running setup.py install for pathtools ... done
  Running setup.py install for PyYAML ... done
  Running setup.py develop for watchdog
Successfully installed PyYAML-5.3 argh-0.26.2 pathtools-0.1.2 pyobjc-core-6.1 pyobjc-framework-Cocoa-6.1 pyobjc-framework-FSEvents-6.1 watchdog

This is the output of ./.venv/bin/watchmedo --help:

usage: watchmedo [-h] [--version] {tricks-from,tricks,tricks-generate-yaml,generate-tricks-yaml,log,shell-command,auto-restart} ...

positional arguments:
  {tricks-from,tricks,tricks-generate-yaml,generate-tricks-yaml,log,shell-command,auto-restart}
    tricks-from (tricks)
                        Subcommand to execute tricks from a tricks configuration file. :param args: Command line argument options.
    tricks-generate-yaml (generate-tricks-yaml)
                        Subcommand to generate Yaml configuration for tricks named on the command line. :param args: Command line argument options.
    log                 Subcommand to log file system events to the console. :param args: Command line argument options.
    shell-command       Subcommand to execute shell commands in response to file system events. :param args: Command line argument options.
    auto-restart        Subcommand to start a long-running subprocess and restart it on matched events. :param args: Command line argument options.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

Copyright 2011 Yesudeep Mangalapilly <[email protected]>.
Copyright 2012 Google, Inc.

Licensed under the terms of the Apache license, version 2.0. Please see
LICENSE in the source code for more information.

Ah that is an excellent news, thanks @keimlink !

@BoboTiG I tested as well and it resolves the issues I was having. Thank you!!!

Strangely it still seems to fail for me. Since it fixed the issue for @thomaspsk on 10.15.3 though, I'm really wondering if the issue is specific to my machine. I'm working around it for now using conda install -c conda-forge watchdog, so you can mark this as fixed since it's working on the latest macOS.

I now merged the fix. Could yo post the output @ericve25?

And I think I still need to add the -Wno-nullability-completeness argument because maybe you have more stricter CFLAGS. I must ask you to try the fix-macos-nullabilty branch, is it possible?

fix-macos-nullabilty branch fixed it for me 馃憤馃憤
pip install git+https://github.com/gorakhargosh/watchdog.git@fix-macos-nullabilty worked successfully in a fresh virtual env. Thanks for your help on this!!

I love when it works so smoothly :)
Thanks a lot. Now we are finally ready for a bugfix release.

The release 0.10.1 is out :)

Was this page helpful?
0 / 5 - 0 ratings