Use latest watchman (#21546)
* chore: upgraded watchman, otherwise it's not used with current metro The latest metro version requires watchman capabilities that are not available in the version we locked, so it was not used. Instead we used the "node watcher", which is slower and buggier (at least for me metro was timing out quite often) * fix: watchman ignore .clj-kondo, .shadow-cljs
This commit is contained in:
parent
ac0a115f1d
commit
6a30ce3de3
|
@ -1,6 +1,8 @@
|
||||||
{
|
{
|
||||||
"ignore_dirs": [
|
"ignore_dirs": [
|
||||||
"android/build",
|
"android/build",
|
||||||
"target"
|
"target",
|
||||||
|
".clj-kondo",
|
||||||
|
".shadow-cljs"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -44,11 +44,6 @@ in {
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
# Downgrade watchman in attempt to fix "too many files open issue"
|
|
||||||
watchman = callPackage ./pkgs/watchman {
|
|
||||||
inherit (super.darwin.apple_sdk.frameworks) CoreServices;
|
|
||||||
autoconf = super.buildPackages.autoconf269;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Package version adjustments
|
# Package version adjustments
|
||||||
nodejs = super.nodejs_20;
|
nodejs = super.nodejs_20;
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
# Issue
|
|
||||||
|
|
||||||
`watchman` was upgraded significantly during the last nixpkgs upgrade (`4.9.0` (Aug 16, 2017) to `2023.01.30.00` - 6 years between):
|
|
||||||
- https://github.com/status-im/status-mobile/pull/14944
|
|
||||||
- https://github.com/status-im/nixpkgs/commit/4e9c02bcc709fe1737a746add0e8e0109133d808
|
|
||||||
|
|
||||||
Probably causing developers to have "too many files open" issue:
|
|
||||||
https://github.com/status-im/status-mobile/issues/16341
|
|
||||||
|
|
||||||
```
|
|
||||||
Error: A non-recoverable condition has triggered. Watchman needs your help!
|
|
||||||
The triggering condition was at timestamp=1687286390: opendir(/Users/javid/Projects/status-mobile/node_modules/metro-core/node_modules/jest-regex-util/build) -> Too many open files
|
|
||||||
All requests will continue to fail with this message until you resolve
|
|
||||||
the underlying problem. You will find more information on fixing this at
|
|
||||||
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-opendir
|
|
||||||
```
|
|
||||||
|
|
||||||
# Fix
|
|
||||||
This is an attempt to fix the issue by downgrading the watchman
|
|
||||||
|
|
||||||
# Upgrade
|
|
||||||
When upgrading in the future, please read the comments:
|
|
||||||
https://github.com/status-im/status-mobile/issues/16341
|
|
|
@ -1,48 +0,0 @@
|
||||||
{ stdenv, lib, config, fetchFromGitHub, autoconf, automake, pcre
|
|
||||||
, libtool, pkg-config, openssl
|
|
||||||
, confFile ? config.watchman.confFile or null
|
|
||||||
, withApple ? stdenv.isDarwin, CoreServices
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "watchman";
|
|
||||||
version = "4.9.0";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "facebook";
|
|
||||||
repo = "watchman";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "0fdaj5pmicm6j17d5q7px800m5rmam1a400x3hv1iiifnmhgnkal";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ autoconf automake pkg-config libtool ];
|
|
||||||
buildInputs = [ pcre openssl ]
|
|
||||||
#++ lib.optionals withApple [ CoreServices ];
|
|
||||||
++ lib.optionals stdenv.isDarwin [ CoreServices ];
|
|
||||||
|
|
||||||
configureFlags = [
|
|
||||||
"--enable-lenient"
|
|
||||||
"--enable-conffile=${if confFile == null then "no" else confFile}"
|
|
||||||
"--with-pcre=yes"
|
|
||||||
|
|
||||||
# For security considerations re: --disable-statedir, see:
|
|
||||||
# https://github.com/facebook/watchman/issues/178
|
|
||||||
"--disable-statedir"
|
|
||||||
];
|
|
||||||
|
|
||||||
prePatch = ''
|
|
||||||
patchShebangs .
|
|
||||||
'';
|
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
./autogen.sh
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Watches files and takes action when they change";
|
|
||||||
homepage = "https://facebook.github.io/watchman";
|
|
||||||
maintainers = with maintainers; [ cstrahan ];
|
|
||||||
platforms = with platforms; linux ++ darwin;
|
|
||||||
license = licenses.asl20;
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue