Comments (15)
Looks like the dependency comes from scala-compiler/ivy-2.11.0-M8.xml :
<dependencies>
<dependency org="org.scala-lang" name="scala-library" rev="2.11.0-M8" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
<dependency org="org.scala-lang" name="scala-reflect" rev="2.11.0-M8" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
<dependency org="org.scala-lang.modules" name="scala-xml_2.11.0-M8" rev="1.0.0-RC7" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
<dependency org="org.scala-lang.modules" name="scala-parser-combinators_2.11.0-M8" rev="1.0.0-RC5" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
<dependency org="jline" name="jline" rev="2.11" force="true" conf="optional->compile(*),master(*)"/>
</dependencies>
from scala-xml.
@adriaanm This is related to the other thread about running scaladoc, it seems but worse. I'll see if I can dive into your classpaths and try to restore some sanity.
from scala-xml.
Proof of the issue, as well as culprit:
> show test:fullClasspath
[warn] Credentials file /home/jsuereth/.ivy2/.credentials does not exist
[info] List(Attributed(/home/jsuereth/projects/scala/scala-xml/target/scala-2.11.0-M8/test-classes), Attributed(/home/jsuereth/projects/scala/scala-xml/target/scala-2.11.0-M8/classes), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.0-M8.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.0-M8.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0-M8.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11.0-M8/bundles/scala-xml_2.11.0-M8-1.0.0-RC7.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11.0-M8/bundles/scala-parser-combinators_2.11.0-M8-1.0.0-RC5.jar), Attributed(/home/jsuereth/.ivy2/cache/junit/junit/jars/junit-4.11.jar), Attributed(/home/jsuereth/.ivy2/cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.3.jar), Attributed(/home/jsuereth/.ivy2/cache/com.novocode/junit-interface/jars/junit-interface-0.10.jar), Attributed(/home/jsuereth/.ivy2/cache/junit/junit-dep/jars/junit-dep-4.10.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-tools.testing/test-interface/jars/test-interface-0.5.jar))
[success] Total time: 0 s, completed Feb 28, 2014 9:03:29 AM
> libraryDependencies
[info] List(org.scala-lang:scala-library:2.11.0-M8, junit:junit:4.11:test, com.novocode:junit-interface:0.10:test, org.scala-lang:scala-compiler:2.11.0-M8:test)
from scala-xml.
Ok, this fix is simple. In build.sbt
:
// used in CompilerErrors test
libraryDependencies += ("org.scala-lang" % "scala-compiler" % scalaVersion.value % "test").excludeAll(ExclusionRule(organization="org.scala-lang.modules"))
Proof:
show test:fullClasspath
[warn] Credentials file /home/jsuereth/.ivy2/.credentials does not exist
[info] Updating {file:/home/jsuereth/projects/scala/scala-xml/}scala-xml...
[info] Resolving jline#jline;2.11 ...
[info] Done updating.
[info] List(Attributed(/home/jsuereth/projects/scala/scala-xml/target/scala-2.11.0-M8/test-classes), Attributed(/home/jsuereth/projects/scala/scala-xml/target/scala-2.11.0-M8/classes), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.0-M8.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.0-M8.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0-M8.jar), Attributed(/home/jsuereth/.ivy2/cache/junit/junit/jars/junit-4.11.jar), Attributed(/home/jsuereth/.ivy2/cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.3.jar), Attributed(/home/jsuereth/.ivy2/cache/com.novocode/junit-interface/jars/junit-interface-0.10.jar), Attributed(/home/jsuereth/.ivy2/cache/junit/junit-dep/jars/junit-dep-4.10.jar), Attributed(/home/jsuereth/.ivy2/cache/org.scala-tools.testing/test-interface/jars/test-interface-0.5.jar))
Locally tests seem to pass. @adriaanm if you want to go this route, I can submit a PR. I think it's what you want, but please validate the resulting classpath.
from scala-xml.
NOK - Just tested on my environment with a modified XMLEventReader source code. I got the same proof result as you for "show test:fullClasspath" sbt command, but the reality is different, when sbt is started with -verbose JVMOptions, I can still see this class loaded from file scala- xml_2.11.0-M8-1.0.0-RC7.jar and not from scala-xml-dacr/target/scala-2.11.0-M8/classes.
[Loaded scala.xml.pull.XMLEventReader from file:/home/work/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11.0-M8/bundles/scala-xml_2.11.0-M8-1.0.0-RC7.jar]
and so my test case is not executed against my modified XMLEventReader class.
from scala-xml.
Ok, thanks for raising this! I consider this a blocker for the Scala 2.11.0 final release.
from scala-xml.
Implied: I'm looking into fixing this and putting in a backstop to make sure we don't break this again. Help much appreciated!
from scala-xml.
Ok, working build fix: https://github.com/scala/scala-xml/tree/wip/fix-build-classpath (not in my own fork, sorry!)
from scala-xml.
I've cloned your branch :
1/ no changes, tests are OK although I can see that :
$ export SBT_OPTS="-verbose" ; sbt test | grep "XMLEventReader "
[Loaded scala.xml.pull.XMLEventReader from file:/Users/dcr/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11.0-M8/bundles/scala-xml_2.11.0-M8-1.0.0-RC7.jar]
(vi ~/.sbtconfig to remove SBT_OPTS overwrite)
2/ bring back my XMLEventReader and XMLEventReaderTest changes, but the dependency is still here, and the wrong XMLEventReader class is tested.
from scala-xml.
I haven't pushed the second half of my fix (developed with help of @jsuereth):
//// testing:
// used in CompilerErrors test
libraryDependencies += ("org.scala-lang" % "scala-compiler" % scalaVersion.value % "test").exclude("org.scala-lang.modules", s"scala-xml*")
// needed to fix classloader issues (see #20)
// alternatively, manage the scala instance as shown below (commented)
fork in Test := true
from scala-xml.
Yeah, I still haven't found where scala-xml 2.11.0-M8 is sneaking into the classpath. My guess is it's getting loaded in sbt's Dual-Loader when the scala compiler is run against the code and then when our child classloader (for the project) is used, it gets that parent one.
Two follow ups:
- We may want to separate sbt from any attempts to share Scala classloaders between the compiler + the project. What we're doing now breaks scala modularization.
- We should resolve the scala-tool configuration for scala modules using "dummy" artifacts so that when there are circular dependencies the current project doesn't get in the way of grabbing necessary jars for bootstrapping.
from scala-xml.
ok sorry I thought it was done. And thanks for the work around, (fork in Test := true).
from scala-xml.
It seems like this is also happening with scala-parser-combinators. After desperately trying to make a new test pass, I realized the wrong classfiles were tested... see scala/scala-parser-combinators#13.
from scala-xml.
I'm still running into this bug.
from scala-xml.
@drewboardman can you be more specific?
there are a lot of tickets in this area; I made a (probably not complete) list at #195 (comment)
you are using sbt 1.1.2 or newer, I hope?
from scala-xml.
Related Issues (20)
- Publish 2.0.0 HOT 1
- Update CHANGELOG.md HOT 2
- Shut down Gitter room, enable GitHub Discussions? HOT 4
- CDATA in MarkupParser HOT 3
- ConstructingParser does not tolerate start of file whitespace HOT 1
- ConstructingParser throws NoSuchMethodError in Scala 3 HOT 6
- Release 2.0.1
- versionPolicyCheck fails for scalajs-library HOT 4
- ""
- Publish next release (to publish Scala 3 Native support) HOT 15
- Version 2.10 null pointer on toString
- Name predicates: which XML version? HOT 2
- Re-enable versionPolicyCheck HOT 2
- Update CHANGELOG, README? HOT 1
- Drop support for Scala 2.11? HOT 5
- Unused value warnings for XML literals starting with Scala 2.13.9 HOT 1
- Infinite loop caused by mismatched quotes HOT 3
- Roll a 2.2 release HOT 5
- Release 1.3.1 HOT 10
- FactoryAdapter loadDocument() modifies XMLReader and breaks it HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-xml.