Skip to content

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