fix(yarn-pack-utils): copy patch files - #814
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04dd34e457
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 948b86538f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d5637571a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e77147cd0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const copyOperations = new Array<{ dest: PortablePath; src: PortablePath }>() | ||
|
|
||
| const parsed = parseDescriptor(resolvedDescriptor) | ||
| for (const [descriptor, ownerWorkspace] of getPatchDescriptorSources(project, workspace)) { |
There was a problem hiding this comment.
Copy patches referenced by package extensions
When the copied .yarnrc.yml contains a reachable packageExtensions dependency such as patch:foo@...#~/.yarn/patches/foo.patch, the temporary install still loads those extensions later in pack() before tmpProject.install(), but this loop only walks the packed workspace manifest and root resolutions. The patch file from the extension is therefore never copied into destination, so export/image pack can still fail with an ENOENT when Yarn resolves that injected dependency.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This finding is technically valid, but it is outside the scope of #813. The reported bug covers project-level patch files preserved by root resolutions; PR #814 now materializes that contract. Supporting patch dependencies injected through packageExtensions requires resolved dependency-graph ownership and belongs to the upcoming packaging architecture refactor, so this thread remains open and is not a merge blocker for this bug fix.
Task
How to verify
Before the fix
Action: run image pack
Expected result: the standalone install fails with ENOENT because the patch resolution is preserved without its patch file
After the fix
Action: run image pack with the committed Raijin runtime
Expected result: workspace-relative patches are included in their owning workspace archives, project-root patches are materialized at the standalone root, and the standalone install completes
Proofs