Open Nickersoft opened 2 years ago
I meet it too.
Also running into this issue as well (for a project using carvel tools that imports this library), so an indirect dependency is causing this on my end.
ERROR: /root/.cache/bazel/_bazel_root/2e020ad50777956f5c6b506427fe5ab3/external/com_github_mattn_go_runewidth/BUILD.bazel:3:11: no such package '@com_github_rivo_uniseg//': BUILD file not found in directory '' of external repository @com_github_rivo_uniseg. Add a BUILD file to a directory to mark it as a package. and referenced by '@com_github_mattn_go_runewidth//:go-runewidth' ERROR: Analysis of target '//scripts/tcxctl:tcxctl' failed; build aborted: Analysis failed INFO: Elapsed time: 25.115s INFO: 0 processes. FAILED: Build did NOT complete successfully (768 packages loaded, 5363 targets configured) Fetching @io_k8s_helm; fetching 17s Fetching @com_github_docker_cli; fetching 10s Fetching @com_github_docker_docker; fetching 10s Fetching @com_github_azure_azure_sdk_for_go; fetching 8s Fetching @com_github_gregjones_httpcache; fetching Fetching @com_github_masterminds_goutils; fetching Fetching @com_github_lann_ps; fetching
We add a patch to this dependency. It can work.
We add a patch to this dependency. It can work.
I encountered this issue earlier today, do you mean there's been a fix since then? That commit/patch looks to be from 8 days ago.
We add a patch to this dependency. It can work.
I encountered this issue earlier today, do you mean there's been a fix since then? That commit/patch looks to be from 8 days ago.
It just changed the bazel build file for com_github_rivo_uniseg
which generated by gazelle. The best fix method is to fix the behavior of the gazelle.
patch
Sorry I'm a bit confused. I'm still getting the same error that I pasted above that the BUILD file was not found in directory '' of external repository @com_github_rivo_uniseg. However, the patch you linked implies that BUILD file exists.
Could you help clear up my confusion? Thanks
Was this issue ever resolved? I'm still seeing this error on my end -
ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/3bfad932a61b6ec3a65186104844629d/external/com_github_mattn_go_runewidth/BUILD.bazel:3:11: no such package '@com_github_rivo_uniseg//': BUILD file not found in directory '' of external repository @com_github_rivo_uniseg. Add a BUILD file to a directory to mark it as a package. and referenced by '@com_github_mattn_go_runewidth//:go-runewidth'
Any help would be greatly appreciated!
@archit-bedrock did you manage to fix your issue?
@archit-bedrock did you manage to fix your issue?
No I don't think I was able to fix it.
@archit-bedrock was there a workaround for you or did you have to use something else?
in case someone circles back: using gazelle 0.33.0 fixed this for me
the newer versions require golang.org/x/tools
> 0.10.0 which for some reason breaks update-repos
What version of rules_go are you using?
0.34.0
What version of gazelle are you using?
0.26.0
What version of Bazel are you using?
5.2.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
OS Version: macOS System Version: 12.3.1 Build Version: 21E258 Architecture: ARM (M1)
What did you do?
bazel run gazelle
andbazel run update-repos
BUILD file not found in directory '' of external repository @com_github_rivo_uniseg. Add a BUILD file to a directory to mark it as a package.
This error is reproducible if you check out my open source repo, switch over to the
nickersoft/final
branch, and runbazel build go
. You'll notice that the generated Go repository it is mentioning does not contain a BUILD file, which is causing the error. The only similar issue I have found to this is this one, though the fixes over there don't seem to work for me.Additional Info
The full error is:
The referencing target:
The
com_github_rivo_uniseg
directory, that contains aWORKSPACE
but noBUILD
files:What did you expect to see?
I expected everything generated by Gazelle to work out-of-the-box, without having to create my own BUILD files.
What did you see instead?
The above error lol