Fix cache manifest not saving: open MPQ writable in ProjectConfigBuilder#1176
Merged
Frotty merged 1 commit intowurstscript:masterfrom Apr 1, 2026
Merged
Conversation
`ProjectConfigBuilder.apply()` opens the target map MPQ to save the updated cache manifest, but passes `readOnly=true` to `getEditor()`. The subsequent `saveManifest()` call tries to insert a file via `mpq.insertFile()`, which calls `JMpqEditor.deleteFile()` internally. JMPQ3 throws `NonWritableChannelException` (with a null message) when the editor is read-only, resulting in: Warning: Could not save manifest to MPQ: null This silently breaks the build caching system introduced in wurstscript#1096 — every build becomes a full rebuild because the manifest is never persisted. Fix: change `readOnly` from `true` to `false` so the manifest can actually be written.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProjectConfigBuilder.apply()opens the target map MPQ withreadOnly=trueto save the updated cache manifest. The subsequentsaveManifest()→mpq.insertFile()call fails because JMPQ3'sJMpqEditor.deleteFile()throwsNonWritableChannelExceptionwhen the editor is read-only.This produces the warning:
The
nullis becauseNonWritableChannelException()has no message by default.This silently breaks the build caching system introduced in #1096 — every build becomes a full rebuild because the manifest is never persisted to the MPQ.
Fix
One-line change:
readOnlyfromtruetofalseatProjectConfigBuilder.java:101so the manifest can actually be written.Call chain
ProjectConfigBuilder.apply()line 101:MpqEditorFactory.getEditor(Optional.of(targetMap), true)— read-onlyImportFile.saveManifest(mpq, manifest)ImportFile.saveManifest()line 224:mpq.insertFile(MANIFEST_MPQ_PATH, data)Jmpq3BasedEditor.insertFile()line 30:getEditor().deleteFile(filenameInMpq)— throws NonWritableChannelExceptionTest plan