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.

Compilation error during cross builds

See original GitHub issue

I have the following class hierarchy:

import com.github.plokhotnyuk.jsoniter_scala.macros._
import com.github.plokhotnyuk.jsoniter_scala.core._

final case class Container(a: Option[Int], b: Option[String], src: Source)

object Container {
  implicit val codec: JsonValueCodec[Container] =
    JsonCodecMaker.make(CodecMakerConfig.withDiscriminatorFieldName(None))
}

sealed trait Source

object Source {
  case object A extends Source
  case object B extends Source
  case object C extends Source
}

While it seems to pass tests and work for single scala version, trying to do the cross-version publish (or any other cross-version task) fails with:

Cannot evaluate a parameter of the 'make' macro call for type

I know this is a known type of error, but what would be the recommended way to overcome this issue?

Please find a minimal failing example here. Running a simple +publishLocal should fail with the described error.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
plokhotnyukcommented, Jul 21, 2020

Yet another workaround that could help for other configurations of derivation is adding intermediate +compile: image

1reaction
plokhotnyukcommented, Jul 20, 2020

Reopening because the source of the problem (using of Eval.eval for passing of parameters to the make macro that can be used in the compile-time) is not fixed yet.

The full list of Eval.eval calls used in the jsoniter-scala library are listed here: https://github.com/scalacenter/scala-3-migration-guide/pull/11

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compiling errors while trying to link libraries in cross compilation
SOLVED -- Explanation at the end of the post. I'm working on a project and right now I have to cross-compile two packages...
Read more >
error in compiling - HDF5 - HDF Forum
Hi, an error occurs when I am compling HdF5-1.10.8 My system is: Linux version 4.18.0-80.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) ...
Read more >
Cross-compiling tools package guidelines - ArchWiki
What to do if compilation fails without clear message? For error, occurred during running configure , read $srcdir/pkgname-build/config.log .
Read more >
Arm-Linux Cross compile error - help - Rust Users Forum
Hello. I have a problem with cross compile for arm-linux (Beaglebone black). Build command: PKG_CONFIG_ALLOW_CROSS=1 cargo build --color=always ...
Read more >
How to cross-compile Go 1.19 compiler for Solaris 11 on Linux
The reason I want to do this is to build a Go 1.19 compiler for Solaris, since there are no prebuilt Go 1.19...
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