Skip to content

Commit 70cbf35

Browse files
authored
Merge pull request #666 from ncave/linux
Fixed netcore codegen on Linux
2 parents 433c037 + 5709689 commit 70cbf35

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

build.fsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ open Fake.UserInputHelper
1414
open Fake.AssemblyInfoFile
1515
open SourceLink
1616

17+
#if MONO
18+
// prevent incorrect output encoding (e.g. https://github.com/fsharp/FAKE/issues/1196)
19+
System.Console.OutputEncoding <- System.Text.Encoding.UTF8
20+
#endif
21+
1722
// --------------------------------------------------------------------------------------
1823
// Information about the project to be used at NuGet and in AssemblyInfo files
1924
// --------------------------------------------------------------------------------------
@@ -257,18 +262,24 @@ Target "CodeGen.NetCore" (fun _ ->
257262
run "dotnet" "restore -v Information"
258263

259264
// run tools
260-
let runInDir exe = runCmdIn "src/fsharp/FSharp.Compiler.Service/" exe
261-
let fsLex fslFilePath outFilePath = runInDir "lib/bootstrap/4.0/fslex.exe" @"%s --unicode %s -o %s" fslFilePath lexArgs outFilePath
262-
let fsYacc = runInDir "lib/bootstrap/4.0/fsyacc.exe"
265+
#if MONO
266+
let toolDir = "../../../lib/bootstrap/4.0/"
267+
#else
268+
let toolDir = "lib/bootstrap/4.0/"
269+
#endif
270+
let workDir = "src/fsharp/FSharp.Compiler.Service/"
271+
let runInDir exe = runCmdIn workDir exe
272+
let fsLex fsl out = runInDir (toolDir + "fslex.exe") "%s --unicode %s -o %s" fsl lexArgs out
273+
let fsYacc fsy out m o = runInDir (toolDir + "fsyacc.exe") "%s %s %s %s %s -o %s" fsy lexArgs yaccArgs m o out
263274

264275
runInDir "dotnet" "fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx"
265276
runInDir "dotnet" "fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx"
266277
fsLex "../lex.fsl" "lex.fs"
267278
fsLex "../pplex.fsl" "pplex.fs"
268279
fsLex "../../absil/illex.fsl" "illex.fs"
269-
fsYacc "../../absil/ilpars.fsy %s %s %s %s -o ilpars.fs" lexArgs yaccArgs module1 open1
270-
fsYacc "../pars.fsy %s %s %s %s -o pars.fs" lexArgs yaccArgs module2 open2
271-
fsYacc "../pppars.fsy %s %s %s %s -o pppars.fs" lexArgs yaccArgs module3 open3
280+
fsYacc "../../absil/ilpars.fsy" "ilpars.fs" module1 open1
281+
fsYacc "../pars.fsy" "pars.fs" module2 open2
282+
fsYacc "../pppars.fsy" "pppars.fs" module3 open3
272283
)
273284

274285
Target "Build.NetCore" (fun _ ->

0 commit comments

Comments
 (0)