Skip to content
Browse files
Remove -Xcheckinit scalac option
The sbt-tpoletcat plugin enables the -Xcheckinit scalacOption. This
option causes scalac to wrap field accessors so they throw an exception
on uninitialized access. Unfortunately, the error message generated in
this exception includes an absolute path to scala files, which is a
constant stored in byte code. This means different build systems create
different bytecode due to different paths, and so builds are not

By removing it, we lose checks for unitialized accesses, but that seems
unlikely and not worth the loss of reproducibility.

Closes #92
  • Loading branch information
stevedlawrence committed Mar 24, 2022
1 parent c35fae3 commit 683bcc8484f0815584315dfc549b85ea749de577
Showing 1 changed file with 3 additions and 0 deletions.
@@ -38,6 +38,9 @@ lazy val commonSettings = {
organization := "org.apache.daffodil",
scalaVersion := "2.12.13",
scalacOptions ++= Seq("-Ypartial-unification"),
// remove the -Xcheckinit option added by the sbt tpoletcat plugin. This
// option leads to non-reproducible builds
scalacOptions --= Seq("-Xcheckinit"),
startYear := Some(2021)

0 comments on commit 683bcc8

Please sign in to comment.