-
Notifications
You must be signed in to change notification settings - Fork 248
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
invalid registered toolchain '@rules_foreign_cc//toolchains:preinstalled_nmake_toolchain': No repository visible as '@rules_foreign_cc' from main repository #1239
invalid registered toolchain '@rules_foreign_cc//toolchains:preinstalled_nmake_toolchain': No repository visible as '@rules_foreign_cc' from main repository #1239
Comments
/cc @jsharpe |
I will also try to debug this issue deeper. But I need time to prepare the Windows development environment first. |
@dmitry-j-mikhin Can you try to verify if #1241 fix the issue? |
OK, looks like we need to fix the type of https://github.com/bazelbuild/rules_foreign_cc/blob/fb209674f326b7020f64d5d022cbe7fa16f3209c/foreign_cc/private/transitions.bzl#L28, make it accept label_list instead of string_list. @dmitry-j-mikhin Do you mind digging into it? It's a bit more involved than I thought. |
Yep, I'm digging) |
+ bazel build -c dbg //:hello_world_bin
ERROR: C:/msys64/home/mikhin/_bazel_mikhin/e6sjlh7b/external/rules_foreign_cc~/toolchains/private/BUILD.bazel:158:15: @@rules_foreign_cc~//
toolchains/private:pkgconfig_tool_msvc_build: expected value of type 'string' for element 0 of attribute 'extra_toolchains' in 'extra_toolc
hains_transitioned_foreign_cc_target' rule, but got Label("@@rules_foreign_cc~//toolchains:preinstalled_nmake_toolchain") (Label)
ERROR: C:/msys64/home/mikhin/_bazel_mikhin/e6sjlh7b/external/rules_foreign_cc~/toolchains/private/BUILD.bazel:158:15: @@rules_foreign_cc~//
toolchains/private:pkgconfig_tool_msvc_build: missing value for mandatory attribute 'extra_toolchains' in 'extra_toolchains_transitioned_fo
reign_cc_target' rule
ERROR: C:/msys64/home/mikhin/_bazel_mikhin/e6sjlh7b/external/rules_foreign_cc~/toolchains/private/BUILD.bazel:164:22: Cannot compute config
conditions
ERROR: C:/msys64/home/mikhin/_bazel_mikhin/e6sjlh7b/external/libxml2~/BUILD.bazel:21:6: Target '@@libxml2~//:libxml2' depends on toolchain
'@@rules_foreign_cc~//toolchains/private:built_pkgconfig', which cannot be found: Target '@@rules_foreign_cc~//toolchains/private:built_pkg
config' contains an error and its package is in error'
ERROR: Analysis of target '//:hello_world_bin' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.449s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
Fetching repository @@rules_perl~~perl_repositories~perl_windows_x86_64; Downloading perl
Fetching repository @@rules_python~~python~python_3_11_x86_64-pc-windows-msvc; starting
Fetching repository @@rules_foreign_cc~~tools~cmake-3.23.2-windows-x86_64; starting
|
full_label(name + "_fg") may produce different result then (name + "_fg") (name + "_fg") is used in srcs attr, so we make cmd attr to use the same value.
on Windows rules_cc are called
dirty hack
dirty hack2
dirty hack3
This fix error message like this in case of bzlmod usage: invalid registered toolchain '@rules_foreign_cc//toolchains:preinstalled_nmake_toolchain': No repository visible as '@rules_foreign_cc' from main repository
This fix following error: The repository '@@[unknown repo 'rules_cc' requested from @@rules_foreign_cc~~tools~glib_dev]' could not be resolved: No repository visible as '@rules_cc' from repository '@@rules_foreign_cc~~tools~glib_dev'. and referenced by '@@rules_foreign_cc~//toolchains/private:pkgconfig_tool_msvc_build_'
@jsharpe I created a clean PR that fixes this bug - #1264 |
This fix following error: The repository '@@[unknown repo 'rules_cc' requested from @@rules_foreign_cc~~tools~glib_dev]' could not be resolved: No repository visible as '@rules_cc' from repository '@@rules_foreign_cc~~tools~glib_dev'. and referenced by '@@rules_foreign_cc~//toolchains/private:pkgconfig_tool_msvc_build_'
This fix error message like this in case of bzlmod usage: invalid registered toolchain '@rules_foreign_cc//toolchains:preinstalled_nmake_toolchain': No repository visible as '@rules_foreign_cc' from main repository
This fix error message like this in case of bzlmod usage: invalid registered toolchain '@rules_foreign_cc//toolchains:preinstalled_nmake_toolchain': No repository visible as '@rules_foreign_cc' from main repository
I have simple Bazel module
MODULE.bazel:
BUILD.bazel:
This module compiles successfully on Linux and macOS. But on Windows the following error occurs:
Full logs are available here - https://buildkite.com/bazel/bcr-presubmit/builds/6949#0191048a-50a6-4826-8e5c-68d888cca6f1
Related discussion in BCR - bazelbuild/bazel-central-registry#2512
The text was updated successfully, but these errors were encountered: