RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

NullPointerException on trunk when closure library is inside "paths" #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Trunk build of plovr.  Not getting the crash under the Nov 2011 release.

    Exception in thread "main" java.lang.NullPointerException
            at org.plovr.Manifest.buildDependenciesInternal(Manifest.java:295)
            at org.plovr.Manifest.buildDependencies(Manifest.java:280)
            at org.plovr.ModuleConfig.partitionInputsIntoModules(ModuleConfig.java:249)
            at org.plovr.ModuleConfig.buildModulesUsingOption1(ModuleConfig.java:191)
            at org.plovr.ModuleConfig.getModules(ModuleConfig.java:186)
            at org.plovr.Manifest.getCompilerArguments(Manifest.java:182)
            at org.plovr.CompileRequestHandler.compile(CompileRequestHandler.java:94)
            at org.plovr.cli.BuildCommand.runCommandWithOptions(BuildCommand.java:60)
            at org.plovr.cli.BuildCommand.runCommandWithOptions(BuildCommand.java:33)
            at org.plovr.cli.AbstractCommandRunner.runCommand(AbstractCommandRunner.java:41)
            at org.plovr.cli.Command.execute(Command.java:47)
            at org.plovr.cli.Main.mainWithExitCode(Main.java:56)
            at org.plovr.cli.Main.main(Main.java:30)

The problem seems to be here in ModuleConfig.java:

    for (String inputName : moduleInfo.getInputs()) {
      JsInput input = manifest.getJsInputByName(inputName);
      manifest.buildDependencies(provideToSource, deps, input);
    }

inputName here is "our_code_root/goog/deps.js", and getJsInputByName returns 
null because it thinks deps.js lives at "/closure/goog/deps.js".  It appears 
this is caused by some weirdness in the config file, which looks like:

    {
        "paths": ["our_code_root"],
        "closure-library": ["our_code_root/goog"],
        "modules": {"core": {"inputs": ["our_code_root/goog/deps.js", ...] ...} ...}
    }

I have no idea why that "goog/deps.js" is listed as an input, but it's 
confusing the heck out of plovr since the filenames coming out of 
moduleInfo.getInputs() don't get "rewritten" if they happen to be names of 
Closure Library files.  I no longer crash (but do get some Closure type errors, 
probably from using an old copy of the library) if I just remove deps.js from 
the list of inputs.

Original issue reported on code.google.com by amunroe-...@yelp.com on 14 Aug 2012 at 12:03

GoogleCodeExporter commented 8 years ago
I'm suffering from the same problem

Original comment by Atn.Mar...@gmail.com on 30 Aug 2012 at 6:48