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

Bug: when the go code embedded a file that located in another package gazelle will ignore that file #1681

Open
ninjadq opened this issue Dec 6, 2023 · 1 comment

Comments

@ninjadq
Copy link

ninjadq commented Dec 6, 2023

What version of gazelle are you using?

0.34.0

What version of rules_go are you using?

0.41.0

What version of Bazel are you using?

v1.11.0

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

Yes

What operating system and processor architecture are you using?

Ubuntu, AMD64

What did you do?

Run gazelle for this xk6-browser project.

git clone https://github.com/grafana/xk6-browser.git
cd xk6-browser
## run command
gezelle

An Error message like pattern js/injected_script.js: matched no files occured.
But that file does exist common/js/injected_script. It embeds from this file common/execution_context.go

I think there is a bug when handling an embedded file located in a sub directory and that directory is another bazel package.

common/
common/BUILD.bazel
common/execution_context.go // embedding a js file
...
common/js/
common/js/BUILD.bazel
common/js/injected_script.js // embedded js file
...

What did you expect to see?

gazelle run without error

What did you see instead?

error msg like

/xxx//gazelle 
gazelle: /xxx/com_github_grafana_xk6_browser/common/execution_context.go:242:2: pattern js/injected_script.js: matched no files
@ninjadq ninjadq changed the title a Bug when the go code embeded a file that located in another package A Bug when the go code embeded a file that located in another package Dec 6, 2023
ninjadq pushed a commit to ninjadq/bazel-gazelle that referenced this issue Dec 6, 2023
These check will ignore a valid scenario mentioned in bazelbuild#1681
@ninjadq ninjadq changed the title A Bug when the go code embeded a file that located in another package Bug: when the go code embedded a file that located in another package gazelle will ignore that file Dec 6, 2023
ninjadq pushed a commit to ninjadq/bazel-gazelle that referenced this issue Dec 6, 2023
These check will ignore a valid scenario mentioned in bazelbuild#1681

Signed-off-by: Qian Deng <qiandeng@microsoft.com>
@ninjadq
Copy link
Author

ninjadq commented Dec 6, 2023

The code removed in this PR https://github.com/bazelbuild/bazel-gazelle/pull/1682/files

I think is the root cause. Because it cut the desired dir before check the file

ninjadq pushed a commit to ninjadq/bazel-gazelle that referenced this issue Dec 6, 2023
These check will ignore a valid scenario mentioned in bazelbuild#1681

Signed-off-by: Qian Deng <dengqian0826@gmail.com>
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

Successfully merging a pull request may close this issue.

1 participant