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

Migrate to newer Closure Compiler version #2

Open
nitind opened this issue Oct 9, 2023 · 6 comments
Open

Migrate to newer Closure Compiler version #2

nitind opened this issue Oct 9, 2023 · 6 comments

Comments

@nitind
Copy link
Contributor

nitind commented Oct 9, 2023

See eclipse-orbit/orbit-simrel#18 .

JSDT currently relies on the ancient com.google.javascript_0.0.20160315.v20161124-1903 (as Closure Compiler). Orbit has moved to the newer com.google.javascript 0.0.20230802.v20230927-1600, but JSDT does not presently compile against it.

@vrubezhny

@benken-parasoft
Copy link

benken-parasoft commented Apr 24, 2024

There is a real issue here. I assemble an Eclipse product based on 4.31 (2024-03). My target platform happens to also include the Orbit 4.31 repository to pull in some additional bundles. At runtime, the JSDT is broken:

java.lang.NoSuchFieldError: ES6
	at org.eclipse.wst.jsdt.internal.compiler.closure.ClosureCompiler.parse(ClosureCompiler.java:112)
	at org.eclipse.wst.jsdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:911)
	at org.eclipse.wst.jsdt.core.dom.ASTParser.createAST(ASTParser.java:675)
	at org.eclipse.wst.jsdt.internal.core.search.indexing.SourceIndexer.indexDocument(SourceIndexer.java:93)
	at org.eclipse.wst.jsdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:79)
	at org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:325)
	at org.eclipse.wst.jsdt.internal.core.search.indexing.AddLibraryFileToIndex.indexFile(AddLibraryFileToIndex.java:251)
	at org.eclipse.wst.jsdt.internal.core.search.indexing.AddLibraryFileToIndex.execute(AddLibraryFileToIndex.java:169)
	at org.eclipse.wst.jsdt.internal.core.search.processing.JobManager.run(JobManager.java:393)
	at java.base/java.lang.Thread.run(Thread.java:840)

The "org.eclipse.wst.jsdt.core" bundle does not declare a version restriction on "com.google.javascript" so Tycho is able to satisfy its dependencies using the latest one from Orbit. At runtime, the newer one isn't actually compatible because of a change to "com.google.javascript.jscomp.parsing.parser.Parser.Config.Mode" where the "ES6" and "ES7" constants were replaced with a single "ES6_OR_ES7" constant.

For now, we are working around this by forcing a restriction on the target platform to require version "0.0.20160315" for "com.google.javascript". Something like this:

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <configuration>
          <dependency-resolution>
            <extraRequirements>
              <requirement>
                <type>eclipse-plugin</type>
                <id>com.google.javascript</id>
                <versionRange>[0.0.20160315,0.0.20231112)</versionRange>
              </requirement>
            </extraRequirements>
          </dependency-resolution>
        </configuration>
      </plugin>

@alexsuter
Copy link

Hello @nitind

I've the same issue as @benken-parasoft

Is there any solution for this problem?

@alexsuter
Copy link

By using an older version, maybe other things are broken then. Build is also failing at the moment:
https://ci.eclipse.org/webtools/job/webtools-jsdt_master/

@nitind
Copy link
Contributor Author

nitind commented Jun 11, 2024

Hello @nitind

I've the same issue as @benken-parasoft

Is there any solution for this problem?

Porting to the newer version would be one, but the committers who moved the project to Nashorn and then the Closure Compiler aren't very active on this project any more.

I doubt that the change in that version constant is the only breaking change. Is it?

@alexsuter
Copy link

Saidly there is much more needed:

image

@alexsuter
Copy link

No longer an issue for us. We have removed JSDT.

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

3 participants