google / google/closure-compiler
Contributing using Eclipse+Windows is hard
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
This is an umbrella issue for the hurdles developers who want to develop in the Closure Compiler codebase using Eclipse on Windows will encounter. It's just taken me, a moderately seasoned external contributor, about half a day to get developing properly from scratch.
First, ideally the "mvn eclipse:eclipse" command would create eclipse configs that just worked, but I don't know how to solve that. Instead, the README has some fairly arduous steps needed to correct the project configuration.
Then, if you want to run tests, either via `mvn` or individually from within Eclipse, you get a bunch of failures mostly relating to filesystem absolute paths, line separators, and one relating to case insensitivity:
```
Failed tests:
DepsGeneratorTest.testWithDepsAndSources:165 expected:<.../my-project/deps1.js[
goog.addDependency('../prescanned1/file1.js', ['dep.string'], []);
goog.addDependency('../prescanned1/file2.js', [], []);
// Included from: /base/my-project/deps2.js]
goog.addDependency(...> but was:<.../my-project/deps1.js[
goog.addDependency('../prescanned1/file1.js', ['dep.string'], []);
goog.addDependency('../prescanned1/file2.js', [], []);
]/ Included from: /base/my-project/deps2.js
goog.addDependency(...>
TranspileResultTest.testEquals:38 TranspileResut{path=a, original=b, transpiled=c, sourceMapURL=d} [group 1, item 1] must not be Object#equals to TranspileResut{path=A, original=b, transpiled=c, sourceMapURL=d} [group 2, item 1]
Tests in error:
SourceFileTest.testSourceFileResolvesZipEntries:119 » NoSuchFile C:\Users\STEV...
DepsGeneratorTest.testDuplicateProvides:337->doErrorMessagesRun:320 » IllegalArgument
DepsGeneratorTest.testDuplicateProvidesErrorThrownIfBadClosurePathSpecified:358->doErrorMessagesRun:320 » IllegalArgument
DepsGeneratorTest.testDuplicateProvidesSameFile:401->doErrorMessagesRun:320 » IllegalArgument
DepsGeneratorTest.testDuplicateRequire:412->doErrorMessagesRun:320 » IllegalArgument
DepsGeneratorTest.testSameFileProvideRequire:423->doErrorMessagesRun:320 » IllegalArgument
DepsGeneratorTest.testUnknownNamespace:433->doErrorMessagesRun:320 » IllegalArgument
ArrayIndexOfToIncludesTest.test_refactorings:41 » IllegalArgument filenameToCo...
ArrayPrototypeSliceToArrayFromTest.test_refactorings:41 » IllegalArgument file...
ChaiExpectToAssertTest.test_refactorings:41 » IllegalArgument filenameToCodeMa...
NavigationalXssSinksRefactoringTest.testModuleRefactoring:51 » IllegalArgument
NavigationalXssSinksRefactoringTest.test_refactorings:41 » IllegalArgument fil...
SetLocationHrefTest.test_refactorings:42 » IllegalArgument filenameToCodeMap m...
StringIndexOfToIncludesTest.test_refactorings:41 » IllegalArgument filenameToC...
Tests run: 12818, Failures: 2, Errors: 14, Skipped: 0
```
* IllegalArguments are mostly because: PathUtil.makeAbsolute() and isAbsolute() don't work together for Windows drive letter based paths;
* DepsGeneratorTest.testWithDepsAndSources fails because println() is used in DepsGenerator, producing `\r\n` on Windows, but `DepsGeneratorTest.LINE_JOINER` has `\n` hard-coded (I suppose changing this to read `line.separator` would work here);
* TranspileResultTest fails because `Path` 'A' and 'a' are considered equal on Windows.
* StringIndexOfToIncludesTest confuses path separator `/` with `\`
* etc.
When working with a fork or developing a PR, you need to `mvn -DskipTests` and if you do run with tests, it's hard to see whether your fork has contributed to the failures.
Updated since #2753.
Contributor guide
Assessment
This issue has not been assessed yet.