Skip to content

Commit 262efd9

Browse files
authored
Merge branch 'main' into merges/release/dev17.5-to-main
2 parents 30508ef + e39cc29 commit 262efd9

File tree

163 files changed

+26153
-8400
lines changed

Some content is hidden

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

163 files changed

+26153
-8400
lines changed

azure-pipelines.yml

Lines changed: 22 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ stages:
217217
name: $(DncEngPublicBuildPool)
218218
demands: ImageOverride -equals $(WindowsMachineQueueName)
219219
timeoutInMinutes: 90
220+
strategy:
221+
maxParallel: 2
222+
matrix:
223+
regular:
224+
_experimental_flag: null
225+
experimental_features:
226+
_experimental_flag: 1
220227
steps:
221228
- checkout: self
222229
clean: true
@@ -229,6 +236,8 @@ stages:
229236
workingDirectory: $(Build.SourcesDirectory)
230237
installationPath: $(Build.SourcesDirectory)/.dotnet
231238
- script: .\eng\test-determinism.cmd -configuration Debug
239+
env:
240+
FSHARP_EXPERIMENTAL_FEATURES: $(_experimental_flag)
232241
displayName: Determinism tests with Debug configuration
233242
- task: PublishPipelineArtifact@1
234243
displayName: Publish Determinism Logs
@@ -280,64 +289,6 @@ stages:
280289
helixRepo: dotnet/fsharp
281290
jobs:
282291

283-
# Windows
284-
- job: Windows
285-
pool:
286-
# The PR build definition sets this variable:
287-
# WindowsMachineQueueName=Windows.vs2022.amd64.open
288-
# and there is an alternate build definition that sets this to a queue that is always scouting the
289-
# next preview of Visual Studio.
290-
name: $(DncEngPublicBuildPool)
291-
demands: ImageOverride -equals $(WindowsMachineQueueName)
292-
timeoutInMinutes: 120
293-
strategy:
294-
maxParallel: 4
295-
matrix:
296-
desktop_release:
297-
_configuration: Release
298-
_testKind: testDesktop
299-
coreclr_release:
300-
_configuration: Release
301-
_testKind: testCoreclr
302-
fsharpqa_release:
303-
_configuration: Release
304-
_testKind: testFSharpQA
305-
vs_release:
306-
_configuration: Release
307-
_testKind: testVs
308-
steps:
309-
- checkout: self
310-
clean: true
311-
- script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind)
312-
displayName: Build / Test
313-
- task: PublishTestResults@2
314-
displayName: Publish Test Results
315-
inputs:
316-
testResultsFormat: 'NUnit'
317-
testResultsFiles: '*.xml'
318-
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)'
319-
continueOnError: true
320-
condition: ne(variables['_testKind'], 'testFSharpQA')
321-
- task: PublishBuildArtifacts@1
322-
displayName: Publish Test Logs
323-
inputs:
324-
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)'
325-
ArtifactName: 'Windows $(_configuration) $(_testKind) test logs'
326-
publishLocation: Container
327-
continueOnError: true
328-
condition: failed()
329-
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
330-
displayName: Dump NuGet cache contents
331-
condition: failed()
332-
- task: PublishBuildArtifacts@1
333-
displayName: Publish NuGet cache contents
334-
inputs:
335-
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
336-
ArtifactName: 'NuGetPackageContents Windows $(_testKind)'
337-
publishLocation: Container
338-
continueOnError: true
339-
condition: failed()
340-
341292
# Windows With Compressed Metadata
342293
- job: WindowsCompressedMetadata
343294
pool:
@@ -492,11 +443,22 @@ stages:
492443
pool:
493444
name: $(DncEngPublicBuildPool)
494445
demands: ImageOverride -equals $(WindowsMachineQueueName)
446+
strategy:
447+
maxParallel: 2
448+
matrix:
449+
regular:
450+
_experimental_flag: null
451+
experimental_features:
452+
_experimental_flag: 1
495453
steps:
496454
- checkout: self
497455
clean: true
498456
- script: .\Build.cmd -c Release -pack
457+
env:
458+
FSHARP_EXPERIMENTAL_FEATURES: $(_experimental_flag)
499459
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release
460+
env:
461+
FSHARP_EXPERIMENTAL_FEATURES: $(_experimental_flag)
500462
displayName: End to end build tests
501463

502464
# Up-to-date - disabled due to it being flaky
@@ -512,35 +474,8 @@ stages:
512474
# filePath: eng\tests\UpToDate.ps1
513475
# arguments: -configuration $(_BuildConfig) -ci -binaryLog
514476

515-
# Run Build with --test:ParallelCheckingWithSignatureFilesOn
516-
- job: ParallelCheckingWithSignatureFiles
517-
condition: eq(variables['Build.Reason'], 'PullRequest')
518-
variables:
519-
- name: _SignType
520-
value: Test
521-
pool:
522-
name: $(DncEngPublicBuildPool)
523-
demands: ImageOverride -equals $(WindowsMachineQueueName)
524-
timeoutInMinutes: 90
525-
steps:
526-
- checkout: self
527-
clean: true
528-
- task: UseDotNet@2
529-
displayName: install SDK
530-
inputs:
531-
packageType: sdk
532-
useGlobalJson: true
533-
includePreviewVersions: false
534-
workingDirectory: $(Build.SourcesDirectory)
535-
installationPath: $(Build.SourcesDirectory)/.dotnet
536-
- script: .\build.cmd -c Release -binaryLog /p:ParallelCheckingWithSignatureFilesOn=true
537-
displayName: ParallelCheckingWithSignatureFiles build with Debug configuration
538-
- task: PublishPipelineArtifact@1
539-
displayName: Publish ParallelCheckingWithSignatureFiles Logs
540-
inputs:
541-
targetPath: '$(Build.SourcesDirectory)/artifacts/log/Release'
542-
artifactName: 'ParallelCheckingWithSignatureFiles Attempt $(System.JobAttempt) Logs'
543-
continueOnError: true
477+
# Run Build with Fsharp Experimental Features
478+
# Possible change: --times:$(Build.SourcesDirectory)/artifacts/log/Release/compiler_timing.csv
544479

545480
# Plain build Windows
546481
- job: Plain_Build_Windows

buildtools/fslex/Arg.fs

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// (c) Microsoft Corporation 2005-2009.
22

3-
#if INTERNALIZED_FSLEXYACC_RUNTIME
4-
namespace Internal.Utilities
5-
#else
6-
namespace Microsoft.FSharp.Text
7-
#endif
8-
3+
namespace FSharp.Text
94

105
type ArgType =
116
| ClearArg of bool ref
@@ -35,38 +30,38 @@ exception HelpText of string
3530
[<Sealed>]
3631
type ArgParser() =
3732
static let getUsage specs u =
38-
let sbuf = new System.Text.StringBuilder 100
33+
let sbuf = System.Text.StringBuilder 100
3934
let pstring (s:string) = sbuf.Append s |> ignore
4035
let pendline s = pstring s; pstring "\n"
4136
pendline u;
4237
List.iter (fun (arg:ArgInfo) ->
4338
match arg.Name, arg.ArgType, arg.HelpText with
44-
| (s, (UnitArg _ | SetArg _ | ClearArg _), helpText) -> pstring "\t"; pstring s; pstring ": "; pendline helpText
45-
| (s, StringArg _, helpText) -> pstring "\t"; pstring s; pstring " <string>: "; pendline helpText
46-
| (s, IntArg _, helpText) -> pstring "\t"; pstring s; pstring " <int>: "; pendline helpText
47-
| (s, FloatArg _, helpText) -> pstring "\t"; pstring s; pstring " <float>: "; pendline helpText
48-
| (s, RestArg _, helpText) -> pstring "\t"; pstring s; pstring " ...: "; pendline helpText)
39+
| s, (UnitArg _ | SetArg _ | ClearArg _), helpText -> pstring "\t"; pstring s; pstring ": "; pendline helpText
40+
| s, StringArg _, helpText -> pstring "\t"; pstring s; pstring " <string>: "; pendline helpText
41+
| s, IntArg _, helpText -> pstring "\t"; pstring s; pstring " <int>: "; pendline helpText
42+
| s, FloatArg _, helpText -> pstring "\t"; pstring s; pstring " <float>: "; pendline helpText
43+
| s, RestArg _, helpText -> pstring "\t"; pstring s; pstring " ...: "; pendline helpText)
4944
specs;
5045
pstring "\t"; pstring "--help"; pstring ": "; pendline "display this list of options";
5146
pstring "\t"; pstring "-help"; pstring ": "; pendline "display this list of options";
5247
sbuf.ToString()
5348

5449

5550
static member ParsePartial(cursor,argv,arguments:seq<ArgInfo>,?otherArgs,?usageText) =
56-
let otherArgs = defaultArg otherArgs (fun _ -> ())
51+
let other = defaultArg otherArgs (fun _ -> ())
5752
let usageText = defaultArg usageText ""
5853
let nargs = Array.length argv
5954
incr cursor;
60-
let arguments = arguments |> Seq.toList
61-
let specs = arguments |> List.map (fun (arg:ArgInfo) -> arg.Name, arg.ArgType)
55+
let argSpecs = arguments |> Seq.toList
56+
let specs = argSpecs |> List.map (fun (arg:ArgInfo) -> arg.Name, arg.ArgType)
6257
while !cursor < nargs do
6358
let arg = argv.[!cursor]
6459
let rec findMatchingArg args =
6560
match args with
66-
| ((s, action) :: _) when s = arg ->
61+
| (s, action) :: _ when s = arg ->
6762
let getSecondArg () =
6863
if !cursor + 1 >= nargs then
69-
raise(Bad("option "+s+" needs an argument.\n"+getUsage arguments usageText));
64+
raise(Bad("option "+s+" needs an argument.\n"+getUsage argSpecs usageText));
7065
argv.[!cursor+1]
7166

7267
match action with
@@ -85,40 +80,40 @@ type ArgParser() =
8580
cursor := !cursor + 2
8681
| IntArg f ->
8782
let arg2 = getSecondArg ()
88-
let arg2 = try int32 arg2 with _ -> raise(Bad(getUsage arguments usageText)) in
83+
let arg2 = try int32 arg2 with _ -> raise(Bad(getUsage argSpecs usageText)) in
8984
f arg2;
9085
cursor := !cursor + 2;
9186
| FloatArg f ->
9287
let arg2 = getSecondArg()
93-
let arg2 = try float arg2 with _ -> raise(Bad(getUsage arguments usageText)) in
88+
let arg2 = try float arg2 with _ -> raise(Bad(getUsage argSpecs usageText)) in
9489
f arg2;
9590
cursor := !cursor + 2;
9691
| RestArg f ->
9792
incr cursor;
9893
while !cursor < nargs do
99-
f (argv.[!cursor]);
94+
f argv.[!cursor];
10095
incr cursor;
10196

102-
| (_ :: more) -> findMatchingArg more
97+
| _ :: more -> findMatchingArg more
10398
| [] ->
10499
if arg = "-help" || arg = "--help" || arg = "/help" || arg = "/help" || arg = "/?" then
105-
raise (HelpText (getUsage arguments usageText))
100+
raise (HelpText (getUsage argSpecs usageText))
106101
// Note: for '/abc/def' does not count as an argument
107102
// Note: '/abc' does
108-
elif arg.Length>0 && (arg.[0] = '-' || (arg.[0] = '/' && not (arg.Length > 1 && arg.[1..].Contains ("/")))) then
109-
raise (Bad ("unrecognized argument: "+ arg + "\n" + getUsage arguments usageText))
103+
elif arg.Length>0 && (arg.[0] = '-' || (arg.[0] = '/' && not (arg.Length > 1 && arg.[1..].Contains "/"))) then
104+
raise (Bad ("unrecognized argument: "+ arg + "\n" + getUsage argSpecs usageText))
110105
else
111-
otherArgs arg;
106+
other arg;
112107
incr cursor
113108
findMatchingArg specs
114109

115-
static member Usage (arguments,?usage) =
110+
static member Usage (arguments, ?usage) =
116111
let usage = defaultArg usage ""
117112
System.Console.Error.WriteLine (getUsage (Seq.toList arguments) usage)
118113

119114
#if FX_NO_COMMAND_LINE_ARGS
120115
#else
121-
static member Parse (arguments,?otherArgs,?usageText) =
116+
static member Parse (arguments, ?otherArgs,?usageText) =
122117
let current = ref 0
123118
let argv = System.Environment.GetCommandLineArgs()
124119
try ArgParser.ParsePartial (current, argv, arguments, ?otherArgs=otherArgs, ?usageText=usageText)
@@ -128,6 +123,6 @@ type ArgParser() =
128123
System.Console.Error.WriteLine h;
129124
System.Console.Error.Flush();
130125
System.Environment.Exit(1);
131-
| e ->
126+
| _ ->
132127
reraise()
133128
#endif

buildtools/fslex/Arg.fsi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
// (c) Microsoft Corporation 2005-2009.
22

33
/// A simple command-line argument processor.
4-
#if INTERNALIZED_FSLEXYACC_RUNTIME
5-
namespace Internal.Utilities
6-
#else
7-
namespace Microsoft.FSharp.Text
8-
#endif
4+
namespace FSharp.Text
95

106
/// The spec value describes the action of the argument,
117
/// and whether it expects a following parameter.
@@ -37,7 +33,7 @@ type ArgParser =
3733
[<System.Obsolete("This method should not be used directly as it will be removed in a future revision of this library")>]
3834
static member ParsePartial: cursor: int ref * argv: string[] * arguments:seq<ArgInfo> * ?otherArgs: (string -> unit) * ?usageText:string -> unit
3935

40-
/// Parse the arguments given by System.Environment.GetEnvironmentVariables()
36+
/// Parse the arguments given by System.Environment.GetCommandLineArgs()
4137
/// according to the argument processing specifications "specs".
4238
/// Args begin with "-". Non-arguments are passed to "f" in
4339
/// order. "use" is printed as part of the usage line if an error occurs.

0 commit comments

Comments
 (0)