Open duarten opened 5 years ago
We seem to be including all runfiles for each package, including those from transitive dependencies. We should only include direct runfiles.
I was looking for bazel rules to execute gqlgen
as well. Is there currently any discussion on if and when to tackle this?
What version of rules_go are you using?
0.19.1
What version of gazelle are you using?
0.18.1
What version of Bazel are you using?
0.28.1
Does this issue reproduce with the latest releases of all the above?
Yes.
What operating system and processor architecture are you using?
Darwin and linux, both amd64.
What did you do?
Executed this rule:
for
Which applies a patch to list *.gotpl files inside the data attribute of the generated
BUILD
files:Full
WORKSPACE
and patch files are pasted at the end of the issue.What did you expect to see?
The files specified in the data attributes should appear in their respective directories.
What did you see instead?
The data files appear together in multiple directories:
This seems related to package dependencies. For example,
bazel-genfiles/gqlgen_path/src/github.com/99designs/gqlgen/plugin/modelgen/
contains links to files that are not supposed to be in that directory, but belong tocom_github_99designs_gqlgen/codegen
.The
go_library
rule forcom_github_99designs_gqlgen/plugin/modelgen/
is:It depends on
//codegen/config
and//codegen/config
. However, those libraries do not (explicitly?) depend on their parent,//codegen
. Nevertheless, data files for//codegen
are linked in thegithub.com/99designs/gqlgen/plugin/modelgen
directory.This is unexpected. What is also unexpected is that data files have this behavior, because even though the library depends on *.go files as well, those are not linked in the library's directory.
WORKESPACE
file:Path file: