I wrote the name of a package in the packages list of stackage_server wrong. The error message was really unhelpful. It consists of several copies (the copies may be subtly different, I don't know) of
ERROR: Analysis of target '//backend/api-types:api-types' failed; build aborted: no such package '@stackage//': Traceback (most recent call last):
File "/home/aspiwack/.cache/bazel/_bazel_aspiwack/bd7cdf0b0195cd3d7f8d5aa71bc1df4e/external/io_tweag_rules_haskell/haskell/cabal.bzl", line 556
_compute_dependency_graph(repository_ctx, versioned_packages, ...)
File "/home/aspiwack/.cache/bazel/_bazel_aspiwack/bd7cdf0b0195cd3d7f8d5aa71bc1df4e/external/io_tweag_rules_haskell/haskell/cabal.bzl", line 491, in _compute_dependency_graph
_execute_or_fail_loudly(repository_ctx, ((stack + ["unpack...))
File "/home/aspiwack/.cache/bazel/_bazel_aspiwack/bd7cdf0b0195cd3d7f8d5aa71bc1df4e/external/io_tweag_rules_haskell/haskell/cabal.bzl", line 20, in _execute_or_fail_loudly
fail("\n".join([("Command failed: " +...]))
File "/home/aspiwack/.cache/bazel/_bazel_aspiwack/bd7cdf0b0195cd3d7f8d5aa71bc1df4e/external/io_tweag_rules_haskell/haskell/cabal.bzl", line 20, in fail
"\n".join([("Command failed: " + " ".join(...])
File "/home/aspiwack/.cache/bazel/_bazel_aspiwack/bd7cdf0b0195cd3d7f8d5aa71bc1df4e/external/io_tweag_rules_haskell/haskell/cabal.bzl", line 20, in "\n".join
" ".join(arguments)
sequence element must be a string (got 'path'). See https://github.com/bazelbuild/bazel/issues/7802 for information about --incompatible_string_join_requires_strings.
Notice how:
The error doesn't mention the package which doesn't exist
The error is about a type error (I am, incidentally, curious about how it is, so don't hesitate to share the debugging story on this one)
The backtrace doesn't mention anything I wrote, hence is useless to me.
Instead we should find a way to produce an error aimed at the user, not the developer, which:
Mentions the name of the missing package
Doesn't speak about internal modules or types.
To Reproduce
Make a workspace with a non-existing package in the package set. For instance:
I wrote the name of a package in the
packages
list ofstackage_server
wrong. The error message was really unhelpful. It consists of several copies (the copies may be subtly different, I don't know) ofNotice how:
Instead we should find a way to produce an error aimed at the user, not the developer, which:
To Reproduce
Make a workspace with a non-existing package in the package set. For instance:
Environment