Skip to content

SI-9508 fix classpaths in Eclipse configuration#4791

Merged
lrytz merged 1 commit intoscala:2.11.xfrom
performantdata:issue/9508
Oct 15, 2015
Merged

SI-9508 fix classpaths in Eclipse configuration#4791
lrytz merged 1 commit intoscala:2.11.xfrom
performantdata:issue/9508

Conversation

@performantdata
Copy link
Contributor

No description provided.

@scala-jenkins scala-jenkins added this to the 2.11.8 milestone Oct 7, 2015
@performantdata
Copy link
Contributor Author

review @retronym

@performantdata
Copy link
Contributor Author

Should I also axe the asm project in this PR?

@retronym
Copy link
Member

retronym commented Oct 7, 2015

Yes, it would make sense to remove asm at the same time.

@retronym
Copy link
Member

retronym commented Oct 7, 2015

For consistency with the existing Eclipse configuration, please refer to the ASM JAR in:

M2_REPO/org/scala-lang/modules/scala-asm/5.0.4-scala-3/scala-asm-5.0.4-scala-3.jar

We also copy them into deps so that we can refer to them easily from the IntelliJ classpath, which supports a reference to deps/*.jar. That approach means we don't have to update the IntelliJ configuration when we update the version of libraries.

AFAIK, Eclipse doesn't support that sort of classpath configuration.

We're missing an automated link here: we should try really try to generate the Eclipse configuration. Perhaps when we move to the SBT build as a standard, we'll be able to do that (although our SBT build is still exotic enough that it is likely trips up the IDE import).

@retronym retronym self-assigned this Oct 7, 2015
@performantdata
Copy link
Contributor Author

For consistency with the existing Eclipse configuration, please refer to the ASM JAR in:

M2_REPO/...

That came from a scala-internals post. Done.

we don't have to update the IntelliJ configuration when we update the version of libraries.

AFAIK, Eclipse doesn't support that sort of classpath configuration.

Normally one would use M2Eclipse for that.

@retronym
Copy link
Member

retronym commented Oct 7, 2015

/nothingtoseehere

@SethTisue
Copy link
Member

yes, I see it wasn't documented though. now doc'ed: scala/scabot#54

@performantdata
Copy link
Contributor Author

@retronym I'm effectively done with commits for this PR, in case you were waiting on that. There may be more adjustments to the Eclipse config files, but these fix all the Eclipse build errors that I've seen.

@lrytz
Copy link
Member

lrytz commented Oct 12, 2015

To match the commit granularity we usually have in this repo, could you squash the changes into a single commit? Then it looks all good.

@performantdata
Copy link
Contributor Author

@lrytz Rebased.

@lrytz
Copy link
Member

lrytz commented Oct 15, 2015

@performantdata I just tried it on my machine using scala IDE 4.2.0, following the instructions in https://github.com/scala/scala/blob/2.11.x/src/eclipse/README.md. I get "Unable to find a scala library. Please add the scala container or a scala library jar to the build path" for all projects - any ideas? https://dl.dropboxusercontent.com/u/4881107/eclipse.png

@performantdata
Copy link
Contributor Author

I'm also on 4.2.0, with Luna (4.4.2). Have you tried the Eclipse Re- Dance (refresh, rebuild, reopen, restart)? I just checked out to my issue/9508 branch and got 16 errors; refreshed all projects, errors gone.

@performantdata
Copy link
Contributor Author

I just did

git clone https://github.com/performantdata/scala.git scala-issue-9508
cd scala-issue-9508
git checkout issue/9508
ant init

started Eclipse in a new workspace, imported the projects, got the errors about SCALA_BASEDIR. (We should have people set that before importing.) Set the SCALA_BASEDIRs, got

  • an error pop-up about "Auto-ignore" "updating .../scala-issue-9508/build/quick/classes/.gitignore failed" "No such file or directory", and
  • your 7 errors. (Not "all projects" have errors; scala-library and scalap don't.)

Added the JLine JAR. Don't get the "Access restriction" error.

Select all projects and refresh: still have the 7 errors, plus some new warnings.

Clean all projects (and rebuild automatically): now I have 19 errors, but none of the "Unable to find a scala library." These are "Project ... not built due to errors in dependent project(s) reflect", and "reflect's tests not built due to errors in dependent scope(s) main", but no errors from reflect's scope main.

Select, close and re-open all projects: all errors are gone. Left with 16 warnings, mostly about deprecation.

Are you not a regular Eclipse user? The Re- Dance is undocumented S.O.P.

@lrytz
Copy link
Member

lrytz commented Oct 15, 2015

Indeed, a few rounds of closing, re-opening and re-building helped. I'm not a regular eclipse user, so I didn't know.. All seems to work fine now!

@lrytz
Copy link
Member

lrytz commented Oct 15, 2015

LGTM

lrytz added a commit that referenced this pull request Oct 15, 2015
SI-9508 fix classpaths in Eclipse configuration
@lrytz lrytz merged commit ae5f0de into scala:2.11.x Oct 15, 2015
@SethTisue
Copy link
Member

thank you @performantdata! having the Eclipse building working increases our pool of potential contributors, so we're definitely glad to have this.

@performantdata performantdata deleted the issue/9508 branch October 15, 2015 16:39
SethTisue added a commit to SethTisue/scala that referenced this pull request Oct 16, 2015
rather than attempt to resolve merge conflicts in the Eclipse config,
the log shows that I merged ae5f0de with `-s ours`. (I have invited
Mike/performantdata to submit a followup PR bringing the Eclipse stuff
into a good state on 2.12.x.)

there were no other merge conflicts.

in test/junit/scala/collection/mutable/OpenHashMapTest.scala I had to
make the following change to fix a test failure:
-    val field = m.getClass.getDeclaredField("scala$collection$mutable$OpenHashMap$$deleted")
+    val field = m.getClass.getDeclaredField("deleted")

% git log --decorate --oneline -1 origin/2.11.x | cat
ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request scala#4791 from performantdata/issue/9508
% git log --decorate --oneline -1 origin/2.12.x | cat
c99e53e (HEAD -> 2.12.x, origin/2.12.x) Merge pull request scala#4797 from lrytz/M3-versions
% export MB=$(git merge-base 2.12.x origin/2.11.x)
% echo $MB
42cafa2
% git checkout -b merge-2.11-to-2.12-oct-16
Switched to a new branch 'merge-2.11-to-2.12-oct-16'
% git log --graph --oneline --decorate $MB...origin/2.11.x | cat
*   ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request scala#4791 from performantdata/issue/9508
|\
| * 08dca37 (origin/pull/4791) SI-9508 fix classpaths in Eclipse configuration
* |   fe76232 Merge pull request scala#4798 from performantdata/issue/9513
|\ \
| * | 9c97a7f (origin/pull/4798) Suppress unneeded import.
| * | 30d704d Document some OpenHashMap internal methods.
| * | 1fb32fc SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reused
| |/
* |   14f875c Merge pull request scala#4788 from dk14/patch-1
|\ \
| * | 42acd55 (origin/pull/4788) explicitly specify insertion-order feature in docs
|  /
* |   68ce049 Merge pull request scala#4771 from som-snytt/issue/9492-here
|\ \
| * | f290962 (origin/pull/4771) SI-9492 Line trimming paste
| * | bc3589d SI-9492 REPL paste here doc
|  /
* |   9834fc8 Merge pull request scala#4610 from todesking/spec-implicits-remove-obsolete
|\ \
| * | 46009b1 (origin/pull/4610) Add view/context-bound parameter ordering rule
| * | 6eba305 Spec: Implicit parameters with context/view bound is allowed since 2.10
|  /
* |   d792e35 Merge pull request scala#4789 from janekdb/2.11.x-param-names-predicates-operations
|\ \
| |/
|/|
| * b19a07e (origin/pull/4789) Rename forall, exists and find predicate and operator params.
|/
*   648c7a1 Merge pull request scala#4790 from SethTisue/issue/9501
|\
| * 40d12f1 (origin/pull/4790) SI-9501 link README to Scala Hacker Guide
* e0b5891 Merge pull request scala#4786 from performantdata/issue/9506
* 39acad8 (origin/pull/4786) SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs
* 74dc364 SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs
% git merge fe76232
Auto-merging src/repl/scala/tools/nsc/interpreter/ILoop.scala
Auto-merging src/library/scala/util/Either.scala
Auto-merging src/library/scala/runtime/Tuple3Zipped.scala
Auto-merging src/library/scala/runtime/Tuple2Zipped.scala
Auto-merging src/library/scala/collection/parallel/ParIterableLike.scala
Auto-merging src/library/scala/collection/immutable/ListMap.scala
Auto-merging src/library/scala/collection/TraversableLike.scala
Auto-merging README.md
Merge made by the 'recursive' strategy.
 README.md                                                   | 11 +++++++-
 spec/07-implicits.md                                        | 12 +++++++--
 src/eclipse/interactive/.gitignore                          |  2 ++
 src/eclipse/partest/.gitignore                              |  2 ++
 src/eclipse/reflect/.gitignore                              |  2 ++
 src/eclipse/repl/.gitignore                                 |  2 ++
 src/eclipse/scala-compiler/.gitignore                       |  2 ++
 src/eclipse/scala-library/.gitignore                        |  2 ++
 src/eclipse/scaladoc/.gitignore                             |  2 ++
 src/eclipse/scalap/.gitignore                               |  2 ++
 src/eclipse/test-junit/.gitignore                           |  2 ++
 src/library/scala/collection/GenTraversableOnce.scala       | 23 ++++++++++++++---
 src/library/scala/collection/TraversableLike.scala          |  2 +-
 src/library/scala/collection/immutable/ListMap.scala        |  2 +-
 src/library/scala/collection/immutable/RedBlackTree.scala   |  4 +--
 src/library/scala/collection/immutable/Set.scala            | 74 ++++++++++++++++++++++++++---------------------------
 src/library/scala/collection/mutable/OpenHashMap.scala      | 19 +++++++++++++-
 src/library/scala/collection/parallel/ParIterableLike.scala | 18 ++++++-------
 src/library/scala/runtime/Tuple2Zipped.scala                |  8 +++---
 src/library/scala/runtime/Tuple3Zipped.scala                |  8 +++---
 src/library/scala/util/Either.scala                         | 12 ++++-----
 src/repl/scala/tools/nsc/interpreter/ILoop.scala            | 51 ++++++++++++++++++++++++------------
 src/repl/scala/tools/nsc/interpreter/ReplProps.scala        |  2 ++
 test/files/run/repl-paste-5.check                           | 28 ++++++++++++++++++++
 test/files/run/repl-paste-5.scala                           | 18 +++++++++++++
 test/junit/scala/collection/mutable/OpenHashMapTest.scala   | 42 ++++++++++++++++++++++++++++++
 26 files changed, 264 insertions(+), 88 deletions(-)
 create mode 100644 src/eclipse/interactive/.gitignore
 create mode 100644 src/eclipse/partest/.gitignore
 create mode 100644 src/eclipse/reflect/.gitignore
 create mode 100644 src/eclipse/repl/.gitignore
 create mode 100644 src/eclipse/scala-compiler/.gitignore
 create mode 100644 src/eclipse/scala-library/.gitignore
 create mode 100644 src/eclipse/scaladoc/.gitignore
 create mode 100644 src/eclipse/scalap/.gitignore
 create mode 100644 src/eclipse/test-junit/.gitignore
 create mode 100644 test/files/run/repl-paste-5.check
 create mode 100644 test/files/run/repl-paste-5.scala
 create mode 100644 test/junit/scala/collection/mutable/OpenHashMapTest.scala
% git merge -s ours ae5f0de
Merge made by the 'ours' strategy.
SethTisue added a commit to SethTisue/scala that referenced this pull request Oct 16, 2015
ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request scala#4791 from performantdata/issue/9508
% git log --decorate --oneline -1 origin/2.12.x | cat
c99e53e (HEAD -> 2.12.x, origin/2.12.x) Merge pull request scala#4797 from lrytz/M3-versions
% export MB=$(git merge-base 2.12.x origin/2.11.x)
% echo $MB
42cafa2
% git log --graph --oneline --decorate $MB...origin/2.11.x | cat
*   ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request scala#4791 from performantdata/issue/9508
|\
| * 08dca37 (origin/pull/4791) SI-9508 fix classpaths in Eclipse configuration
* |   fe76232 Merge pull request scala#4798 from performantdata/issue/9513
|\ \
| * | 9c97a7f (origin/pull/4798) Suppress unneeded import.
| * | 30d704d Document some OpenHashMap internal methods.
| * | 1fb32fc SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reused
| |/
* |   14f875c Merge pull request scala#4788 from dk14/patch-1
|\ \
| * | 42acd55 (origin/pull/4788) explicitly specify insertion-order feature in docs
|  /
* |   68ce049 Merge pull request scala#4771 from som-snytt/issue/9492-here
|\ \
| * | f290962 (origin/pull/4771) SI-9492 Line trimming paste
| * | bc3589d SI-9492 REPL paste here doc
|  /
* |   9834fc8 Merge pull request scala#4610 from todesking/spec-implicits-remove-obsolete
|\ \
| * | 46009b1 (origin/pull/4610) Add view/context-bound parameter ordering rule
| * | 6eba305 Spec: Implicit parameters with context/view bound is allowed since 2.10
|  /
* |   d792e35 Merge pull request scala#4789 from janekdb/2.11.x-param-names-predicates-operations
|\ \
| |/
|/|
| * b19a07e (origin/pull/4789) Rename forall, exists and find predicate and operator params.
|/
*   648c7a1 Merge pull request scala#4790 from SethTisue/issue/9501
|\
| * 40d12f1 (origin/pull/4790) SI-9501 link README to Scala Hacker Guide
* e0b5891 Merge pull request scala#4786 from performantdata/issue/9506
* 39acad8 (origin/pull/4786) SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs
* 74dc364 SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs
% git merge ae5f0de
Auto-merging src/repl/scala/tools/nsc/interpreter/ILoop.scala
Auto-merging src/library/scala/util/Either.scala
Auto-merging src/library/scala/runtime/Tuple3Zipped.scala
Auto-merging src/library/scala/runtime/Tuple2Zipped.scala
Auto-merging src/library/scala/collection/parallel/ParIterableLike.scala
Auto-merging src/library/scala/collection/immutable/ListMap.scala
Auto-merging src/library/scala/collection/TraversableLike.scala
Auto-merging src/eclipse/test-junit/.classpath
CONFLICT (content): Merge conflict in src/eclipse/test-junit/.classpath
Auto-merging src/eclipse/scaladoc/.classpath
CONFLICT (content): Merge conflict in src/eclipse/scaladoc/.classpath
Auto-merging src/eclipse/scala-compiler/.classpath
Auto-merging src/eclipse/repl/.classpath
CONFLICT (content): Merge conflict in src/eclipse/repl/.classpath
Auto-merging src/eclipse/partest/.classpath
CONFLICT (content): Merge conflict in src/eclipse/partest/.classpath
Auto-merging src/eclipse/interactive/.classpath
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.
% git checkout --ours src/eclipse/partest/.classpath
% git checkout --ours src/eclipse/repl/.classpath
% git checkout --ours src/eclipse/scaladoc/.classpath
% git checkout --ours src/eclipse/test-junit/.classpath
% git add -u
% emacs test/junit/scala/collection/mutable/OpenHashMapTest.scala
% git diff test/junit/scala/collection/mutable/OpenHashMapTest.scala | cat
...
-    val field = m.getClass.getDeclaredField("scala$collection$mutable$OpenHashMap$$deleted")
+    val field = m.getClass.getDeclaredField("deleted")
...
% git add -u
SethTisue added a commit to SethTisue/scala that referenced this pull request Oct 16, 2015
there were merge conflicts in the Eclipse config that I resolved with
--ours.  I invite @performantdata to submit a followup PR bringing the
Eclipse stuff into a good state on 2.12.x.

there was a test failure in
test/junit/scala/collection/mutable/OpenHashMapTest.scala
due to the 2.12 compiler emitting the field backing a
private var differently (with an unmangled name).  Lukas
says the difference is expected, so I just updated the
code in the test.

there were no other merge conflicts.

% git log --decorate --oneline -1 origin/2.11.x | cat
ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request scala#4791 from performantdata/issue/9508
% git log --decorate --oneline -1 origin/2.12.x | cat
c99e53e (HEAD -> 2.12.x, origin/2.12.x) Merge pull request scala#4797 from lrytz/M3-versions
% export MB=$(git merge-base 2.12.x origin/2.11.x)
% echo $MB
42cafa2
% git log --graph --oneline --decorate $MB...origin/2.11.x | cat
*   ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request scala#4791 from performantdata/issue/9508
|\
| * 08dca37 (origin/pull/4791) SI-9508 fix classpaths in Eclipse configuration
* |   fe76232 Merge pull request scala#4798 from performantdata/issue/9513
|\ \
| * | 9c97a7f (origin/pull/4798) Suppress unneeded import.
| * | 30d704d Document some OpenHashMap internal methods.
| * | 1fb32fc SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reused
| |/
* |   14f875c Merge pull request scala#4788 from dk14/patch-1
|\ \
| * | 42acd55 (origin/pull/4788) explicitly specify insertion-order feature in docs
|  /
* |   68ce049 Merge pull request scala#4771 from som-snytt/issue/9492-here
|\ \
| * | f290962 (origin/pull/4771) SI-9492 Line trimming paste
| * | bc3589d SI-9492 REPL paste here doc
|  /
* |   9834fc8 Merge pull request scala#4610 from todesking/spec-implicits-remove-obsolete
|\ \
| * | 46009b1 (origin/pull/4610) Add view/context-bound parameter ordering rule
| * | 6eba305 Spec: Implicit parameters with context/view bound is allowed since 2.10
|  /
* |   d792e35 Merge pull request scala#4789 from janekdb/2.11.x-param-names-predicates-operations
|\ \
| |/
|/|
| * b19a07e (origin/pull/4789) Rename forall, exists and find predicate and operator params.
|/
*   648c7a1 Merge pull request scala#4790 from SethTisue/issue/9501
|\
| * 40d12f1 (origin/pull/4790) SI-9501 link README to Scala Hacker Guide
* e0b5891 Merge pull request scala#4786 from performantdata/issue/9506
* 39acad8 (origin/pull/4786) SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs
* 74dc364 SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs
% git merge ae5f0de
Auto-merging src/repl/scala/tools/nsc/interpreter/ILoop.scala
Auto-merging src/library/scala/util/Either.scala
Auto-merging src/library/scala/runtime/Tuple3Zipped.scala
Auto-merging src/library/scala/runtime/Tuple2Zipped.scala
Auto-merging src/library/scala/collection/parallel/ParIterableLike.scala
Auto-merging src/library/scala/collection/immutable/ListMap.scala
Auto-merging src/library/scala/collection/TraversableLike.scala
Auto-merging src/eclipse/test-junit/.classpath
CONFLICT (content): Merge conflict in src/eclipse/test-junit/.classpath
Auto-merging src/eclipse/scaladoc/.classpath
CONFLICT (content): Merge conflict in src/eclipse/scaladoc/.classpath
Auto-merging src/eclipse/scala-compiler/.classpath
Auto-merging src/eclipse/repl/.classpath
CONFLICT (content): Merge conflict in src/eclipse/repl/.classpath
Auto-merging src/eclipse/partest/.classpath
CONFLICT (content): Merge conflict in src/eclipse/partest/.classpath
Auto-merging src/eclipse/interactive/.classpath
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.
% git checkout --ours src/eclipse/partest/.classpath
% git checkout --ours src/eclipse/repl/.classpath
% git checkout --ours src/eclipse/scaladoc/.classpath
% git checkout --ours src/eclipse/test-junit/.classpath
% git add -u
% emacs test/junit/scala/collection/mutable/OpenHashMapTest.scala
% git diff test/junit/scala/collection/mutable/OpenHashMapTest.scala | cat
...
-    val field = m.getClass.getDeclaredField("scala$collection$mutable$OpenHashMap$$deleted")
+    val field = m.getClass.getDeclaredField("deleted")
...
% git add -u
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

Successfully merging this pull request may close these issues.

5 participants