I'm trying to get some broken, platform dependent C# code to compile using bazel and I'm having quite a lot of problems defining a platform.
I've defined two platforms:
platform ( name = "darwin", constraint_values = [ "@bazel_tools//platform:osx", ], ) platform ( name = "windows", constraint_values = [ "@bazel_tools//platform:windows", ], ) Which I then use in a select in a genrule somewhere else in the BUILD file:
cmd = select ({ ":darwin" : "a bash command", ":windows" : "a long and complex windows command because windows is stupid and makes everything much much more complex than it has to be" }) When I try to build something, however, I get an error along the lines of
no such package '@bazel_tools//platform': BUILD file not found on package path and referenced by //<package>:darwin I take this to mean that @bazel_tools isn't available.
The documentation claims that @bazel_tools is builtin, so this is quite a surprise to me -- to me "builtin", means "you don't have to do anything for this to be available to you". I haven't been able to find anything that will tell how to fix the problem either.