Skip to content

Remove eclipse conditionals #44075

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

Merged
merged 12 commits into from
Oct 3, 2019
Merged

Conversation

alpar-t
Copy link
Contributor

@alpar-t alpar-t commented Jul 8, 2019

We used to have some meta projects with a -test prefix because
historically eclipse could not distinguish between test and main
source-sets and could only use a single classpath.
This is no longer the case for the past few Eclipse versions.

This PR adds the necessary configuration to correctly categorize source
folders and libraries.
With this change eclipse can import projects, and the visibility rules
are correct e.x. auto compete doesn't offer classes from test code or
testCompile dependencies when editing classes in main.

Unfortunately the cyclic dependency detection in Eclipse doesn't seem to
take the difference between test and non test source sets into account,
but since we are checking this in Gradle anyhow, it's safe to set to
warning in the settings. Unfortunately there is no setting to ignore
it.

This might cause problems when building since Eclipse will probably not
know the right order to build things in so more work might be necessary.

//cc @cbuescher @jpountz @colings86 ( please add other Eclipse users )

We used to have some meta projects with a `-test` prefix because
historically eclipse could not distinguish between test and main
source-sets and could only use a single classpath.
This is no longer the case for the past few Eclipse versions.

This PR adds the necessary configuration to correctly categorize source
folders and libraries.
With this change eclipse can import projects, and the visibility rules
are correct e.x. auto compete doesn't offer classes from test code or
`testCompile` dependencies when editing classes in `main`.

Unfortunately the cyclic dependency detection in Eclipse doesn't seem to
take the difference between test and non test source sets into account,
but since we are checking this in Gradle anyhow, it's safe to set to
`warning` in the settings. Unfortunately there is no setting to ignore
it.

This might cause problems when building since Eclipse will probably not
know the right order to build things in so more wirk might be necesarry.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

So glad we are ditching all this stuff 👍

Couple of comments. There's still some isEclipse stuff in the root build script. Is this still needed?

Also, of course we'll want to have our Eclipse users functionally test this to ensure it works as intended.

build.gradle Outdated
// edit the generated .classpath to correctly mark test vs non test code and dependencies
// for more info: https://github.com/eclipse/buildship/issues/689 and https://github.com/gradle/gradle/issues/4802
Set<String> testOnlyProjectDependencies = new HashSet();
if (configurations.findByName("testCompile") != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be using testCompileClasspath instead of testCompile since the later is deprecated.

build.gradle Outdated
Set<String> testOnlyProjectDependencies = new HashSet();
if (configurations.findByName("testCompile") != null) {
testOnlyProjectDependencies.addAll(
configurations.testCompile.getDependencies().findAll {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use getAllDependencies() here to ensure we also get dependencies from parent configurations (like compileOnly). Also we should stick to Groovy conventions and use property accessors allDependencies vs getter methods getAllDependencies() just for consistency. I realize this is difficult switching between Java and Groovy a lot 😄

build.gradle Outdated
it.entryAttributes['test'] = (it.entryAttributes['gradle_used_by_scope'] == 'test')
}
if (it.hasProperty("path") && it.path.startsWith("/:")) {
if (testOnlyProjectDependencies.contains(it.path.substring(1))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we ditch the extra nested if for just another conditional?

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was mistakenly checked in.

@@ -68,7 +68,9 @@ dependencies {
hdfsFixture project(':test:fixtures:hdfs-fixture')
// Set the keytab files in the classpath so that we can access them from test code without the security manager
// freaking out.
testRuntime files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs","hdfs_hdfs.build.elastic.co.keytab").parent)
if (isEclipse == false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this suddenly needed?

@@ -62,6 +62,7 @@ public static String toString(Object value) {
return "null";
}


Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra newline?

@cbuescher
Copy link
Member

@atorok thanks for much for tackling this. Fyi I tried rebuilding my complete workspace with this but unfortunately there were quite a number of errors. Most prominently most modules/plugins are missing dependencies to some Lucene jars and some to org.apache.logging.log4j.Logger. I can dig into some of these in more detail if you want and concentrate on particular projects. Let me know what information helps you move this forward.

@jpountz
Copy link
Contributor

jpountz commented Jul 9, 2019

For the record I'm seeing the same issue as Christoph. Note that the test folder is seeing the Lucene and logging JARs as expected, only the main folder is not seeing them.

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 9, 2019

I'm working with @cbuescher to set this up.

For anyone testing this, since there are projects being removed ( all the *-test ones ) make sure to do a complete clean before importing with:

find  -name .classpath -o -name .settings -o -name .project -o -name build-eclipse  | xargs rm -Rf

The usual method of

./graldew cleanEclipse

Would only work if done before checking out the PR.

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 9, 2019

After looking at the build problems some more and doing a small sample project it became apparent that eclipse can't handle our setup even when source folders are correctly marked for tests and non test code.

The circular dependency is not really circular with this considered.
For example :server tests depends on test:framework which depends on :server main but Eclipse wan't to compile a project at a time and can't figure out how to build these.

There is however a solution to this problem: Buildship - the Gradle integration from the Eclipse side. IDEA has been working like this for a long time and it's a much better maintained solution than the Gradle eclipse project that we use to generate the configuration so far.
This works because the project dependencies are not added to the .classpath instead the classpaths are delegated to Gradle via Build ship.

This does mean that we would only support Eclipse with build ship.
@jpountz @cbuescher could you test this please and see if it's acceptable ?
For the things I tried it worked pretty well ( I did have to increase the heap of Eclipse, but I'm not sure that's because of Build ship and is something I have to do on Idea as well ).
With these changes, the only errors I saw were for groovy code in build-tools probably because I don't have groovy tooling installed.

To try this out run

./gradlew eclipse

then Import using Existing Gradle Project
Note that projects have a Gradle -> Refresh Gradle Project option.
A regular refresh does not refresh the Gradle model.

Also note that I removed the workaround to mark source folders and libraries as tests,
as this is coming in the next Gradle version.
I tested it with

./gradlew wrapper --gradle-version=5.6-20190709000031+0000

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 9, 2019

I'll update CONTRIBUTING.md before merging if this is accepted.
I just saw we already document increasing the heap.

@mark-vieira
Copy link
Contributor

There is however a solution to this problem: Buildship - the Gradle integration from the Eclipse side.

I don't see this as a problem. This is the official way to use Gradle with Eclipse and is favored over the legacy eclipse plugins, similarly to how the idea plugin is generally no longer needed. Using Buildship should be the goal here. If it does what we need it to I see that as a win.

Also note that I removed the workaround to mark source folders and libraries as tests,
as this is coming in the next Gradle version.

So I assume we'd need to wait for the 5.6 release to merge this?

@cbuescher
Copy link
Member

could you test this please and see if it's acceptable

First try was partially successful at least (using newest Eclipse 2019-06). I had to do a few things though:

  • change Preferences -> Java -> Compiler -> Building -> "Circular Dependencies ..." from "Error" to "Warning"
  • change Preferences -> Java -> Compiler -> Errors/Warning -> "Forbidden references ..." from "Error" to "Warning"
    I was getting errors like "Access restriction: The constructor 'HttpsConfigurator(SSLContext)' is not API (restriction on required library '/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/rt.jar')" e.g. in the RestClientSingleHostIntegTests in the clients project otherwise
  • "build tools" is giving me a weird "Groovy:Access to org.elasticsearch.gradle.DependenciesInfoTask#deps is forbidden @ line -1, column -1. BuildPlugin.groovy /:build-tools/src/main/groovy/org/elasticsearch/gradle" problem I ignored by closing the project for now
  • I ran into OOM on initial import, increase memory in eclipse.ini to Xms2024m/Xmx2024m for now, will see how this holds up

My biggest issue atm is that I cannot run unit test, e.g. in the "server" project, like I was able to do before. As an experiment I tried running "IdsQueryBuilderTests" from the IDE and got Jar-Hell errors for the test classpath:

java.lang.RuntimeException: found jar hell in test classpath
	at org.elasticsearch.bootstrap.BootstrapForTesting.<clinit>(BootstrapForTesting.java:99)
	at org.elasticsearch.test.ESTestCase.<clinit>(ESTestCase.java:224)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:623)
Caused by: java.lang.IllegalStateException: jar hell!
duplicate jar [/] on classpath: /Users/christoph/workspace/elasticsearch-44075/server/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/server/build-eclipse/2:/Users/christoph/workspace/elasticsearch-44075/server/build-eclipse/3:/Users/christoph/workspace/elasticsearch-44075/server/build-eclipse/4:/:libs:elasticsearch-x-content/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/libs/x-content/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/libs/x-content/build-eclipse/2:/:libs:elasticsearch-cli/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/libs/cli/build-eclipse/1:/:libs:elasticsearch-core/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/libs/core/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/libs/core/build-eclipse/2:/Users/christoph/workspace/elasticsearch-44075/libs/core/build-eclipse/3:/:libs:elasticsearch-secure-sm/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/libs/secure-sm/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/libs/secure-sm/build-eclipse/2:/:libs:elasticsearch-geo/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/libs/geo/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/libs/geo/build-eclipse/2:/:libs:elasticsearch-plugin-classloader/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/libs/plugin-classloader/build-eclipse/1:/:test:framework/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/test/framework/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/test/framework/build-eclipse/2:/Users/christoph/workspace/elasticsearch-44075/test/framework/build-eclipse/3:/Users/christoph/workspace/elasticsearch-44075/test/framework/build-eclipse/4:/:libs:elasticsearch-nio/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/libs/nio/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/libs/nio/build-eclipse/2:/Users/christoph/workspace/elasticsearch-44075/libs/nio/build-eclipse/3:/:client:sniffer/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/client/sniffer/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/client/sniffer/build-eclipse/2:/Users/christoph/workspace/elasticsearch-44075/client/sniffer/build-eclipse/3:/:client:rest/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/client/rest/build-eclipse/1:/Users/christoph/workspace/elasticsearch-44075/client/rest/build-eclipse/2:/Users/christoph/workspace/elasticsearch-44075/client/rest/build-eclipse/3:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-core/8.1.0/46d614acdeb42f4661e91347100217bc72aae11e/lucene-core-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-analyzers-common/8.1.0/262f20cb2786cdf7015a4ba1a64ce90ff2d746f5/lucene-analyzers-common-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-backward-codecs/8.1.0/c5610306f8eff182b399b9aed7a60b82668a8395/lucene-backward-codecs-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-grouping/8.1.0/443f63d9038eea0601b493fa37fc599d74b035eb/lucene-grouping-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-highlighter/8.1.0/e3e52591f8d44a4e1006ced4dd4a67f7a572990a/lucene-highlighter-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-join/8.1.0/2e885b1e3e55f94ccc2744f85738563a577a4e21/lucene-join-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-memory/8.1.0/e58d0092da1c4744627d57d022f4e07d8b80d11b/lucene-memory-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-misc/8.1.0/7833aee2c5feb6fa1a16a21d27c8f15c01d0b4c/lucene-misc-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-queries/8.1.0/63096d40298b8b8245a602d344b57bfa14b929fd/lucene-queries-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-queryparser/8.1.0/9bb4fb3c7035a877e4a87ed86870894509d26d65/lucene-queryparser-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-sandbox/8.1.0/1033737c97703516134ba4c99d41724729854df4/lucene-sandbox-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-spatial/8.1.0/968d2fb35b0c2e68ac07c1ec187ab38a74b6602a/lucene-spatial-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-spatial-extras/8.1.0/551b7fa327645d3fd59ae1321320153b2f858766/lucene-spatial-extras-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-spatial3d/8.1.0/45e63df708be458e95d9da3e6054189c50c30dff/lucene-spatial3d-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-suggest/8.1.0/d5cd0e619b473e132f03e3577d1b422f050f99c0/lucene-suggest-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/com.carrotsearch/hppc/0.8.1/ffc7ba8f289428b9508ab484b8001dea944ae603/hppc-0.8.1.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.10.2/a079fc39ccc3de02acdeb7117443e5d9bd431687/joda-time-2.10.2.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/com.tdunning/t-digest/3.2/2ab94758b0276a8a26102adf8d528cf6d0567b9a/t-digest-3.2.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.hdrhistogram/HdrHistogram/2.1.9/e4631ce165eb400edecfa32e03d3f1be53dee754/HdrHistogram-2.1.9.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.locationtech.spatial4j/spatial4j/0.7/faa8ba85d503da4ab872d17ba8c00da0098ab2f2/spatial4j-0.7.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.locationtech.jts/jts-core/1.15.0/705981b7e25d05a76a3654e597dab6ba423eb79e/jts-core-1.15.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.11.1/268f0fe4df3eefe052b57c87ec48517d64fb2a10/log4j-api-2.11.1.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.11.1/592a48674c926b01a9a747c7831bcd82a9e6d6e4/log4j-core-2.11.1.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.elasticsearch/jna/4.5.1/da10908ae23dc59b19dc258e63aea1c44621dc3a/jna-4.5.1.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.17/7a27ea250c5130b2922b86dea63cbb1cc10a660c/snakeyaml-1.17.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.8.11/876ead1db19f0c9e79c9789273a3ef8c6fd6c29b/jackson-core-2.8.11.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-smile/2.8.11/d9d1c49c5d9d5e46e2aee55f3cdd119286fe0fc1/jackson-dataformat-smile-2.8.11.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.8.11/2e77c6ff7342cd61ab1ae7cb14ed16aebfc8a72a/jackson-dataformat-yaml-2.8.11.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.8.11/8b9826e16c3366764bfb7ad7362554f0471046c3/jackson-dataformat-cbor-2.8.11.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/5.0.2/98cafc6081d5632b61be2c9e60650b64ddbc637c/jopt-simple-5.0.2.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/com.carrotsearch.randomizedtesting/randomizedtesting-runner/2.7.1/e917f4983144c3b969eb7d3648338ecde5e3ba89/randomizedtesting-runner-2.7.1.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest/2.1/9420ba32c29217b54eebd26ff7f9234d31c3fbb2/hamcrest-2.1.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-test-framework/8.1.0/bb9d9070244b7d106181a147e95f7d94c77afadb/lucene-test-framework-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-codecs/8.1.0/9a742c73188a7994cbbb09bde5cb4f9b350e41be/lucene-codecs-8.1.0.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f/commons-logging-1.1.3.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.11/3acb4705652e16236558f0f4f2192cc33c3bd189/commons-codec-1.11.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.elasticsearch/securemock/1.2/98201d4ad5ac93f6b415ae9172d52b5e7cda490e/securemock-1.2.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.elasticsearch/mocksocket/1.2/190ad3f42fd6ab7367bae0c0e14d1dc4e4a3c361/mocksocket-1.2.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.5.8/c27c9d6f15435dc2b6947112027b418b0eef32b9/httpclient-4.5.8.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.4.11/de748cf874e4e193b42eceea9fe5574fabb9d4df/httpcore-4.4.11.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpasyncclient/4.1.4/f3a3240681faae3fa46b573a4c7e50cec9db0d86/httpasyncclient-4.1.4.jar:/Users/christoph/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore-nio/4.4.11/7d0a97d01d39cff9aa3e6db81f21fddb2435f4e6/httpcore-nio-4.4.11.jar:/:server/build-eclipse-default:/:client:test/build-eclipse-default:/Users/christoph/workspace/elasticsearch-44075/client/test/build-eclipse/1:/Users/christoph/eclipse/java-2019-06/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/217/0/.cp:/Users/christoph/eclipse/java-2019-06/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/216/0/.cp
	at org.elasticsearch.bootstrap.JarHell.parseClassPath(JarHell.java:139)
	at org.elasticsearch.bootstrap.JarHell.parseClassPath(JarHell.java:95)
	at org.elasticsearch.bootstrap.JarHell.checkJarHell(JarHell.java:86)
	at org.elasticsearch.bootstrap.BootstrapForTesting.<clinit>(BootstrapForTesting.java:97)
	... 4 more

Which might be cause by the circular dependencies I was supressing earlier on, no idea really.

// it adds to the classpath
project.file("$buildDir/pluginUnderTestMetadata").mkdirs()
}
eclipse.classpath.defaultOutputDir = file('build-eclipse')
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this? I'm not completely sure what issue this was originally meant to workaround but I think with Buildship it would behoove us to have Gradle and Eclipse share build directories.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would have been my expectation as well, but without it Eclipse still creates the bin directories even with build-ship.

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 10, 2019

@mark-vieira I don't think we need to wait for 5.6 but we'll have to re-test this and make sure it works. It just means that main and test code will be mixed as before until we get that,
so you would get auto compete test classes in main code for instance.

@cbuescher
Copy link
Member

I ran a re-import of the master branch in a new workspace with the last two commits and didn't run into any intial trouble. Unit tests (at least the ones I most frequently run in :server) work now. I still get the weird "Groovy:Access" error in build-tools, but ignore that as sth. cosmetic atm by closing the project.
I'm going to try working with this for a bit to see how stable buildship feels (especially around the incremental compiler etc...). I had some not-so great experiences with sluggishness in the past but thats a while ago and might be gone by now. I'm also curious how "buildship" support works on daily workspace updates i.e. how the dreaded clean-and-refresh dance goes with this update.

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 10, 2019

NOTE: When trying this out for the first time, a full clean with

find  -name .classpath -o -name .settings -o -name .project -o -name build-eclipse  | xargs rm -Rf

and a re-import is needed ( since projects are being removed ).

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 10, 2019

@elasticmachine run elasticsearch-ci/bwc

1 similar comment
@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 11, 2019

@elasticmachine run elasticsearch-ci/bwc

@alpar-t
Copy link
Contributor Author

alpar-t commented Jul 11, 2019

@elasticmachine run elasticsearch-ci/bwc

@alpar-t
Copy link
Contributor Author

alpar-t commented Sep 16, 2019

Merged master in and made the necessary changes to make it work again.
Seems to work fine ( everything except build-tools ) just close that for now.

Note that I had some errors shown initially and they just went away without me doing anything was a bit wired but I think it's a glitch until Eclipse gets to build all the classes some class not found errors are shown.

Please test again as time permits. My feeling from the slack discussions is that it's ok to move forward with this.
@costin I know you had some reservations, could you please give it a go and let me know if there's specific things not working that would prevent us from moving forward ?

@alpar-t
Copy link
Contributor Author

alpar-t commented Sep 17, 2019

@elasticmachine run elasticsearch-ci/2 run elasticsearch-ci/bwc and run elasticsearch-ci/oss-distro-docs

Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

LGTM.

My only concern is the need to run ./gradlew eclipse before importing the projects using gradle buildship to get the setting to only warn on circular dependencies. The reason for my concern here is presumably if we need to set a different similar setting in the future this will also not get picked up by buildship and we'll have to wipe our workspace and start from scratch.

My concern here is not large enough that I think we should block this change since this solves a lot of existing problems and needing to add a setting like the circular dependency (i.e. one that buildship won't pick up itself) one should hopefully be very rare

@alpar-t alpar-t removed the WIP label Sep 23, 2019
@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 3, 2019

I'm going to go ahead and merge this, as I'm not aware of any troubles it might cause.
I'm happy to address any fallout or work trough any issues should they surface after the merge.

@alpar-t alpar-t merged commit ca54b44 into elastic:master Oct 3, 2019
@alpar-t alpar-t deleted the remove-eclipse-conditionals branch October 3, 2019 07:50
alpar-t added a commit that referenced this pull request Oct 3, 2019
* Remove eclipse conditionals

We used to have some meta projects with a `-test` prefix because
historically eclipse could not distinguish between test and main
source-sets and could only use a single classpath.
This is no longer the case for the past few Eclipse versions.

This PR adds the necessary configuration to correctly categorize source
folders and libraries.
With this change eclipse can import projects, and the visibility rules
are correct e.x. auto compete doesn't offer classes from test code or
`testCompile` dependencies when editing classes in `main`.

Unfortunately the cyclic dependency detection in Eclipse doesn't seem to
take the difference between test and non test source sets into account,
but since we are checking this in Gradle anyhow, it's safe to set to
`warning` in the settings. Unfortunately there is no setting to ignore
it.

This might cause problems when building since Eclipse will probably not
know the right order to build things in so more wirk might be necesarry.
alpar-t added a commit that referenced this pull request Oct 3, 2019
* Remove eclipse conditionals

We used to have some meta projects with a `-test` prefix because
historically eclipse could not distinguish between test and main
source-sets and could only use a single classpath.
This is no longer the case for the past few Eclipse versions.

This PR adds the necessary configuration to correctly categorize source
folders and libraries.
With this change eclipse can import projects, and the visibility rules
are correct e.x. auto compete doesn't offer classes from test code or
`testCompile` dependencies when editing classes in `main`.

Unfortunately the cyclic dependency detection in Eclipse doesn't seem to
take the difference between test and non test source sets into account,
but since we are checking this in Gradle anyhow, it's safe to set to
`warning` in the settings. Unfortunately there is no setting to ignore
it.

This might cause problems when building since Eclipse will probably not
know the right order to build things in so more wirk might be necesarry.
alpar-t added a commit that referenced this pull request Oct 3, 2019
* Remove eclipse conditionals

We used to have some meta projects with a `-test` prefix because
historically eclipse could not distinguish between test and main
source-sets and could only use a single classpath.
This is no longer the case for the past few Eclipse versions.

This PR adds the necessary configuration to correctly categorize source
folders and libraries.
With this change eclipse can import projects, and the visibility rules
are correct e.x. auto compete doesn't offer classes from test code or
`testCompile` dependencies when editing classes in `main`.

Unfortunately the cyclic dependency detection in Eclipse doesn't seem to
take the difference between test and non test source sets into account,
but since we are checking this in Gradle anyhow, it's safe to set to
`warning` in the settings. Unfortunately there is no setting to ignore
it.

This might cause problems when building since Eclipse will probably not
know the right order to build things in so more wirk might be necesarry.
@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 3, 2019

Pack-port complete across all active development branches.

@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants