question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cross compiling for dependsOn

See original GitHub issue

@eed3si9n rewrote this case.

steps

$ cat project/build.properties 
sbt.version=0.13.5
$ cat build.sbt               
lazy val rootProj = (project in file(".")).
  aggregate(fooProj, barProj).
  settings(
    scalaVersion := "2.11.1",
    crossScalaVersions := Seq("2.10.4", "2.11.1")
  )

lazy val fooProj = (project in file("foo")).
  dependsOn(barProj).
  settings(
    scalaVersion := "2.10.4"
  )

lazy val barProj = (project in file("bar")).
  settings(
    scalaVersion := "2.11.1",
    crossScalaVersions := Seq("2.10.4", "2.11.1")
  )

problem

$ sbt compile
[info] Loading global plugins from /Users/eugene/dotfiles/sbt/0.13/plugins
[info] Loading project definition from /Users/eugene/work/quick-test/sbt-1448/project
[info] Set current project to rootProj (in build file:/Users/eugene/work/quick-test/sbt-1448/)
[info] Updating {file:/Users/eugene/work/quick-test/sbt-1448/}fooProj...
[info] Resolving barproj#barproj_2.10;0.1-SNAPSHOT ...
[warn]  module not found: barproj#barproj_2.10;0.1-SNAPSHOT
[warn] ==== local: tried
[warn]   /Users/eugene/.ivy2/local/barproj/barproj_2.10/0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/barproj/barproj_2.10/0.1-SNAPSHOT/barproj_2.10-0.1-SNAPSHOT.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: barproj#barproj_2.10;0.1-SNAPSHOT: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: barproj#barproj_2.10;0.1-SNAPSHOT: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:126)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:125)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:103)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:48)
    at sbt.IvySbt$$anon$3.call(Ivy.scala:57)

expectation

  1. fooProj is either excluded from aggregation
  2. or scalaVersion is switched to “2.10.4” when it runs compile task under fooProj.

original report

When using

lazy val a = project
lazy val b = project dependsOn a

…where project a is Scala version x and project b is Scala version y

…then the class path of a in the context of b should be for Scala version y i.e. b’s Scala version.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:5
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
fchailloucommented, Jun 28, 2018

Actually, this still doesn’t work. I tried with sbt 1.1.6 and sbt still tries to fetch the barProj with ivy instead of using the local project ref as it should

2reactions
joan38commented, Mar 18, 2015

Is there any fix scheduled for that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to cross-compile C++-library with dependencies?
I need to cross-compile some C/C++ library. The library depends on several C/C++ libraries. Some of those of libraries in turn depend on ......
Read more >
How to properly tell Bob about host dependencies
If a recipe depends on resources that are outside of the declared recipes the ... For cross-compiling the resources are usually provided by...
Read more >
Handling host-build for cross-compilation — qiBuild 2.1.1.16 ...
Currently, to cross-compile a project that depends on some host-tools, you must run something ... CMake only needs to know one compiler (cross...
Read more >
MXE (M cross environment)
Now it depends on what you actually want – or need. If you choose to enter: ... You'll always end up with a...
Read more >
Cross-compiling a package that build-depends on Python
Hi, I maintain a binary package that is not part of Debian (yet). The upstream content is developed for amd64 and armhf architectures...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found