Scala Programming Language
  1. Scala Programming Language
  2. SI-4909

make -sourcepath into something less visible

    Details

      Description

      There is no defense for having a "standard" option which is only useful for compiling the scala library. A -X or -Y option would be better, but that just clutters the next set. It should be a "-Z" option, only for guys like ourselves.

      On 28 July 2011 16:12, Lukas Rytz <lukas.rytz@epfl.ch> wrote:

      I think you misunderstand what sourcepath does. In fact, I don't believe there
      is a good usecase for it, except compiling the standard library

      It's not giving a path and telling the compiler to compile everything in there.

      Basically, sourcepath allows you to compile the standard library without anything
      on the classpath. The compiler will create class symbols for source files based
      on their path and name.

      Oh, ok. I think it would be good to somehow make this setting less visible. If you go here: http://www.scala-lang.org/docu/files/tools/scalac.html
      -sourcepath <path>
      Specify where to find input source files.

      This description gives no clue what this option is about.

        Issue Links

          Activity

          Hide
          Eugene Burmako added a comment -
          Show
          Eugene Burmako added a comment - Fixed by Vlad in https://github.com/scalamacros/kepler/pull/1
          Hide
          Lukas Rytz added a comment -

          lucky me thanks

          Show
          Lukas Rytz added a comment - lucky me thanks
          Hide
          Vlad Ureche added a comment - - edited

          -sourcepath is also used in the presentation compiler. And it seems pretty standard:

          $ javac -help 2>&1 | grep sourcepath
            -sourcepath <path>         Specify where to find input source files
          

          EDIT: regarding the -sourcepath semantics clash in scalac vs scaladoc, the meeting decision was to disable the bootstrapping semantics from sourcepath when running scaladoc. So (still) WON'T FIX, sorry.

          Show
          Vlad Ureche added a comment - - edited -sourcepath is also used in the presentation compiler. And it seems pretty standard: $ javac -help 2>&1 | grep sourcepath -sourcepath <path> Specify where to find input source files EDIT: regarding the -sourcepath semantics clash in scalac vs scaladoc, the meeting decision was to disable the bootstrapping semantics from sourcepath when running scaladoc. So (still) WON'T FIX, sorry.
          Hide
          Mark Harrah added a comment -

          It does something sensible for end users in javac. It does not appear to do the same thing for scalac, which is why it should be hidden behind -X or -Y.

          a/A.scala:

          package a
          trait A {
             def x: a.B
          }
          

          a/B.scala:

          package a
          
          class B {
                  val x = 3
          }
          

          Run:

          $ scalac -sourcepath . a/A.scala 
          a/A.scala:4: error: type B is not a member of package a
          	def x: a.B
                           ^
          one error found
          

          It doesn't find a/B.scala like javac would. This is why the original report quoted:

          In fact, I don't believe there is a good usecase for it, except compiling the standard library.

          Show
          Mark Harrah added a comment - It does something sensible for end users in javac. It does not appear to do the same thing for scalac, which is why it should be hidden behind -X or -Y. a/A.scala: package a trait A { def x: a.B } a/B.scala: package a class B { val x = 3 } Run: $ scalac -sourcepath . a/A.scala a/A.scala:4: error: type B is not a member of package a def x: a.B ^ one error found It doesn't find a/B.scala like javac would. This is why the original report quoted: In fact, I don't believe there is a good usecase for it, except compiling the standard library.
          Hide
          Vlad Ureche added a comment -

          Well, it should find a.B, so is a bug on its own...

          Show
          Vlad Ureche added a comment - Well, it should find a.B, so is a bug on its own...

            People

            • Assignee:
              Vlad Ureche
              Reporter:
              Paul Phillips
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development