Skip to content

Commit 6ebb959

Browse files
authored
Merge pull request fable-compiler#3542 from ncave/rust
Enable builds with .NET 6.0/7.0/8.0
2 parents c141555 + a72d5e4 commit 6ebb959

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+219
-201
lines changed

build/Build.fsproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net6.0</TargetFramework>
5+
<RollForward>Major</RollForward>
56
</PropertyGroup>
67
<ItemGroup>
78
<Compile Include="Utils.fs" />
@@ -38,12 +39,12 @@
3839
<Compile Include="Main.fs" />
3940
</ItemGroup>
4041
<ItemGroup>
42+
<PackageReference Update="FSharp.Core" Version="7.0.400" />
4143
<PackageReference Include="BlackFox.CommandLine" Version="1.0.0" />
4244
<PackageReference Include="EluciusFTW.SpectreCoff" Version="0.47.28" />
4345
<PackageReference Include="Fake.IO.FileSystem" Version="6.0.0" />
4446
<PackageReference Include="SimpleExec" Version="11.0.0" />
4547
<PackageReference Include="Spectre.Console" Version="0.47.0" />
46-
<PackageReference Update="FSharp.Core" Version="7.0.400" />
4748
<PackageReference Include="Thoth.Json.Net" Version="11.0.0" />
4849
<PackageReference Include="Octokit" Version="8.0.0" />
4950
<PackageReference Include="Semver" Version="2.3.0" />

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
33
"version": "6.0.100",
4-
"rollForward": "latestMinor"
4+
"rollForward": "latestMajor"
55
}
66
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"rollup": "rollup",
88
"terser": "terser",
99
"tslint": "tslint",
10-
"build": "dotnet fsi build.fsx",
11-
"publish": "dotnet fsi build.fsx publish",
12-
"test": "dotnet fsi build.fsx test",
10+
"build": "dotnet run --project build/Build.fsproj",
11+
"publish": "dotnet run --project build/Build.fsproj publish",
12+
"test": "dotnet run --project build/Build.fsproj test",
1313
"build-compiler-js": "dotnet fable src/fable-compiler-js/src/fable-compiler-js.fsproj -o build/fable-compiler-js/out",
1414
"postbuild-compiler-js": "rollup build/fable-compiler-js/out/app.js --file src/fable-compiler-js/dist/app.js --format umd --name Fable",
1515
"minify-compiler-js": "terser src/fable-compiler-js/dist/app.js -o src/fable-compiler-js/dist/app.min.js --mangle --compress",

src/Fable.Cli/Fable.Cli.fsproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
<Reference Include="../../lib/fcs/FSharp.Core.dll" />
6262
</ItemGroup>
6363
<ItemGroup>
64-
<PackageReference Include="Buildalyzer" Version="4.1.6" />
65-
<PackageReference Include="FSharp.SystemTextJson" Version="0.17.4" />
66-
<PackageReference Include="source-map-sharp" Version="1.0.8" />
64+
<PackageReference Include="Buildalyzer" Version="5.0.1" />
65+
<PackageReference Include="FSharp.SystemTextJson" Version="1.2.42" />
66+
<PackageReference Include="source-map-sharp" Version="1.0.9" />
6767
</ItemGroup>
6868
</Project>

src/Fable.PublishUtils/Fable.PublishUtils.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5+
<RollForward>Major</RollForward>
56
<GenerateDocumentationFile>true</GenerateDocumentationFile>
67
<Version>2.4.0</Version>
78
</PropertyGroup>

src/Fable.Transforms/Fable.Transforms.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
<ProjectReference Include="Rust/AST/Rust.AST.fsproj" />
4848
</ItemGroup>
4949
<ItemGroup>
50-
<!-- <PackageReference Include="FSharp.Compiler.Service" Version="40.0" /> -->
5150
<Reference Include="../../lib/fcs/FSharp.Core.dll" />
5251
<Reference Include="../../lib/fcs/FSharp.Compiler.Service.dll" />
5352
</ItemGroup>

src/Fable.Transforms/Fable2Babel.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ module Reflection =
347347
| Fable.Any -> Expression.booleanLiteral(true)
348348
| Fable.Unit -> com.TransformAsExpr(ctx, expr) |> Util.makeNullCheck range true
349349
| Fable.Boolean -> jsTypeof "boolean" expr
350-
| Fable.Char | Fable.String _ -> jsTypeof "string" expr
350+
| Fable.Char | Fable.String -> jsTypeof "string" expr
351351
| Fable.Number(Decimal,_) -> jsInstanceof (libValue com ctx "Decimal" "default") expr
352352
| Fable.Number(JS.Replacements.BigIntegers _, _) -> jsTypeof "bigint" expr
353353
| Fable.Number _ -> jsTypeof "number" expr

src/Fable.Transforms/FableTransforms.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ let noSideEffectBeforeIdent identName expr =
125125
| Get(_, ExprGet _, _, _) ->
126126
sideEffect <- true
127127
true
128-
| Get(e, (TupleIndex _|UnionField _|UnionTag|ListHead|ListTail|OptionValue _), _, _) ->
128+
| Get(e, (TupleIndex _|UnionField _|UnionTag|ListHead|ListTail|OptionValue), _, _) ->
129129
findIdentOrSideEffect e
130130
| Import _ | Lambda _ | Delegate _ -> false
131131
| Extended((Throw _|Debugger),_) -> true

src/Fable.Transforms/Php/Fable2Php.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ and convertMatching (com: IPhpCompiler) input guard thenExpr elseExpr expr retur
11751175
com.AddLocalVar(fixName t, false)
11761176
PhpAssign(PhpVar(fixName t, None), PhpConst(PhpConstNumber(float i)))
11771177
PhpBreak None
1178-
| Return _ ->
1178+
| Return ->
11791179
yield! convertExprToStatement com target returnStrategy
11801180
| _ ->
11811181
yield! convertExprToStatement com target returnStrategy
@@ -1214,7 +1214,7 @@ and convertExprToStatement (com: IPhpCompiler) expr returnStrategy =
12141214
yield! convertExprToStatement com expr returnStrategy
12151215
| None -> ()
12161216
match returnStrategy with
1217-
| Return _ -> ()
1217+
| Return -> ()
12181218
| _ -> PhpBreak None;
12191219
]
12201220

@@ -1306,7 +1306,7 @@ and convertExprToStatement (com: IPhpCompiler) expr returnStrategy =
13061306
| Fable.Extended(Fable.Throw(expr, _ ),_) ->
13071307
match expr with
13081308
| None -> failwith "TODO: rethrow"
1309-
| Some (Fable.Call (Fable.IdentExpr expr, args, _, _)) when expr.Name = "Error" ->
1309+
| Some (Fable.Call (Fable.IdentExpr expr, args, _, _)) when expr.Name = "Error" ->
13101310
[ PhpThrow (PhpNew (ExType { Name="Exception"; Namespace=Some ""; Class=None }, List.map (convertExpr com) args.Args))]
13111311
| Some expr -> [ PhpThrow(convertExpr com expr)]
13121312
| Fable.Extended(Fable.Curry(expr, arrity),_) ->

src/Fable.Transforms/Python/Fable2Python.fs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ type BoundVars =
4646
enclosingScope.UnionWith(this.EnclosingScope)
4747
enclosingScope.UnionWith(this.LocalScope)
4848

49-
{ this with
50-
LocalScope = HashSet()
51-
EnclosingScope = enclosingScope
52-
Inceptions = this.Inceptions + 1 }
49+
{ LocalScope = HashSet()
50+
EnclosingScope = enclosingScope
51+
Inceptions = this.Inceptions + 1 }
5352

5453
member this.Bind(name: string) =
5554
this.LocalScope.Add name |> ignore
@@ -419,7 +418,7 @@ module Reflection =
419418
Expression.compare (expr, [ Is ], [ Util.undefined None ], ?loc = range), stmts
420419
| Fable.Boolean -> pyTypeof "<class 'bool'>" expr
421420
| Fable.Char
422-
| Fable.String _ -> pyTypeof "<class 'str'>" expr
421+
| Fable.String -> pyTypeof "<class 'str'>" expr
423422
| Fable.Number (kind, b) ->
424423
match kind, typ with
425424
| _, Fable.Type.Number (UInt8, _) -> pyTypeof "<fable_modules.fable_library.types.uint8'>>" expr

0 commit comments

Comments
 (0)