-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Target @@io_bazel_rules_docker//platforms:image_transition was referenced as a platform, but does not provide PlatformInfo #21191
Comments
Help to create the local python image so that I can push it in the docker hub |
_IMAGE_TRANSITION_CONSTRAINTS = [ [[ platform( I think this issue is with the [rules_docker/platforms/BUILD] file kindly resolve this |
Not able to create the local image through bazel rules |
Does the flag rules_docker fails to build with HEAD bazel · Issue #2275 · bazelbuild/rules_docker |
No it haven't worked for me |
@jayeshkotia @stagnation fyi..https://github.com/orgs/kubev2v/discussions/1082
|
@jayeshkotia any workaround you got ? I am having similar issue: @stagnation fyi.. https://github.com/orgs/kubev2v/discussions/1082
|
Description of the bug:
ERROR: C:/users/jkotia/_bazel_jkotia/vil3omde/external/io_bazel_rules_docker/platforms/BUILD:78:9: in constraint_values attribute of platform rule @@io_bazel_rules_docker//platforms:image_transition: '@@io_bazel_rules_docker//platforms:image_transition_cpu' does not have mandatory providers: 'ConstraintValueInfo'
ERROR: C:/users/jkotia/_bazel_jkotia/vil3omde/external/io_bazel_rules_docker/platforms/BUILD:78:9: in constraint_values attribute of platform rule @@io_bazel_rules_docker//platforms:image_transition:
'@@io_bazel_rules_docker//platforms:image_transition_os' does not have mandatory providers: 'ConstraintValueInfo'
ERROR: C:/users/jkotia/_bazel_jkotia/vil3omde/external/io_bazel_rules_docker/platforms/BUILD:78:9: Analysis of target '@@io_bazel_rules_docker//platforms:image_transition' failed
ERROR: C:/users/jkotia/downloads/working_project/bazel_projects_pocs/multi-language-bazel-monorepo/projects/python_web/BUILD.bazel:20:9: Target @@io_bazel_rules_docker//platforms:image_transition was referenced as a platform, but does not provide PlatformInfo
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
WORKSPACE FILE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "b593d13bb43c94ce94b483c2858e53a9b811f6f10e1e0eedc61073bd90e58d9c",
strip_prefix = "rules_python-0.12.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.12.0.tar.gz",
)
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
name = "pip_deps",
requirements_lock = "//third_party:requirements_lock.txt",
)
load("@pip_deps//:requirements.bzl", "install_deps")
install_deps()
http_archive(
name = "io_bazel_rules_docker",
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
)
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",container_repositories = "repositories")
container_repositories()
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps()
load(
"@io_bazel_rules_docker//python3:image.bzl",
_py_image_repos = "repositories",
)
_py_image_repos()
BUILD.bazel file :
load("@pip_deps//:requirements.bzl", "requirement")
load("@io_bazel_rules_docker//python3:image.bzl", py_image="py3_image")
py_library(
name = "python_web_lib",
srcs = ["python_web.py"],
deps = [
requirement("Flask"),
"//projects/python_calculator:calculator",
],
)
py_binary(
name = "python_web",
srcs = ["python_web.py"],
main = "python_web.py",
deps = [":python_web_lib"],
)
py_image(
name = "python_web_image",
srcs = ["python_web.py"],
main = "python_web.py",
deps = [":python_web_lib"],
)
Which operating system are you running Bazel on?
Windows
What is the output of
bazel info release
?Build label: 7.0.0 Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer Build time: Mon Dec 11 16:54:12 2023 (1702313652) Build timestamp: 1702313652 Build timestamp as int: 1702313652
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.Build label: 7.0.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Dec 11 16:54:12 2023 (1702313652)
Build timestamp: 1702313652
Build timestamp as int: 1702313652
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
When Adding the
py_image(
name = "python_web_image",
srcs = ["python_web.py"],
main = "python_web.py",
deps = [":python_web_lib"],
)
in the BUILD.bazel file I am getting this error
Image: transition,
Platform Info
'ConstraintValueInfo'
The text was updated successfully, but these errors were encountered: