Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ed163f

Browse files
committed
Make sure assembly search paths for #r directives include directory of declaring source file
fixesdotnet#273fixesdotnet#293closesdotnet#306commitc81e263Author: latkin <latkin@microsoft.com>Date: Tue Mar 17 12:34:06 2015 -0700 Add keep.lst file so that shared test lib file isn't whacked immediatelycommit7c02652Author: latkin <latkin@microsoft.com>Date: Tue Mar 17 10:53:46 2015 -0700 Add commentscommita8201deAuthor: latkin <latkin@microsoft.com>Date: Tue Mar 17 10:49:44 2015 -0700 Expand testing to cover FSC and other scenarioscommitf5649e7Author: latkin <latkin@microsoft.com>Date: Mon Mar 16 17:56:55 2015 -0700 Add IDE unit testscommit1dc3e15Author: latkin <latkin@microsoft.com>Date: Mon Mar 16 16:22:58 2015 -0700 Add tests for fsi.execommit83e2576Author: latkin <latkin@microsoft.com>Date: Thu Mar 12 17:44:20 2015 -0700 Make sure assembly search paths for #r directives include directory of declaring source filefixesdotnet#273fixesdotnet#293
1 parentc2b9aa7 commit3ed163f

16 files changed

+237
-5
lines changed

‎src/fsharp/build.fs‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,9 +2705,19 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
27052705
letisNetModule= String.Compare(ext,".netmodule",StringComparison.OrdinalIgnoreCase)=0
27062706
if String.Compare(ext,".dll",StringComparison.OrdinalIgnoreCase)=0
27072707
|| String.Compare(ext,".exe",StringComparison.OrdinalIgnoreCase)=0
2708-
|| isNetModulethen
2709-
2710-
letresolved= TryResolveFileUsingPaths(tcConfig.SearchPathsForLibraryFiles,m,nm)
2708+
|| isNetModulethen
2709+
2710+
letsearchPaths=
2711+
// if this is a #r reference (not from dummy range), make sure the directory of the declaring
2712+
// file is included in the search path. This should ideally already be one of the search paths, but
2713+
// during some global checks it won't be. We append to the end of the search list so that this is the last
2714+
// place that is checked.
2715+
if m<> range0&& m<> rangeStartup&& m<> rangeCmdArgs&& FileSystem.IsPathRootedShim m.FileNamethen
2716+
tcConfig.SearchPathsForLibraryFiles@[Path.GetDirectoryName(m.FileName)]
2717+
else
2718+
tcConfig.SearchPathsForLibraryFiles
2719+
2720+
letresolved= TryResolveFileUsingPaths(searchPaths,m,nm)
27112721
match resolvedwith
27122722
| Some(resolved)->
27132723
letsysdir= tcConfig.IsSystemAssembly resolved
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#r"./lib.dll"
2+
3+
moduleFoo=
4+
letY=22
5+
do
6+
printfn"%O"(Lib.X())
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#r"lib.dll"
2+
3+
moduleFoo=
4+
letY=22
5+
do
6+
printfn"%O"(Lib.X())
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#r"lib.dll"
2+
3+
moduleFoo=
4+
letY=22
5+
do
6+
printfn"%O"(Lib.X())
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#r"../lib.dll"
2+
3+
moduleFoo=
4+
letY=22
5+
do
6+
printfn"%O"(Lib.X())
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#if PIPED_FROM_TEST_DIR
2+
#load"aaa/bbb/RelativeHashRResolution04_2.fsx"
3+
#else
4+
#load"RelativeHashRResolution04_2.fsx"
5+
#endif
6+
7+
printfn"%O"(Lib.X())
8+
printfn"%O" RelativeHashRResolution04_2.Foo.Y
9+
10+
#q;;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#r"../lib.dll"
2+
3+
moduleFoo=
4+
letY=22
5+
do
6+
printfn"%O"(Lib.X())
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#if PIPED_FROM_TEST_DIR
2+
#load"./aaa/RelativeHashRResolution05_2.fsx"
3+
#else
4+
#load"../RelativeHashRResolution05_2.fsx"
5+
#endif
6+
7+
printfn"%O"(Lib.X())
8+
printfn"%O" RelativeHashRResolution05_2.Foo.Y
9+
10+
#q;;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#if PIPED_FROM_TEST_DIR
2+
#load"aaa/bbb/RelativeHashRResolution01_2.fsx"
3+
#else
4+
#load"../aaa/bbb/RelativeHashRResolution01_2.fsx"
5+
#endif
6+
7+
printfn"%O"(Lib.X())
8+
printfn"%O" RelativeHashRResolution01_2.Foo.Y
9+
10+
#q;;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#if PIPED_FROM_TEST_DIR
2+
#load"./aaa/RelativeHashRResolution02_2.fsx"
3+
#else
4+
#load"../aaa/RelativeHashRResolution02_2.fsx"
5+
#endif
6+
7+
printfn"%O"(Lib.X())
8+
printfn"%O" RelativeHashRResolution02_2.Foo.Y
9+
10+
#q;;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp