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
embedsrcs
0.39.1
0.50.1
7.4.0
yes
linux amd64
MODULE.bazel:
... http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") http_file( name = "jfrog-cli", sha256 = "b3c92f70b75e7b05948ef70f015511928b986bd04ed60d90bb2fedcc62f1ea02", url = "https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.66.0/jfrog-cli-linux-amd64/jf", )
BUILD.bazel:
load("@bazel_skylib//rules:copy_file.bzl", "copy_file") load("@rules_go//go:def.bzl", "go_binary", "go_library") copy_file( name = "jf", src = "@jfrog-cli//file:file", out = "jf", ) go_library( name = "download_test_lib", srcs = ["main.go"], embedsrcs = [ ":jf", #keep ], importpath = "local.test/download_test", visibility = ["//visibility:private"], deps = ["@com_github_rs_zerolog//log"], ) go_binary( name = "download_test", embed = [":download_test_lib"], visibility = ["//visibility:public"], )
main.go:
package main import ( _ "embed" ) //go:embed jf var test_data []byte func main() { fmt.Printf("len: %d\n", len(test_data)) }
running bazel run //:gazelle will not modify the embedsrcs.
bazel run //:gazelle
running bazel run //:gazelle will modify the embedsrcs which breaks the build.
go_library( name = "download_test_lib", srcs = ["main.go"], embedsrcs = [ ":jf", #keep "jf", ], importpath = "local.test/download_test", visibility = ["//visibility:private"], deps = ["@com_github_rs_zerolog//log"], )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of gazelle are you using?
0.39.1
What version of rules_go are you using?
0.50.1
What version of Bazel are you using?
7.4.0
Does this issue reproduce with the latest releases of all the above?
yes
What operating system and processor architecture are you using?
linux amd64
What did you do?
MODULE.bazel:
BUILD.bazel:
main.go:
What did you expect to see?
running
bazel run //:gazelle
will not modify theembedsrcs
.What did you see instead?
running
bazel run //:gazelle
will modify theembedsrcs
which breaks the build.The text was updated successfully, but these errors were encountered: