-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
ctx.actions.declare_directory throws error #4668
Comments
Recent changes by @ola-rozenfeld have resulted in this changing (but still failing). New log is:
New rev head is 0af09b7 |
After debugging it a bit: the problem is not with Changing the output to
I don't know if this is a bug or simply not an error. AFAIK, outputs can't be directories so bazel assumptions are true. Please correct me if I am wrong. |
This is a bug, and the intention of |
@werkt Thanks for your response. However we still have a problem: what should be returned from That's a problem because that the outputs are prebuilt as files before the rule's I could not find any good solution for these problems; Please let me know what you think. |
Re: "The outputs are prebuilt as files": yes, but they're built as The Note that the precondition failure occurs having not specified |
@werkt , Thanks for your detailed answer. I was not explaining the problem enough in my previous comment; I will try to do better this time: We currently have According to my debugging, the error has been caused by a path to directory that has been represented as a regular I have found two ways of implementing output directories properly:
I hope you understand me, Please write if you have a better design / you don't agree with some of the assumptions I made. |
Hi All, In short, how we can customize: 1. "bazel-bin" location with "bazel-bin/opt" and 2. "bazel-bin/subpackage-A/" with "bazel-bin/opt/subpackage-A/bin/" by any technical means ? Similar to "output_to_bindir=1" concept, how any Bazel package at root level, allow any generic ctx.actions/genrule/plugin can be extended/utilized, to define per sub-package specific custom target output path "bazel-bin/opt/subpackage-A/bin/" location ? While trying to adapt the above mentioned solution, ctx.actions.declare_directory("custom_unix_path") as inline, also facing similar issues as inline: We are not very sure whether the problem is in our api implementation usage or Bazel specification ( for example: declare_directory, genrule ) limitation ?
@mhlopko, Bazel users, any idea/hint would be highly appreciated. |
The discussion has been wandering around for a bit, it seems. We have been discussing adding the ability of declaring direct outputs. We have decided against it so far, since we would like to generally get rid of declared outputs in favor of output groups. Re #4668 (comment): we do not allow further customization within |
Description of the problem / feature request:
ctx.actions.declare_directory
throws runtime exceptions after action execution (run_shell
used to demonstrate)Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
ubuntu 14.04
What's the output of
bazel info release
?release 0.10.1
Any other information, logs, or outputs that you want to share?
My output from this build is as follows:
The text was updated successfully, but these errors were encountered: