Here's the error I see in the most recent build:
gulp-google-[secure]: TypeError: Cannot read property 'b' of null
at l6b (/home/travis/build/google/[secure]/node_modules/[secure]-npm/packages/google-[secure]-js/jscomp.js:8755:375)
at zxd (/home/travis/build/google/[secure]/node_modules/[secure]-npm/packages/google-[secure]-js/jscomp.js:8175:160)
at h2b (/home/travis/build/google/[secure]/node_modules/[secure]-npm/packages/google-[secure]-js/jscomp.js:6209:103)
at Z1b (/home/travis/build/google/[secure]/node_modules/[secure]-npm/packages/google-[secure]-js/jscomp.js:8416:290)
which causes a test failure
1) gulp-google-[secure]
javascript version
should properly compose sourcemaps when multiple transformations are chained:
Uncaught Error: gulp-google-[secure]: Compilation errors occurred
at CompilationStream._compilationComplete (lib/gulp/index.js:256:28)
Seems to be a failure in closure-compiler-npm package bubbling up to travis, breaking update seems to have been published June 30. (I might be misreading the error log though.)
I think we had two separate causes of the CI failing.
https://github.com/google/closure-compiler/pull/3627/files fixed the original cause of the broken CI, introduced when adding a J2CL build a few weeks ago.
While that PR was still in review, a change to source map lookup https://github.com/google/closure-compiler/commit/dac995ac563bfe3170280899112699845768e135 caused a different CI failure (the one Christian mentioned)
I compared the Travis builds before and after the source map change https://github.com/google/closure-compiler/commit/dac995ac563bfe3170280899112699845768e135. Both builds fail but the failure message changes.
That commit was actually attempt #2 at making the caching sourcemap lookup. I was originally submitted in late May then reverted in https://github.com/google/closure-compiler/commit/5f4e410752df4483c43e8b7e818bae32ab4c2a97 because of the CI failure. (The commit message does not specify that it's a rollback because of a quirk of how we scrub commits for GitHub). We probably didn't notice that the rollforward broke the CI again because it was already broken :(.
Bradford pointed out that prior to https://github.com/google/closure-compiler/commit/dac995ac563bfe3170280899112699845768e135 the Travis build was failing with what looks like a timeout.
[INFO] --- gwt-maven-plugin:1.0-rc-6:compile (default-compile) @ [secure]-gwt ---
[INFO] Compiling module com.google.JsComp
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
I've debugged the sourcemap issue some more. Here's the stack trace causing a test failure w/ a pretty-printed GWT compiler:
gulp-google-closure-compiler: TypeError: Cannot read property 'fileName' of null
at $getSourceMapping (/usr/local/google/home/lharker/git/closure-compiler/node_modules/closure-compiler-npm/packages/google-closure-compiler-js/jscomp.js:37108:251)
at $addMapping_0 (/usr/local/google/home/lharker/git/closure-compiler/node_modules/closure-compiler-npm/packages/google-closure-compiler-js/jscomp.js:92406:21)
at $generateSourceMap (/usr/local/google/home/lharker/git/closure-compiler/node_modules/closure-compiler-npm/packages/google-closure-compiler-js/jscomp.js:35005:7)
at toSource (/usr/local/google/home/lharker/git/closure-compiler/node_modules/closure-compiler-npm/packages/google-closure-compiler-js/jscomp.js:34936:22)
at $build_12 (/usr/local/google/home/lharker/git/closure-compiler/node_modules/closure-compiler-npm/packages/google-closure-compiler-js/jscomp.js:34944:10)
at $toSource_1 (/usr/local/google/home/lharker/git/closure-compiler/node_modules/closure-compiler-npm/packages/google-closure-compiler-js/jscomp.js:37909:10)
[...]
Here's the compiled $getSourceMapping method:
function $getSourceMapping(this$static, sourceName, lineNumber, columnNumber){
var consumer, relativePath, result, resultOriginalPath, source, sourceMap, sourceMapOriginalPath;
if (sourceName == null) {
return null;
}
sourceMap = castTo($get_23(this$static.inputSourceMaps, sourceName), 434);
if (!sourceMap) {
return null;
}
consumer = $getSourceMap(sourceMap, this$static.errorManager);
if (!consumer) {
return null;
}
result = $getMappingForLine(consumer, lineNumber, columnNumber + 1);
if (!result) {
return null;
}
sourceMapOriginalPath = sourceMap.sourceFile.fileName;
resultOriginalPath = result.originalFile;
source = null;
if ($equals_19(sourceMapOriginalPath, this$static.resolvedSourceMap.originalPath) && $equals_19(resultOriginalPath, this$static.resolvedSourceMap.sourceMapPath)) {
source = this$static.resolvedSourceMap.sourceFile;
}
else {
relativePath = resolveSibling(sourceMapOriginalPath, resultOriginalPath);
source = $getSourceFileByName(this$static, relativePath);
if (!source && !!resultOriginalPath) {
source = null;
!!source && $putIfAbsent_0(this$static.sourceMapOriginalSources, relativePath, source);
}
this$static.resolvedSourceMap.originalPath = sourceMapOriginalPath;
this$static.resolvedSourceMap.sourceMapPath = resultOriginalPath;
this$static.resolvedSourceMap.sourceFile = source;
}
return $build_6($setColumnPosition($setOriginalFile($setIdentifier($setColumnPosition($setLineNumber($setOriginalFile(new Mapping$OriginalMapping$Builder, result.originalFile), result.lineNumber), result.columnPosition), result.identifier), source.fileName), result.columnPosition - 1));
}
The stack trace points to the last line in the function,
return $build_6($setColumnPosition($setOriginalFile($setIdentifier($setColumnPosition($setLineNumber($setOriginalFile(new Mapping$OriginalMapping$Builder, result.originalFile), result.lineNumber), result.columnPosition), result.identifier), source.fileName), result.columnPosition - 1));
implying that source is null.
This function corresponds togetSourceMapping in Compiler.java: https://github.com/google/closure-compiler/blob/4bf54b232b13162f6c621b2d1f12cddab5b00701/src/com/google/javascript/jscomp/Compiler.java#L2871
https://github.com/google/closure-compiler/commit/dac995ac563bfe3170280899112699845768e135 introduced a reference to source in the return for that function without first checking that it's non-null. Probably source was already null in the GWT compiled test before that commit, but it just didn't matter earlier.
I don't know why it's only null in the GWT tests though. That might be an unrelated bug?
The latest build for master passed! https://travis-ci.org/github/google/closure-compiler/builds/708436760
Closing this issue. If we start seeing timeouts in Travis again we can open a new issue. (This build did take ~30 min, whereas the previous passing build on master was only ~20min, so might be something wrong there).