A friend and I took a year off from work to experiment with Scala and
develop some useful tools and libraries that we could need one of
these days if we stay in love with Scala. One of these tools is a
"Scala-only" replacement for the various GNU "gettext" i18n utilities.
In a typical development environment context, this gettext tool would
notably be called at build time to compile "PO" files into .class
"translation resource files". But before this tool can be invoked, it
must itself be built first. And this tool and our end-user application
code share some common "core" code. Hence, we have identified that we
need three projects to start off: one for our common "core" code, one
for the gettext replacement utility and one for the end-user
application.
Our three projects have been defined within SBT and they compile OK
using the SBT console. Eclipse projects are created with SBT using the
command "eclipse with-sources". We then start Eclipse in an empty
workspace, and we import the three projects from their source
directory. For us, it is desirable to have these three projects opened
at the same time in Eclipse because they share a lot of stuff and must
thus be edited in parallel when changes are made.
Support for multiple projects in Eclipse with the Scala plugin seems
to be rather broken. When we started our work, we had rather few
problems, but as our code base reached few thousand lines, problems
became far more frequent. A directive "import com.xyz.core._"
specified in the application project would often be flagged as
erroneous by the Eclipse presentation compiler (red underlining), with
a reported error similar to "Object core is not a member of package
com.xyz". This is annoying because while the error is (generally) not
reported when we do a fresh clean build, it generally disables the
Intellisense-type functionality of Eclipse. This behavior would
typically disappear for a while when a "project clean" would be done,
but not always. It would be solved for "a bit longer" if the Eclipse
environment was totally zapped out and recreated from scratch:
regenerating the Eclipse project files in SBT, clearing totally the
workspace, re-importing the projects and the preferences, perform
clean build, etc. At times, an "import com.xyz.core.abc._" directive
was flagged as erroneous in a class belonging to the "com.xyz.core"
package itself. We have fooled around quite a bit to find a simple and
repeatable scenario for this issue, to no avail -- these problems seem
totally spurious. Thinking that these issues could be caused by
package objects, we removed them all, but it did not fix the problems.
For the time being, we reverted to a single-project strategy, and
Eclipse runs perfectly this way. But we will need to go back to a
multi-projects approach pretty soon, so I was wondering if these
problems have been encountered by someone else and whether there are
plans to fix them.
We are using this configuration: eclipse buildId M20110909-1335, linux
gtk and Windows, x86_64, -Xmx2048m, Scala Plugin
2.0.0.beta10-2_09-201109130916-d64e014.
> A friend and I took a year off from work to experiment with Scala and
> develop some useful tools and libraries that we could need one of
> these days if we stay in love with Scala. One of these tools is a
> "Scala-only" replacement for the various GNU "gettext" i18n utilities.
> In a typical development environment context, this gettext tool would
> notably be called at build time to compile "PO" files into .class
> "translation resource files". But before this tool can be invoked, it
> must itself be built first. And this tool and our end-user application
> code share some common "core" code. Hence, we have identified that we
> need three projects to start off: one for our common "core" code, one
> for the gettext replacement utility and one for the end-user
> application.
> Our three projects have been defined within SBT and they compile OK
> using the SBT console. Eclipse projects are created with SBT using the
> command "eclipse with-sources". We then start Eclipse in an empty
> workspace, and we import the three projects from their source
> directory. For us, it is desirable to have these three projects opened
> at the same time in Eclipse because they share a lot of stuff and must
> thus be edited in parallel when changes are made.
> Support for multiple projects in Eclipse with the Scala plugin seems
> to be rather broken. When we started our work, we had rather few
> problems, but as our code base reached few thousand lines, problems
> became far more frequent. A directive "import com.xyz.core._"
> specified in the application project would often be flagged as
> erroneous by the Eclipse presentation compiler (red underlining), with
> a reported error similar to "Object core is not a member of package
> com.xyz". This is annoying because while the error is (generally) not
> reported when we do a fresh clean build, it generally disables the
> Intellisense-type functionality of Eclipse. This behavior would
> typically disappear for a while when a "project clean" would be done,
> but not always. It would be solved for "a bit longer" if the Eclipse
> environment was totally zapped out and recreated from scratch:
> regenerating the Eclipse project files in SBT, clearing totally the
> workspace, re-importing the projects and the preferences, perform
> clean build, etc. At times, an "import com.xyz.core.abc._" directive
> was flagged as erroneous in a class belonging to the "com.xyz.core"
> package itself. We have fooled around quite a bit to find a simple and
> repeatable scenario for this issue, to no avail -- these problems seem
> totally spurious. Thinking that these issues could be caused by
> package objects, we removed them all, but it did not fix the problems.
> For the time being, we reverted to a single-project strategy, and
> Eclipse runs perfectly this way. But we will need to go back to a
> multi-projects approach pretty soon, so I was wondering if these
> problems have been encountered by someone else and whether there are
> plans to fix them.
> We are using this configuration: eclipse buildId M20110909-1335, linux
> gtk and Windows, x86_64, -Xmx2048m, Scala Plugin
> 2.0.0.beta10-2_09-201109130916-d64e014.
> As a side note, these problems have also been experienced when using > the latest nightly builds for the Scala IDE plugin. JL >[..]
These kind of problems were quite commons (for me, it was with maven in multi-project set-up) before "sbt based build manager", which should be the default in nightlies (but clearly not in 2.9).
So, perhaps you should check that in your eclipse > preferences > scala > compiler, the build manager is SBT, see:
> > As a side note, these problems have also been experienced when using
> > the latest nightly builds for the Scala IDE plugin. JL
> >[..]
> These kind of problems were quite commons (for me, it was with maven in
> multi-project set-up) before "sbt based build manager", which should be
> the default in nightlies (but clearly not in 2.9).
> So, perhaps you should check that in your eclipse > preferences > scala
> > compiler, the build manager is SBT, see:
> We have tried both SBT and Refined build managers. The problems were > experienced with both of them.
> Do you have a working multi-project setup by any chance ?
Our software is composed by several projects, most of them being maven "multi-modules" one. So, sometime there is a dozen interdependent projects open at the same time. The full code is something like 30k loc.
And since I start using SBT build manager, class dependencies are really well handled. Not to say I no more experience any problems, but they are now enough rare to accept the corresponding "refresh all project + clean all projects + wait a long time for the compilation".
thinking of that... Do you do things at the FS level, with the console, in parallel of your eclipse work ? Eclipse put in cache a bunch of things, and it quickly start to behave strangely when files in its scope are modified by other than itself. Most of the time, a "refresh (F5)" on the project is enough, sometime not.
In general, Scala IDE has been a fantastic tool for me, but I'm also
having problems with inter-project dependencies and the SBT build
manager on Beta-11. Unfortunately I haven't had the time to try to
create a small test case. It's been my experience that the SBT
developers are excellent at fixing bugs once they're identified, but I
find it hard to create these reduced test cases. I wonder if there
could be a "best practices" guide for helping IDE users help the
developers? Would it make sense to have some kind of "event-log" of
high-level user actions that could be inspected/replayed for
reproducing bugs?
In my case, I have only two projects: A and B, where B depends on A.
When I encounter an inter-project build failure, it is necessary to
first clean A and then clean B (cleaning them simultaneously doesn't
work).
Kip
On Oct 15, 10:26 am, jrlemieux <jacques.lemi...@gmail.com> wrote:
On Sun, Oct 16, 2011 at 6:40 PM, Kipton Barros <kbar...@gmail.com> wrote: > Hello,
> In general, Scala IDE has been a fantastic tool for me, but I'm also > having problems with inter-project dependencies and the SBT build > manager on Beta-11.
There is one related bug fix that may be related to this discussion (presentation compiler not being notified of changes in dependent projects):
This can lead to spurious errors in the editor (even when there are none in the Problem View -- build was successful).
> Unfortunately I haven't had the time to try to > create a small test case. It's been my experience that the SBT > developers are excellent at fixing bugs once they're identified, but I > find it hard to create these reduced test cases. I wonder if there > could be a "best practices" guide for helping IDE users help the > developers? Would it make sense to have some kind of "event-log" of > high-level user actions that could be inspected/replayed for > reproducing bugs?
You can enable 'build-manager-debug' for your project, in the advanced compiler settings. Also, run Eclipse from the command line, and you'll see lots of printed output. That can help us debug what's going on. Ideally, you'd close all projects except the ones involved in the problems you're seeing (otherwise the output is too large).
iulian
> In my case, I have only two projects: A and B, where B depends on A. > When I encounter an inter-project build failure, it is necessary to > first clean A and then clean B (cleaning them simultaneously doesn't > work).
> Kip
> On Oct 15, 10:26 am, jrlemieux <jacques.lemi...@gmail.com> wrote:
>> Support for multiple projects in Eclipse with the Scala plugin seems >> to be rather broken.
-- « Je déteste la montagne, ça cache le paysage » Alphonse Allais
Since a multi-projects configuration does not seem well supported yet,
we will simply stick to a single-project configuration for the time
being.
We are looking forward for the day when Scala development will be
fully supported in Eclipse. This landmark will notably allow Scala
enthusiasts to start evangelizing their comrades, workplaces and
clients.
Many thanks again and all the very best!
JL
On 17 oct, 04:50, iulian dragos <jagua...@gmail.com> wrote:
> On Sun, Oct 16, 2011 at 6:40 PM, Kipton Barros <kbar...@gmail.com> wrote:
> > Hello,
> > In general, Scala IDE has been a fantastic tool for me, but I'm also
> > having problems with inter-project dependencies and the SBT build
> > manager on Beta-11.
> There is one related bug fix that may be related to this discussion
> (presentation compiler not being notified of changes in dependent
> projects):
> This can lead to spurious errors in the editor (even when there are
> none in the Problem View -- build was successful).
> > Unfortunately I haven't had the time to try to
> > create a small test case. It's been my experience that the SBT
> > developers are excellent at fixing bugs once they're identified, but I
> > find it hard to create these reduced test cases. I wonder if there
> > could be a "best practices" guide for helping IDE users help the
> > developers? Would it make sense to have some kind of "event-log" of
> > high-level user actions that could be inspected/replayed for
> > reproducing bugs?
> You can enable 'build-manager-debug' for your project, in the advanced
> compiler settings. Also, run Eclipse from the command line, and you'll
> see lots of printed output. That can help us debug what's going on.
> Ideally, you'd close all projects except the ones involved in the
> problems you're seeing (otherwise the output is too large).
> iulian
> > In my case, I have only two projects: A and B, where B depends on A.
> > When I encounter an inter-project build failure, it is necessary to
> > first clean A and then clean B (cleaning them simultaneously doesn't
> > work).
> > Kip
> > On Oct 15, 10:26 am, jrlemieux <jacques.lemi...@gmail.com> wrote:
> >> Support for multiple projects in Eclipse with the Scala plugin seems
> >> to be rather broken.
> --
> « Je déteste la montagne, ça cache le paysage »
> Alphonse Allais
> Since a multi-projects configuration does not seem well supported yet, > we will simply stick to a single-project configuration for the time > being.
> We are looking forward for the day when Scala development will be > fully supported in Eclipse. This landmark will notably allow Scala > enthusiasts to start evangelizing their comrades, workplaces and > clients.
> > On Sun, Oct 16, 2011 at 6:40 PM, Kipton Barros <kbar...@gmail.com> > wrote: > > > Hello,
> > > In general, Scala IDE has been a fantastic tool for me, but I'm also > > > having problems with inter-project dependencies and the SBT build > > > manager on Beta-11.
> > There is one related bug fix that may be related to this discussion > > (presentation compiler not being notified of changes in dependent > > projects):
> > This can lead to spurious errors in the editor (even when there are > > none in the Problem View -- build was successful).
> > > Unfortunately I haven't had the time to try to > > > create a small test case. It's been my experience that the SBT > > > developers are excellent at fixing bugs once they're identified, but I > > > find it hard to create these reduced test cases. I wonder if there > > > could be a "best practices" guide for helping IDE users help the > > > developers? Would it make sense to have some kind of "event-log" of > > > high-level user actions that could be inspected/replayed for > > > reproducing bugs?
> > You can enable 'build-manager-debug' for your project, in the advanced > > compiler settings. Also, run Eclipse from the command line, and you'll > > see lots of printed output. That can help us debug what's going on. > > Ideally, you'd close all projects except the ones involved in the > > problems you're seeing (otherwise the output is too large).
> > iulian
> > > In my case, I have only two projects: A and B, where B depends on A. > > > When I encounter an inter-project build failure, it is necessary to > > > first clean A and then clean B (cleaning them simultaneously doesn't > > > work).
> > > Kip
> > > On Oct 15, 10:26 am, jrlemieux <jacques.lemi...@gmail.com> wrote:
> > >> Support for multiple projects in Eclipse with the Scala plugin seems > > >> to be rather broken.
> > -- > > « Je déteste la montagne, ça cache le paysage » > > Alphonse Allais
On Mon, Oct 17, 2011 at 6:32 PM, jrlemieux <jacques.lemi...@gmail.com> wrote: > OK, many thanks to all of you.
> Since a multi-projects configuration does not seem well supported yet, > we will simply stick to a single-project configuration for the time > being.
It would be so much better if you could take the time to check if the ticket I mentioned is indeed the one causing the problems (especially since the ticket is fixed in the nightly builds). Any bug report that is 'actionable' (meaning it has a reproducible sequence) will clearly help the IDE more than reverting back to what works.
> We are looking forward for the day when Scala development will be > fully supported in Eclipse. This landmark will notably allow Scala > enthusiasts to start evangelizing their comrades, workplaces and > clients.
See above what you can do to help speed things up!
>> On Sun, Oct 16, 2011 at 6:40 PM, Kipton Barros <kbar...@gmail.com> wrote: >> > Hello,
>> > In general, Scala IDE has been a fantastic tool for me, but I'm also >> > having problems with inter-project dependencies and the SBT build >> > manager on Beta-11.
>> There is one related bug fix that may be related to this discussion >> (presentation compiler not being notified of changes in dependent >> projects):
>> This can lead to spurious errors in the editor (even when there are >> none in the Problem View -- build was successful).
>> > Unfortunately I haven't had the time to try to >> > create a small test case. It's been my experience that the SBT >> > developers are excellent at fixing bugs once they're identified, but I >> > find it hard to create these reduced test cases. I wonder if there >> > could be a "best practices" guide for helping IDE users help the >> > developers? Would it make sense to have some kind of "event-log" of >> > high-level user actions that could be inspected/replayed for >> > reproducing bugs?
>> You can enable 'build-manager-debug' for your project, in the advanced >> compiler settings. Also, run Eclipse from the command line, and you'll >> see lots of printed output. That can help us debug what's going on. >> Ideally, you'd close all projects except the ones involved in the >> problems you're seeing (otherwise the output is too large).
>> iulian
>> > In my case, I have only two projects: A and B, where B depends on A. >> > When I encounter an inter-project build failure, it is necessary to >> > first clean A and then clean B (cleaning them simultaneously doesn't >> > work).
>> > Kip
>> > On Oct 15, 10:26 am, jrlemieux <jacques.lemi...@gmail.com> wrote:
>> >> Support for multiple projects in Eclipse with the Scala plugin seems >> >> to be rather broken.
>> -- >> « Je déteste la montagne, ça cache le paysage » >> Alphonse Allais
-- « Je déteste la montagne, ça cache le paysage » Alphonse Allais
I've submitted the bug report in the ticket. I've updated to the
latest Scala IDE 2.0.x Scala 2.9.2 SNAPSHOT nightly and could nott
reproduce the issue. After the necessary edits the error markers
disappeared both from the package explorer and from the editor as
expected.
Thank you,
Szabolcs
On Oct 18, 9:56 am, iulian dragos <jagua...@gmail.com> wrote:
> On Mon, Oct 17, 2011 at 6:32 PM, jrlemieux <jacques.lemi...@gmail.com> wrote:
> > OK, many thanks to all of you.
> > Since a multi-projects configuration does not seem well supported yet,
> > we will simply stick to a single-project configuration for the time
> > being.
> It would be so much better if you could take the time to check if the
> ticket I mentioned is indeed the one causing the problems (especially
> since the ticket is fixed in the nightly builds). Any bug report that
> is 'actionable' (meaning it has a reproducible sequence) will clearly
> help the IDE more than reverting back to what works.
> > We are looking forward for the day when Scala development will be
> > fully supported in Eclipse. This landmark will notably allow Scala
> > enthusiasts to start evangelizing their comrades, workplaces and
> > clients.
> See above what you can do to help speed things up!
> >> On Sun, Oct 16, 2011 at 6:40 PM, Kipton Barros <kbar...@gmail.com> wrote:
> >> > Hello,
> >> > In general, Scala IDE has been a fantastic tool for me, but I'm also
> >> > having problems with inter-project dependencies and the SBT build
> >> > manager on Beta-11.
> >> There is one related bug fix that may be related to this discussion
> >> (presentation compiler not being notified of changes in dependent
> >> projects):
> >> This can lead to spurious errors in the editor (even when there are
> >> none in the Problem View -- build was successful).
> >> > Unfortunately I haven't had the time to try to
> >> > create a small test case. It's been my experience that the SBT
> >> > developers are excellent at fixing bugs once they're identified, but I
> >> > find it hard to create these reduced test cases. I wonder if there
> >> > could be a "best practices" guide for helping IDE users help the
> >> > developers? Would it make sense to have some kind of "event-log" of
> >> > high-level user actions that could be inspected/replayed for
> >> > reproducing bugs?
> >> You can enable 'build-manager-debug' for your project, in the advanced
> >> compiler settings. Also, run Eclipse from the command line, and you'll
> >> see lots of printed output. That can help us debug what's going on.
> >> Ideally, you'd close all projects except the ones involved in the
> >> problems you're seeing (otherwise the output is too large).
> >> iulian
> >> > In my case, I have only two projects: A and B, where B depends on A.
> >> > When I encounter an inter-project build failure, it is necessary to
> >> > first clean A and then clean B (cleaning them simultaneously doesn't
> >> > work).
> >> > Kip
> >> > On Oct 15, 10:26 am, jrlemieux <jacques.lemi...@gmail.com> wrote:
> >> >> Support for multiple projects in Eclipse with the Scala plugin seems
> >> >> to be rather broken.
> >> --
> >> « Je déteste la montagne, ça cache le paysage »
> >> Alphonse Allais
> --
> « Je déteste la montagne, ça cache le paysage »
> Alphonse Allais
On Fri, Oct 21, 2011 at 2:58 PM, Póta Szabolcs <szabolcs.p...@gmail.com> wrote: > Hi Iulian,
> I've submitted the bug report in the ticket. I've updated to the > latest Scala IDE 2.0.x Scala 2.9.2 SNAPSHOT nightly and could nott > reproduce the issue. After the necessary edits the error markers > disappeared both from the package explorer and from the editor as > expected.
> On Oct 18, 9:56 am, iulian dragos <jagua...@gmail.com> wrote: >> On Mon, Oct 17, 2011 at 6:32 PM, jrlemieux <jacques.lemi...@gmail.com> wrote: >> > OK, many thanks to all of you.
>> > Since a multi-projects configuration does not seem well supported yet, >> > we will simply stick to a single-project configuration for the time >> > being.
>> It would be so much better if you could take the time to check if the >> ticket I mentioned is indeed the one causing the problems (especially >> since the ticket is fixed in the nightly builds). Any bug report that >> is 'actionable' (meaning it has a reproducible sequence) will clearly >> help the IDE more than reverting back to what works.
>> > We are looking forward for the day when Scala development will be >> > fully supported in Eclipse. This landmark will notably allow Scala >> > enthusiasts to start evangelizing their comrades, workplaces and >> > clients.
>> See above what you can do to help speed things up!
>> >> On Sun, Oct 16, 2011 at 6:40 PM, Kipton Barros <kbar...@gmail.com> wrote: >> >> > Hello,
>> >> > In general, Scala IDE has been a fantastic tool for me, but I'm also >> >> > having problems with inter-project dependencies and the SBT build >> >> > manager on Beta-11.
>> >> There is one related bug fix that may be related to this discussion >> >> (presentation compiler not being notified of changes in dependent >> >> projects):
>> >> This can lead to spurious errors in the editor (even when there are >> >> none in the Problem View -- build was successful).
>> >> > Unfortunately I haven't had the time to try to >> >> > create a small test case. It's been my experience that the SBT >> >> > developers are excellent at fixing bugs once they're identified, but I >> >> > find it hard to create these reduced test cases. I wonder if there >> >> > could be a "best practices" guide for helping IDE users help the >> >> > developers? Would it make sense to have some kind of "event-log" of >> >> > high-level user actions that could be inspected/replayed for >> >> > reproducing bugs?
>> >> You can enable 'build-manager-debug' for your project, in the advanced >> >> compiler settings. Also, run Eclipse from the command line, and you'll >> >> see lots of printed output. That can help us debug what's going on. >> >> Ideally, you'd close all projects except the ones involved in the >> >> problems you're seeing (otherwise the output is too large).
>> >> iulian
>> >> > In my case, I have only two projects: A and B, where B depends on A. >> >> > When I encounter an inter-project build failure, it is necessary to >> >> > first clean A and then clean B (cleaning them simultaneously doesn't >> >> > work).
>> >> > Kip
>> >> > On Oct 15, 10:26 am, jrlemieux <jacques.lemi...@gmail.com> wrote:
>> >> >> Support for multiple projects in Eclipse with the Scala plugin seems >> >> >> to be rather broken.
>> >> -- >> >> « Je déteste la montagne, ça cache le paysage » >> >> Alphonse Allais
>> -- >> « Je déteste la montagne, ça cache le paysage » >> Alphonse Allais
-- « Je déteste la montagne, ça cache le paysage » Alphonse Allais