We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
451f267
5.0.0-homebrew
yes
macos, x86-64
Tried using //go/tools/gopackagesdriver in a repo structured like the following minial example: https://github.com/ok32/rules_go_aspect_bug .
//go/tools/gopackagesdriver
I expected it to work.
It breaks down on abc/abc_test.go.
abc/abc_test.go
Further investigation has shown that it generally breaks if:
git clone https://github.com/ok32/rules_go_aspect_bug
This works (not a test target):
bazel build \ --experimental_convenience_symlinks=ignore \ --aspects=@io_bazel_rules_go//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect \ --output_groups=go_pkg_driver_json_file,go_pkg_driver_stdlib_json_file,go_pkg_driver_srcs \ //abc:abc --subcommands
But this doesn't:
bazel build \ --experimental_convenience_symlinks=ignore \ --aspects=@io_bazel_rules_go//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect \ --output_groups=go_pkg_driver_json_file,go_pkg_driver_stdlib_json_file,go_pkg_driver_srcs \ //abc:abc_test --subcommands
It outputs an error:
ERROR: file 'abc/abc.pkg.json' is generated by these conflicting actions: Label: //abc:abc, //abc:abc_test RuleClass: go_library rule, go_test rule Configuration: 6ce34163bfbd3676ac846c4d40d7bd78b19138e848dffd069ada524d4e8e5a67, a7058d315debeef2eff4e053ea51cf00209814c3324262972d58300e41d5054a Mnemonic: FileWrite Action key: 64914f125e758196376624426b91b0caf41e87b1af8978762498baa836d346c2, 705900d71e6d42536e6578136d957d67a6660d4caeb2f55e168ed10b750de01e Progress message: Writing file abc/abc.pkg.json PrimaryInput: (null) PrimaryOutput: File:[[<execution_root>]bazel-out/darwin-fastbuild/bin]abc/abc.pkg.json Owner information: []#@io_bazel_rules_go//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect BuildConfigurationValue.Key[6ce34163bfbd3676ac846c4d40d7bd78b19138e848dffd069ada524d4e8e5a67] ConfiguredTargetKey{label=//abc:abc, config=BuildConfigurationValue.Key[6ce34163bfbd3676ac846c4d40d7bd78b19138e848dffd069ada524d4e8e5a67]} {}, []#@io_bazel_rules_go//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect BuildConfigurationValue.Key[a7058d315debeef2eff4e053ea51cf00209814c3324262972d58300e41d5054a] ConfiguredTargetKey{label=//abc:abc_test, config=BuildConfigurationValue.Key[a7058d315debeef2eff4e053ea51cf00209814c3324262972d58300e41d5054a]} {} MandatoryInputs: are equal Outputs: are equal
Basically, it tries to create two abc.pkg.json's in the same dir, one for each of the targets: //a/abc and //abc.
abc.pkg.json
//a/abc
//abc
As a workaround, patching this line https://github.com/bazelbuild/rules_go/blob/451f26754eeb2c4002984873774414caab1cfd57/go/tools/gopackagesdriver/aspect.bzl#L54 to
pkg_json_file = ctx.actions.declare_file(archive.data.importpath + "/" + archive.data.name + ".pkg.json")
works.
But I'm not sure it's the best way to fix it.
The text was updated successfully, but these errors were encountered:
Will be fixed by whatever approach is landed on in #3053.
Sorry, something went wrong.
Should be fixed by #3111. Reopen if it doesn't
No branches or pull requests
What version of rules_go are you using?
451f267
What version of gazelle are you using?
What version of Bazel are you using?
5.0.0-homebrew
Does this issue reproduce with the latest releases of all the above?
yes
What operating system and processor architecture are you using?
macos, x86-64
Any other potentially useful information about your toolchain?
What did you do?
Tried using
//go/tools/gopackagesdriver
in a repo structured like the following minial example: https://github.com/ok32/rules_go_aspect_bug .What did you expect to see?
I expected it to work.
What did you see instead?
It breaks down on
abc/abc_test.go
.Further investigation has shown that it generally breaks if:
How to reproduce
This works (not a test target):
But this doesn't:
It outputs an error:
Basically, it tries to create two
abc.pkg.json
's in the same dir, one for each of the targets://a/abc
and//abc
.What helps
As a workaround, patching this line https://github.com/bazelbuild/rules_go/blob/451f26754eeb2c4002984873774414caab1cfd57/go/tools/gopackagesdriver/aspect.bzl#L54 to
works.
But I'm not sure it's the best way to fix it.
The text was updated successfully, but these errors were encountered: