Skip to content

Debugging functionality #615

Description

@lf-

Hi!

I have some hpack includes which aren't working due to, erm, probably, what we refer to as "yaml footguns" at work:

# /!\ /!\ /!\ /!\ /!\ /!\ /!\
# /!\ YAML FOOTGUN ALERT  /!\
# /!\ /!\ /!\ /!\ /!\ /!\ /!\
#
# Be warned, future traveler: YAML documents can only have one value for each
# key. So if we define a key in this document:
#
#     when:
#     - condition: ...
#       ghc-options: ...
#
# And then in `../package.yaml` we do
#
#     <<: !include hpack-common/defaults.yaml
#     when:
#     - condition: ...
#       ghc-options: ...
#
# Then the flags defined here will be completely and unceremoniously erased!
# Therefore, we define _anchors_ for these values which we can reuse in
# `../package.yaml` (where we want to add additional mwb-specific flags)
# _and_ a default value for `when:` that will be used in (e.g.)
# `../local-packages`.
#
# See: https://stackoverflow.com/a/46644785

The include system adds enough complexity that I would really really like to be able to dump out the resulting YAML that is being evaluated, so that I can figure out where each value like when is coming from. As far as I can tell from the highly limited output of --help, there is no way to dump this:

Usage: hpack [ --silent ] [ --canonical ] [ --force | -f ] [ --[no-]hash ] [ PATH ] [ - ]
       hpack --version
       hpack --numeric-version
       hpack --help

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions