question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Yarn 3.2.0 hangs when diffing lockfiles due to endless-loop bug in `diff` package

See original GitHub issue

Self-service

  • I’d be willing to implement a fix

Describe the bug

When I yarn install --immutable inside a container as part of my CI process, Yarn detects that the lockfile would be updated and attempts to show me the diff before exiting with an error.

For the particular lockfile that I am using with my project, the diff never completes: yarn runs forever, using 100% CPU, until I kill it.

To reproduce

I have isolated the problem to the diff package, a dependency of Yarn, and filed an issue with the maintainer of that package, including a self-contained reproduction that does not depend on yarn.

Environment

System:
    OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (4) x64 unknown
  Binaries:
    Node: 16.14.2 - /tmp/xfs-5c2a3254/node
    Yarn: 4.0.0-rc.3.git.20220426.hash-67ce47fc6 - /tmp/xfs-5c2a3254/yarn
    npm: 8.5.0 - /usr/local/bin/npm

Additional context

I am at an impasse: I can’t upgrade my project to Yarn 2/3 as long as those tools are unstable and prone to disrupt my development workflow. It seems like Yarn’s attempt to provide a UI nicety (colorized diffs) is making it fundamentally unstable.

The hang happens both with diff@4.0.1 (used by yarn@3.2.0) and the most recent build, diff@5.0.0 – so a simple upgrade of diff will not suffice to fix the issue.

Short of fixing the underlying bug, I’m not sure how the Yarn team could proceed. Personally, I don’t need the diff in the environments where this hang occurs – or ever. A .yarnrc.yml flag to disable diffs would be an adequate workaround for me.

I’m happy to attempt whatever feature the team decides is appropriate. Personally, I’m not sure I trust the diff package enough at this point to depend on it for a tool that is a core part of my software development lifecycle. I appreciate that yarn’s goal is to run with no dependencies on the OS, however, and it seems that Yarn patches also use diff – so perhaps the Yarn team can provide some help to the maintainer of diff.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kpdeckercommented, May 23, 2022

5.1.0 just published.

1reaction
kpdeckercommented, May 6, 2022

Merged PR. Will have to dust off the build toolchain to get a release out. Will try to tackle this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

patch-package | Yarn
patch-package lets app authors instantly make and keep fixes to npm dependencies. It's a vital band-aid for those of us living on the...
Read more >
error Your lockfile needs to be updated, but yarn was run with
lock folder and run the yarn install from there. Solution 2. run yarn add <package> which will generate a file yarn.lock in the...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
Bug :1523 - "[IDEA] Offload work by distributing trivial ebuild ... Bug:177585 - "dev-java/fop-0.93 has package.use.masked doc on amd64 due to out of...
Read more >
The Ultimate Guide to yarn.lock Lockfiles - Andrew Hansen
This is the problem package managers like npm aim to solve. ... A yarn.lock lockfile describes a project's dependencies as well as its ......
Read more >
Change Log for Plesk Obsidian
Fixed bugs related to the accessibility of the Plesk extension logs. ... In Plesk for Linux, the extension now supports the Yarn package...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found