Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make -sourcepath into something less visible #4909

Closed
scabug opened this issue Aug 13, 2011 · 6 comments
Closed

make -sourcepath into something less visible #4909

scabug opened this issue Aug 13, 2011 · 6 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Aug 13, 2011

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
Specify where to find input source files.

This description gives no clue what this option is about.

@scabug
Copy link
Author

scabug commented Aug 13, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4909?orig=1
Reporter: @paulp
See #5763

@scabug
Copy link
Author

scabug commented Jun 5, 2012

@xeno-by said:
Fixed by Vlad in scalamacros/kepler#1

@scabug
Copy link
Author

scabug commented Jun 5, 2012

@lrytz said:
lucky me :-) thanks

@scabug
Copy link
Author

scabug commented Jun 13, 2012

@VladUreche said (edited on Jun 14, 2012 8:36:44 AM UTC):
-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.

@scabug scabug closed this as completed Jun 13, 2012
@scabug
Copy link
Author

scabug commented Jun 15, 2012

@harrah said:
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.

@scabug
Copy link
Author

scabug commented Jun 15, 2012

@VladUreche said:
Well, it should find a.B, so is a bug on its own...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants