rules_haskell
rules_haskell copied to clipboard
Unable to build image for haskell binary with the instructions in rules_haskell docs.
Describe the bug
I am following the instructions to use rules_docker together with nixpkgs from here in the docs.
When I run bazel build //:example-image if fails with
[pranaysashank@nixos:~/src/nd]$ bazel build //:example-image
ERROR: While resolving toolchains for target //:example: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
ERROR: Analysis of target '//:example-image' failed; build aborted: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
INFO: Elapsed time: 0.481s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 4 targets configured)
To Reproduce
- Clone my repo https://github.com/pranaysashank/nd
- Run
bazel run //:example, should print"Hello from rules_haskell!" - Run
bazel build //:example-image, this should fail with the above mentioned error
Expected behavior example-image should be built.
Environment
- OS name + version: nixos, 21.11
- Bazel version: 4.2.1
- Version of the rules:
- rules_haskell: 0.14
- rules_docker: 0.23.0
When I downgrade to rules_docker-0.22.0, it's working. So the issue is likely caused by the breaking change mentioned here https://github.com/bazelbuild/rules_docker/releases/tag/v0.23.0 and this issue should probably be moved to rules_nixpkgs
The example was updated to use rules_oci instead of rules_docker, see #2137.
Closing, please open a new issue if you still encounter problems using rules_oci.