Skip to content
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

embed: allow symbolic links #44507

Closed
bprosnitz opened this issue Feb 22, 2021 · 1 comment
Closed

embed: allow symbolic links #44507

bprosnitz opened this issue Feb 22, 2021 · 1 comment

Comments

@bprosnitz
Copy link
Contributor

Currently, go:embed errors when it is passes a symlinked file, indicating that it isn't supported. This support would be useful.

In the Fuchsia go build system, we often end up with files that are symlinked in a generated directory that serves as inputs to go. While the files can be copied, it would be much easier if the symlinked files could be directly referenced.

@jayconrod jayconrod changed the title go:embed symlink support embed: allow symbolic links Feb 22, 2021
@jayconrod
Copy link
Contributor

Sorry, forbidding symbolic links was a design decision from the embed proposal.

It is an error for a pattern to match files outside the current module or that cannot be packaged into a module, like .git/* or symbolic links (or, as noted above, empty directories).

Symbolic links are ignored when modules are archived for distribution. That would mean if symbolic links were allowed, a different set of files would be embedded in a package depending on whether the package was in the main module or in a dependency.

(I'm not familiar with Fuchsia's build system. Is it based on cmd/go or does it invoke cmd/compile directly? cmd/compile treats symbolic links like regular files or directories, but it needs another tool to generate an embedcfg file for it.)

@golang golang locked and limited conversation to collaborators Feb 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants