robinpellegrims / pellegrims

Nx monorepo with open source projects
MIT License
44 stars 20 forks source link

Cache output with NX14 is messy (compared to without this plugin) #164

Open NullVoxPopuli opened 1 year ago

NullVoxPopuli commented 1 year ago

Describe the bug

Starting with NX14, nx started doing a nicer terminal UI that updated whole screens, rather than continuously scrolled. Since adding the remote cache plugin, the output is back to scrolling, but incosistently.

Can this be fixed?

To Reproduce Use nx 14 have interactions with the cache

Expected behavior

terminal output is mostly the same as without the cache plugin, but instead appends information about remote cache hit / miss local cache, etc inline with existing output

Screenshots

I cannot share these

Desktop (please complete the following information):

robinpellegrims commented 1 year ago

I tried and failed to reproduce this, would it be possible to give some more information or maybe some logs from a dummy project with and without the caching enabled?

NullVoxPopuli commented 1 year ago

yeah, the output is all segmented per package, like this:

# many, many lines omitted for brevity

 >  NX   Running target _build for 15 projects

    ✔  nx run <package-c>:_build (9s)

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target _build for 15 projects

    ✔  nx run <package-b>:_build (5s)

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target _build for 15 projects

    ✔  nx run <package-a>:_build (9s)

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Successfully ran target _build for 15 projects (26s)

Without caching enabled, it looks like this:

    ✔  nx run <package-a>:_build (4s)
    ✔  nx run <package-b>:_build (4s)
    ✔  nx run <package-c>:_build (4s)
    ✔  nx run <package-d>:_build (9s)

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target _build for 15 projects

    →    Executing 8/11 remaining tasks in parallel...

    ⠼    nx run <package-e>:_build
    ⠼    nx run <package-f>:_build
    ⠼    nx run <package-g>:_build
    ⠼    nx run <package-h>:_build
    ⠼    nx run <package-i>:_build
    ⠼    nx run <package-j>:_build
    ⠼    nx run <package-k>:_build
    ⠼    nx run <package-l>:_build

Without caching the relevant parts of the terminal are re-written so that all the pending tasks eventually move above the line

robinpellegrims commented 1 year ago

It seems related to how the external library nx-remotecache-custom logs messages to the console, so I created an issue there.