Skip to content

use csc from a NuGet package #4023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/fsharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Net.Compilers" version="2.4.0" />
<package id="NUnit3TestAdapter" version="3.7.0" targetFramework="net45" />
<package id="runtime.win-x64.Microsoft.NETCore.ILDAsm" version="2.0.3" />
<package id="runtime.win-x86.Microsoft.NETCore.ILDAsm" version="2.0.3" />
Expand Down
25 changes: 1 addition & 24 deletions tests/fsharp/test-framework.fs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ module Commands =

type TestConfig =
{ EnvironmentVariables : Map<string, string>
CORDIR : string
CSC : string
csc_flags : string
BUILD_CONFIG : string
Expand All @@ -131,25 +130,6 @@ module WindowsPlatform =
[| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x
value = "AMD64"

let clrPath envVars =

let windir =
match envVars |> Map.tryFind "windir" with
| Some x -> x
| None -> failwithf "environment variable '%s' required " "WINDIR"

let mutable CORDIR =
match Directory.EnumerateDirectories (windir ++ "Microsoft.NET" ++ "Framework", "v4.0.?????") |> List.ofSeq |> List.rev with
| x :: _ -> x
| [] -> failwith "couldn't determine CORDIR"

// == Use the same runtime as our architecture
// == ASSUMPTION: This could be a good or bad thing.
if Is64BitOperatingSystem envVars then
CORDIR <- CORDIR.Replace("Framework", "Framework64")

CORDIR

type FSLibPaths =
{ FSCOREDLLPATH : string }

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

{ EnvironmentVariables = envVars
CORDIR = CORDIR |> Commands.pathAddBackslash
FSCBinPath = FSCBinPath |> Commands.pathAddBackslash
FSCOREDLLPATH = FSCOREDLLPATH
ILDASM = ILDASM
Expand All @@ -225,7 +203,6 @@ let logConfig (cfg: TestConfig) =
log "---------------------------------------------------------------"
log "Executables"
log ""
log "CORDIR =%s" cfg.CORDIR
log "CSC =%s" cfg.CSC
log "BUILD_CONFIG =%s" cfg.BUILD_CONFIG
log "csc_flags =%s" cfg.csc_flags
Expand Down