lerna / lerna/lerna

`lerna watch` not working on arch linux

Open
#3,953 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
36.1k
Forks
2.3k
Avg merge
1d 4h
Merged PRs (30d)
50

Description

Current Behavior

pnpm exec lerna watch -- echo \$LERNA_PACKAGE_NAME \$LERNA_FILE_CHANGE

does not do anything when I modify files. Actually sometimes it does it once or twice but then it stops working.

When I look at the nx logs, I see that it registers the file modifications (with an ever growing lag!), but they don't get to lerna.

I have tested this on 2 different OS: Arch Linux and Mac OS. The buggy behavior only happens on Arch Linux, everything works as expected on Mac OS. There is also no "ever growing lag" on Mac OS.

Expected Behavior

lerna properly responds to files changing, even on Arch Linux!

I don't know if this is a regression.

Steps to Reproduce

I have made a minimal repo reproducing the issue: https://github.com/simlmx/repro-lerna-watch
See the instructions in the README.

Failure Logs / Configuration

When I modify a file, I see these nx logs:

[NX Daemon Server] - 2024-02-06T19:27:52.852Z - [WATCHER]: 0 file(s) created or restored, 0 file(s) modified, 2 file(s) deleted
[NX Daemon Server] - 2024-02-06T19:27:52.852Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-02-06T19:27:52.853Z - Time taken for 'changed-projects' 0.017439999617636204ms

<Here there is a lag that gets longer and longer every time I modify a file>

[NX Daemon Server] - 2024-02-06T19:27:59.259Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-02-06T19:27:59.259Z - [REQUEST]:
[NX Daemon Server] - 2024-02-06T19:27:59.259Z - [REQUEST]: packages/a/package.json,packages/a/4913
[NX Daemon Server] - 2024-02-06T19:27:59.261Z - Time taken for 'hash changed files from watcher' 0.038179999217391014ms
lerna.json

{
  "$schema": "node_modules/lerna/schemas/lerna-schema.json",
  "version": "0.0.0",
  "npmClient": "pnpm"
}

Environment
Environment info:

 System:
   OS: Linux 6.7 Arch Linux
   CPU: (24) x64 AMD Ryzen 9 7900 12-Core Processor
 Binaries:
   Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
   Yarn: 1.22.21 - ~/.nvm/versions/node/v20.10.0/bin/yarn
   npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
 Utilities:
   Git: 2.43.0 - /usr/bin/git
 npmPackages:
   lerna: ^8.1.2 => 8.1.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal reproduction repository and its README, then trace pnpm exec lerna watch through the Nx watcher logs and the lerna.json configuration. Compare file-change handling on Arch Linux with the working macOS behavior; done means repeated file modifications consistently reach lerna without increasing lag.

Written by the indexing model from the issue text.

Assessment

Tech stack
arch-linux, typescript
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.