This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Contributing to scala library

15 replies
Rüdiger Klaehn
Joined: 2009-06-02,
User offline. Last seen 42 years 45 weeks ago.

Hi all,

I would like to contribute a small change to the scala library.
Specifically, some tiny one-liners in
scala.collection.immutable.HashMap to increase the amount of
structural sharing. See https://issues.scala-lang.org/browse/SI-5139.
The code I want to submit is already attached to the SI.

1. Is there a howto for contributing to scala-library? I did not find
anything with a short search

2. Which is the proper google group to ask questions when I run into
trouble? scala-user? scala-language? Or an IRC channel?

best regards,

Rüdiger

Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Contributing to scala library
Hallo Rüdiger,

1. Is there a howto for contributing to scala-library? I did not find
anything with a short search

first of all you need to sign some contributor agreement. (http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf)
After that, forking Scala on GitHub and creating a pull request is the way to go. (http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf)

2. Which is the proper google group to ask questions when I run into
trouble? scala-user? scala-language? Or an IRC channel?

Probably the IRC channel. When hacking the internals use scala-internals, otherwise scala-language/user is great.

Grüße,

Simon
Rüdiger Klaehn
Joined: 2009-06-02,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Contributing to scala library
On Sat, Feb 4, 2012 at 5:55 PM, Simon Ochsenreither <simon.ochsenreither@googlemail.com> wrote:
Hallo Rüdiger,

1. Is there a howto for contributing to scala-library? I did not find
anything with a short search

first of all you need to sign some contributor agreement. (http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf)

I saw that. I will sign it as soon as I get home.
 
After that, forking Scala on GitHub and creating a pull request is the way to go. (http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf)
I have already forked scala, cloned the fork and built it. I ran the test suite before doing any changes, but I got some failed tests (see below). Is there any guide to the test suite? I just want to run tests related to scala.collection.immutable.HashMap and not all of them to validate a change.

 
2. Which is the proper google group to ask questions when I run into
trouble? scala-user? scala-language? Or an IRC channel?

Probably the IRC channel. When hacking the internals use scala-internals, otherwise scala-language/user is great.

OK. Thanks.

---

BUILD FAILED
/home/rudi/scala/build.xml:1689: java.lang.RuntimeException: Test suite finished with 79 cases failing:
/home/rudi/scala/test/files/pos/t1745 [FAILED]
/home/rudi/scala/test/files/pos/t3567 [FAILED]
/home/rudi/scala/test/files/pos/t0695 [FAILED]
/home/rudi/scala/test/files/pos/t2569 [FAILED]
/home/rudi/scala/test/files/pos/t4603 [FAILED]
/home/rudi/scala/test/files/pos/t3404 [FAILED]
/home/rudi/scala/test/files/pos/t3946 [FAILED]
/home/rudi/scala/test/files/pos/t1782 [FAILED]
/home/rudi/scala/test/files/pos/t294 [FAILED]
/home/rudi/scala/test/files/pos/t3622 [FAILED]
/home/rudi/scala/test/files/pos/t2433 [FAILED]
/home/rudi/scala/test/files/pos/super [FAILED]
/home/rudi/scala/test/files/pos/ilya [FAILED]
/home/rudi/scala/test/files/pos/java-access-pos [FAILED]
/home/rudi/scala/test/files/pos/t1254 [FAILED]
/home/rudi/scala/test/files/pos/ilya2 [FAILED]
/home/rudi/scala/test/files/pos/t1232 [FAILED]
/home/rudi/scala/test/files/pos/signatures [FAILED]
/home/rudi/scala/test/files/pos/t1711 [FAILED]
/home/rudi/scala/test/files/pos/t3249 [FAILED]
/home/rudi/scala/test/files/pos/t3429 [FAILED]
/home/rudi/scala/test/files/pos/t4737 [FAILED]
/home/rudi/scala/test/files/pos/t1196 [FAILED]
/home/rudi/scala/test/files/pos/t1231 [FAILED]
/home/rudi/scala/test/files/pos/t2868 [FAILED]
/home/rudi/scala/test/files/pos/t2464 [FAILED]
/home/rudi/scala/test/files/pos/t1642 [FAILED]
/home/rudi/scala/test/files/pos/t1152 [FAILED]
/home/rudi/scala/test/files/pos/t3486 [FAILED]
/home/rudi/scala/test/files/pos/t2409 [FAILED]
/home/rudi/scala/test/files/pos/t1751 [FAILED]
/home/rudi/scala/test/files/pos/t1459 [FAILED]
/home/rudi/scala/test/files/pos/javaReadsSigs [FAILED]
/home/rudi/scala/test/files/pos/t2413 [FAILED]
/home/rudi/scala/test/files/pos/t1197 [FAILED]
/home/rudi/scala/test/files/pos/t3938 [FAILED]
/home/rudi/scala/test/files/pos/t1101 [FAILED]
/home/rudi/scala/test/files/pos/t1409 [FAILED]
/home/rudi/scala/test/files/pos/t1186 [FAILED]
/home/rudi/scala/test/files/pos/t2377 [FAILED]
/home/rudi/scala/test/files/pos/t3642 [FAILED]
/home/rudi/scala/test/files/pos/t3349 [FAILED]
/home/rudi/scala/test/files/pos/chang [FAILED]
/home/rudi/scala/test/files/pos/t1102 [FAILED]
/home/rudi/scala/test/files/pos/t3521 [FAILED]
/home/rudi/scala/test/files/pos/t4402 [FAILED]
/home/rudi/scala/test/files/pos/t1235 [FAILED]
/home/rudi/scala/test/files/pos/t1203 [FAILED]
/home/rudi/scala/test/files/pos/t2940 [FAILED]
/home/rudi/scala/test/files/pos/raw-map [FAILED]
/home/rudi/scala/test/files/pos/protected-static [FAILED]
/home/rudi/scala/test/files/pos/t1230 [FAILED]
/home/rudi/scala/test/files/pos/t0288 [FAILED]
/home/rudi/scala/test/files/pos/t1840 [FAILED]
/home/rudi/scala/test/files/pos/t1263 [FAILED]
/home/rudi/scala/test/files/pos/t2956 [FAILED]
/home/rudi/scala/test/files/pos/t1836 [FAILED]
/home/rudi/scala/test/files/pos/t1176 [FAILED]
/home/rudi/scala/test/files/pos/t1150 [FAILED]
/home/rudi/scala/test/files/pos/t1937 [FAILED]
/home/rudi/scala/test/files/run/t4119 [FAILED]
/home/rudi/scala/test/files/run/t1430 [FAILED]
/home/rudi/scala/test/files/run/t4891 [FAILED]
/home/rudi/scala/test/files/run/t4317 [FAILED]
/home/rudi/scala/test/files/run/t3897 [FAILED]
/home/rudi/scala/test/files/run/t4238 [FAILED]
/home/rudi/scala/test/files/jvm/t1143-2 [FAILED]
/home/rudi/scala/test/files/jvm/t2470 [FAILED]
/home/rudi/scala/test/files/jvm/t2570 [FAILED]
/home/rudi/scala/test/files/jvm/t2585 [FAILED]
/home/rudi/scala/test/files/jvm/deprecation [FAILED]
/home/rudi/scala/test/files/jvm/t3415 [FAILED]
/home/rudi/scala/test/files/jvm/t3003 [FAILED]
/home/rudi/scala/test/files/jvm/t1342 [FAILED]
/home/rudi/scala/test/files/jvm/ticket2163 [FAILED]
/home/rudi/scala/test/files/jvm/ticket4283 [FAILED]
/home/rudi/scala/test/files/jvm/t1464 [FAILED]
/home/rudi/scala/test/files/jvm/varargs [FAILED]
/home/rudi/scala/test/files/presentation/ide-bug-1000531 [FAILED]
    at scala.sys.package$.error(package.scala:27)
    at scala.tools.partest.PartestTask$$anonfun$f$1$1.apply(PartestTask.scala:372)
    at scala.tools.partest.PartestTask$$anonfun$f$1$1.apply(PartestTask.scala:372)
    at scala.tools.partest.PartestTask.execute(PartestTask.scala:381)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 43 minutes 41 seconds
Rüdiger Klaehn
Joined: 2009-06-02,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Contributing to scala library
By the way: I am using ubuntu 11.04 (I originally tried using windows, but when I saw the pull-binary-libs.sh and push-binary-libs.sh I figured that I would be better off using linux). It seems that the sun JDK is no longer available from ubuntu or partner repositories. So is it OK to use openjdk, or do I have to download and manually install the binary sun JDK packages from oracle.com?

cheers,

Rüdiger
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Re: Contributing to scala library

On Sat, Feb 4, 2012 at 15:48, Rüdiger Klaehn wrote:
> By the way: I am using ubuntu 11.04 (I originally tried using windows, but
> when I saw the pull-binary-libs.sh and push-binary-libs.sh I figured that I
> would be better off using linux). It seems that the sun JDK is no longer
> available from ubuntu or partner repositories. So is it OK to use openjdk,
> or do I have to download and manually install the binary sun JDK packages
> from oracle.com?

General guidance:

Windows: I have built Scala on Windows for a long, long time, but it
has been broken since the github move, because of the way it handles
the binary dependencies. I expect you might get it to work with
cygwin, but I don't care for cygwin, so I don't care whether that is
possible or not. ATM, I use linux to do any Scala hacking, which,
sadly, has decreased the amount of time I do it in.

Sun Java: Oracle has been pushing OpenJDK as the standard. It has
always been supported by Scala, though not on the same level. At any
rate, my Java-aware acquaintances tell me the future is OpenJDK.

Building: are you using Java 7 by any chance? If so, don't. There are
known incompatibilities between Scala's Swing and Java 7. Use Java 6
or 5 to build Scala. Also, I had to give up 32 bits Java a long time
ago -- I'm not sure it is possible to build Scala with 32 bits Java
anymore, but it was a real pain when I gave up on it.

Errors: I can build trunk without test errors, so it is definitely
possible, and you should have that working before you do anything
else. I didn't see any comments on how you are building it, so I'll
assume you tried an "ant dist" -- which is what you should do for now.
If you have no ANT_OPTS variable set, you'll see some defaults
displayed right at the beginning of the build. They don't work for me:
I have to increase mx, ss and permgen. I can successfully build Scala
with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.

Test coverage: when adding code to Scala, make sure there's a test
covering it. If there isn't any, create one. Partest divides its tests
into those that must compile (pos), those that must not compile (neg),
and other categories such as scalacheck tests, jvm tests, etc. Find
the proper category by looking over the tests in each, and see what
fits better. Most tests compare the output of the X.scala file with a
X.check file. More complex tests involving multiple files -- even
mixed java&scala projects -- are possible as well.

Do ask for help. If at all possible go to the irc #scala channel on
freenode, where you can often find people experienced with these
issues to help you along.

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: Contributing to scala library

You should be able to use msys to develop scala on windows.

The sbt build, although requiring 0.11.3-SNAPSHOT of sbt does work on windows as well.

On Feb 4, 2012 2:25 PM, "Daniel Sobral" <dcsobral@gmail.com> wrote:
On Sat, Feb 4, 2012 at 15:48, Rüdiger Klaehn <rklaehn@googlemail.com> wrote:
> By the way: I am using ubuntu 11.04 (I originally tried using windows, but
> when I saw the pull-binary-libs.sh and push-binary-libs.sh I figured that I
> would be better off using linux). It seems that the sun JDK is no longer
> available from ubuntu or partner repositories. So is it OK to use openjdk,
> or do I have to download and manually install the binary sun JDK packages
> from oracle.com?

General guidance:

Windows: I have built Scala on Windows for a long, long time, but it
has been broken since the github move, because of the way it handles
the binary dependencies. I expect you might get it to work with
cygwin, but I don't care for cygwin, so I don't care whether that is
possible or not. ATM, I use linux to do any Scala hacking, which,
sadly, has decreased the amount of time I do it in.

Sun Java: Oracle has been pushing OpenJDK as the standard. It has
always been supported by Scala, though not on the same level. At any
rate, my Java-aware acquaintances tell me the future is OpenJDK.

Building: are you using Java 7 by any chance? If so, don't. There are
known incompatibilities between Scala's Swing and Java 7. Use Java 6
or 5 to build Scala. Also, I had to give up 32 bits Java a long time
ago -- I'm not sure it is possible to build Scala with 32 bits Java
anymore, but it was a real pain when I gave up on it.

Errors: I can build trunk without test errors, so it is definitely
possible, and you should have that working before you do anything
else. I didn't see any comments on how you are building it, so I'll
assume you tried an "ant dist" -- which is what you should do for now.
If you have no ANT_OPTS variable set, you'll see some defaults
displayed right at the beginning of the build. They don't work for me:
I have to increase mx, ss and permgen. I can successfully build Scala
with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.

Test coverage: when adding code to Scala, make sure there's a test
covering it. If there isn't any, create one. Partest divides its tests
into those that must compile (pos), those that must not compile (neg),
and other categories such as scalacheck tests, jvm tests, etc. Find
the proper category by looking over the tests in each, and see what
fits better. Most tests compare the output of the X.scala file with a
X.check file. More complex tests involving multiple files -- even
mixed java&scala projects -- are possible as well.

Do ask for help. If at all possible go to the irc #scala channel on
freenode, where you can often find people experienced with these
issues to help you along.

--
Daniel C. Sobral

I travel to the future all the time.
Rüdiger Klaehn
Joined: 2009-06-02,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Contributing to scala library
On Sat, Feb 4, 2012 at 8:24 PM, Daniel Sobral <dcsobral@gmail.com> wrote:
On Sat, Feb 4, 2012 at 15:48, Rüdiger Klaehn <rklaehn@googlemail.com> wrote:
> By the way: I am using ubuntu 11.04 (I originally tried using windows, but
> when I saw the pull-binary-libs.sh and push-binary-libs.sh I figured that I
> would be better off using linux). It seems that the sun JDK is no longer
> available from ubuntu or partner repositories. So is it OK to use openjdk,
> or do I have to download and manually install the binary sun JDK packages
> from oracle.com?

General guidance:

Windows: I have built Scala on Windows for a long, long time, but it
has been broken since the github move, because of the way it handles
the binary dependencies. I expect you might get it to work with
cygwin, but I don't care for cygwin, so I don't care whether that is
possible or not. ATM, I use linux to do any Scala hacking, which,
sadly, has decreased the amount of time I do it in.

It's OK. I will use linux.
 
Sun Java: Oracle has been pushing OpenJDK as the standard. It has
always been supported by Scala, though not on the same level. At any
rate, my Java-aware acquaintances tell me the future is OpenJDK.

That was what I was told. And ubuntu does not even provide sun-jdk anymore, not even in partner repositories. But many java programs such as my favorite IDE IDEA do need sun JDK.
 
Building: are you using Java 7 by any chance? If so, don't. There are
known incompatibilities between Scala's Swing and Java 7. Use Java 6
or 5 to build Scala. Also, I had to give up 32 bits Java a long time
ago -- I'm not sure it is possible to build Scala with 32 bits Java
anymore, but it was a real pain when I gave up on it.

No. Latest version of sun java 6. (1.6.0_30). 
 
Errors: I can build trunk without test errors, so it is definitely
possible, and you should have that working before you do anything
else. I didn't see any comments on how you are building it, so I'll
assume you tried an "ant dist" -- which is what you should do for now.

I did an ant without arguments to compile everything, and then ant test.
 
If you have no ANT_OPTS variable set, you'll see some defaults
displayed right at the beginning of the build. They don't work for me:
I have to increase mx, ss and permgen. I can successfully build Scala
with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.
 
Test coverage: when adding code to Scala, make sure there's a test
covering it. If there isn't any, create one. Partest divides its tests
into those that must compile (pos), those that must not compile (neg),
and other categories such as scalacheck tests, jvm tests, etc. Find
the proper category by looking over the tests in each, and see what
fits better. Most tests compare the output of the X.scala file with a
X.check file. More complex tests involving multiple files -- even
mixed java&scala projects -- are possible as well.

Do ask for help. If at all possible go to the irc #scala channel on
freenode, where you can often find people experienced with these
issues to help you along.

OK. Thanks. I will do that. 
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Re: Contributing to scala library

On Sat, Feb 4, 2012 at 18:18, Josh Suereth wrote:
> You should be able to use msys to develop scala on windows.
>
> The sbt build, although requiring 0.11.3-SNAPSHOT of sbt does work on
> windows as well.

As long as I don't have to install unixy stuff like shells, libraries
or command line tools...

The worst thing someone can do to a Windows environment is make it
more like Unix: that's like half-karate, to quote Miyagi. You end up
with a machine that will not do what Unix does, and in which you may
be able to do thing that won't work at all on 99% of the Windows
machines on the planet.

Pre-github there were two things I needed to get a Scala build
running: ant and java. Now, I don't object to that not working
anymore, but anything beyond ant+java or sbt+java means it doesn't
work on Windows, and let's not tell people otherwise.

>
> On Feb 4, 2012 2:25 PM, "Daniel Sobral" wrote:
>>
>> On Sat, Feb 4, 2012 at 15:48, Rüdiger Klaehn
>> wrote:
>> > By the way: I am using ubuntu 11.04 (I originally tried using windows,
>> > but
>> > when I saw the pull-binary-libs.sh and push-binary-libs.sh I figured
>> > that I
>> > would be better off using linux). It seems that the sun JDK is no longer
>> > available from ubuntu or partner repositories. So is it OK to use
>> > openjdk,
>> > or do I have to download and manually install the binary sun JDK
>> > packages
>> > from oracle.com?
>>
>> General guidance:
>>
>> Windows: I have built Scala on Windows for a long, long time, but it
>> has been broken since the github move, because of the way it handles
>> the binary dependencies. I expect you might get it to work with
>> cygwin, but I don't care for cygwin, so I don't care whether that is
>> possible or not. ATM, I use linux to do any Scala hacking, which,
>> sadly, has decreased the amount of time I do it in.
>>
>> Sun Java: Oracle has been pushing OpenJDK as the standard. It has
>> always been supported by Scala, though not on the same level. At any
>> rate, my Java-aware acquaintances tell me the future is OpenJDK.
>>
>> Building: are you using Java 7 by any chance? If so, don't. There are
>> known incompatibilities between Scala's Swing and Java 7. Use Java 6
>> or 5 to build Scala. Also, I had to give up 32 bits Java a long time
>> ago -- I'm not sure it is possible to build Scala with 32 bits Java
>> anymore, but it was a real pain when I gave up on it.
>>
>> Errors: I can build trunk without test errors, so it is definitely
>> possible, and you should have that working before you do anything
>> else. I didn't see any comments on how you are building it, so I'll
>> assume you tried an "ant dist" -- which is what you should do for now.
>> If you have no ANT_OPTS variable set, you'll see some defaults
>> displayed right at the beginning of the build. They don't work for me:
>> I have to increase mx, ss and permgen. I can successfully build Scala
>> with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.
>>
>> Test coverage: when adding code to Scala, make sure there's a test
>> covering it. If there isn't any, create one. Partest divides its tests
>> into those that must compile (pos), those that must not compile (neg),
>> and other categories such as scalacheck tests, jvm tests, etc. Find
>> the proper category by looking over the tests in each, and see what
>> fits better. Most tests compare the output of the X.scala file with a
>> X.check file. More complex tests involving multiple files -- even
>> mixed java&scala projects -- are possible as well.
>>
>> Do ask for help. If at all possible go to the irc #scala channel on
>> freenode, where you can often find people experienced with these
>> issues to help you along.
>>
>> --
>> Daniel C. Sobral
>>
>> I travel to the future all the time.

rytz
Joined: 2008-07-01,
User offline. Last seen 45 weeks 5 days ago.
Re: Re: Contributing to scala library


On Sat, Feb 4, 2012 at 22:09, Daniel Sobral <dcsobral@gmail.com> wrote:
On Sat, Feb 4, 2012 at 18:18, Josh Suereth <joshua.suereth@gmail.com> wrote:
> You should be able to use msys to develop scala on windows.
>
> The sbt build, although requiring 0.11.3-SNAPSHOT of sbt does work on
> windows as well.

As long as I don't have to install unixy stuff like shells, libraries
or command line tools...

The worst thing someone can do to a Windows environment is make it
more like Unix: that's like half-karate, to quote Miyagi. You end up
with a machine that will not do what Unix does, and in which you may
be able to do thing that won't work at all on 99% of the Windows
machines on the planet.

Pre-github there were two things I needed to get a Scala build
running: ant and java. Now, I don't object to that not working
anymore, but anything beyond ant+java or sbt+java means it doesn't
work on Windows, and let's not tell people otherwise.

it works on windows+java+sbt (beta) or on windows+java+ant+cygwin.the latter is ci'd https://scala-webapps.epfl.ch/jenkins/job/scala-nightly-windows/  

>
> On Feb 4, 2012 2:25 PM, "Daniel Sobral" <dcsobral@gmail.com> wrote:
>>
>> On Sat, Feb 4, 2012 at 15:48, Rüdiger Klaehn <rklaehn@googlemail.com>
>> wrote:
>> > By the way: I am using ubuntu 11.04 (I originally tried using windows,
>> > but
>> > when I saw the pull-binary-libs.sh and push-binary-libs.sh I figured
>> > that I
>> > would be better off using linux). It seems that the sun JDK is no longer
>> > available from ubuntu or partner repositories. So is it OK to use
>> > openjdk,
>> > or do I have to download and manually install the binary sun JDK
>> > packages
>> > from oracle.com?
>>
>> General guidance:
>>
>> Windows: I have built Scala on Windows for a long, long time, but it
>> has been broken since the github move, because of the way it handles
>> the binary dependencies. I expect you might get it to work with
>> cygwin, but I don't care for cygwin, so I don't care whether that is
>> possible or not. ATM, I use linux to do any Scala hacking, which,
>> sadly, has decreased the amount of time I do it in.
>>
>> Sun Java: Oracle has been pushing OpenJDK as the standard. It has
>> always been supported by Scala, though not on the same level. At any
>> rate, my Java-aware acquaintances tell me the future is OpenJDK.
>>
>> Building: are you using Java 7 by any chance? If so, don't. There are
>> known incompatibilities between Scala's Swing and Java 7. Use Java 6
>> or 5 to build Scala. Also, I had to give up 32 bits Java a long time
>> ago -- I'm not sure it is possible to build Scala with 32 bits Java
>> anymore, but it was a real pain when I gave up on it.
>>
>> Errors: I can build trunk without test errors, so it is definitely
>> possible, and you should have that working before you do anything
>> else. I didn't see any comments on how you are building it, so I'll
>> assume you tried an "ant dist" -- which is what you should do for now.
>> If you have no ANT_OPTS variable set, you'll see some defaults
>> displayed right at the beginning of the build. They don't work for me:
>> I have to increase mx, ss and permgen. I can successfully build Scala
>> with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.
>>
>> Test coverage: when adding code to Scala, make sure there's a test
>> covering it. If there isn't any, create one. Partest divides its tests
>> into those that must compile (pos), those that must not compile (neg),
>> and other categories such as scalacheck tests, jvm tests, etc. Find
>> the proper category by looking over the tests in each, and see what
>> fits better. Most tests compare the output of the X.scala file with a
>> X.check file. More complex tests involving multiple files -- even
>> mixed java&scala projects -- are possible as well.
>>
>> Do ask for help. If at all possible go to the irc #scala channel on
>> freenode, where you can often find people experienced with these
>> issues to help you along.
>>
>> --
>> Daniel C. Sobral
>>
>> I travel to the future all the time.



--
Daniel C. Sobral

I travel to the future all the time.

Johannes Rudolph 2
Joined: 2010-02-12,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Contributing to scala library

On Sat, Feb 4, 2012 at 11:15 PM, Lukas Rytz wrote:
> it works on windows+java+sbt (beta) or on windows+java+ant+cygwin.
> the latter is ci'd
> https://scala-webapps.epfl.ch/jenkins/job/scala-nightly-windows/

Wouldn't a CI build on openjdk be also useful, then?

BTW: That's certainly no scala-user topic, moved to internals.

Rüdiger Klaehn
Joined: 2009-06-02,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Contributing to scala library
On Sat, Feb 4, 2012 at 8:24 PM, Daniel Sobral <dcsobral@gmail.com> wrote:

OK. I now tried the whole thing again using jdk1.6.0_30 (64bit). I had to adjust the ANT_OPTS variable as you suggested. The build ran through without an out of memory error, but I still get a bunch of failed tests.

As I said, I just forked the scala repository from github.com/scala/scala to my github account, then cloned it to my machine. I did not touch any code yet, so I don't really understand what I'm doing wrong.

Errors: I can build trunk without test errors, so it is definitely
possible, and you should have that working before you do anything
else. I didn't see any comments on how you are building it, so I'll
assume you tried an "ant dist" -- which is what you should do for now.
If you have no ANT_OPTS variable set, you'll see some defaults
displayed right at the beginning of the build. They don't work for me:
I have to increase mx, ss and permgen. I can successfully build Scala
with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: Contributing to scala library

I run my scala dev on both windows and Ubuntu with openjdk.  Unfortunately we do have a ton of openjdk failures that I haven't been able to isolate what the issues are. 

If all test cases relating to you feature are working, you could try that in a pull request, mentioning the issues.   Right now Paul vets all pull requests and its a tough job.  In the future we hope to have an automated build to vet pull requests and notify you of cross-jvm issues.

On Feb 5, 2012 4:41 AM, "Rüdiger Klaehn" <rklaehn@googlemail.com> wrote:
On Sat, Feb 4, 2012 at 8:24 PM, Daniel Sobral <dcsobral@gmail.com> wrote:

OK. I now tried the whole thing again using jdk1.6.0_30 (64bit). I had to adjust the ANT_OPTS variable as you suggested. The build ran through without an out of memory error, but I still get a bunch of failed tests.

As I said, I just forked the scala repository from github.com/scala/scala to my github account, then cloned it to my machine. I did not touch any code yet, so I don't really understand what I'm doing wrong.

Errors: I can build trunk without test errors, so it is definitely
possible, and you should have that working before you do anything
else. I didn't see any comments on how you are building it, so I'll
assume you tried an "ant dist" -- which is what you should do for now.
If you have no ANT_OPTS variable set, you'll see some defaults
displayed right at the beginning of the build. They don't work for me:
I have to increase mx, ss and permgen. I can successfully build Scala
with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.

Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Contributing to scala library
Unfortunately we do have a ton of openjdk failures that I haven't been able to isolate what the issues are. 

I regularly compile Scala with OpenJDK 6 and 7 without any problems ... I wonder what's the problem you're having.
Johannes Rudolph 2
Joined: 2010-02-12,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Contributing to scala library

I just tried and it seems JDK_HOME is set to the openjdk/jre directory
in my case so that javac isn't found when running the tests. Just
setting JDK_HOME correctly seems to help. Not sure if that removes all
problems, tests are still running here...

On Sun, Feb 5, 2012 at 4:58 PM, Simon Ochsenreither
wrote:
>> Unfortunately we do have a ton of openjdk failures that I haven't been
>> able to isolate what the issues are.
>
>
> I regularly compile Scala with OpenJDK 6 and 7 without any problems ... I
> wonder what's the problem you're having.

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: Contributing to scala library
That could be what it is.  I try other incantations on partest to no avail.  Perhaps just setting the environment would work.

On Sun, Feb 5, 2012 at 11:05 AM, Johannes Rudolph <johannes.rudolph@googlemail.com> wrote:
I just tried and it seems JDK_HOME is set to the openjdk/jre directory
in my case so that javac isn't found when running the tests. Just
setting JDK_HOME correctly seems to help. Not sure if that removes all
problems, tests are still running here...

On Sun, Feb 5, 2012 at 4:58 PM, Simon Ochsenreither
<simon.ochsenreither@googlemail.com> wrote:
>> Unfortunately we do have a ton of openjdk failures that I haven't been
>> able to isolate what the issues are.
>
>
> I regularly compile Scala with OpenJDK 6 and 7 without any problems ... I
> wonder what's the problem you're having.



--
Johannes

-----------------------------------------------
Johannes Rudolph
http://virtual-void.net

tolsen77
Joined: 2008-10-08,
User offline. Last seen 1 year 38 weeks ago.
Re: Re: Contributing to scala library
You can manually patch the Ant build script with https://issues.scala-lang.org/browse/SI-5296. Just pre-download http://typesafe.artifactoryonline.com/typesafe/scala-sha-bootstrap/org/scala-lang/bootstrap/943cd5c8802b2a3a64a010efb86ec19bac142e40/lib/ant/ant-contrib.jar to the /lib/ant dir and it will download the rest.

On 4 February 2012 20:24, Daniel Sobral <dcsobral@gmail.com> wrote:
On Sat, Feb 4, 2012 at 15:48, Rüdiger Klaehn <rklaehn@googlemail.com> wrote:
> By the way: I am using ubuntu 11.04 (I originally tried using windows, but
> when I saw the pull-binary-libs.sh and push-binary-libs.sh I figured that I
> would be better off using linux). It seems that the sun JDK is no longer
> available from ubuntu or partner repositories. So is it OK to use openjdk,
> or do I have to download and manually install the binary sun JDK packages
> from oracle.com?

General guidance:

Windows: I have built Scala on Windows for a long, long time, but it
has been broken since the github move, because of the way it handles
the binary dependencies. I expect you might get it to work with
cygwin, but I don't care for cygwin, so I don't care whether that is
possible or not. ATM, I use linux to do any Scala hacking, which,
sadly, has decreased the amount of time I do it in.

Sun Java: Oracle has been pushing OpenJDK as the standard. It has
always been supported by Scala, though not on the same level. At any
rate, my Java-aware acquaintances tell me the future is OpenJDK.

Building: are you using Java 7 by any chance? If so, don't. There are
known incompatibilities between Scala's Swing and Java 7. Use Java 6
or 5 to build Scala. Also, I had to give up 32 bits Java a long time
ago -- I'm not sure it is possible to build Scala with 32 bits Java
anymore, but it was a real pain when I gave up on it.

Errors: I can build trunk without test errors, so it is definitely
possible, and you should have that working before you do anything
else. I didn't see any comments on how you are building it, so I'll
assume you tried an "ant dist" -- which is what you should do for now.
If you have no ANT_OPTS variable set, you'll see some defaults
displayed right at the beginning of the build. They don't work for me:
I have to increase mx, ss and permgen. I can successfully build Scala
with a 64 bits Sun Java 6 with 1736m mx, 2m ss and 256m permgen.

Test coverage: when adding code to Scala, make sure there's a test
covering it. If there isn't any, create one. Partest divides its tests
into those that must compile (pos), those that must not compile (neg),
and other categories such as scalacheck tests, jvm tests, etc. Find
the proper category by looking over the tests in each, and see what
fits better. Most tests compare the output of the X.scala file with a
X.check file. More complex tests involving multiple files -- even
mixed java&scala projects -- are possible as well.

Do ask for help. If at all possible go to the irc #scala channel on
freenode, where you can often find people experienced with these
issues to help you along.

--
Daniel C. Sobral

I travel to the future all the time.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland