Skip to content

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Oct 12, 2016

While reviewing the MSBuild resolution, I came across some undocumented behaviour which we should remove.

In particular, when compiling scripts using direct invocation of "fsc.exe" (e.g. without using VisualStudio or MSBuild or --noframework) we compute this:

        let outputDirectory = 
            match tcConfig.outputFile with 
            | Some(outputFile) -> tcConfig.MakePathAbsolute outputFile
            | None -> tcConfig.implicitIncludeDir

then add this as a DLL search location:

        ... Path.GetDIrectroyName(outputDirectory)

What does this do?

  • With an explicit output file this searches the output directory, which is very strange behaviour in any case - why are we searching the output directory for dependencies!?
  • Without an explicit output file this searches the directory above the script root directory, which is nuts.

Explicit compilation of scripts is relatively rare and in any case people shouldn't be relying on behaviour that deviates so much when an explicit output file is/isn't used. Let's just remove this.

@dsyme
Copy link
Contributor Author

dsyme commented Oct 12, 2016

Also remove some significant code duplication in this file that has crept in over time

@dsyme dsyme merged commit 2002675 into dotnet:master Oct 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants