Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pranaysashank opened this issue Mar 27, 2022 · 2 comments

Comments

@pranaysashank
Copy link
Contributor

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
Copy link
Contributor Author

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

@avdv
Copy link
Member

avdv commented Mar 21, 2024

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 avdv closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants