Skip to content

Keep the hash worker when rebuilding from the Nx cache - #39

Open
Yagz wants to merge 1 commit into
Arkazzae:masterfrom
Yagz:fix/hash-worker-nx-cache-output
Open

Yagz wants to merge 1 commit into
Arkazzae:masterfrom
Yagz:fix/hash-worker-nx-cache-output

Conversation

@Yagz

@Yagz Yagz commented Nov 21, 2026 •

Copy link
Copy Markdown

Adds patches/0046-hash-worker-nx-cache-output.patch.

The problem

A package rebuilt in a folder where it was already built can ship without hash-worker.cjs. In that package, adding an archive by hand fails with:

failed to calculate hash ... Cannot find module '/opt/Vortex/resources/app.asar/hash-worker.cjs'

The archive gets no MD5, so a collection never recognises it and keeps trying to download the file instead.

Released packages are not affected, because they are built from scratch.

Why it happens

Nx caches Vortex's main build. When it reuses that cache, it only restores the files listed as the build's outputs. The list includes bsdiff-worker.cjs but forgets hash-worker.cjs, even though the same build script writes both.

Rebuilding the package with makepkg -C in the same folder reuses the cache kept under ~/.nx, so the hash worker goes missing.

The fix

Add hash-worker.cjs and hash-worker.cjs.map to the outputs of @vortex/main:build.

Testing

  • Reproduced with nx run @vortex/main:build: build once, delete build/hash-worker.cjs, build again. Without the patch, the cached run doesn't bring the file back. With the patch, it does.
  • Real setup: with a package built from this branch, an archive added by hand got its MD5 and was installed by its collection.

Notes

The same omission exists in upstream Vortex, so it could also be reported to Nexus-Mods/Vortex.

This is one of three separate pull requests (#37 and #38 are the others). Each one adds its patch at the same place in PKGBUILD and .SRCINFO, so after the first one is merged the others will need a small conflict fix.

Suggested changelog line: A package rebuilt from an existing Nx cache no longer lacks the hash worker, which made archives added by hand fail to hash.

🤖 Generated with Claude Code

@vortex/main:build is cached by Nx, but its outputs list bsdiff-worker.cjs and not hash-worker.cjs. A build that restores the main build from the Nx cache, such as rebuilding the package in the same folder, ships without the hash worker: importing an archive by hand then fails with "Cannot find module .../app.asar/hash-worker.cjs", the archive gets no MD5 and a collection never recognises it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Yagz Yagz changed the title List the hash worker among the cached outputs of Vortex's main build Keep the hash worker when rebuilding from the Nx cache Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant