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

Commit56f97a8

Browse files
authored
Merge pull requestdotnet#4860 from KevinRansom/tpupdate
Servicing Fix for FSC : error FS0193: Could not find file 'c:\Users\kevinr\source\r…
2 parents16ecf5a +079a80a commit56f97a8

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

‎src/absil/ilread.fs‎

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ type PEReader =
10601060
resourcesAddr:int32
10611061
strongnameAddr:int32
10621062
vtableFixupsAddr:int32
1063+
noFileOnDisk:bool
10631064
}
10641065

10651066
[<NoEquality; NoComparison; RequireQualifiedAccess>]
@@ -1537,11 +1538,25 @@ let readBlobHeapAsDouble ctxt vidx = fst (sigptrGetDouble (readBlobHeap ctxt vid
15371538
// (e) the start of the native resources attached to the binary if any
15381539
// ----------------------------------------------------------------------*)
15391540

1540-
letreadNativeResources(pectxt:PEReader)=
1541+
// noFileOnDisk indicates that the PE file was read from Memory using OpenILModuleReaderFromBytes
1542+
// For example the assembly came from a type provider
1543+
// In this case we eagerly read the native resources into memory
1544+
letreadNativeResources(pectxt:PEReader)=
15411545
[if pectxt.nativeResourcesSize<>0x0&& pectxt.nativeResourcesAddr<>0x0then
1542-
letstart= pectxt.anyV2P(pectxt.fileName+": native resources", pectxt.nativeResourcesAddr)
1543-
yield ILNativeResource.In(pectxt.fileName, pectxt.nativeResourcesAddr, start, pectxt.nativeResourcesSize)]
1544-
1546+
letstart= pectxt.anyV2P(pectxt.fileName+": native resources", pectxt.nativeResourcesAddr)
1547+
if pectxt.noFileOnDiskthen
1548+
#if!FX_NO_LINKEDRESOURCES
1549+
letunlinkedResource=
1550+
letlinkedResource= seekReadBytes(pectxt.pefile.GetView()) start pectxt.nativeResourcesSize
1551+
unlinkResource pectxt.nativeResourcesAddr linkedResource
1552+
yield ILNativeResource.Out unlinkedResource
1553+
#else
1554+
()
1555+
#endif
1556+
else
1557+
yield ILNativeResource.In(pectxt.fileName, pectxt.nativeResourcesAddr, start, pectxt.nativeResourcesSize)]
1558+
1559+
15451560
letgetDataEndPointsDelayed(pectxt:PEReader)ctxtH=
15461561
lazy
15471562
let(ctxt:ILMetadataReader)= getHole ctxtH
@@ -3688,7 +3703,7 @@ let openMetadataReader (fileName, mdfile: BinaryFile, metadataPhysLoc, peinfo, p
36883703
// read of the AbsIL module.
36893704
// ----------------------------------------------------------------------
36903705

3691-
letopenPEFileReader(fileName,pefile:BinaryFile,pdbPath)=
3706+
letopenPEFileReader(fileName,pefile:BinaryFile,pdbPath,noFileOnDisk)=
36923707
letpev= pefile.GetView()
36933708
(* MSDOS HEADER*)
36943709
letpeSignaturePhysLoc= seekReadInt32 pev0x3c
@@ -3881,12 +3896,13 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbPath) =
38813896
pefile=pefile
38823897
fileName=fileName
38833898
entryPointToken=entryPointToken
3899+
noFileOnDisk=noFileOnDisk
38843900
}
38853901
letpeinfo=(subsys,(subsysMajor, subsysMinor), useHighEnthropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal)
38863902
(metadataPhysLoc, metadataSize, peinfo, pectxt, pev, pdb)
38873903

3888-
letopenPE(fileName,pefile,pdbPath,reduceMemoryUsage,ilGlobals)=
3889-
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile, pdbPath)
3904+
letopenPE(fileName,pefile,pdbPath,reduceMemoryUsage,ilGlobals,noFileOnDisk)=
3905+
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile, pdbPath, noFileOnDisk)
38903906
letilModule,ilAssemblyRefs= openMetadataReader(fileName, pefile, metadataPhysLoc, peinfo, pectxt, pev, Some pectxt, reduceMemoryUsage, ilGlobals)
38913907
ilModule, ilAssemblyRefs, pdb
38923908

@@ -3963,7 +3979,7 @@ let tryMemoryMapWholeFile opts fileName =
39633979

39643980
letOpenILModuleReaderFromBytes fileName bytes opts=
39653981
letpefile= ByteFile(fileName, bytes):> BinaryFile
3966-
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals)
3982+
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals,true)
39673983
new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
39683984

39693985
letOpenILModuleReader fileName opts=
@@ -4011,7 +4027,7 @@ let OpenILModuleReader fileName opts =
40114027
// Then use the metadata blob as the long-lived memory resource.
40124028
letdisposer,pefileEager= tryMemoryMapWholeFile opts fullPath
40134029
use _disposer= disposer
4014-
let(metadataPhysLoc,metadataSize,peinfo,pectxtEager,pevEager,_pdb)= openPEFileReader(fullPath, pefileEager, None)
4030+
let(metadataPhysLoc,metadataSize,peinfo,pectxtEager,pevEager,_pdb)= openPEFileReader(fullPath, pefileEager, None,false)
40154031
letmdfile=
40164032
match mdfileOptwith
40174033
| Some mdfile-> mdfile
@@ -4025,7 +4041,7 @@ let OpenILModuleReader fileName opts =
40254041
// If we are not doing metadata-only, then just go ahead and read all the bytes and hold them either strongly or weakly
40264042
// depending on the heuristic
40274043
letpefile= createByteFileChunk opts fullPath None
4028-
letilModule,ilAssemblyRefs,_pdb= openPE(fullPath, pefile, None, reduceMemoryUsage, opts.ilGlobals)
4044+
letilModule,ilAssemblyRefs,_pdb= openPE(fullPath, pefile, None, reduceMemoryUsage, opts.ilGlobals,false)
40294045
new ILModuleReader(ilModule, ilAssemblyRefs, ignore)
40304046

40314047
if keyOkthen
@@ -4043,7 +4059,7 @@ let OpenILModuleReader fileName opts =
40434059
//
40444060
// We do however care about avoiding locks on files that prevent their deletion during a
40454061
// multi-proc build. So use memory mapping, but only for stable files. Other files
4046-
//fill use an in-memory ByteFile
4062+
//still use an in-memory ByteFile
40474063
let_disposer,pefile=
40484064
if alwaysMemoryMapFSC|| stableFileHeuristicApplies fullPaththen
40494065
tryMemoryMapWholeFile opts fullPath
@@ -4052,7 +4068,7 @@ let OpenILModuleReader fileName opts =
40524068
letdisposer={new IDisposablewithmember__.Dispose()=()}
40534069
disposer, pefile
40544070

4055-
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbPath, reduceMemoryUsage, opts.ilGlobals)
4071+
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbPath, reduceMemoryUsage, opts.ilGlobals,false)
40564072
letilModuleReader=new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
40574073

40584074
// Readers with PDB reader disposal logic don't go in the cache. Note the PDB reader is only used in static linking.

‎src/fsharp/CompileOps.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4064,7 +4064,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
40644064
reduceMemoryUsage= tcConfig.reduceMemoryUsage
40654065
pdbPath= None
40664066
metadataOnly= MetadataOnlyFlag.Yes
4067-
tryGetMetadataSnapshot= tcConfig.tryGetMetadataSnapshot}
4067+
tryGetMetadataSnapshot= tcConfig.tryGetMetadataSnapshot}
40684068
letreader= OpenILModuleReaderFromBytes fileName bytes opts
40694069
reader.ILModuleDef, reader.ILAssemblyRefs
40704070

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp