Introduced scalac options being managed in a git-managed and local precedence fashion
Simon Leischnig
Branch: simlei/opal_hiwi:feature/scalacOptsSquash
Branch: delors/opal:develop
Merged
Merged pull request
Merged in simlei/opal_hiwi/feature/scalacOptsSquash (pull request #464)
See Issue #119 Behaviour is configured in Project/ScalacOptionsLocality.scala; defaults should do.
The problem of local and git-managed files getting out of sync is recognized by maintaining a "whitelist" of options that are commonly changed off-the-grid like "-Xdisable-assertions" (see
ScalacOptionsLocality#localAndManagedOptionsHandler
). Whitelist behavior is as follows:Scalac options that are not in this whitelist, and differ between the locally specified- and the git-managed scalac options file (symmetric difference), issue a warning. For example, if a later origin change introduces a setting like "-Ywarn-unused:params,patvars" and the local scalac options file does not capture that, on compilation this warning appears:
[warn] Your local and global scalac options in this build differ in the significant options Set(-Ywarn-unused). [warn] Consider merging the managed scalac options file: /home/simon/gitShared/opal_hiwi/scalac.options [warn] into the local scalac options file (not tracked by git): /home/simon/gitShared/opal_hiwi/local.scalac.options
This behavior is easily customizable and is nondisruptive to the user. By throwing an exception instead of logging a warning, one could catch cases that are potentially fatal.