I am using bazel to build my golang project. I want to use fips compliant crypto libraries.
I have made these changes in my WORKSPACE.bazel -
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies", "go_download_sdk")
go_rules_dependencies()
go_register_toolchains(version = "1.14.8")
go_download_sdk(
name = "go_sdk",
sdks = {
"linux_amd64": ("go1.14.15b4.linux-amd64.tar.gz", "82ba7297d26afcdade439de5621bdcb16e5261877f204aa60d03b5e07223a5c8"),
},
urls = ["https://go-boringcrypto.storage.googleapis.com/{}"],
)
This works fine and build is success on Ubuntu. But if I run it on MacOS, I get unsupported platform error.
Above boringcrypto sdk is not available for macos. So I want to remove this dependency in case platform is darwinamd64. How I can selectively add this dependency on the basis of OS? I want to add this sdk if OS is linux and not if OS is MacOS.