Skip to content
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

Gradle compiler returns 0 exit code for some errors #678

Closed
raiju opened this issue Aug 20, 2020 · 1 comment
Closed

Gradle compiler returns 0 exit code for some errors #678

raiju opened this issue Aug 20, 2020 · 1 comment

Comments

@raiju
Copy link
Contributor

raiju commented Aug 20, 2020

What happened?

When trying to compile a conjure definition with gradle-conjure, no files were generated. Digging deeper, no new IR files were being generated. Executing the compile command directly resulted in the following output:

java.lang.RuntimeException: Encountered error trying to parse file '<FILE>'
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseConjureDef$3(ConjureParserUtils.java:228)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
	at com.palantir.conjure.defs.ConjureParserUtils.parseConjureDef(ConjureParserUtils.java:199)
	at com.palantir.conjure.defs.Conjure.parse(Conjure.java:37)
	at com.palantir.conjure.cli.ConjureCli$CompileCommand.generate(ConjureCli.java:91)
	at com.palantir.conjure.cli.ConjureCli$CompileCommand.run(ConjureCli.java:85)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1919)
	at picocli.CommandLine.access$1100(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at com.palantir.conjure.cli.ConjureCli.main(ConjureCli.java:46)
Caused by: java.lang.NullPointerException: Import not found for namespace: Namespace{name=<NAMESPACE_NAME>}
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:987)
	at com.palantir.conjure.defs.ConjureTypeParserVisitor$ByParsedRepresentationTypeNameResolver.resolve(ConjureTypeParserVisitor.java:66)
	at com.palantir.conjure.defs.ConjureTypeParserVisitor.visitForeignReference(ConjureTypeParserVisitor.java:143)
	at com.palantir.conjure.defs.ConjureTypeParserVisitor.visitForeignReference(ConjureTypeParserVisitor.java:41)
	at com.palantir.conjure.parser.types.reference.ForeignReferenceType.visit(ForeignReferenceType.java:33)
	at com.palantir.conjure.defs.ConjureParserUtils.parseArgs(ConjureParserUtils.java:412)
	at com.palantir.conjure.defs.ConjureParserUtils.parseEndpoint(ConjureParserUtils.java:365)
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseService$5(ConjureParserUtils.java:266)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:723)
	at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1521)
	at com.palantir.conjure.defs.ConjureParserUtils.parseService(ConjureParserUtils.java:266)
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseConjureDef$2(ConjureParserUtils.java:217)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:723)
	at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1521)
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseConjureDef$3(ConjureParserUtils.java:216)
	... 13 more

with a 0 return code. This meant that the next build steps were executed.

What did you want to happen?

A non-zero return code, which would then enable GradleExecUtils to print out the error.

@ferozco
Copy link
Contributor

ferozco commented Aug 20, 2020

This was an issue with conjure CLI which was fixed here: #675. An upgrade should sort you out

@ferozco ferozco closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants