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

no such package '@@com_github_pingcap_tidb//pkg/parser/mysql': BUILD file not found in directory 'pkg/parser/mysql' #1939

Open
D3Hunter opened this issue Sep 29, 2024 · 0 comments

Comments

@D3Hunter
Copy link

D3Hunter commented Sep 29, 2024

What version of gazelle are you using?

v0.38.0

What version of rules_go are you using?

v0.50.1

What version of Bazel are you using?

bazel 7.3.1

Does this issue reproduce with the latest releases of all the above?

not tested

What operating system and processor architecture are you using?

macos

What did you do?

I am following this https://www.tweag.io/blog/2021-09-08-rules_go-gazelle/ to setup a simple bazel project.

I have a simple repo which has only one file and depends on tidb, which is also build with bazel

The file is like this

package main

import (
	"github.com/pingcap/tidb/pkg/kv"
	"github.com/pingcap/tidb/pkg/tablecodec"
	"github.com/pingcap/tidb/pkg/util/codec"
)

func main() {
	_ = codec.EncodeBytes(nil, tablecodec.EncodeRowKeyWithHandle(1, kv.IntHandle(0)))[:10]
}

When I try to build it, it report that BUILD file not found in directory 'pkg/parser/mysql' , but pkg/parser/mysql is actually another repo inside TiDB and TiDB replace it with github.com/pingcap/tidb/pkg/parser => ./pkg/parser. I guess the reason might be with the replace inside TiDB, but I cannot search any useful thing using google.

I have tried building other files which depends on github.com/docker/go-units, and it works.

bazel build //cmd/kv-regions

INFO: Invocation ID: 1d085997-19be-4f91-ac96-3d9650ed421b
ERROR: no such package '@@com_github_pingcap_tidb//pkg/parser/mysql': BUILD file not found in directory 'pkg/parser/mysql' of external repository @@com_github_pingcap_tidb. Add a BUILD file to a directory to mark it as a package.
ERROR: /private/var/tmp/_bazel_xxx/e4358c848742f2ce260860f15bf899aa/external/com_github_pingcap_tidb/pkg/util/codec/BUILD.bazel:3:11: no such package '@@com_github_pingcap_tidb//pkg/parser/mysql': BUILD file not found in directory 'pkg/parser/mysql' of external repository @@com_github_pingcap_tidb. Add a BUILD file to a directory to mark it as a package. and referenced by '@@com_github_pingcap_tidb//pkg/util/codec:codec'
ERROR: Analysis of target '//cmd/kv-regions:kv-regions' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.181s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

What did you expect to see?

success

What did you see instead?

fail

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

No branches or pull requests

1 participant