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

fsc keeps old current working directory across compilations

    Details

      Description

      === What steps will reproduce the problem (please be specific and use wikiformatting)? ===

        % touch help.scala
        % fsc help.scala
        % mkdir -p new && mv help.scala new
        % cd new
        % fsc help.scala  # this should build help.scala in directory "new" 
        error: source file 'help.scala' could not be found
        one error found
        % mv help.scala ..
        % fsc help.scala  # here help.scala relates to ../help.scala
      

      === What is the expected behavior? ===

      When running fsc from a different directory.. if there is already a scala compiler daemon running then it should inherit the new current working directory of fsc.

      === What do you see instead? ===

      When running fsc, if there is no scala compiler daemon running it is run with the current working directory of fsc, but keeps this PWD for all subsequent runs until the daemon exits, even when subsequent fsc invocations are from different directories.

      === What versions of the following are you using? ===

      • Scala: 2.9
      • Java: OpenJDK 1.6.0_22
      • Operating system: Linux 2.6.37

        Issue Links

          Activity

          Hide
          Jonathan Clark added a comment -

          This caused bizzare errors in the Scala Eclipse IDE plug-in after I moved my project directory for git reasons.

          Workaround: "fsc -reset" and then refreshing the project to rebuild it.

          Show
          Jonathan Clark added a comment - This caused bizzare errors in the Scala Eclipse IDE plug-in after I moved my project directory for git reasons. Workaround: "fsc -reset" and then refreshing the project to rebuild it.
          Hide
          James Iry added a comment - - edited

          The fix is pretty simple, just be sure to make source file names absolute based on the client's working directory. https://github.com/JamesIry/scala/commit/6744cbbecf9fa846dec8eaa0f3027dcedf2d7ed6 . What's missing from that commit is a good automated test.

          Show
          James Iry added a comment - - edited The fix is pretty simple, just be sure to make source file names absolute based on the client's working directory. https://github.com/JamesIry/scala/commit/6744cbbecf9fa846dec8eaa0f3027dcedf2d7ed6 . What's missing from that commit is a good automated test.
          Show
          James Iry added a comment - https://github.com/scala/scala/pull/1973
          Hide
          Jeffrey Schwab added a comment -

          `fsc -reset` does not appear to help. Using the file's absolute path works, as does `fsc -shutdown`.

          Show
          Jeffrey Schwab added a comment - `fsc -reset` does not appear to help. Using the file's absolute path works, as does `fsc -shutdown`.

            People

            • Assignee:
              James Iry
              Reporter:
              J
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development