You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by sl...@apache.org on 2022/03/24 19:05:43 UTC

[daffodil-vscode] branch main updated: Remove -Xcheckinit scalac option

This is an automated email from the ASF dual-hosted git repository.

slawrence pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git


The following commit(s) were added to refs/heads/main by this push:
     new 683bcc8  Remove -Xcheckinit scalac option
683bcc8 is described below

commit 683bcc8484f0815584315dfc549b85ea749de577
Author: Steve Lawrence <sl...@apache.org>
AuthorDate: Thu Mar 24 13:25:49 2022 -0400

    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
    reproducible.
    
    By removing it, we lose checks for unitialized accesses, but that seems
    unlikely and not worth the loss of reproducibility.
    
    Closes #92
---
 build.sbt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/build.sbt b/build.sbt
index 6761d60..eec3956 100644
--- a/build.sbt
+++ b/build.sbt
@@ -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)
   )
 }