- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Scala 2.9.0 RC2
Tue, 2011-04-26, 15:42
The second release candidate of the new Scala 2.9 distribution is
now available: Scala 2.9.0 RC2 is currently available from our
Download Page at: http://www.scala-lang.org/downloads
The Scala 2.9.0 codebase includes several additions, notably the
new Parallel Collections, but it also introduces improvements on
many existing features, and contains many bug fixes.
Please help us with the testing of this release candidate, and
let us know of any issues you may detect.
The Scala 2.9.0 RC2 distribution
=====================================
This Release Candidate is made available for testing purposes
only and is not intended for production environments. We will
wait at least two weeks before issuing a final release, in
order to allow developers and testers to send us their
feedback.
What is new?
============
The new Scala 2.9 codebase includes the following new features
and changes:
Parallel Collections
====================
Every collection may be converted into a corresponding
parallel collection with the new `par` method. Parallel
collections utilize multicore processors by implementing bulk
operations such as `foreach`, `map`, `filter` etc. in
parallel. Parallel collections are located in the package
`scala.collection.parallel`.
Depending on the collection in question, `par` may require
copying the underlying dataset to create a parallel
collection. However, specific collections share their
underlying dataset with a parallel collection, making `par` a
constant time operation.
Currently available parallel collections are:
* parallel arrays -
scala.collection.parallel.mutable.ParArray
* parallel ranges -
scala.collection.parallel.immutable.ParRange
* parallel hash maps -
scala.collection.parallel.mutable.ParHashMap
* parallel hash sets -
scala.collection.parallel.mutable.ParHashSet
* parallel hash tries -
scala.collection.parallel.immutable.ParHashMap
scala.collection.parallel.immutable.ParHashSet
* parallel vectors -
scala.collection.parallel.immutable.ParVector
The method `seq` is used to convert from a parallel collection
to a corresponding sequential collection. This method is
always efficient (O(1)).
The App Trait
=============
The App trait is a safer, more powerful alternative to the
previous Application trait, which has now been deprecated. The
new recommended way to write a top-level application is like this:
object Echo extends App {
println("Echo" + (args mkString " "))
}
Objects inheriting from the old Application trait were almost as
convenient to write, but were not thread-safe and were often not
optimized by the VM, since the application’s body was execited as
part of of the object’s initialization sequence. Objects inheriting
the App trait instead make use of Scala 2.9’s delayed initialization
feature to execute the whole body as part of an inherited main
method.
Another new feature of the App scheme is that command line arguments
are now accessible via the args value (which is inherited from trait
App)
The DelayedInit Trait
=====================
The DelayedInit trait provides another tool to customize
initialization sequences of classes and objects. If a class or
object inherits from this trait, all its initialization code is
packed in a closure and forwarded as an argument to a method named
delayedInit which is defined as an abstract method in trait
DelayedInit.
Implementations of delayedInit have thus full freedom when to
execute the initialization code. For instance, Scala’s new App trait
stores all initialization sequences in an internal buffer and
executes them when the object’s main method is called. Note that
only initialization code contained in classes and objects is passed
to DelayedInit; initialization code contained in traits is not
affected.
Repl Improvements
=================
Improvements in jline, the repl input handler. More robust cursor
handling, bash-style ctrl-R history search, new commands like
:imports, :implicits, :keybindings. On platforms with the necessary
runtime support, :javap will disassemble any class including
repl-defined ones. A long-running repl command can now be
interrupted via ctrl-C without terminating the repl session.
Improved programmability: the repl classloader exposes repl-defined
classes via their given names.
Scala Runner
============
Scala code can now be executed in any of the following ways:
- scala will run the main class, similar to java -jar
- scala will run the main method of that class
- scala will run the script contents as a scala script
- scala will, if the contents are not a script, find a
single main method in a top level object and run that. This
allows the same file to be used with scalac and to be run directly.
- scala -save will create a jar file with the compiled
source, which is then reusable and can be run as scala
Java Interop
============
The @strictfp annotation is now supported.
Various fixes in JavaConverters and JavaConversions for smoother
interoperation. Primitive types and their boxed versions are now
implicitly converted bidirectionally.
Other features
==============
* Generalized try-catch-finally:
try body
catch handler
finally cleanup
Here, body and cleanup can be arbitrary expressions, and
handler can be any expression which evaluates to a valid
exception handler (which is: PartialFunction[Throwable, T]).
* New packages:
scala.sys and scala.sys.process which are imported from
sbt.Proces
* New trait:
App, a safer and more performant alternative to Application.
It now allows to access command line arguments. It relies
on another new trait, DelayedInit, which lets one capture
class initialization code in a closure.
* New methods in collections:
collectFirst, maxBy, minBy, span, inits, tails,
permutations, combinations, subsets
* AnyRef specialization:
It’s now possible to specialize on type parameters for subtypes of
AnyRef (class Foo[@specialize(AnyRef) T](arr: Array[T]) {...}),
which allows for more efficient array indexing and updates.
Plus a large number of bugfixes and performance improvements.
Fri, 2011-04-29, 13:17
#2
Re: Re: Scala 2.9.0 RC2
Hi Bill,
The problem is apparently confined to Cygwin; compiling using fsc seems
to work fine from the standard Windows shell.
I've done a few tests, and even just the underlying java invocation, by
itself, causes those messages. Something in the Cygwin environment must
be confusing fsc. The problem is not the "class broken", but actually
the NullPointerException.
Curiously, even spawning a cmd.exe from inside a Cygwin session, and
invoking fsc from there, leads to the same errors.
This issue may possibly have to do with the network communication
between compilation client and server, but it is quite difficult to tell
what sort of tricks Cygwin is playing in this case.
Please file a ticket on the Scala Trac system; you can still use fsc
from the Windows shell in the meantime.
Thanks,
Toni
Fri, 2011-04-29, 14:47
#3
Re: Re: Scala 2.9.0 RC2
I'd suspect a problem with the handling of file path separator and,
perhaps, class path separator. It may be that something is using Unix
standard -- because of Cygwin -- and something else is using Windows
standard.
On Fri, Apr 29, 2011 at 09:16, Antonio Cunei wrote:
> Hi Bill,
>
> The problem is apparently confined to Cygwin; compiling using fsc seems to
> work fine from the standard Windows shell.
>
> I've done a few tests, and even just the underlying java invocation, by
> itself, causes those messages. Something in the Cygwin environment must be
> confusing fsc. The problem is not the "class broken", but actually the
> NullPointerException.
>
> Curiously, even spawning a cmd.exe from inside a Cygwin session, and
> invoking fsc from there, leads to the same errors.
>
> This issue may possibly have to do with the network communication between
> compilation client and server, but it is quite difficult to tell what sort
> of tricks Cygwin is playing in this case.
>
> Please file a ticket on the Scala Trac system; you can still use fsc from
> the Windows shell in the meantime.
>
> Thanks,
> Toni
>
> --
> Antonio Cunei
> Scala Team, EPFL
>
>
> On 27/04/2011 22:00, Bill Lear wrote:
>>
>> I am currently using 2.8.1 and tried upgrading to 2.9.0.RC2. The fsc
>> compiler has stopped working for me. Here is my environment:
>>
>> % scala
>> Welcome to Scala version 2.9.0.RC2 (Java HotSpot(TM) Client VM, Java
>> 1.6.0_21).
>>
>> % which fsc
>> /cygdrive/c/scala-2.9.0.RC2/bin/fsc
>>
>> % which scalac
>> /cygdrive/c/scala-2.9.0.RC2/bin/scalac
>>
>> When I try fsc on a file that previously worked just fine (2.8.1), I
>> get this on first startup of fsc:
>>
>> % fsc tuple_unpack.scala
>> error: error while loading package, class file 'C:\SCALA-~1.RC2\bin\..
>> \lib\scala-library.jar(scala/package.class)' is broken
>> (class java.lang.NullPointerException)
>> error: error while loading Object, class file 'C:\Program Files\Java
>> \jdk1.6.0_21\jre\lib\rt.jar(java/lang/Object.class)' is broken
>> (class java.lang.NullPointerException)
>> error: error while loading String, class file 'C:\Program Files\Java
>> \jdk1.6.0_21\jre\lib\rt.jar(java/lang/String.class)' is broken
>> (class java.lang.NullPointerException)
>> error: error while loading package, class file 'C:\SCALA-~1.RC2\bin\..
>> \lib\scala-library.jar(scala/runtime/package.class)' is broken
>> (class java.lang.NullPointerException)
>> error: error while loading package, class file 'C:\SCALA-~1.RC2\bin\..
>> \lib\scala-library.jar(scala/collection/package.class)' is broken
>> (class java.lang.NullPointerException)
>> 5 errors found
>>
>> and nothing gets compiled. Using the scalac compiler, it works fine:
>>
>> % scalac tuple_unpack.scala
>> warning: there were 1 deprecation warnings; re-run with -deprecation
>> for details
>> one warning found
>>
>>
>
Tue, 2011-05-03, 02:37
#4
Re: Scala 2.9.0 RC2
On Apr 29, 8:44 am, Daniel Sobral wrote:
> I'd suspect a problem with the handling of file path separator and,
> perhaps, class path separator. It may be that something is using Unix
> standard -- because of Cygwin -- and something else is using Windows
> standard.
Indeed. If you want to find out what is being passed to Java, you
just need to put 'set -x' at the top of the fsc script and run it.
The output should be illuminating to whoever wrote fsc:
+ '/cygdrive/c/Program Files/Java/jdk1.6.0_21/bin/java' -Xmx256M -
Xms32M '-Xbootclasspath/a:C:/SCALA-~1.RC2/lib/jline.jar;C:/SCALA-
~1.RC2/lib/scala-compiler.jar;C:/SCALA-~1.RC2/lib/scala-dbc.jar;C:/
SCALA-~1.RC2/lib/scala-library.jar;C:/SCALA-~1.RC2/lib/scala-
swing.jar;C:/SCALA-~1.RC2/lib/scalap.jar' -Dscala.usejavacp=true -
Dscala.home=C:/SCALA-~1.RC2 -Denv.emacs= -
Djline.terminal=scala.tools.jline.UnixTerminal
scala.tools.nsc.CompileClient tuple_unpack.scala
It would be good to fix this.
Bill
Tue, 2011-05-03, 03:17
#5
Re: Re: Scala 2.9.0 RC2
Not so. If you do the same thing with scalac, you'll notice the only
difference is that's the class being invoked.
On Mon, May 2, 2011 at 22:36, Bill Lear wrote:
> On Apr 29, 8:44 am, Daniel Sobral wrote:
>> I'd suspect a problem with the handling of file path separator and,
>> perhaps, class path separator. It may be that something is using Unix
>> standard -- because of Cygwin -- and something else is using Windows
>> standard.
>
> Indeed. If you want to find out what is being passed to Java, you
> just need to put 'set -x' at the top of the fsc script and run it.
> The output should be illuminating to whoever wrote fsc:
>
> + '/cygdrive/c/Program Files/Java/jdk1.6.0_21/bin/java' -Xmx256M -
> Xms32M '-Xbootclasspath/a:C:/SCALA-~1.RC2/lib/jline.jar;C:/SCALA-
> ~1.RC2/lib/scala-compiler.jar;C:/SCALA-~1.RC2/lib/scala-dbc.jar;C:/
> SCALA-~1.RC2/lib/scala-library.jar;C:/SCALA-~1.RC2/lib/scala-
> swing.jar;C:/SCALA-~1.RC2/lib/scalap.jar' -Dscala.usejavacp=true -
> Dscala.home=C:/SCALA-~1.RC2 -Denv.emacs= -
> Djline.terminal=scala.tools.jline.UnixTerminal
> scala.tools.nsc.CompileClient tuple_unpack.scala
>
> It would be good to fix this.
>
>
> Bill
Tue, 2011-05-03, 03:27
#6
Re: Re: Scala 2.9.0 RC2
As I mentioned in my first message, the same invocation works under
CMD.EXE, but not when said CMD.EXE is called from within a Cygwin shell.
That, I suspect, points to wrapping by Cygwin of some system calls,
which happens to interfere with fsc. But I'm no Windows expert, so that
is just my guess.
Toni
On 03/05/2011 04:10, Daniel Sobral wrote:
> Not so. If you do the same thing with scalac, you'll notice the only
> difference is that's the class being invoked.
>
> On Mon, May 2, 2011 at 22:36, Bill Lear wrote:
>> On Apr 29, 8:44 am, Daniel Sobral wrote:
>>> I'd suspect a problem with the handling of file path separator and,
>>> perhaps, class path separator. It may be that something is using Unix
>>> standard -- because of Cygwin -- and something else is using Windows
>>> standard.
>>
>> Indeed. If you want to find out what is being passed to Java, you
>> just need to put 'set -x' at the top of the fsc script and run it.
>> The output should be illuminating to whoever wrote fsc:
>>
>> + '/cygdrive/c/Program Files/Java/jdk1.6.0_21/bin/java' -Xmx256M -
>> Xms32M '-Xbootclasspath/a:C:/SCALA-~1.RC2/lib/jline.jar;C:/SCALA-
>> ~1.RC2/lib/scala-compiler.jar;C:/SCALA-~1.RC2/lib/scala-dbc.jar;C:/
>> SCALA-~1.RC2/lib/scala-library.jar;C:/SCALA-~1.RC2/lib/scala-
>> swing.jar;C:/SCALA-~1.RC2/lib/scalap.jar' -Dscala.usejavacp=true -
>> Dscala.home=C:/SCALA-~1.RC2 -Denv.emacs= -
>> Djline.terminal=scala.tools.jline.UnixTerminal
>> scala.tools.nsc.CompileClient tuple_unpack.scala
>>
>> It would be good to fix this.
>>
>>
>> Bill
>
>
>
Wed, 2011-05-04, 04:48
#7
Re: Scala 2.9.0 RC2
I use cygwin on a daily basis but usually not fsc.
I can reproduce the issue too. I don't think that's cygwin specific
though as I can reproduce under cmd.exe:
C:\setup\scala\scala-2.9.0.RC2\bin>fsc.bat -d classes foo.scala
classes does not exist or is not a directory
(fsc,classes does not exist or is not a directory
fsc -help gives more information)
error: error while loading package, class file 'C:\setup\scala\SCALA-
~1.RC2\bin\
..\lib\scala-library.jar(scala/package.class)' is broken
(class java.lang.NullPointerException)
error: error while loading Object, class file 'C:\util\java\jre6\lib
\rt.jar(java
/lang/Object.class)' is broken
(class java.lang.NullPointerException)
error: error while loading package, class file 'C:\setup\scala\SCALA-
~1.RC2\bin\
..\lib\scala-library.jar(scala/runtime/package.class)' is broken
(class java.lang.NullPointerException)
error: error while loading package, class file 'C:\setup\scala\SCALA-
~1.RC2\bin\
..\lib\scala-library.jar(scala/collection/package.class)' is broken
(class java.lang.NullPointerException)
error: source file 'foo.scala' could not be found
5 errors found
I'm on Vista 32 bits. I downloaded the zip RC2 and unpacked just lib
and bin using cygwin's unzip.
I also have a Win 7 64 bits. I'll try in a bit over there to see if it
makes a difference.
Jean-Laurent
On May 2, 7:26 pm, Antonio Cunei wrote:
> As I mentioned in my first message, the same invocation works under
> CMD.EXE, but not when said CMD.EXE is called from within a Cygwin shell.
> That, I suspect, points to wrapping by Cygwin of some system calls,
> which happens to interfere with fsc. But I'm no Windows expert, so that
> is just my guess.
> Toni
Wed, 2011-05-04, 05:57
#8
Re: Scala 2.9.0 RC2
And I get the same error on Win 7, 64 bits and cmd.exe with RC3
(downloaded as zip file and exploded with the Windows explorer).
scala.bat and scalac.bat work fine. Only fsc.bat has that behavior.
On May 3, 8:39 pm, huynhjl wrote:
> I use cygwin on a daily basis but usually not fsc.
> I can reproduce the issue too. I don't think that's cygwin specific
> though as I can reproduce under cmd.exe:
>
> C:\setup\scala\scala-2.9.0.RC2\bin>fsc.bat -d classes foo.scala
> classes does not exist or is not a directory
> (fsc,classes does not exist or is not a directory
> fsc -help gives more information)
> error: error while loading package, class file 'C:\setup\scala\SCALA-
> ~1.RC2\bin\
> ..\lib\scala-library.jar(scala/package.class)' is broken
> (class java.lang.NullPointerException)
> error: error while loading Object, class file 'C:\util\java\jre6\lib
> \rt.jar(java
> /lang/Object.class)' is broken
> (class java.lang.NullPointerException)
> error: error while loading package, class file 'C:\setup\scala\SCALA-
> ~1.RC2\bin\
> ..\lib\scala-library.jar(scala/runtime/package.class)' is broken
> (class java.lang.NullPointerException)
> error: error while loading package, class file 'C:\setup\scala\SCALA-
> ~1.RC2\bin\
> ..\lib\scala-library.jar(scala/collection/package.class)' is broken
> (class java.lang.NullPointerException)
> error: source file 'foo.scala' could not be found
> 5 errors found
>
> I'm on Vista 32 bits. I downloaded the zip RC2 and unpacked just lib
> and bin using cygwin's unzip.
>
> I also have a Win 7 64 bits. I'll try in a bit over there to see if it
> makes a difference.
>
> Jean-Laurent
>
> On May 2, 7:26 pm, Antonio Cunei wrote:
>
>
>
>
>
>
>
> > As I mentioned in my first message, the same invocation works under
> > CMD.EXE, but not when said CMD.EXE is called from within a Cygwin shell.
> > That, I suspect, points to wrapping by Cygwin of some system calls,
> > which happens to interfere with fsc. But I'm no Windows expert, so that
> > is just my guess.
> > Toni
Wed, 2011-05-04, 13:47
#9
Re: Re: Scala 2.9.0 RC2 - cygwin
On 04/05/2011 05:39, huynhjl wrote:
> I use cygwin on a daily basis but usually not fsc.
> I can reproduce the issue too. I don't think that's cygwin specific
> though as I can reproduce under cmd.exe:
According to my tests, that only happens when cmd.exe is launched from
within a cygwin session. Launching "Command Prompt" from the start menu,
all works.
I narrowed the issue down to this revision:
03/28/11 01:27:05 - extempore
Trying to get fsc doing the right thing with respect
to absolute and relative paths.
https://lampsvn.epfl.ch/trac/scala/changeset/24610
Revision 24609 works fine under cygwin.
Wed, 2011-05-04, 15:17
#10
Re: Scala 2.9.0 RC2 - cygwin
Hi Antonio,
My tests shows that is also happens without having cygwin being
involved, so there is a bit of discrepancy here between your
environment and mine. I also start from the win start menu and
although cygwin is installed, I can't see any reference in session (in
the path or other environment variables). I'll file that into mystery
section.
It's good you tracked it down to a revision number.
I can also reproduce using a RC2 local build. I was actually trying to
step debug when you sent your message. This is what I had so far.
Using cygwin: ../build/quick/bin/fsc -verbose -d classes Foo.scala.
The output around when it's printing the error is:
[Port number: 58367]
[Connected to compilation daemon at port 58367]
[search path for source files: ]
[search path for class files: C:\Program Files\Java\jre6\lib
\resources.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Program Files
\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:
\Program Files\Java\jre6\lib\charsets.jar;C:\Program Files\Java
\jre6\lib\ext\dnsns.jar;C:\Program Files\Java\jre6\lib\ext
\dns_sd.jar;C:\Program Files\Java\jre6\lib\ext\localedata.jar;C:
\Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\jlh\code\scala
\HUYNHJ~1\build\quick\bin\..\classes\compiler;C:\jlh\code\scala
\HUYNHJ~1\build\quick\bin\..\classes\continuations-plugin;C:\jlh\code
\scala\HUYNHJ~1\build\quick\bin\..\classes\library;C:\jlh\code\scala
\HUYNHJ~1\build\quick\bin\..\classes\partest;C:\jlh\code\scala
\HUYNHJ~1\build\quick\bin\..\classes\scalacheck;C:\jlh\code\scala
\HUYNHJ~1\build\quick\bin\..\classes\scalap;.;C:\Program Files
(x86)\Java\jre6\lib\ext\QTJava.zip]
[loaded package loader resources.jar in 770ms]
[loaded package loader java in 1ms]
[loaded package loader lang in 12ms]
error: error while loading package, class file 'C:\jlh\code\scala
\HUYNHJ~1\build
\quick\bin\..\classes\library\scala\package.class' is broken
This happens in this loop in CompileSocket.scala (line 33):
def loop(): Boolean = in.readLine() match {
case null => noErrors
case line =>
if (isErrorMessage(line))
noErrors = false
compileSocket.echo(line)
loop()
}
Jean-Laurent
On May 4, 5:44 am, Antonio Cunei wrote:
> On 04/05/2011 05:39, huynhjl wrote:
>
> > I use cygwin on a daily basis but usually not fsc.
> > I can reproduce the issue too. I don't think that's cygwin specific
> > though as I can reproduce under cmd.exe:
>
> According to my tests, that only happens when cmd.exe is launched from
> within a cygwin session. Launching "Command Prompt" from the start menu,
> all works.
>
> I narrowed the issue down to this revision:
>
> 03/28/11 01:27:05 - extempore
> Trying to get fsc doing the right thing with respect
> to absolute and relative paths.
>
> https://lampsvn.epfl.ch/trac/scala/changeset/24610
>
> Revision 24609 works fine under cygwin.
> --
> Antonio Cunei
> Scala Team, EPFL
>
>
>
>
>
>
>
> > C:\setup\scala\scala-2.9.0.RC2\bin>fsc.bat -d classes foo.scala
> > classes does not exist or is not a directory
> > (fsc,classes does not exist or is not a directory
> > fsc -help gives more information)
> > error: error while loading package, class file 'C:\setup\scala\SCALA-
> > ~1.RC2\bin\
> > ..\lib\scala-library.jar(scala/package.class)' is broken
> > (class java.lang.NullPointerException)
> > error: error while loading Object, class file 'C:\util\java\jre6\lib
> > \rt.jar(java
> > /lang/Object.class)' is broken
> > (class java.lang.NullPointerException)
> > error: error while loading package, class file 'C:\setup\scala\SCALA-
> > ~1.RC2\bin\
> > ..\lib\scala-library.jar(scala/runtime/package.class)' is broken
> > (class java.lang.NullPointerException)
> > error: error while loading package, class file 'C:\setup\scala\SCALA-
> > ~1.RC2\bin\
> > ..\lib\scala-library.jar(scala/collection/package.class)' is broken
> > (class java.lang.NullPointerException)
> > error: source file 'foo.scala' could not be found
> > 5 errors found
Wed, 2011-05-04, 15:27
#11
Re: Re: Scala 2.9.0 RC2
I'm working with Windows Vista 64, and I do not have cygwin installed
at all. I cannot reproduce this problem.
On Wed, May 4, 2011 at 00:39, huynhjl wrote:
> I use cygwin on a daily basis but usually not fsc.
> I can reproduce the issue too. I don't think that's cygwin specific
> though as I can reproduce under cmd.exe:
>
> C:\setup\scala\scala-2.9.0.RC2\bin>fsc.bat -d classes foo.scala
> classes does not exist or is not a directory
> (fsc,classes does not exist or is not a directory
> fsc -help gives more information)
> error: error while loading package, class file 'C:\setup\scala\SCALA-
> ~1.RC2\bin\
> ..\lib\scala-library.jar(scala/package.class)' is broken
> (class java.lang.NullPointerException)
> error: error while loading Object, class file 'C:\util\java\jre6\lib
> \rt.jar(java
> /lang/Object.class)' is broken
> (class java.lang.NullPointerException)
> error: error while loading package, class file 'C:\setup\scala\SCALA-
> ~1.RC2\bin\
> ..\lib\scala-library.jar(scala/runtime/package.class)' is broken
> (class java.lang.NullPointerException)
> error: error while loading package, class file 'C:\setup\scala\SCALA-
> ~1.RC2\bin\
> ..\lib\scala-library.jar(scala/collection/package.class)' is broken
> (class java.lang.NullPointerException)
> error: source file 'foo.scala' could not be found
> 5 errors found
>
> I'm on Vista 32 bits. I downloaded the zip RC2 and unpacked just lib
> and bin using cygwin's unzip.
>
> I also have a Win 7 64 bits. I'll try in a bit over there to see if it
> makes a difference.
>
> Jean-Laurent
>
> On May 2, 7:26 pm, Antonio Cunei wrote:
>> As I mentioned in my first message, the same invocation works under
>> CMD.EXE, but not when said CMD.EXE is called from within a Cygwin shell.
>> That, I suspect, points to wrapping by Cygwin of some system calls,
>> which happens to interfere with fsc. But I'm no Windows expert, so that
>> is just my guess.
>> Toni
>
Wed, 2011-05-04, 17:47
#12
Re: Re: Scala 2.9.0 RC2 - cygwin
On 5/4/11 5:44 AM, Antonio Cunei wrote:
> I narrowed the issue down to this revision:
>
> 03/28/11 01:27:05 - extempore
> Trying to get fsc doing the right thing with respect
> to absolute and relative paths.
>
> https://lampsvn.epfl.ch/trac/scala/changeset/24610
>
> Revision 24609 works fine under cygwin.
Interesting. Since the current behavior will most likely end up in
final, I suggest that the community of windows users see this as a
suggestion that somebody somewhere has to stand up for windows if
windows is to be a first-class platform. I explicitly solicited
community input for that commit. Five weeks ago.
// Last line of changelog
Closes #4395, no review, but community input would be great.
If no windows users use development builds, then it would be prudent for
everyone to keep expectations low.
Wed, 2011-05-04, 18:37
#13
Re: Re: Scala 2.9.0 RC2 - cygwin
On Wed, May 4, 2011 at 13:35, Paul Phillips wrote:
> On 5/4/11 5:44 AM, Antonio Cunei wrote:
>> I narrowed the issue down to this revision:
>>
>> 03/28/11 01:27:05 - extempore
>> Trying to get fsc doing the right thing with respect
>> to absolute and relative paths.
>>
>> https://lampsvn.epfl.ch/trac/scala/changeset/24610
>>
>> Revision 24609 works fine under cygwin.
>
> Interesting. Since the current behavior will most likely end up in
> final, I suggest that the community of windows users see this as a
> suggestion that somebody somewhere has to stand up for windows if
> windows is to be a first-class platform. I explicitly solicited
> community input for that commit. Five weeks ago.
As I said, I don't see the issue at all. I'll try it out on my Windows
7, but, so far, it seems to be related to cygwin.
Those of you having problem, is your Java 32 or 64 bits?
Thu, 2011-05-05, 11:47
#14
Re: Scala 2.9.0 RC2 - cygwin
Antonio> Revision 24609 works fine under cygwin.
Daniel> Those of you having problem, is your Java 32 or 64 bits?
Both 32/64 bits. It's indeed cygwin specific but the same error
message can occur under plain cmd.exe which made things harder to
troubleshoot.
Basically the PWD environment variable is now used to infer the
current dir (https://lampsvn.epfl.ch/trac/scala/changeset/24610/scala/
trunk/src/compiler/scala/tools/nsc/
OfflineCompilerCommand.scala#file0).
On Cygwin, PWD starts with "/cygdgrive/" which is not a valid win path
and I think things go wrong from there. So the short answer is that to
make fsc run on cygwin post 24610, it can be invoked like this:
fsc -current-dir .
For instance: fsc -current-dir . -d classes Foo.scala
I'm not sure what -current-dir is used for, so if Paul could shed some
light whether . is a reasonable value, that would be helpful.
Now whether on cygwin or plain old cmd.exe or on Linux, if the
destination directory (such as classes in -d classes) does not exist,
you will get "error while loading package" messages. It also prints
out "classes does not exist or is not a directory" so hopefully people
will know what to do.
Paul> Interesting. Since the current behavior will most likely end up
in
Paul> final, I suggest that the community of windows users see this as
a
Paul> suggestion that somebody somewhere has to stand up for windows
if
Paul> windows is to be a first-class platform. I explicitly solicited
Paul> community input for that commit. Five weeks ago.
Paul>
Paul> // Last line of changelog
Paul> Closes #4395, no review, but community input would be great.
Paul>
Paul> If no windows users use development builds, then it would be
prudent for
Paul> everyone to keep expectations low.
I think indeed our expectations should be low. In this case, the issue
is at the intersection of users using dev or RC build, using cygwin on
windows and fsc. I'm not sure how many users that is.
For this specific example, the hurdle is quite high. The pool of
potential helpers is limited to those reading the commit messages. It
hints but does not indicate clearly was what broken before and being
fixed. The bar would have been lower if the ticket had a few examples
of what was broken and how to reproduce it and if an email was sent on
scala-language or scala-user.
Even with that, the RC phase is basically the first time the pool of
users expands substantially. So I think it will just be a fact of life
that issues will be reported at that stage.
Jean-Laurent
Thu, 2011-05-05, 12:37
#15
Re: Re: Scala 2.9.0 RC2 - cygwin
2011/5/5 huynhjl :
> Even with that, the RC phase is basically the first time the pool of
> users expands substantially. So I think it will just be a fact of life
> that issues will be reported at that stage.
Indeed, this is just another indicator that Scala's "Release
Candidates" should be "Betas". I really love Scala and I'm thankful to
all the people that work on it, but this release process is very
naive.
Why not be honest to the community and call them Beta?
Regards,
Rüdiger
Thu, 2011-05-05, 17:57
#16
Re: Re: Scala 2.9.0 RC2 - cygwin
On 5/5/11 4:32 AM, Rüdiger Keller wrote:
> Indeed, this is just another indicator that Scala's "Release
> Candidates" should be "Betas". I really love Scala and I'm thankful to
> all the people that work on it, but this release process is very
> naive.
>
> Why not be honest to the community and call them Beta?
I tried to google up the reasoning which has been given and failed.
Since the reasoning is not something I understand, I can't derive it
from first principles. Perhaps a better googler can find.
Thu, 2011-05-05, 18:17
#17
Re: Re: Scala 2.9.0 RC2 - cygwin
I don't know about Google, but I think common sense suggests that
something called a "release candidate" is a candidate for being
released as the final version, which is usually expected to be rather
low on bugs. At least to me the wording "release candidate" conveys
the meaning "thoroughly tested and believed to be the real thing".
On the other hand, to me calling something a beta conveys the meaning
"this is reasonably close to the final version that we want to have a
broader audience but it's not 100% finished".
Actually, I believe that is a quite commonly accepted interpretation
of the terms "release candidate" and "beta".
Therefore IMHO the Scala team would more clearly express the state of
the releases by calling them Betas.
Regards,
Rüdiger
2011/5/5 Paul Phillips :
> On 5/5/11 4:32 AM, Rüdiger Keller wrote:
>> Indeed, this is just another indicator that Scala's "Release
>> Candidates" should be "Betas". I really love Scala and I'm thankful to
>> all the people that work on it, but this release process is very
>> naive.
>>
>> Why not be honest to the community and call them Beta?
>
> I tried to google up the reasoning which has been given and failed.
> Since the reasoning is not something I understand, I can't derive it
> from first principles. Perhaps a better googler can find.
>
Thu, 2011-05-05, 18:27
#18
Re: Re: Scala 2.9.0 RC2 - cygwin
On 5/5/11 10:06 AM, Rüdiger Keller wrote:
> I don't know about Google, but I think common sense suggests that
> something called a "release candidate" is a candidate for being
> released as the final version, which is usually expected to be rather
> low on bugs. At least to me the wording "release candidate" conveys
> the meaning "thoroughly tested and believed to be the real thing".
The reason I suggested googling up the given reasoning is that I agree,
without hesitation, reservation, or qualification, with everything you
have just written.
My major efforts to alter the naming strategy were performed off-list,
which seemed like the right idea at the time, but since I failed maybe
it wasn't. Here is a sample. (You can see from the date this is in
regards to 2.8.0.)
On Fri, Mar 26, 2010 at 3:46 PM, I wrote:
> RC is supposed to mean "release candidate". It implies we think it's
> ready to ship exactly as is. If we attach such a label to a release
> which includes brand new code in fundamental areas, it sends the message
> that we simply don't care very much how well things work. I don't see
> the upside of sending such a message.
On 5/5/11 10:06 AM, Rüdiger Keller wrote:
> Therefore IMHO the Scala team would more clearly express the state of
> the releases by calling them Betas.
It is your (entirely reasonable) usage of "scala team" that makes this
so difficult to stomach, because whatever faults I may have, I try to be
completely transparent about the code.
But in fairness, if it were up to me we might never ship, because the
software I envision is perpetually far ahead of the software we are in
possession of.
Thu, 2011-05-05, 19:37
#19
Re: Re: Scala 2.9.0 RC2 - cygwin
Hello Paul,
I'm sorry for my careless choice of words. I did not realize you were
trying to change the naming scheme before.
But I'm glad to hear that I'm not the only one who thinks the current
naming scheme might have some room for improvement.
Regards,
Rüdiger
2011/5/5 Paul Phillips :
> On 5/5/11 10:06 AM, Rüdiger Keller wrote:
>>
>> I don't know about Google, but I think common sense suggests that
>> something called a "release candidate" is a candidate for being
>> released as the final version, which is usually expected to be rather
>> low on bugs. At least to me the wording "release candidate" conveys
>> the meaning "thoroughly tested and believed to be the real thing".
>
> The reason I suggested googling up the given reasoning is that I agree,
> without hesitation, reservation, or qualification, with everything you have
> just written.
>
> My major efforts to alter the naming strategy were performed off-list, which
> seemed like the right idea at the time, but since I failed maybe it wasn't.
> Here is a sample. (You can see from the date this is in regards to 2.8.0.)
>
> On Fri, Mar 26, 2010 at 3:46 PM, I wrote:
>>
>> RC is supposed to mean "release candidate". It implies we think it's
>> ready to ship exactly as is. If we attach such a label to a release
>> which includes brand new code in fundamental areas, it sends the message
>> that we simply don't care very much how well things work. I don't see
>> the upside of sending such a message.
>
>
> On 5/5/11 10:06 AM, Rüdiger Keller wrote:
>>
>> Therefore IMHO the Scala team would more clearly express the state of
>> the releases by calling them Betas.
>
> It is your (entirely reasonable) usage of "scala team" that makes this so
> difficult to stomach, because whatever faults I may have, I try to be
> completely transparent about the code.
>
> But in fairness, if it were up to me we might never ship, because the
> software I envision is perpetually far ahead of the software we are in
> possession of.
>
Thu, 2011-05-05, 19:47
#20
Re: Re: Scala 2.9.0 RC2 - cygwin
On 5/5/11 11:27 AM, Rüdiger Keller wrote:
> I'm sorry for my careless choice of words. I did not realize you were
> trying to change the naming scheme before.
I didn't mean to sound offended, if indeed I did: I AM part of the scala
team (whether anyone likes it or not, ha ha) even if only by volume of
code, and it's part of life on a team that you don't always get your
way. My sense of how things ought best be done is the only offended party.
Fri, 2011-05-06, 14:47
#21
Re: Re: Scala 2.9.0 RC2 - cygwin
>>>>> "Paul" == Paul Phillips writes:
Rüdiger Keller wrote:
>> Indeed, this is just another indicator that Scala's "Release
>> Candidates" should be "Betas"
+1
Paul> I tried to google up the reasoning which has been given and
Paul> failed.
To the extent that anything was offered, I think it was post #19 from
Martin at http://www.scala-lang.org/node/8801 ("I fully agree that an RC
is a release candidate...")
Sat, 2011-05-07, 04:07
#22
Re: Re: Scala 2.9.0 RC2 - cygwin
The necessity of fixing the private[collection] trait may have given me
a chance to fix this as well, but I need someone to tell me if this
solves the problem on cygwin. As soon as possible.
Sat, 2011-05-07, 07:07
#23
Re: Scala 2.9.0 RC2 - cygwin
Yes that fix works for me (on a locally built build/pack binaries).
Cygwin on Win 7 with java 32 or 64 bits.
cmd.exe still works fine too.
fsc can't find the files if I change directory after the initial start
of the daemon but I assume that's an understood limitation for
Windows.
On May 6, 7:57 pm, Paul Phillips wrote:
> The necessity of fixing the private[collection] trait may have given me
> a chance to fix this as well, but I need someone to tell me if this
> solves the problem on cygwin. As soon as possible.
>
> http://lampsvn.epfl.ch/trac/scala/changeset/24902
Sat, 2011-05-07, 07:17
#24
Re: Re: Scala 2.9.0 RC2 - cygwin
On 5/6/11 10:59 PM, huynhjl wrote:
> Yes that fix works for me (on a locally built build/pack binaries).
> Cygwin on Win 7 with java 32 or 64 bits.
> cmd.exe still works fine too.
That's promising, thanks.
> fsc can't find the files if I change directory after the initial start
> of the daemon but I assume that's an understood limitation for
> Windows.
It was a limitation of everywhere until r24610 - that's what I was
trying to fix on my way to breaking cygwin. And now, it's an understood
limitation of windows. I'm not aware of anything which makes it a
fundamental limitation of windows, so if you want to take a crack at it
after 2.9 ships you are more than invited.
On Apr 26, 9:42 am, Antonio Cunei wrote:
> The second release candidate of the new Scala 2.9 distribution is
> now available: Scala 2.9.0 RC2 is currently available from our
> Download Page at:http://www.scala-lang.org/downloads
>
> The Scala 2.9.0 codebase includes several additions, notably the
> new Parallel Collections, but it also introduces improvements on
> many existing features, and contains many bug fixes.
>
> Please help us with the testing of this release candidate, and
> let us know of any issues you may detect. [...]
I am currently using 2.8.1 and tried upgrading to 2.9.0.RC2. The fsc
compiler has stopped working for me. Here is my environment:
% scala
Welcome to Scala version 2.9.0.RC2 (Java HotSpot(TM) Client VM, Java
1.6.0_21).
% which fsc
/cygdrive/c/scala-2.9.0.RC2/bin/fsc
% which scalac
/cygdrive/c/scala-2.9.0.RC2/bin/scalac
When I try fsc on a file that previously worked just fine (2.8.1), I
get this on first startup of fsc:
% fsc tuple_unpack.scala
error: error while loading package, class file 'C:\SCALA-~1.RC2\bin\..
\lib\scala-library.jar(scala/package.class)' is broken
(class java.lang.NullPointerException)
error: error while loading Object, class file 'C:\Program Files\Java
\jdk1.6.0_21\jre\lib\rt.jar(java/lang/Object.class)' is broken
(class java.lang.NullPointerException)
error: error while loading String, class file 'C:\Program Files\Java
\jdk1.6.0_21\jre\lib\rt.jar(java/lang/String.class)' is broken
(class java.lang.NullPointerException)
error: error while loading package, class file 'C:\SCALA-~1.RC2\bin\..
\lib\scala-library.jar(scala/runtime/package.class)' is broken
(class java.lang.NullPointerException)
error: error while loading package, class file 'C:\SCALA-~1.RC2\bin\..
\lib\scala-library.jar(scala/collection/package.class)' is broken
(class java.lang.NullPointerException)
5 errors found
and nothing gets compiled. Using the scalac compiler, it works fine:
% scalac tuple_unpack.scala
warning: there were 1 deprecation warnings; re-run with -deprecation
for details
one warning found
Bill