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

[FR]: Should output_dir use output as the dir name rather than `name? #170

Open
surma opened this issue Dec 1, 2023 · 1 comment
Open
Labels
enhancement New feature or request untriaged Requires traige

Comments

@surma
Copy link

surma commented Dec 1, 2023

What is the current behavior?

It seems that if output_dir is true, a directory artifact is declared using the rule name as the folder name.

if ctx.attr.output_dir:
js_out = ctx.actions.declare_directory("%s" % ctx.attr.name)
output_sources.append(js_out)

Describe the feature

I was surprised that when I defined output = "dist" with output_dir = True, that the rule would fail with “The following files have no generating action: .../dist". After digging into the code, it seems that name is used for the folder name. Is that intentional?

@surma surma added the enhancement New feature or request label Dec 1, 2023
@github-actions github-actions bot added the untriaged Requires traige label Dec 1, 2023
@jbedard
Copy link
Member

jbedard commented Feb 27, 2024

I believe this is because the output attribute is a predeclared output file and can not be a directory.

Would an error message have helped if both output and output_dir are set? I think that would be harmless and maybe improve the DX. Want to open a PR adding that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged Requires traige
Projects
Status: No status
Development

No branches or pull requests

2 participants