{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14309","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14309/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14309/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14309/events","html_url":"https://github.com/NixOS/nixpkgs/issues/14309","id":144395713,"number":14309,"title":"Watchman on OS X doesn't build with FSEvents","user":{"login":"wmertens","id":54934,"avatar_url":"https://avatars.githubusercontent.com/u/54934?v=3","gravatar_id":"","url":"https://api.github.com/users/wmertens","html_url":"https://github.com/wmertens","followers_url":"https://api.github.com/users/wmertens/followers","following_url":"https://api.github.com/users/wmertens/following{/other_user}","gists_url":"https://api.github.com/users/wmertens/gists{/gist_id}","starred_url":"https://api.github.com/users/wmertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmertens/subscriptions","organizations_url":"https://api.github.com/users/wmertens/orgs","repos_url":"https://api.github.com/users/wmertens/repos","events_url":"https://api.github.com/users/wmertens/events{/privacy}","received_events_url":"https://api.github.com/users/wmertens/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/6.topic:%20darwin","name":"6.topic: darwin","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-29T21:36:57Z","updated_at":"2016-04-25T05:04:31Z","closed_at":null,"body":"* Kernel: Darwin Wouts-MBP 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64\r\n* System: OS X 10.11.4\r\n* Nix version: 1.11.2\r\n* Nixpkgs version: \"16.09pre79463.d88ae10\"\r\n\r\nWatchman uses kqueue instead of FSEvents, which makes it basically unusable. This can be verified by looking at the log which starts with `Using watcher mechanism kqueue`.\r\n\r\nI traced it down to CoreServices not being provided as a build input, but when I try to do that I get these build errors:\r\n\r\n```\r\nwatcher/fsevents.c:118:31: error: unknown type name 'CFFileDescriptorRef'\r\nstatic void fse_pipe_callback(CFFileDescriptorRef fdref,\r\n                              ^\r\nwatcher/fsevents.c:138:3: error: use of undeclared identifier 'CFFileDescriptorContext'\r\n  CFFileDescriptorContext fdctx;\r\n  ^\r\nwatcher/fsevents.c:139:3: error: use of undeclared identifier 'CFFileDescriptorRef'\r\n  CFFileDescriptorRef fdref;\r\n  ^\r\nwatcher/fsevents.c:152:28: error: use of undeclared identifier 'fdctx'; did you mean 'fsctl'?\r\n  memset(&fdctx, 0, sizeof(fdctx));\r\n                           ^~~~~\r\n                           fsctl\r\n```\r\n\r\nTo build, I use this `nixpkgs/config.nix`:\r\n```nix\r\n{ pkgs }:\r\n{\r\n\tpackageOverrides = pkgs: rec {\r\n\t\twatchman = pkgs.callPackage ./watchman.nix {\r\n\t\t    inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;\r\n\t\t    };\r\n\t};\r\n}\r\n```\r\nand this `watchman.nix`:\r\n```nix\r\n{ stdenv, lib, config, fetchFromGitHub, autoconf, automake, pcre\r\n, confFile ? config.watchman.confFile or null, CoreServices\r\n}:\r\n\r\nstdenv.mkDerivation rec {\r\n  name = \"watchman-${version}\";\r\n\r\n  version = \"4.5.0\";\r\n\r\n  src = fetchFromGitHub {\r\n    owner = \"facebook\";\r\n    repo = \"watchman\";\r\n    rev = \"v${version}\";\r\n    sha256 = \"0hyj7nbsm5mv8zq2fldd06f92a3wamavha20311518qv7q5jj72v\";\r\n  };\r\n\r\n  buildInputs = [ autoconf automake pcre ]\r\n    ++ stdenv.lib.optional stdenv.isDarwin CoreServices;\r\n\r\n  configureFlags = [\r\n      \"--enable-lenient\"\r\n      \"--enable-conffile=${if confFile == null then \"no\" else confFile}\"\r\n      \"--with-pcre=yes\"\r\n\r\n      # For security considerations re: --disable-statedir, see:\r\n      # https://github.com/facebook/watchman/issues/178\r\n      \"--disable-statedir\"\r\n  ];\r\n\r\n  preConfigure = ''\r\n    ./autogen.sh\r\n  '';\r\n\r\n  meta = with lib; {\r\n    description = \"Watches files and takes action when they change\";\r\n    homepage    = https://facebook.github.io/watchman;\r\n    maintainers = with maintainers; [ cstrahan ];\r\n    platforms   = with platforms; linux ++ darwin;\r\n    license     = licenses.asl20;\r\n  };\r\n}\r\n```\r\n\r\n/cc @copumpkin or @shlevy any ideas on how to fix this build? @cstrahan I presume you're not using Darwin? Any others that may know?"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/214132207","html_url":"https://github.com/NixOS/nixpkgs/issues/14309#issuecomment-214132207","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14309","id":214132207,"user":{"login":"matthewbauer","id":19036,"avatar_url":"https://avatars.githubusercontent.com/u/19036?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewbauer","html_url":"https://github.com/matthewbauer","followers_url":"https://api.github.com/users/matthewbauer/followers","following_url":"https://api.github.com/users/matthewbauer/following{/other_user}","gists_url":"https://api.github.com/users/matthewbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewbauer/subscriptions","organizations_url":"https://api.github.com/users/matthewbauer/orgs","repos_url":"https://api.github.com/users/matthewbauer/repos","events_url":"https://api.github.com/users/matthewbauer/events{/privacy}","received_events_url":"https://api.github.com/users/matthewbauer/received_events","type":"User","site_admin":false},"created_at":"2016-04-25T05:04:31Z","updated_at":"2016-04-25T05:04:31Z","body":"@wmertens You should look at the logs... It's very possible it just never go added. It's going to end up looking like the original with probably some updated patches. I think @copumpkin mainly responsible for most of the SDK stuff in Darwin."}}