The problem is that it exposes absolute path of the file. It seems to be a wrong thing to do and could be a mild security risk as it exposes the directory structure from the machine it compiles on. It also makes build less reproducible.
Should not it be changed to relative path instead?
I could try to make PR for that, but I wanted to make sure it is not an intentional behavior before investing too much time into it.
Reproduction steps
Scala version: 2.13.10
Problem
When compiled with
-Xcheckinit
flag, the code above will emit the bytecode like following:The problem is that it exposes absolute path of the file. It seems to be a wrong thing to do and could be a mild security risk as it exposes the directory structure from the machine it compiles on. It also makes build less reproducible.
Should not it be changed to relative path instead?
I could try to make PR for that, but I wanted to make sure it is not an intentional behavior before investing too much time into it.
One can find a responsible code here: https://github.com/scala/scala/blob/a360263370c1d9b4d26b943b1c55d8e4d6ed8360/src/compiler/scala/tools/nsc/transform/AccessorSynthesis.scala#L360