Skip to content

8295884: Implement IDE support for Eclipse#10853

Closed
TheShermanTanker wants to merge 54 commits intoopenjdk:masterfrom
TheShermanTanker:eclipse
Closed

8295884: Implement IDE support for Eclipse#10853
TheShermanTanker wants to merge 54 commits intoopenjdk:masterfrom
TheShermanTanker:eclipse

Conversation

@TheShermanTanker
Copy link
Copy Markdown
Contributor

@TheShermanTanker TheShermanTanker commented Oct 25, 2022

Eclipse is a popular and very well-known IDE in the world of Java development, utilized widely in many contexts, by beginners and experienced teams alike. Although a relatively lightweight IDE, it features surprisingly powerful indexing and code analysis capabilities, as well as useful tools, among which are make integration. While the tools it provides are not always as sophisticated as other IDEs (IntelliJ IDEA will likely come to mind as one such competitor), the simplicity of using it, as well as the reliability of this rugged IDE makes up greatly for the slightly less advanced tooling. Eclipse requires very little starting infrastructure in the workspace for all these features and indexing support as well, which makes it a good candidate for developing on the JDK.

This enhancement adds 4 extra targets to the make system for generating a basic Eclipse Workspace that provides almost full indexing support for the JDK, with varying levels as desired, from a minimalistic option only including the Java Virtual Machine's source code, to generating a workspace with both Java and C/C++ natures included, which allows for using Eclipse's unique ability to quickly swap between Java and C/C++ mode to work on both native and Java sources at the same time. Cross Compiling support is available, and in its entirety the change touches very little of the existing make system, barring its own Makefile within the ide subdirectory.

Indexing capabilities utilizing the enhancement:
java
escape


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10853/head:pull/10853
$ git checkout pull/10853

Update a local copy of the PR:
$ git checkout pull/10853
$ git pull https://git.openjdk.org/jdk pull/10853/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10853

View PR using the GUI difftool:
$ git pr show -t 10853

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10853.diff

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Oct 25, 2022

👋 Welcome back jwaters! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot changed the title 8295884 8295884: Support for developing with the Eclipse IDE Oct 25, 2022
@TheShermanTanker TheShermanTanker changed the title 8295884: Support for developing with the Eclipse IDE 8295884: Support for development with the Eclipse IDE Oct 25, 2022
@openjdk
Copy link
Copy Markdown

openjdk bot commented Oct 25, 2022

@TheShermanTanker The following labels will be automatically applied to this pull request:

  • build
  • ide-support

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org ide-support ide-support-dev@openjdk.org labels Oct 25, 2022
@TheShermanTanker TheShermanTanker marked this pull request as draft October 25, 2022 13:33
@TheShermanTanker TheShermanTanker marked this pull request as ready for review October 25, 2022 14:01
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 25, 2022
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Oct 25, 2022

Copy link
Copy Markdown
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like nice work.

I'm curious how does this eclipse project figures out preprocessor settings like -D flags from the build to correctly setup the environment for the native code? I know this was a major deal when creating the compile-commands.json for other native IDE integrations. I've heard some IDEs just run the build once and inspect the command lines, but our default log level won't show that. I'm not familiar with eclipse project files, but I couldn't really see anything here that addressed this issue. Can you work with the native code in a meaningful way without it?

@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

This looks like nice work.

I'm curious how does this eclipse project figures out preprocessor settings like -D flags from the build to correctly setup the environment for the native code? I know this was a major deal when creating the compile-commands.json for other native IDE integrations. I've heard some IDEs just run the build once and inspect the command lines, but our default log level won't show that. I'm not familiar with eclipse project files, but I couldn't really see anything here that addressed this issue. Can you work with the native code in a meaningful way without it?

You're right, it seems I forgot to also include the preprocessor defines in the generated workspace :P
I'll add them in the next commit, thanks for catching that. Eclipse does work very well with native code even without those defines and flags from the build for the most part though, just that utilities which require them (For instance something like PRODUCT_ONLY and NOT_PRODUCT in HotSpot) wouldn't properly work with the indexer, which would be annoying, but it's more of a mild inconvenience than anything.

@openjdk-notifier
Copy link
Copy Markdown

@TheShermanTanker Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@tstuefe
Copy link
Copy Markdown
Member

tstuefe commented Oct 26, 2022

Will this work with jtreg test sources too? At least on Intellij those require a brittle intellij plugin.

@TheShermanTanker TheShermanTanker changed the title 8295884: Support for development with the Eclipse IDE 8295884: Implement IDE support for Eclipse Oct 27, 2022
@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

I've heard some IDEs just run the build once and inspect the command lines, but our default log level won't show that.

I also forgot to mention that CDT does come with an integrated Build Output Parser that can do just that, but I do want to avoid using it, if possible, since it's much more convenient to be able to start working on code the moment configure completes instead of having to wait for the build to finish once

@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

@erikj79 @magicus Seems like this is the best I can do for now, baseline support for Eclipse should now be present with these final touchups (Environment setup is not fully complete yet, but Eclipse is flexible enough that for most development work, this should not be too problematic). I do plan to refine support for it in the future, since there are still areas for improvement, but at present I think this should be decent enough for the time being

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Java</name>
<comment>The official Java HotSpot Virtual Machine, Runtime Environment, and Development Kit</comment>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just call it OpenJDK; there is a legal trademark swamp associated with "Java".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, will also rename it to just jdk to match the cloned repository to be extra safe


# Use server as base for defines and includes
JVM_VARIANT=server
# Use primary variant for defines and includes
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a correct fix but it is independent of this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted https://bugs.openjdk.org/browse/JDK-8303760 and #12906 to fix that issue separately

@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

:(

Copy link
Copy Markdown
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this looks ok to me, just some comment on cosmetics.

TheShermanTanker and others added 5 commits March 10, 2023 02:08
Co-authored-by: Erik Joelsson <37597443+erikj79@users.noreply.github.com>
Co-authored-by: Erik Joelsson <37597443+erikj79@users.noreply.github.com>
Co-authored-by: Erik Joelsson <37597443+erikj79@users.noreply.github.com>
@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

Alright, that should be all of them

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 14, 2023

@TheShermanTanker This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8295884: Implement IDE support for Eclipse

Reviewed-by: erikj

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 167 new commits pushed to the master branch:

  • ec1eb00: 8303415: Add VM_Version::is_intrinsic_supported(id)
  • 31680b2: 8303410: Remove ContentSigner APIs and jarsigner -altsigner and -altsignerpath options
  • 0cc0f06: 8304015: G1: Metaspace-induced GCs should not trigger maximal compaction
  • 43eca1d: 8303910: jdk/classfile/CorpusTest.java failed 1 of 6754 tests
  • b6d70f2: 8303973: Library detection in runtime/ErrorHandling/TestDwarf.java fails on ppc64le RHEL8.5 for libpthread-2.28.so
  • 2bb990e: 8301244: Tidy up compiler specific warnings files
  • c073ef2: 8303482: Update LCMS to 2.15
  • 49181b8: 8303955: RISC-V: Factor out the tmp parameter from copy_memory and copy_memory_v
  • 7bbc5e0: 8300517: Refactor VisibleMemberTable (method members)
  • a8f662e: 8303908: Add missing check in VTMS_transition_disable_for_all() for suspend mode
  • ... and 157 more: https://git.openjdk.org/jdk/compare/b51ea4204eaa18687e7712e87cdc92efbddfcb5b...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 14, 2023
@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

Thanks Erik!

@magicus is this final revision ok with you?

@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

/integrate

@TheShermanTanker
Copy link
Copy Markdown
Contributor Author

Sorry this took so long, for everyone that was waiting for this. Do note that C support may still be a little wonky in some cases, if there are any bugs do feel free to send me a message in this Pull Request (doesn't matter that it's already been integrated)

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 14, 2023

Going to push as commit 45809fd.
Since your change was applied there have been 176 commits pushed to the master branch:

  • baf11e7: 8303814: getLastErrorString should avoid charset conversions
  • 830fd41: 8302795: Shared archive failed on old version class with jsr bytecode
  • 4e631fa: 8298966: Deprecate JMX Subject Delegation and the method JMXConnector.getMBeanServerConnection(Subject) for removal.
  • 10f1674: 8303809: Dispose context in SPNEGO NegotiatorImpl
  • 9f9ab02: 8303895: Simplify and clean up LinkFactory code
  • a00f5d2: 8303861: Error handling step timeouts should never be blocked by OnError and others
  • da044dd: 8300939: sun/security/provider/certpath/OCSP/OCSPNoContentLength.java fails due to network errors
  • c466cdf: 8299546: C2: MulLNode::mul_ring() wrongly returns bottom type due to casting errors with large numbers
  • 55aa122: 8304059: Use InstanceKlass in dependencies
  • ec1eb00: 8303415: Add VM_Version::is_intrinsic_supported(id)
  • ... and 166 more: https://git.openjdk.org/jdk/compare/b51ea4204eaa18687e7712e87cdc92efbddfcb5b...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 14, 2023
@openjdk openjdk bot closed this Mar 14, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 14, 2023
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 14, 2023

@TheShermanTanker Pushed as commit 45809fd.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@TheShermanTanker TheShermanTanker deleted the eclipse branch March 14, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build build-dev@openjdk.org ide-support ide-support-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants