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

fix: restore default outputs of jsonnet_to_json #217

Merged
merged 1 commit into from
Oct 7, 2024
Merged

fix: restore default outputs of jsonnet_to_json #217

merged 1 commit into from
Oct 7, 2024

Conversation

thomasquinn
Copy link
Contributor

This PR restores the default outputs of the jsonnet_to_json rule.

PR #192 seems to have broken the default outputs of this rule, which previously relied on only setting ctx.outputs and not returning a DefaultInfo provider (unless out_dir is set).

This is useful when you have some target that only has one output e.g.:

jsonnet_to_json(
    name = "foo",
    src = "foo.jsonnet",
    outs = ["foo.json"],
)

Before #192 you could depend on this as :foo, but after #192 you need to depend on :foo.json to access the singular output.

@EdSchouten
Copy link
Collaborator

Thanks! Could you please add a test case for this under examples/?

@thomasquinn
Copy link
Contributor Author

Thanks! Could you please add a test case for this under examples/?

Let me know if there's a better way to test this than what I've come up with. This test does pass after the change to jsonnet/jsonnet.bzl and fail without it, at least.

@EdSchouten EdSchouten merged commit 035eb9c into bazel-contrib:master Oct 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants