Skip to content

Conversation

KushalP
Copy link
Contributor

@KushalP KushalP commented Jul 12, 2024

This will allow using the outs produced by pkl_eval as inputs to other rules.

This will allow using the `outs` produced by `pkl_eval` as inputs to
other rules.
@@ -1 +1 @@
tests/pkl_eval/pkl_eval_with_out/helloworld.pcf
tests/pkl_eval/helloworld.pcf
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if removing the intermediary directories is an issue here. I would appreciate feedback on this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's backward incompatible but I support this change:

  • when outs is specified, then I strongly prefer not namespacing with a directory (otherwise it's confusing to the user: they specify a path that looks relative to the Bazel package dir and would end up with a different path)
  • when outs is unspecified withmultiple_outputs = False, there's already namespacing going on via the file name
  • when outs is unspecified with multiple_outputs = True, namespacing is still happening via a directory.

For context, initially, the rationale for a namespacing directory was to keep every case above consistent (they would all be under a namespaced directory) but taking a step back, the suggested approach has more benefits.

KushalP added 3 commits July 15, 2024 14:40
Otherwise we'll find that the common prefix of `[somedir/two, somedir/three]` is `somedir/t`.
Writing this test case produced caused the previous implementation to
fail. After spending some time debugging it, I realised that the
`output_location` for multiple defined `outs` can be simplified to
just use the `genfiles_dir` concatenated with the `label.package`.
@KushalP KushalP requested a review from sitaktif July 15, 2024 15:16
Copy link
Collaborator

@sitaktif sitaktif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@KushalP KushalP merged commit 5ad3360 into apple:main Jul 15, 2024
@KushalP KushalP deleted the outs-is-attr-output_list branch July 15, 2024 15:18
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