Skip to content

Commit 537af43

Browse files
brettfoKevinRansom
authored andcommitted
use csc from a NuGet package (#4023)
1 parent 010c0b8 commit 537af43

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

tests/fsharp/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Microsoft.Net.Compilers" version="2.4.0" />
34
<package id="NUnit3TestAdapter" version="3.7.0" targetFramework="net45" />
45
<package id="runtime.win-x64.Microsoft.NETCore.ILDAsm" version="2.0.3" />
56
<package id="runtime.win-x86.Microsoft.NETCore.ILDAsm" version="2.0.3" />

tests/fsharp/test-framework.fs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ module Commands =
105105

106106
type TestConfig =
107107
{ EnvironmentVariables : Map<string, string>
108-
CORDIR : string
109108
CSC : string
110109
csc_flags : string
111110
BUILD_CONFIG : string
@@ -131,25 +130,6 @@ module WindowsPlatform =
131130
[| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x
132131
value = "AMD64"
133132

134-
let clrPath envVars =
135-
136-
let windir =
137-
match envVars |> Map.tryFind "windir" with
138-
| Some x -> x
139-
| None -> failwithf "environment variable '%s' required " "WINDIR"
140-
141-
let mutable CORDIR =
142-
match Directory.EnumerateDirectories (windir ++ "Microsoft.NET" ++ "Framework", "v4.0.?????") |> List.ofSeq |> List.rev with
143-
| x :: _ -> x
144-
| [] -> failwith "couldn't determine CORDIR"
145-
146-
// == Use the same runtime as our architecture
147-
// == ASSUMPTION: This could be a good or bad thing.
148-
if Is64BitOperatingSystem envVars then
149-
CORDIR <- CORDIR.Replace("Framework", "Framework64")
150-
151-
CORDIR
152-
153133
type FSLibPaths =
154134
{ FSCOREDLLPATH : string }
155135

@@ -164,10 +144,9 @@ let config configurationName envVars =
164144
let csc_flags = "/nologo"
165145
let fsc_flags = "-r:System.Core.dll --nowarn:20 --define:COMPILED"
166146
let fsi_flags = "-r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror"
167-
let CORDIR = WindowsPlatform.clrPath envVars
168147
let Is64BitOperatingSystem = WindowsPlatform.Is64BitOperatingSystem envVars
169148
let architectureMoniker = if Is64BitOperatingSystem then "x64" else "x86"
170-
let CSC = requireFile (CORDIR ++ "csc.exe")
149+
let CSC = requireFile (packagesDir ++ "Microsoft.Net.Compilers.2.4.0" ++ "tools" ++ "csc.exe")
171150
let ILDASM = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ildasm.exe")
172151
let coreclrdll = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "coreclr.dll")
173152
let PEVERIFY = requireFile (SCRIPT_ROOT ++ ".." ++ "fsharpqa" ++ "testenv" ++ "src" ++ "PEVerify" ++ "bin" ++ configurationName ++ "net46" ++ "PEVerify.exe")
@@ -204,7 +183,6 @@ let config configurationName envVars =
204183
| false -> "win7-x86"
205184

206185
{ EnvironmentVariables = envVars
207-
CORDIR = CORDIR |> Commands.pathAddBackslash
208186
FSCBinPath = FSCBinPath |> Commands.pathAddBackslash
209187
FSCOREDLLPATH = FSCOREDLLPATH
210188
ILDASM = ILDASM
@@ -225,7 +203,6 @@ let logConfig (cfg: TestConfig) =
225203
log "---------------------------------------------------------------"
226204
log "Executables"
227205
log ""
228-
log "CORDIR =%s" cfg.CORDIR
229206
log "CSC =%s" cfg.CSC
230207
log "BUILD_CONFIG =%s" cfg.BUILD_CONFIG
231208
log "csc_flags =%s" cfg.csc_flags

0 commit comments

Comments
 (0)