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

classpath includes '.' whether you like it or not

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0-M7
    • Component/s: None
    • Labels:
      None

      Description

      package foo {
        object Test {
          def main(args: Array[String]): Unit = {
            println("It's us chickens")
          }
        }
      }
      
      % scalac3 ./a.scala
      % scala3 -cp /nobody-here-but-us-chickens foo.Test
      It's us chickens
      
      % scala3 -Ylog-classpath -cp /nobody-here-but-us-chickens foo.Test
      [snip]
      After java boot/extdirs classpath has 1 entries:
        directory classpath: .
      

        Activity

        Hide
        Commit Message Bot added a comment -

        (extempore in r25452) Attacked classpaths to get "." off of it when it's not actually
        specified. The commit makes me nervous, but there's no invisible way to
        fix something like this.

          • Attention, this commit changes classpath handling **

        We desperately need some way of testing that the classpath has
        certain qualities and does not have others; partest is not that way.
        Closes SI-4857, no review.

        Show
        Commit Message Bot added a comment - (extempore in r25452 ) Attacked classpaths to get "." off of it when it's not actually specified. The commit makes me nervous, but there's no invisible way to fix something like this. Attention, this commit changes classpath handling ** We desperately need some way of testing that the classpath has certain qualities and does not have others; partest is not that way. Closes SI-4857 , no review.
        Hide
        Seth Tisue added a comment -

        Ow, this bit me today. Is there a workaround? (And if there's a list somewhere of candidates for inclusion in 2.9.2, I hope this is on it.)

        Note that scaladoc is affected too.

        Show
        Seth Tisue added a comment - Ow, this bit me today. Is there a workaround? (And if there's a list somewhere of candidates for inclusion in 2.9.2, I hope this is on it.) Note that scaladoc is affected too.
        Hide
        Seth Tisue added a comment -

        In addition to being a correctness problem, this is also a performance problem in that it can potentially take a long time for the compiler to recursively descend the entire subtree of the current directory, looking for any and all class files.

        Show
        Seth Tisue added a comment - In addition to being a correctness problem, this is also a performance problem in that it can potentially take a long time for the compiler to recursively descend the entire subtree of the current directory, looking for any and all class files.
        Hide
        Seth Tisue added a comment -

        fwiw, in the case of Scaladoc I was able to work around this by patching my local copy of the scaladoc shell script to pass -Dscala.usejavacp=false instead of -Dscala.usejavacp=true (it isn't enough to override it in JAVA_OPTS since that comes earlier in the command line)

        Show
        Seth Tisue added a comment - fwiw, in the case of Scaladoc I was able to work around this by patching my local copy of the scaladoc shell script to pass -Dscala.usejavacp=false instead of -Dscala.usejavacp=true (it isn't enough to override it in JAVA_OPTS since that comes earlier in the command line)

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development