Cannot run the soy compiler against templates

206 views
Skip to first unread message

Peter StJ

unread,
Jul 6, 2017, 10:35:05 AM7/6/17
to Closure Templates Discuss
I have not been using closure tools for awhile and today started an improvement on an old project, first step - rebuild everything to make sure things are in order (new compiler, new template compiler etc).

However I cannot figure out what is wrong with the template compiler: it always says that it cannot find the file:

java -jar ../../templates/new/SoyToJsSrcCompiler.jar --locales en --outputPathFormat '{INPUT_FILE_NAME_NO_EXT}_generated_{LOCALE}.js'   --srcs templates/app.soy
Exception in thread "main" java.io.FileNotFoundException:  (No such file or directory)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at com.google.common.io.Files$FileByteSource.openStream(Files.java:124)
        at com.google.common.io.Files$FileByteSource.openStream(Files.java:114)
        at com.google.common.io.ByteSource$AsCharSource.openStream(ByteSource.java:287)
        at com.google.common.io.CharSource.read(CharSource.java:136)
        at com.google.common.io.Files.toString(Files.java:369)
        at com.google.template.soy.msgs.SoyMsgBundleHandler.createFromFile(SoyMsgBundleHandler.java:131)
        at com.google.template.soy.SoyFileSet.compileToJsSrcFiles(SoyFileSet.java:940)
        at com.google.template.soy.SoyToJsSrcCompiler.execMain(SoyToJsSrcCompiler.java:307)
        at com.google.template.soy.SoyToJsSrcCompiler.main(SoyToJsSrcCompiler.java:243)

However the file exists and has all the needed permissions (it 666 actually). Tried with and without the `--srcs` flag - the same result always. 

ls -al templates/
drwxrwxr-x  2 peterj peterj 4096 Feb  4 00:44 .
drwxrwxr-x 16 peterj peterj 4096 Jul  6 14:07 ..
-rw-rw-rw-  1 peterj peterj 7973 Jun 22 13:15 app.soy
-rw-rw-r--  1 peterj peterj  147 Feb  3 01:11 README.txt

Java is 

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

The compiler is the one downloaded from the link in github repo (prebuilt).

The thing is that it used to work : the original command used was 
java -jar ../../templates/SoyToJsSrcCompiler.jar --locales en --messageFilePathFormat "" --shouldProvideRequireSoyNamespaces --shouldGenerateJsdoc --outputPathFormat 'tpl/{INPUT_FILE_NAME_NO_EXT}.soy.js' templates/*.soy ../pstj/templates/*.soy ../smjs/templates/*.soy
It says: INTERNAL SOY ERROR.
Please open an issue at https://github.com/google/closure-templates/issues with this stack trace and repro steps

I would open an issue but it happens with ALL my soy files, some of them no older than a year and all written in the new syntax..

I hope someone can point me to what might be happening. 

Thanks

Nick Santos

unread,
Jul 6, 2017, 10:41:30 AM7/6/17
to closure-temp...@googlegroups.com
I don't understand your command-line invocation. You're saying that you want per-locale bundles (the {LOCALE} part) but you're not providing localized messages anywhere. Did you leave something out?

--

---
You received this message because you are subscribed to the Google Groups "Closure Templates Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-templates-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter StJ

unread,
Jul 6, 2017, 11:34:31 AM7/6/17
to Closure Templates Discuss
Ooohhh... I got it now, it cannot find the XLF file, not the soy file. Feel so stupid now, thank you Nick. Sorry for the fuss.
Reply all
Reply to author
Forward
0 new messages