fsharp/tests/scripts/scriptlib.fsx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

210 строки
8.0 KiB
Plaintext
Исходник Обычный вид История

// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
//
// Scripting utilities
//=========================================================================================
namespace global
open System
open System.IO
Merge master to dev15.8 (#5087) * Update README.md * Update README.md * Update README.md * [RFCs FS-1051, FS-1052, FS-1053] support for span, readonly refs, byref-like structs (#4888) * initial support for span, readonly refs, byref-like structs * fix proto build * make proto work with previous FSharp.Core * make proto work with previous FSharp.Core * update baselines * integrate code cleanup * integrate code cleanup * integrate code cleanup * integrate code cleanup * fix build * fix build * implicit deref of byref returns * add tests for Memory, ReadOnlySpan and ReadOnlyMemory * fix tests * simplify diff * simplify diff * remove duplicate error messages * fix build * test updates * fix build * fix build * update baselines * fix uses of NativePtr.toByRef * switch to inference using byref pointer capabilities * fix proto build * update baselines, byref extension methods * fix test errors * emit in,out,modreq attributes correctly * update tests * fix build * fix build * fix tests * fix tests * get it right silly boy * fix test * minor cleanup * add more tests * clarify overloading behaviour + test case * fix build break * fix build of tests * update tests * add more tests * byref fixes * updates for subsumption calls, error message, assign-to-return-byref * test updates, implicit deref on byref return for normal functions * update baseline * improve debug formatting, better error message on implicit deref, improve error messages * add more tests for recursive functions * update baselines * fix baselines * updates for new test cases * updates for new test cases * test updates and byref-to-byreflike * deal with 'M() <- expr' * restrict addresses of immutable top-level things * fix IsByRefLike on struct * update tests * fix test * fix test * improve check for no-return-of-struct-field-addresses * fix test case * Provide fast generic comparer for bool values (#5076) * provide fast generic comparer for bool values * formatting * no completion on name of value and function declaration (#5083) * LOC CHECKIN | Microsoft/visualfsharp master | 20180604 | Termchange (#5082) * fix merge
2018-06-05 16:23:37 +03:00
open System.Text
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
open System.Diagnostics
[<AutoOpen>]
module Scripting =
let isNullOrEmpty s = String.IsNullOrEmpty s
let executeProcess fileName arguments =
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
let processWriteMessage (chan:TextWriter) (message:string) =
if message <> null then
chan.WriteLine(message)
printfn "%s %s" fileName arguments
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
let info = ProcessStartInfo(Arguments=arguments, UseShellExecute=false,
RedirectStandardOutput=true, RedirectStandardError=true,
CreateNoWindow=true, FileName=fileName)
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
let p = new Process(StartInfo=info)
p.OutputDataReceived.Add(fun x -> processWriteMessage stdout x.Data)
p.ErrorDataReceived.Add(fun x -> processWriteMessage stderr x.Data)
if p.Start() then
p.BeginOutputReadLine()
p.BeginErrorReadLine()
p.WaitForExit()
p.ExitCode
else
0
#if INTERACTIVE
let argv = FSharp.Compiler.Interactive.Settings.fsi.CommandLineArgs |> Seq.skip 1 |> Seq.toArray
Enable Build/CI with Mono (#1703) This enables a build of this repo using Mono. - Use FSharp.Compiler.Tools nuget package as LKG (like fsharp/fsharp) - Update init-tools.cmd and init-tools.sh to be the latest from the .NET Core repos. - There are a bunch of simplifications and extra checking in FSharpSource,targets - Some of the key signing logic has Mono-compat implementations - Removed use of tuple structs from the compiler code (this was done when initially updating the LKG. I eventually updated the LKG to one that actually supports tuple structs, but the uses of the feature aren't needed in the compiler code, so I'll remove them in any case) - Adjust CustomCopyLocal and remove subst.exe. We can work out how to implement a copy-and-substitute at a later point. - Project files on Mono need to use <FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..</FSharpSourcesRoot> instead of <FSharpSourcesRoot>..\..</FSharpSourcesRoot> CoreCLR bits are not built on Mono though the PR includes some preliminary changes in that direction. We do some things differently on Linux/Mono: - UseMicroBuild is off - UseSourceLink is off - UseGatherBinaries is off - AddVsSdkAttributesToSomeCoreComponents is off The define CROSS_PLATFORM_COMPILER is set when building for Mono to workaround a couple of limitations in Mono. The code is written in a way so that it is valid to set it on Windows too, but we don't CI that. One odd de-capitalization change was needed in init-tools.sh to use microsoft.dotnet.buildtools instead of Microsoft.DotNet.BuildTools since the Linux package gets the former name See https://github.com/Microsoft/visualfsharp/pull/1703
2016-11-06 21:49:18 +03:00
let getCmdLineArgOptional (switchName: string) =
Enable Build/CI with Mono (#1703) This enables a build of this repo using Mono. - Use FSharp.Compiler.Tools nuget package as LKG (like fsharp/fsharp) - Update init-tools.cmd and init-tools.sh to be the latest from the .NET Core repos. - There are a bunch of simplifications and extra checking in FSharpSource,targets - Some of the key signing logic has Mono-compat implementations - Removed use of tuple structs from the compiler code (this was done when initially updating the LKG. I eventually updated the LKG to one that actually supports tuple structs, but the uses of the feature aren't needed in the compiler code, so I'll remove them in any case) - Adjust CustomCopyLocal and remove subst.exe. We can work out how to implement a copy-and-substitute at a later point. - Project files on Mono need to use <FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..</FSharpSourcesRoot> instead of <FSharpSourcesRoot>..\..</FSharpSourcesRoot> CoreCLR bits are not built on Mono though the PR includes some preliminary changes in that direction. We do some things differently on Linux/Mono: - UseMicroBuild is off - UseSourceLink is off - UseGatherBinaries is off - AddVsSdkAttributesToSomeCoreComponents is off The define CROSS_PLATFORM_COMPILER is set when building for Mono to workaround a couple of limitations in Mono. The code is written in a way so that it is valid to set it on Windows too, but we don't CI that. One odd de-capitalization change was needed in init-tools.sh to use microsoft.dotnet.buildtools instead of Microsoft.DotNet.BuildTools since the Linux package gets the former name See https://github.com/Microsoft/visualfsharp/pull/1703
2016-11-06 21:49:18 +03:00
argv |> Array.filter(fun t -> t.StartsWith(switchName)) |> Array.map(fun t -> t.Remove(0, switchName.Length).Trim()) |> Array.tryHead
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
let getCmdLineArg switchName defaultValue =
Enable Build/CI with Mono (#1703) This enables a build of this repo using Mono. - Use FSharp.Compiler.Tools nuget package as LKG (like fsharp/fsharp) - Update init-tools.cmd and init-tools.sh to be the latest from the .NET Core repos. - There are a bunch of simplifications and extra checking in FSharpSource,targets - Some of the key signing logic has Mono-compat implementations - Removed use of tuple structs from the compiler code (this was done when initially updating the LKG. I eventually updated the LKG to one that actually supports tuple structs, but the uses of the feature aren't needed in the compiler code, so I'll remove them in any case) - Adjust CustomCopyLocal and remove subst.exe. We can work out how to implement a copy-and-substitute at a later point. - Project files on Mono need to use <FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..</FSharpSourcesRoot> instead of <FSharpSourcesRoot>..\..</FSharpSourcesRoot> CoreCLR bits are not built on Mono though the PR includes some preliminary changes in that direction. We do some things differently on Linux/Mono: - UseMicroBuild is off - UseSourceLink is off - UseGatherBinaries is off - AddVsSdkAttributesToSomeCoreComponents is off The define CROSS_PLATFORM_COMPILER is set when building for Mono to workaround a couple of limitations in Mono. The code is written in a way so that it is valid to set it on Windows too, but we don't CI that. One odd de-capitalization change was needed in init-tools.sh to use microsoft.dotnet.buildtools instead of Microsoft.DotNet.BuildTools since the Linux package gets the former name See https://github.com/Microsoft/visualfsharp/pull/1703
2016-11-06 21:49:18 +03:00
match getCmdLineArgOptional switchName with
| Some file -> file
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
| _ -> defaultValue
Enable Build/CI with Mono (#1703) This enables a build of this repo using Mono. - Use FSharp.Compiler.Tools nuget package as LKG (like fsharp/fsharp) - Update init-tools.cmd and init-tools.sh to be the latest from the .NET Core repos. - There are a bunch of simplifications and extra checking in FSharpSource,targets - Some of the key signing logic has Mono-compat implementations - Removed use of tuple structs from the compiler code (this was done when initially updating the LKG. I eventually updated the LKG to one that actually supports tuple structs, but the uses of the feature aren't needed in the compiler code, so I'll remove them in any case) - Adjust CustomCopyLocal and remove subst.exe. We can work out how to implement a copy-and-substitute at a later point. - Project files on Mono need to use <FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..</FSharpSourcesRoot> instead of <FSharpSourcesRoot>..\..</FSharpSourcesRoot> CoreCLR bits are not built on Mono though the PR includes some preliminary changes in that direction. We do some things differently on Linux/Mono: - UseMicroBuild is off - UseSourceLink is off - UseGatherBinaries is off - AddVsSdkAttributesToSomeCoreComponents is off The define CROSS_PLATFORM_COMPILER is set when building for Mono to workaround a couple of limitations in Mono. The code is written in a way so that it is valid to set it on Windows too, but we don't CI that. One odd de-capitalization change was needed in init-tools.sh to use microsoft.dotnet.buildtools instead of Microsoft.DotNet.BuildTools since the Linux package gets the former name See https://github.com/Microsoft/visualfsharp/pull/1703
2016-11-06 21:49:18 +03:00
let getCmdLineArgReqd switchName =
match getCmdLineArg switchName null with
| null -> failwith (sprintf "The argument %s is required" switchName)
| x -> x
2016-11-17 03:21:24 +03:00
let getCmdLineExtraArgs isSwitch = argv |> Array.skipWhile isSwitch
#endif
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
let makeDirectory output =
if not (Directory.Exists(output)) then
Directory.CreateDirectory(output) |> ignore
let (++) a b = Path.Combine(a,b)
2018-11-27 21:10:43 +03:00
let getBasename (a:string) = Path.GetFileNameWithoutExtension a
let getFullPath (a:string) = Path.GetFullPath a
let getFilename (a:string) = Path.GetFileName a
let getDirectoryName (a:string) = Path.GetDirectoryName a
2018-11-27 21:10:43 +03:00
let copyFile (source:string) dir =
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
let dest =
if not (Directory.Exists dir) then Directory.CreateDirectory dir |>ignore
let result = Path.Combine(dir, getFilename source)
Squashed commit of the following: commit 2a991b6c8e30c712640e2869972f02c6313cc7e3 Author: Don Syme <dsyme@users.noreply.github.com> Date: Mon Oct 17 20:40:15 2016 +0100 Fix microbuild (#1629) commit 169d366713a31c0945328897db5fe58480bf1a43 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 15:04:50 2016 -0700 Add missed file. (#1625) * Ensure that portable libraries have correct hintpath for preview 5 * Replaced missed file commit d64ff35398a62c91103e9aa1373c2786bc0e83d6 Author: Don Syme <dsyme@users.noreply.github.com> Date: Sun Oct 16 22:37:08 2016 +0100 cleanup build and test scripts (#1615) * cleanup build and test scripts commit 39480c4c402eb6e37b2ccfa9961189d29b352289 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sun Oct 16 10:19:03 2016 -0700 Ensure that portable libraries have correct hintpath for preview 5 (#1624) commit 2fe5a3be8227a379a33845c04762f51d3dd24fcf Author: Kevin Ransom (msft) <codecutter@hotmail.com> Date: Sat Oct 15 14:03:48 2016 -0700 Add support for generating sourcelink record in portable pdbs. Fixes #1585 commit e0318a8f65a596ddf234171c70bc3c535fd5f27f Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:32:44 2016 -0700 FSharp ms build task to support new xommand line options (#1616) commit 749ba2dfbbb457e1d746ce7659965d0ce0b34eac Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Sat Oct 15 13:27:14 2016 -0700 Don't match braces at the end of the caret (#1619) commit 00bab9974f21e71db02e47a000cc6b101bf139a2 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Sat Oct 15 13:25:15 2016 -0700 (Nugetize F# templates. Ensure value tuple installed on create template. (#1620) commit 2a9b5ef8189500e0af7bf2364d1f89e9b3dd5d1f Author: Omar Tawfik <OmarTawfik@users.noreply.github.com> Date: Fri Oct 14 22:45:35 2016 -0700 Add fsx files to workspaces (#1612) * Add fsx files to workspaces * Stop passing project output paths to CPS * Read script file contents from memory (on workspace initialization) commit 8b434e0fedc4f5c51ace6d4c3191d04f01667546 Author: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com> Date: Fri Oct 14 10:32:59 2016 -0700 Don't try to deploy vsix during OSS build. Specify prereq in vsixmanifest (#1613) commit 79430d298d916dbfb2628b5c60b9254f3316cc0c Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 15:58:08 2016 +0100 simplify use of if-defs (#1614) commit b708921ebe0974a31b081f4bae58b4034f9beba9 Author: Don Syme <dsyme@users.noreply.github.com> Date: Fri Oct 14 10:25:28 2016 +0100 Always use FSharp.Core not fsharp.core (#1610)
2016-10-18 01:31:53 +03:00
result
//printfn "Copy %s --> %s" source dest
File.Copy(source, dest, true)
let deleteDirectory output =
if Directory.Exists output then
Directory.Delete(output, true)
let log format = printfn format
type FilePath = string
type CmdResult =
| Success
| ErrorLevel of string * int
type CmdArguments =
{ RedirectOutput : (string -> unit) option
RedirectError : (string -> unit) option
RedirectInput : (StreamWriter -> unit) option }
module Process =
2018-11-27 21:10:43 +03:00
let processExePath baseDir (exe:string) =
if Path.IsPathRooted(exe) then exe
else
match getDirectoryName exe with
| "" -> exe
| _ -> Path.Combine(baseDir,exe) |> Path.GetFullPath
let exec cmdArgs (workDir: FilePath) envs (path: FilePath) (arguments: string) =
let exePath = path |> processExePath workDir
let processInfo = new ProcessStartInfo(exePath, arguments)
processInfo.EnvironmentVariables.["DOTNET_ROLL_FORWARD"] <- "LatestMajor"
processInfo.EnvironmentVariables.["DOTNET_ROLL_FORWARD_TO_PRERELEASE"] <- "1"
processInfo.CreateNoWindow <- true
processInfo.UseShellExecute <- false
processInfo.WorkingDirectory <- workDir
ignore envs // work out what to do about this
let p = new Process()
p.EnableRaisingEvents <- true
p.StartInfo <- processInfo
Merge master to dev15.8 (#5087) * Update README.md * Update README.md * Update README.md * [RFCs FS-1051, FS-1052, FS-1053] support for span, readonly refs, byref-like structs (#4888) * initial support for span, readonly refs, byref-like structs * fix proto build * make proto work with previous FSharp.Core * make proto work with previous FSharp.Core * update baselines * integrate code cleanup * integrate code cleanup * integrate code cleanup * integrate code cleanup * fix build * fix build * implicit deref of byref returns * add tests for Memory, ReadOnlySpan and ReadOnlyMemory * fix tests * simplify diff * simplify diff * remove duplicate error messages * fix build * test updates * fix build * fix build * update baselines * fix uses of NativePtr.toByRef * switch to inference using byref pointer capabilities * fix proto build * update baselines, byref extension methods * fix test errors * emit in,out,modreq attributes correctly * update tests * fix build * fix build * fix tests * fix tests * get it right silly boy * fix test * minor cleanup * add more tests * clarify overloading behaviour + test case * fix build break * fix build of tests * update tests * add more tests * byref fixes * updates for subsumption calls, error message, assign-to-return-byref * test updates, implicit deref on byref return for normal functions * update baseline * improve debug formatting, better error message on implicit deref, improve error messages * add more tests for recursive functions * update baselines * fix baselines * updates for new test cases * updates for new test cases * test updates and byref-to-byreflike * deal with 'M() <- expr' * restrict addresses of immutable top-level things * fix IsByRefLike on struct * update tests * fix test * fix test * improve check for no-return-of-struct-field-addresses * fix test case * Provide fast generic comparer for bool values (#5076) * provide fast generic comparer for bool values * formatting * no completion on name of value and function declaration (#5083) * LOC CHECKIN | Microsoft/visualfsharp master | 20180604 | Termchange (#5082) * fix merge
2018-06-05 16:23:37 +03:00
let out = StringBuilder()
let err = StringBuilder()
cmdArgs.RedirectOutput|> Option.iter (fun f ->
processInfo.RedirectStandardOutput <- true
Merge master to dev15.8 (#5087) * Update README.md * Update README.md * Update README.md * [RFCs FS-1051, FS-1052, FS-1053] support for span, readonly refs, byref-like structs (#4888) * initial support for span, readonly refs, byref-like structs * fix proto build * make proto work with previous FSharp.Core * make proto work with previous FSharp.Core * update baselines * integrate code cleanup * integrate code cleanup * integrate code cleanup * integrate code cleanup * fix build * fix build * implicit deref of byref returns * add tests for Memory, ReadOnlySpan and ReadOnlyMemory * fix tests * simplify diff * simplify diff * remove duplicate error messages * fix build * test updates * fix build * fix build * update baselines * fix uses of NativePtr.toByRef * switch to inference using byref pointer capabilities * fix proto build * update baselines, byref extension methods * fix test errors * emit in,out,modreq attributes correctly * update tests * fix build * fix build * fix tests * fix tests * get it right silly boy * fix test * minor cleanup * add more tests * clarify overloading behaviour + test case * fix build break * fix build of tests * update tests * add more tests * byref fixes * updates for subsumption calls, error message, assign-to-return-byref * test updates, implicit deref on byref return for normal functions * update baseline * improve debug formatting, better error message on implicit deref, improve error messages * add more tests for recursive functions * update baselines * fix baselines * updates for new test cases * updates for new test cases * test updates and byref-to-byreflike * deal with 'M() <- expr' * restrict addresses of immutable top-level things * fix IsByRefLike on struct * update tests * fix test * fix test * improve check for no-return-of-struct-field-addresses * fix test case * Provide fast generic comparer for bool values (#5076) * provide fast generic comparer for bool values * formatting * no completion on name of value and function declaration (#5083) * LOC CHECKIN | Microsoft/visualfsharp master | 20180604 | Termchange (#5082) * fix merge
2018-06-05 16:23:37 +03:00
p.OutputDataReceived.Add (fun ea ->
if ea.Data <> null then
out.Append(ea.Data + Environment.NewLine) |> ignore
f ea.Data)
)
cmdArgs.RedirectError |> Option.iter (fun f ->
processInfo.RedirectStandardError <- true
Merge master to dev15.8 (#5087) * Update README.md * Update README.md * Update README.md * [RFCs FS-1051, FS-1052, FS-1053] support for span, readonly refs, byref-like structs (#4888) * initial support for span, readonly refs, byref-like structs * fix proto build * make proto work with previous FSharp.Core * make proto work with previous FSharp.Core * update baselines * integrate code cleanup * integrate code cleanup * integrate code cleanup * integrate code cleanup * fix build * fix build * implicit deref of byref returns * add tests for Memory, ReadOnlySpan and ReadOnlyMemory * fix tests * simplify diff * simplify diff * remove duplicate error messages * fix build * test updates * fix build * fix build * update baselines * fix uses of NativePtr.toByRef * switch to inference using byref pointer capabilities * fix proto build * update baselines, byref extension methods * fix test errors * emit in,out,modreq attributes correctly * update tests * fix build * fix build * fix tests * fix tests * get it right silly boy * fix test * minor cleanup * add more tests * clarify overloading behaviour + test case * fix build break * fix build of tests * update tests * add more tests * byref fixes * updates for subsumption calls, error message, assign-to-return-byref * test updates, implicit deref on byref return for normal functions * update baseline * improve debug formatting, better error message on implicit deref, improve error messages * add more tests for recursive functions * update baselines * fix baselines * updates for new test cases * updates for new test cases * test updates and byref-to-byreflike * deal with 'M() <- expr' * restrict addresses of immutable top-level things * fix IsByRefLike on struct * update tests * fix test * fix test * improve check for no-return-of-struct-field-addresses * fix test case * Provide fast generic comparer for bool values (#5076) * provide fast generic comparer for bool values * formatting * no completion on name of value and function declaration (#5083) * LOC CHECKIN | Microsoft/visualfsharp master | 20180604 | Termchange (#5082) * fix merge
2018-06-05 16:23:37 +03:00
p.ErrorDataReceived.Add (fun ea ->
if ea.Data <> null then
err.Append(ea.Data + Environment.NewLine) |> ignore
f ea.Data)
)
cmdArgs.RedirectInput
|> Option.iter (fun _ -> p.StartInfo.RedirectStandardInput <- true)
p.Start() |> ignore
cmdArgs.RedirectOutput |> Option.iter (fun _ -> p.BeginOutputReadLine())
cmdArgs.RedirectError |> Option.iter (fun _ -> p.BeginErrorReadLine())
cmdArgs.RedirectInput |> Option.iter (fun input ->
async {
let inputWriter = p.StandardInput
do! inputWriter.FlushAsync () |> Async.AwaitIAsyncResult |> Async.Ignore
input inputWriter
do! inputWriter.FlushAsync () |> Async.AwaitIAsyncResult |> Async.Ignore
inputWriter.Dispose ()
}
|> Async.Start)
p.WaitForExit()
match p.ExitCode with
| 0 -> Success
| errCode ->
Merge master to dev15.8 (#5087) * Update README.md * Update README.md * Update README.md * [RFCs FS-1051, FS-1052, FS-1053] support for span, readonly refs, byref-like structs (#4888) * initial support for span, readonly refs, byref-like structs * fix proto build * make proto work with previous FSharp.Core * make proto work with previous FSharp.Core * update baselines * integrate code cleanup * integrate code cleanup * integrate code cleanup * integrate code cleanup * fix build * fix build * implicit deref of byref returns * add tests for Memory, ReadOnlySpan and ReadOnlyMemory * fix tests * simplify diff * simplify diff * remove duplicate error messages * fix build * test updates * fix build * fix build * update baselines * fix uses of NativePtr.toByRef * switch to inference using byref pointer capabilities * fix proto build * update baselines, byref extension methods * fix test errors * emit in,out,modreq attributes correctly * update tests * fix build * fix build * fix tests * fix tests * get it right silly boy * fix test * minor cleanup * add more tests * clarify overloading behaviour + test case * fix build break * fix build of tests * update tests * add more tests * byref fixes * updates for subsumption calls, error message, assign-to-return-byref * test updates, implicit deref on byref return for normal functions * update baseline * improve debug formatting, better error message on implicit deref, improve error messages * add more tests for recursive functions * update baselines * fix baselines * updates for new test cases * updates for new test cases * test updates and byref-to-byreflike * deal with 'M() <- expr' * restrict addresses of immutable top-level things * fix IsByRefLike on struct * update tests * fix test * fix test * improve check for no-return-of-struct-field-addresses * fix test case * Provide fast generic comparer for bool values (#5076) * provide fast generic comparer for bool values * formatting * no completion on name of value and function declaration (#5083) * LOC CHECKIN | Microsoft/visualfsharp master | 20180604 | Termchange (#5082) * fix merge
2018-06-05 16:23:37 +03:00
let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'.\n---- stdout below --- \n%s\n---- stderr below --- \n%s " exePath arguments workDir (out.ToString()) (err.ToString())
ErrorLevel (msg, errCode)
type OutPipe (writer: TextWriter) =
member x.Post (msg:string) = lock writer (fun () -> writer.WriteLine(msg))
interface System.IDisposable with
member _.Dispose() = writer.Flush()
let redirectTo (writer: TextWriter) = new OutPipe (writer)
let redirectToLog () = redirectTo System.Console.Out
2020-04-22 20:37:27 +03:00
#if !NETCOREAPP
2016-11-17 03:21:24 +03:00
let defaultPlatform =
match Environment.OSVersion.Platform, Environment.Is64BitOperatingSystem with
| PlatformID.MacOSX, true -> "osx.10.11-x64"
2016-11-17 03:21:24 +03:00
| PlatformID.Unix,true -> "ubuntu.14.04-x64"
| _, true -> "win7-x64"
| _, false -> "win7-x86"
#endif
let executeProcessNoRedirect fileName arguments =
let info = ProcessStartInfo(Arguments=arguments, UseShellExecute=false,
RedirectStandardOutput=true, RedirectStandardError=true,RedirectStandardInput=true,
CreateNoWindow=true, FileName=fileName)
let p = new Process(StartInfo=info)
if p.Start() then
async { try
let buffer = Array.zeroCreate 4096
while not p.StandardOutput.EndOfStream do
let n = p.StandardOutput.Read(buffer, 0, buffer.Length)
if n > 0 then System.Console.Out.Write(buffer, 0, n)
with _ -> () } |> Async.Start
async { try
let buffer = Array.zeroCreate 4096
while not p.StandardError.EndOfStream do
let n = p.StandardError.Read(buffer, 0, buffer.Length)
if n > 0 then System.Console.Error.Write(buffer, 0, n)
with _ -> () } |> Async.Start
async { try
while true do
let c = System.Console.In.ReadLine()
p.StandardInput.WriteLine(c)
with _ -> () } |> Async.Start
p.WaitForExit()
p.ExitCode
else
0