`-sourcepath` should be a `-Y` setting, it's only used for compiling the standard library. A separate flag should be added for Scaladoc, to support `-doc-source-url`. Apply the same change to Scala 3. https://github.com/sbt/zinc/issues/1304#issuecomment-1877155832 Older discussion https://groups.google.com/forum/?fromgroups=#!topic/scala-internals/8xbRfONJL7U.