Fix copy:build ENOENT on extensionless README symlinks#146
Open
agibson-godaddy wants to merge 2 commits into
Open
Fix copy:build ENOENT on extensionless README symlinks#146agibson-godaddy wants to merge 2 commits into
agibson-godaddy wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes copy:build failures caused by vendored packages that contain extensionless README symlinks pointing to relative targets (e.g., README -> README.md), which can trigger a misleading ENOENT ... lstat 'README.md' error during gulp.src globbing.
Changes:
- Exclude extensionless
READMEfiles from the build copy glob to avoid vinyl-fs’s incorrect relative-target symlink handling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
The
copy:buildtask fails with a misleadingENOENT: ... lstat 'README.md'error in any plugin whose dependency tree includes a vendored package with a relative-target README symlink (e.g.cybersource/rest-client-phppulls insingpolyma/openpgp-php, which shipsREADME -> README.md).The error
The cause
vendor/singpolyma/openpgp-php/contains an extensionless symlink:When
gulp.src(via vinyl-fs) globs this file, it callsfs.readlink()to read the target (README.md) and thenfs.lstat()on the bare target string. Thatlstatis resolved relative to the gulpcwd(the plugin root), not the symlink's directory — andREADME.mddoesn't exist at the plugin root, so the task crashes.The error message points at
README.mdbecause that's the readlink target, which is why it's a red herring: there's no actualREADME.mdinvolved in the copy, and the failure isn't a race condition or task-ordering issue.The fix
Exclude extensionless
READMEfiles from the build glob alongside the existingreadme.mdexclusion. These are documentation files we don't ship anyway, and excluding them sidesteps vinyl-fs's broken handling of relative-target symlinks.Test plan
singpolyma/openpgp-php(e.g. cybersource gateway), runnpx sake copy:buildand confirm it completes without the ENOENT errorREADMEsymlinkreadme.md/readme.txt/README.mdexclusions still behave as before🤖 Generated with Claude Code