- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
disabling assertion in Scala build
Sun, 2009-02-01, 16:15
Is there a way to disable assertions when building the Scala distribution w/o modifying the build.xml file?
Sun, 2009-02-01, 19:17
#2
Re: disabling assertion in Scala build
On Sun, Feb 01, 2009 at 10:15:08AM -0500, Erik Engbrecht wrote:
> Is there a way to disable assertions when building the Scala distribution
> w/o modifying the build.xml file?
Interestingly, the build fails with assertions disabled. This appears to be related to internal use of exceptions
to handle some XML logic, but since you shouldn't be able to catch a failed assertion and assertion disabling only
disables the throwing of AssertionErrors, I'm not yet sure how this can be.
Here's how it fails, in quick.lib:
[scalacfork] Compiling 405 files to /scala/trunk/build/quick/classes/library
[scalacfork] /scala/trunk/src/library/scala/xml/persistent/CachedFileStorage.scala:94: error: in XML literal: in XML content, please use '}}' to express '}'
[scalacfork] val storageNode = { nodes.toList }
[scalacfork] ^
[scalacfork] /scala/trunk/src/library/scala/xml/persistent/CachedFileStorage.scala:94: error: I encountered a '}' where I didn't expect one, maybe this tag isn't closed <
[scalacfork] val storageNode = { nodes.toList }
[scalacfork] ^
[scalacfork] two errors found
Sun, 2009-02-01, 19:27
#3
Re: disabling assertion in Scala build
My mistake, you can catch errors, you're just not supposed to. In that case there are a couple dozen places in the
compiler which catch Throwable, and the XML parser at least appears to use Exceptions for non-fatal control flow,
and I think these might be interacting poorly.
Sun, 2009-02-01, 19:37
#4
Re: disabling assertion in Scala build
On Sun, Feb 1, 2009 at 6:20 PM, Paul Phillips <paulp@improving.org> wrote:
Mr Phillips, you show a nearly British level of skill in the art of understatement...
and I think these might be interacting poorly.
Mr Phillips, you show a nearly British level of skill in the art of understatement...
On Sun, Feb 01, 2009 at 10:15:08AM -0500, Erik Engbrecht wrote:
> Is there a way to disable assertions when building the Scala distribution
> w/o modifying the build.xml file?
Assuming -Xdisable-assertions works as advertised,
ant -Dscalac.args=-Xdisable-assertions