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.

1.0.0-RC2 cross build cannot find fileToRichFile method

See original GitHub issue

steps

Create a scripted test with an inlined task like this

TaskKey[Unit]("check") := {
  val application = (target in Universal).value / "tmp" / "conf" / "application.ini"
  val content = IO.read(application)
  val options = (javaOptions in Linux).value
  options.foreach { opt =>
    assert(content.contains(opt), "Option [" + opt + "] is missing")
  }
}

Cross build with

; ++2.12.2 ; ^^1.0.0-RC2 ; scripted universal/application-ini-from-javaoptions

Example is taken from this pull request: https://github.com/sbt/sbt-native-packager/pull/1000

problem

An exception is thrown

[info] [error] java.lang.NoSuchMethodError: sbt.package$.fileToRichFile(Ljava/io/File;)Lsbt/io/RichFile;
[info] [error] 	at $f99bf77d124917c77ead$.$anonfun$$sbtdef$1(/tmp/sbt_4bd421e4/application-ini-from-javaoptions/build.sbt:12)
[info] [error] 	at $f99bf77d124917c77ead$.$anonfun$$sbtdef$1$adapted(/tmp/sbt_4bd421e4/application-ini-from-javaoptions/build.sbt:11)
[info] [error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[info] [error] (*:check) java.lang.NoSuchMethodError: sbt.package$.fileToRichFile(Ljava/io/File;)Lsbt/io/RichFile;
[info] [error] Total time: 0 s, completed 27.07.2017 20:16:19

expectation

The implicit method is found.

notes

sbt version build: 0.13.16 sbt version for scripted test: 1.0.0-RC2

If I import the method explicitly the implicit conversion is not applied.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
eed3si9ncommented, Jul 28, 2017

Thanks for spending your time to try the beta! These inputs are super useful.

0reactions
muuki88commented, Jul 29, 2017

Thanks a lot for the quick response and fix 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test using Maven semantics · Issue #3381 · sbt/sbt - GitHub
We need to get off publishLocal and switch over to using Maven resolution ... 1.0.0-RC2 cross build cannot find fileToRichFile method #3378.
Read more >
cross-compiling Python 2.7.4+ - Stack Overflow
This breaks all of the previous cross-build hacks, and I cannot find any updated tutorials or documentation for the new built-in cross-compile procedure....
Read more >
Cross-Compiling Rust Apps II: Linux Subtrees and Linker ...
Now that we've got a working cross-compile setup for the base feature set in our app, let's turn on the additional features that...
Read more >
Cross-Compilation (automake) - GNU.org
To cross-compile is to build on one platform a binary that will run on another platform. When speaking of cross-compilation, it is important...
Read more >
Cross compilation - The Meson Build system
The main meson object provides two functions to determine cross compilation status. You can run system checks on both the system compiler or...
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