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

Commit7a886e1

Browse files
authored
Fix FSC : error FS0193: Could not find file 'c:\Users\kevinr\source\repos\Library2\Library2\tmpB4E3.dll (#4800)
* Fix buildfromsource build* Fix NativeResources* Feedback
1 parent26ae35b commit7a886e1

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
@@ -1066,6 +1066,7 @@ type PEReader =
10661066
resourcesAddr:int32
10671067
strongnameAddr:int32
10681068
vtableFixupsAddr:int32
1069+
noFileOnDisk:bool
10691070
}
10701071

10711072
[<NoEquality; NoComparison; RequireQualifiedAccess>]
@@ -1543,11 +1544,25 @@ let readBlobHeapAsDouble ctxt vidx = fst (sigptrGetDouble (readBlobHeap ctxt vid
15431544
// (e) the start of the native resources attached to the binary if any
15441545
// ----------------------------------------------------------------------*)
15451546

1546-
letreadNativeResources(pectxt:PEReader)=
1547+
// noFileOnDisk indicates that the PE file was read from Memory using OpenILModuleReaderFromBytes
1548+
// For example the assembly came from a type provider
1549+
// In this case we eagerly read the native resources into memory
1550+
letreadNativeResources(pectxt:PEReader)=
15471551
[if pectxt.nativeResourcesSize<>0x0&& pectxt.nativeResourcesAddr<>0x0then
1548-
letstart= pectxt.anyV2P(pectxt.fileName+": native resources", pectxt.nativeResourcesAddr)
1549-
yield ILNativeResource.In(pectxt.fileName, pectxt.nativeResourcesAddr, start, pectxt.nativeResourcesSize)]
1550-
1552+
letstart= pectxt.anyV2P(pectxt.fileName+": native resources", pectxt.nativeResourcesAddr)
1553+
if pectxt.noFileOnDiskthen
1554+
#if!FX_NO_LINKEDRESOURCES
1555+
letunlinkedResource=
1556+
letlinkedResource= seekReadBytes(pectxt.pefile.GetView()) start pectxt.nativeResourcesSize
1557+
unlinkResource pectxt.nativeResourcesAddr linkedResource
1558+
yield ILNativeResource.Out unlinkedResource
1559+
#else
1560+
()
1561+
#endif
1562+
else
1563+
yield ILNativeResource.In(pectxt.fileName, pectxt.nativeResourcesAddr, start, pectxt.nativeResourcesSize)]
1564+
1565+
15511566
letgetDataEndPointsDelayed(pectxt:PEReader)ctxtH=
15521567
lazy
15531568
let(ctxt:ILMetadataReader)= getHole ctxtH
@@ -3694,7 +3709,7 @@ let openMetadataReader (fileName, mdfile: BinaryFile, metadataPhysLoc, peinfo, p
36943709
// read of the AbsIL module.
36953710
// ----------------------------------------------------------------------
36963711

3697-
letopenPEFileReader(fileName,pefile:BinaryFile,pdbDirPath)=
3712+
letopenPEFileReader(fileName,pefile:BinaryFile,pdbDirPath,noFileOnDisk)=
36983713
letpev= pefile.GetView()
36993714
(* MSDOS HEADER*)
37003715
letpeSignaturePhysLoc= seekReadInt32 pev0x3c
@@ -3887,12 +3902,13 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbDirPath) =
38873902
pefile=pefile
38883903
fileName=fileName
38893904
entryPointToken=entryPointToken
3905+
noFileOnDisk=noFileOnDisk
38903906
}
38913907
letpeinfo=(subsys,(subsysMajor, subsysMinor), useHighEnthropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal)
38923908
(metadataPhysLoc, metadataSize, peinfo, pectxt, pev, pdb)
38933909

3894-
letopenPE(fileName,pefile,pdbDirPath,reduceMemoryUsage,ilGlobals)=
3895-
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile, pdbDirPath)
3910+
letopenPE(fileName,pefile,pdbDirPath,reduceMemoryUsage,ilGlobals,noFileOnDisk)=
3911+
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile, pdbDirPath, noFileOnDisk)
38963912
letilModule,ilAssemblyRefs= openMetadataReader(fileName, pefile, metadataPhysLoc, peinfo, pectxt, pev, Some pectxt, reduceMemoryUsage, ilGlobals)
38973913
ilModule, ilAssemblyRefs, pdb
38983914

@@ -3969,7 +3985,7 @@ let tryMemoryMapWholeFile opts fileName =
39693985

39703986
letOpenILModuleReaderFromBytes fileName bytes opts=
39713987
letpefile= ByteFile(fileName, bytes):> BinaryFile
3972-
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbDirPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals)
3988+
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbDirPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals,true)
39733989
new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
39743990

39753991
letOpenILModuleReader fileName opts=
@@ -4017,7 +4033,7 @@ let OpenILModuleReader fileName opts =
40174033
// Then use the metadata blob as the long-lived memory resource.
40184034
letdisposer,pefileEager= tryMemoryMapWholeFile opts fullPath
40194035
use _disposer= disposer
4020-
let(metadataPhysLoc,metadataSize,peinfo,pectxtEager,pevEager,_pdb)= openPEFileReader(fullPath, pefileEager, None)
4036+
let(metadataPhysLoc,metadataSize,peinfo,pectxtEager,pevEager,_pdb)= openPEFileReader(fullPath, pefileEager, None,false)
40214037
letmdfile=
40224038
match mdfileOptwith
40234039
| Some mdfile-> mdfile
@@ -4031,7 +4047,7 @@ let OpenILModuleReader fileName opts =
40314047
// If we are not doing metadata-only, then just go ahead and read all the bytes and hold them either strongly or weakly
40324048
// depending on the heuristic
40334049
letpefile= createByteFileChunk opts fullPath None
4034-
letilModule,ilAssemblyRefs,_pdb= openPE(fullPath, pefile, None, reduceMemoryUsage, opts.ilGlobals)
4050+
letilModule,ilAssemblyRefs,_pdb= openPE(fullPath, pefile, None, reduceMemoryUsage, opts.ilGlobals,false)
40354051
new ILModuleReader(ilModule, ilAssemblyRefs, ignore)
40364052

40374053
if keyOkthen
@@ -4049,7 +4065,7 @@ let OpenILModuleReader fileName opts =
40494065
//
40504066
// We do however care about avoiding locks on files that prevent their deletion during a
40514067
// multi-proc build. So use memory mapping, but only for stable files. Other files
4052-
//fill use an in-memory ByteFile
4068+
//still use an in-memory ByteFile
40534069
let_disposer,pefile=
40544070
if alwaysMemoryMapFSC|| stableFileHeuristicApplies fullPaththen
40554071
tryMemoryMapWholeFile opts fullPath
@@ -4058,7 +4074,7 @@ let OpenILModuleReader fileName opts =
40584074
letdisposer={new IDisposablewithmember__.Dispose()=()}
40594075
disposer, pefile
40604076

4061-
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbDirPath, reduceMemoryUsage, opts.ilGlobals)
4077+
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbDirPath, reduceMemoryUsage, opts.ilGlobals,false)
40624078
letilModuleReader=new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
40634079

40644080
// 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
@@ -4063,7 +4063,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
40634063
reduceMemoryUsage= tcConfig.reduceMemoryUsage
40644064
pdbDirPath= None
40654065
metadataOnly= MetadataOnlyFlag.Yes
4066-
tryGetMetadataSnapshot= tcConfig.tryGetMetadataSnapshot}
4066+
tryGetMetadataSnapshot= tcConfig.tryGetMetadataSnapshot}
40674067
letreader= OpenILModuleReaderFromBytes fileName bytes opts
40684068
reader.ILModuleDef, reader.ILAssemblyRefs
40694069

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp