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.

When cross-building is enabled, the code is generated only for one version

See original GitHub issue

In my SBT project, my main Scala version is set to 2.11.8, but because I am also using Spark, I set up my project for cross-building for 2.10.6 and 2.11.8.

However, the +avro:generate-specific (the plus for crossbuild mode) puts the generated Scala code to target/scala-2.10/src_managed/main/compiled_avro. I manually have to copy it to the respective scala_2.11 folder.

Without the copying, a sbt +compile works, but when using the project in Eclipse, I manually have to add the 2.10 folder to my project, otherwise it shows a lot of compiler errors.

Is it possible to tell the plugin to output the generated code to both directories?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sndnvcommented, Apr 6, 2022

We’ve been having this issue where sometimes the 2.12 compilation would run first and things would succeed (Scala 2.13 seems to be happy compiling with the 2.12 code) but the other way around things fail (2.12 is very unhappy about compiling with 2.13 code).

I tracked this down to the file caching done here - https://github.com/julianpeeters/sbt-avrohugger/blob/main/src/main/scala/sbtavrohugger/SbtAvrohugger.scala#L65

The files are cached when the first version finishes compiling and the other versions just don’t bother since the cache says it’s all good. I hope the fix is just using crossTarget instead (looks like it’s work locally) - https://github.com/julianpeeters/sbt-avrohugger/pull/88

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cross building — conan 1.55.0 documentation
Cross building (or cross compilation) is the process of generating binaries for a platform that is not the one where the compiling process...
Read more >
CrossBuildPackagingGuidelines - Debian Wiki
Guidelines for cross-build friendly packages. This page describes good (and bad) practice in packaging (and upstream code) with respect to ...
Read more >
sbt Reference Manual — Cross-building
This page describes how to use sbt to build and publish your project against multiple versions of Scala and how to use libraries...
Read more >
Cross Building - Link SDK - Alibaba Cloud Documentation Center
Cross Building,Link SDK:In this chapter, a complete cross-building process is shown by compiling the SDK on arm-Linux platform as an example.
Read more >
Cross compiler - Wikipedia
A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is...
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