lucidsoftware / rules_twirl

Bazel rules for compiling Twirl templates
Apache License 2.0
3 stars 9 forks source link

Invalid call to scopt from CLI version for Play 2.6, Scala 2.12 #22

Closed vuspenskiy closed 5 years ago

vuspenskiy commented 5 years ago

Using io_bazel_rules_twirl//default-compiler-clis:scala_2_12_play_2_6 I am getting the following error,

vlad$ bazel build //bla:bla-twirl-templates
INFO: Analyzed target //bla:bla-twirl-templates (1 packages loaded, 62 targets configured).
INFO: Found 1 target...
ERROR: /Users/vlad/myproject/bla/BUILD:10:1: Compiling twirl template failed: Worker process did not return a WorkResponse:

---8<---8<--- Start of log, file at /private/var/tmp/_bazel_vlad/b89728c931ebd040d5fe09ea273557b0/bazel-workers/worker-55-TwirlCompile.log ---8<---8<---
Error: Unknown option --persistent_worker
Error: Missing argument <output>
Error: Missing argument <sourceDirectory>
Error: Missing argument <source>
Twirl Template Compiler 0.1
Usage: scopt [options] <output> <sourceDirectory> <source>

  <output>                 output file
  <sourceDirectory>        root source directory
  <source>                 source file
  -i, --additionalImport <import>
                           additional imports to add to the compiled templates
  -t, --templateFormat:format=formatterType
                           additional template formats to use when compiling templates
---8<---8<--- End of log ---8<---8<---
Target //bla:bla-twirl-templates failed to build
INFO: Elapsed time: 1.184s, Critical Path: 0.85s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

Not sure what I might have done wrong, here is my usage example:

load("@io_bazel_rules_twirl//twirl:twirl.bzl", "twirl_templates")
twirl_templates(
  name = "bla-twirl-templates",
  source_directory = "app",
  include_play_imports = True,
  srcs = glob(["app/**/*.scala.html"]), # + glob(["app/**/*.scala.xml"]) + glob(["app/**/*.scala.js"]),
  additional_imports = ["foo"],
)

rules_twirl_version = "adf1b620b9e5babdde6b605c79126820354a218b"

SrodriguezO commented 5 years ago

Ugh it seems I never merged the revert... https://github.com/lucidsoftware/rules_twirl/pull/21 The new twirl versions broke things despite passing the tests. I have it in my backlog to go back and investigate.

I'm merging the revert now; simply use the latest version of rules_twirl and you should be good

vuspenskiy commented 5 years ago

@SrodriguezO so cool, you're so fast, man!