Skip to content

Support go_path rule for targets that have a dir in embedsrcs #4401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cmfcmf
Copy link

@cmfcmf cmfcmf commented Jul 29, 2025

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

This PR fixes go_path failing when a go_library rule has a directory in its embedsrcs. It does so by correctly copying folders (as well as symlinked folders).

Which issues(s) does this PR fix?

Fixes #4400

Other notes for review

target = filepath.Join(filepath.Dir(src), target)
}

return copyRecursively(target, dst, writeFile, createDir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this lead out us out of the sandbox? Would it work if we only copied the symlink as is without recurring on its target?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this lead out us out of the sandbox?

I don't know enough about Bazel to answer this.

Would it work if we only copied the symlink as is without recurring on its target?

I think that would only work for the copyPath function, but I don't think that would work for the ZIP archive created by archivePath, because the ZIP file cannot contain symlinks.

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.

go_path rule does not support go_library using embedsrcs containing a directory
2 participants