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

Commit858b5ea

Browse files
committed
Fix build for: FSharp.Compiler-proto.fsproj
revert to use msbuild libraries that come with the core framework, which requires eliminating .net 4.51 checking when building proto compiler.when building the protocompiler, Seq.list is not available so instead use copied implementation for generalized slicing parser only when building proto compiler.
1 parent6a6343f commit858b5ea

File tree

5 files changed

+44
-14
lines changed

5 files changed

+44
-14
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@ tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLi
102102
*.log
103103
*.jrs
104104
*.chk
105+
*.bak

‎src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
<ReferenceInclude="$(FSCoreLKGPath)" />
4848
<ReferenceInclude="System" />
4949
<ReferenceInclude="System.Numerics" />
50-
<ReferenceInclude="Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
51-
<ReferenceInclude="Microsoft.Build.Engine, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
52-
<ReferenceInclude="Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
53-
<ReferenceInclude="Microsoft.Build.Utilities.v12.0" />
54-
<ReferenceInclude="Microsoft.Build.Tasks.v12.0" />
50+
<ReferenceInclude="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
51+
<ReferenceInclude="Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
52+
<ReferenceInclude="Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
53+
<ReferenceInclude="Microsoft.Build.Utilities.v4.0" />
54+
<ReferenceInclude="Microsoft.Build.Tasks.v4.0" />
5555
</ItemGroup>
5656
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />
5757
</Project>

‎src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,12 @@
439439
<ReferenceInclude="System.Drawing" />
440440
<ReferenceInclude="System.Numerics" />
441441
<ReferenceInclude="System.Runtime.Remoting" />
442-
<ReferenceInclude="Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
443-
<ReferenceInclude="Microsoft.Build.Engine, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
442+
<ReferenceInclude="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
443+
<ReferenceInclude="Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
444444
<ReferenceInclude="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
445-
<ReferenceInclude="Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
446-
<ReferenceInclude="Microsoft.Build.Utilities.v12.0" />
447-
<ReferenceInclude="Microsoft.Build.Tasks.v12.0" />
445+
<ReferenceInclude="Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
446+
<ReferenceInclude="Microsoft.Build.Utilities.v4.0" />
447+
<ReferenceInclude="Microsoft.Build.Tasks.v4.0" />
448448

449449
</ItemGroup>
450450
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />

‎src/fsharp/ReferenceResolution.fs‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,17 @@ module internal MSBuildResolver =
9191
letprivateNet40="v4.0"
9292
[<Literal>]
9393
letprivateNet45="v4.5"
94+
#if BUILDING_PROTO
95+
#else
9496
[<Literal>]
9597
letprivateNet451="v4.5.1"
98+
#endif
9699

100+
#if BUILDING_PROTO
101+
letSupportedNetFrameworkVersions= set[ Net20; Net30; Net35; Net40; Net45;(*SL only*)"v5.0"]
102+
#else
97103
letSupportedNetFrameworkVersions= set[ Net20; Net30; Net35; Net40; Net45; Net451;(*SL only*)"v5.0"]
98-
104+
#endif
99105
letGetPathToDotNetFramework(v)=
100106
#if FX_ATLEAST_45
101107
letv=
@@ -106,7 +112,10 @@ module internal MSBuildResolver =
106112
| Net35-> Some TargetDotNetFrameworkVersion.Version35
107113
| Net40-> Some TargetDotNetFrameworkVersion.Version40
108114
| Net45-> Some TargetDotNetFrameworkVersion.Version45
115+
#if BUILDING_PROTO
116+
#else
109117
| Net451-> Some TargetDotNetFrameworkVersion.Version451
118+
#endif
110119
|_->assertfalse; None
111120
match vwith
112121
| Some v->
@@ -126,7 +135,10 @@ module internal MSBuildResolver =
126135
match versionwith
127136
| Net40-> Some TargetDotNetFrameworkVersion.Version40
128137
| Net45-> Some TargetDotNetFrameworkVersion.Version45
138+
#if BUILDING_PROTO
139+
#else
129140
| Net451-> Some TargetDotNetFrameworkVersion.Version451
141+
#endif
130142
|_->assertfalse; None// unknown version - some parts in the code are not synced
131143
match vwith
132144
| Some v->
@@ -143,9 +155,13 @@ module internal MSBuildResolver =
143155
/// This code uses MSBuild to determine version of the highest installed framework.
144156
letHighestInstalledNetFrameworkVersionMajorMinor()=
145157
#if FX_ATLEAST_45
158+
#if BUILDING_PROTO
159+
#else
146160
if box(ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451))<>nullthen4, Net451
147-
elif box(ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45))<>nullthen4, Net45
148-
else4, Net40// version is 4.0 assumed since this code is running.
161+
else
162+
#endif
163+
if box(ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45))<>nullthen4, Net45
164+
else4, Net40// version is 4.0 assumed since this code is running.
149165
#else
150166
// FX_ATLEAST_45 is not defined is required for step when we build compiler with proto compiler and this branch should not be hit
151167
4, Net40

‎src/fsharp/ast.fs‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,19 @@ let ParseAssemblyCodeType s m =
17061706
IL.EcmaILGlobals.typ_Object
17071707
#endif
17081708

1709+
#if BUILDING_PROTO
1710+
letlast(source:seq<_>)=
1711+
use e= source.GetEnumerator()
1712+
if e.MoveNext()then
1713+
let mutableres= e.Current
1714+
while(e.MoveNext())do res<- e.Current
1715+
res
1716+
else
1717+
raise(new System.InvalidOperationException())
1718+
#else
1719+
letlast= Seq.last
1720+
#endif
1721+
17091722

17101723
//------------------------------------------------------------------------
17111724
// AST constructors
@@ -1742,7 +1755,7 @@ let mkSynDotBrackSeqSliceGet m mDot arr (argslist:list<SynIndexerArg>) =
17421755
| SynIndexerArg.One x->yield x
17431756
|_->()]
17441757
if notsliced.Length= argslist.Lengththen
1745-
SynExpr.DotIndexedGet(arr,[SynIndexerArg.One(SynExpr.Tuple(notsliced,[],unionRanges(Seq.head notsliced).Range(Seq.last notsliced).Range))],mDot,m)
1758+
SynExpr.DotIndexedGet(arr,[SynIndexerArg.One(SynExpr.Tuple(notsliced,[],unionRanges(Seq.head notsliced).Range(last notsliced).Range))],mDot,m)
17461759
else
17471760
SynExpr.DotIndexedGet(arr,argslist,mDot,m)
17481761

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp