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.

Race condition with multiple source generators in a multi module project

See original GitHub issue

I’m a bit at a loss tracking this one down (time constraints) but have created a simple project to replicate the problem:

https://github.com/nefilim/sbtrace

Running compile (on a clean tree) will almost always result in:

[error] source file 'sbtrace/child/target/scala-2.10/src_managed/main/sbt-buildinfo/BuildInfo.scala' could not be found

In larger project I sometimes see a different missing file but it’s usually this generated file (by sbt-buildinfo plugin).

running compile again will complete successfully. In this sample project, disabling the scalabuff generator (by excluding the scalabuffSettings from the child project settings) will prevent this problem from happening, similarly if multi module projects are collapsed to a single project.

Included in the Build.scala are some workarounds I tried but were unsuccessful.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

27reactions
tjdettcommented, Nov 22, 2016

For those that find this issue thread searching for a way to get sbt-protoc & sbt-buildinfo to play nice:

managedSourceDirectories in Compile += target.value / "protobuf-generated"

PB.targets in Compile := Seq(
  scalapb.gen() -> (target.value / "protobuf-generated")
)
0reactions
eed3si9ncommented, Oct 13, 2016

@DustinChaloupka I think generating source into a completely different source like src/main/protobuf-generated usually fixed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Race condition - Wikipedia
A race condition or race hazard is the condition of an electronics, software, or other system where the system's substantive behavior is dependent...
Read more >
Use multiple project in c# source generator - Stack Overflow
I'm trying to build a C# source generator where I need to reference source files (.cs) that are in another project in the...
Read more >
US9396245B2 - Race condition handling in a system which ...
Techniques are disclosed for race condition handling in a system which incrementally updates clients with what occurred in a cloud-enabled platform.
Read more >
Generating Random Numbers for Cryptographic Modules Using ...
... Recently, racing conditions in multi-core environments have also been explored as sources of entropy. Both CPU [16,17] and GPU [18] [19] [20] ......
Read more >
The safety system in the C# Job System - Unity - Manual
When a race condition does cause a bug, it can be hard to find the source of the problem because it depends on...
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