Skip to content

Commit

Permalink
Fix error in worker declaration example sniplet
Browse files Browse the repository at this point in the history
With line:
```
  executable=ctx.attr.worker,
```
I got error like:
```
Error in run: in call to run(), parameter 'executable' got value of type 'Target', want 'File, string, or FilesToRunProvider'
```
  • Loading branch information
bozaro committed Sep 21, 2021
1 parent 8965d25 commit 255d350
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions site/docs/creating-workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ for singleplex workers.

```json
{
args : [--some_argument],
inputs : [
{ /path/to/my/file/1 : fdk3e2ml23d},
{ /path/to/my/file/2 : 1fwqd4qdd }
],
request_id : 12
"args" : ["--some_argument"],
"inputs" : [
{ "/path/to/my/file/1" : "fdk3e2ml23d"},
{ "/path/to/my/file/2" : "1fwqd4qdd" }
],
"request_id" : 12
}
```

Expand All @@ -70,10 +70,9 @@ to redirect the `stdout` of any tools it uses to `stderr`.

```json
{
“exit_code” : 1,
“output” : “Action failed with the following message:\nCould not find input
file “/path/to/my/file/1”,
“request_id” : 12
"exit_code" : 1,
"output" : "Action failed with the following message:\nCould not find input file \"/path/to/my/file/1\"",
"request_id" : 12
}
```

Expand All @@ -84,7 +83,7 @@ id, so the request id must be specified if it is nonzero. This is a valid

```json
{
request_id : 12,
"request_id" : 12,
}
```

Expand Down Expand Up @@ -215,13 +214,14 @@ startup args, the call to `ctx.actions.run` might be:
```python
ctx.actions.run(
inputs=ctx.files.srcs,
outputs=[ctx.attr.output],
executable=ctx.attr.worker,
outputs=[ctx.outputs.output],
executable=ctx.executable.worker,
mnemonic="someMnemonic",
execution_requirements={
“supports-workers” : “1”,
“requires-worker-protocol” : “json},
arguments=ctx.attr.args + [“@flagfile”]
"supports-workers" : "1",
"requires-worker-protocol" : "json",
},
arguments=ctx.attr.args + ["@flagfile"]
)
```

Expand Down

0 comments on commit 255d350

Please sign in to comment.