I'm writing Bazel rules for Apple's new config language pkl. My repo for the new rules is here.
I am attempting to register toolchains and use those for the 'pkl_eval' rule that would essentially call 'pkl eval ...' on some set of .pkl files.
I have a toolchain type setup here. It is depended on by the pkl_eval rule here. My repository rules/macros for creating and registering the toolchain repos in the module are here.
When I attempt to build the target declared here, I get this output:
[clatham@clatham-dev rules_pkl]$ bazel build //... --toolchain_resolution_debug='//pkl:toolchain_type'
ERROR: /home/clatham/code/rules_pkl/test/BUILD.bazel:3:9: While resolving toolchains for target //test:test_eval (71dc0e2): No matching toolchains found for types //pkl:toolchain_type.
To debug, rerun with --toolchain_resolution_debug='//pkl:toolchain_type'
If platforms or toolchains are a new concept for you, we'd encourage reading https://bazel.build/concepts/platforms-intro.
Target //pkl:toolchain_type up-to-date (nothing to build)
ERROR: Analysis of target '//test:test_eval' failed; build aborted
INFO: Elapsed time: 0.055s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
[clatham@clatham-dev rules_pkl]$
I have a feeling this is a silly mistake somewhere, but I just can't spot it. My host constraints should satisfy at least one of the platforms I have. Here is the file contents:
[clatham@clatham-dev local_config_platform]$ cat constraints.bzl
# DO NOT EDIT: automatically generated constraints list for local_config_platform
# Auto-detected host platform constraints.
HOST_CONSTRAINTS = [
'@platforms//cpu:x86_64',
'@platforms//os:linux',
]