Closed xgqt closed 4 months ago
You don't need to call rules_foreign_cc_dependencies if you're using bzlmod... Just remove that from your WORKSPACE.bazel file.
You don't need to call rules_foreign_cc_dependencies if you're using bzlmod... Just remove that from your WORKSPACE.bazel file.
@jsharpe ok, but how would I then register my own toolchains?
You don't need to call rules_foreign_cc_dependencies if you're using bzlmod... Just remove that from your WORKSPACE.bazel file.
@jsharpe ok, but how would I then register my own toolchains?
Ok, so when I use MODULE.bazel I already have all the toolchains registered.
"@rules_foreign_cc//toolchains:all",
But when I want to sue the preinstalled TC like so:
...
toolchains = [
"@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_automake_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_m4_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_make_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain",
],
...
then Im getting:
'@@rules_foreign_cc~//toolchains:preinstalled_autoconf_toolchain' does not have mandatory providers: 'TemplateVariableInfo'
Ok, I solved the prebuilt usage issue:
configure_make_variant(
name = "vendor_curl_foreign",
lib_source = "@vendor_curl//:all",
out_binaries = [
"curl",
],
toolchain = "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain",
...
)
Hi!
I wanted to build a custom curl binary using
rules_foreign_cc
. The default setup fails for me on the toolchain registration step but in a very weird way - Bazel claims that@@rules_foreign_cc//toolchains
does not exist.If I do not register the TCs it passes but all required TCs are built by Bazel.
Issue
The default
rules_foreign_cc_dependencies()
call fails for me.As a workaround I had to do:
Error
The whole error log is (when called
bazel build "//vendor-curl"
):Setup
I have composed a minimal setup to reproduce this:
bazel/starlark/vendors.bzl
:vendor-curl/BUILD.bazel
:top-level
BUILD.bazel
:empty
top-level
MODULE.bazel
:top-level
WORKSPACE.bazel
:Environment
This machine runs stable Gentoo Linux but I doubt that this has anything to do with the issue.
Bazel version: