rules_haskell icon indicating copy to clipboard operation
rules_haskell copied to clipboard

Unable to build image for haskell binary with the instructions in rules_haskell docs.

Open pranaysashank opened this issue 3 years ago • 1 comments

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

  1. Clone my repo https://github.com/pranaysashank/nd
  2. Run bazel run //:example, should print "Hello from rules_haskell!"
  3. 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

pranaysashank avatar Mar 27 '22 08:03 pranaysashank

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

pranaysashank avatar Mar 27 '22 10:03 pranaysashank

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.

avdv avatar Mar 21 '24 08:03 avdv