michael-hoke commented on code in PR #1057:
URL: https://github.com/apache/daffodil/pull/1057#discussion_r1342897901
##########
build.sbt:
##########
@@ -211,6 +212,43 @@ lazy val testStdLayout =
Project("daffodil-test-stdLayout", file("test-stdLayout
.dependsOn(tdmlProc % "test")
.settings(commonSettings, nopublish)
+/* Workaround: certain reflection (used by JAXB) isn't allowed by default in
JDK 17:
+ *
https://docs.oracle.com/en/java/javase/17/migrate/migrating-jdk-8-later-jdk-releases.html#GUID-7BB28E4D-99B3-4078-BDC4-FC24180CE82B
+ *
+ * While we can handle this JVM quirk at build time, at runtime we won't know
+ * a user's JVM version. We'll provide documentation and an extension setting
+ * to add these flags to the extension-launched debugger backend.
+ */
+lazy val extraJvmOptions: Seq[String] =
+ if (scala.util.Properties.isJavaAtLeast("17"))
+ Seq(
+ "--add-opens",
+ "java.base/java.lang=ALL-UNNAMED",
+ )
+ else Seq()
+
+lazy val xjcSettings =
+ Seq(
+ libraryDependencies ++= Seq(
+ "com.sun.xml.bind" % "jaxb-impl" % "2.2.11",
+ "javax.activation" % "activation" % "1.1.1",
+ "org.glassfish.jaxb" % "jaxb-xjc" % "2.2.11",
+ ),
+ xjcCommandLine += "-nv",
+ xjcCommandLine += "-p",
+ xjcCommandLine += "org.apache.daffodil.tdml",
Review Comment:
It looks like the `-no-header` flag solves the issue for the .class and .jar
files, but I'm not exactly sure why... I did confirm that all that flag does is
strip out a comment header at the beginning of the file, so I don't know why
that matters for .class files... I did confirm that the build is not
reproducible without the `-no-header` flag. I also found out that there is a
.class decompiler in VSCode (I think it might even be native). I decompiled
both versions of a class that the `diff` command reported as different and did
not see a change.
That being said, even with the `-no-header` flag, I notice differences in
the generated .java files. These differences are the order of {@link ...}
comments, so they also do not affect the actual code... Completely unsure as to
why these comments don't matter and the header's do. The list of files that
differ also varies, at least slightly, with every build.
If you can confirm that the current code on this branch creates a
reproducible build for you, we'll leave `-no-header` in. If/When we attempt to
switch over to scalaxb, we'll verify that we have a reproducible build.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]