Skip to content

Commit b1b810f

Browse files
authored
Fix 17561 - FS0243 - Unrecognized option: '--realsig- (#17562)
* Fix 17561 * tests
1 parent 02adf13 commit b1b810f

File tree

4 files changed

+12
-63
lines changed

4 files changed

+12
-63
lines changed

docs/release-notes/.FSharp.Compiler.Service/8.0.400.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Fix for exponential runtime in CE builders when using nested implicit yields [PR #17096](https://github.com/dotnet/fsharp/pull/17096)
1919
* Fix several AND operator parser bugs and regressions ([Issue #16447](https://github.com/dotnet/fsharp/issues/16447), [Issue #17134](https://github.com/dotnet/fsharp/issues/17134), [Issue #16309](https://github.com/dotnet/fsharp/issues/16309), [PR #17113](https://github.com/dotnet/fsharp/pull/17113))
2020
* Treat exceptions as types in a namespace for graph based type checking ([Issue #17262](https://github.com/dotnet/fsharp/issues/17262), [PR #17268](https://github.com/dotnet/fsharp/pull/17268))
21+
* FS0243 - Unrecognized option: '--realsig-' #17561 ([Issue #17561](https://github.com/dotnet/fsharp/issues/17561), [PR #17268](https://github.com/dotnet/fsharp/pull/17562))
2122

2223
### Added
2324

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<!-- F# Version components -->
1515
<FSMajorVersion>8</FSMajorVersion>
1616
<FSMinorVersion>0</FSMinorVersion>
17-
<FSBuildVersion>400</FSBuildVersion>
17+
<FSBuildVersion>401</FSBuildVersion>
1818
<FSRevisionVersion>0</FSRevisionVersion>
1919
<!-- -->
2020
<!-- F# Language version -->

src/FSharp.Build/Fsc.fs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type public Fsc() as this =
5656
let mutable preferredUILang: string MaybeNull = null
5757
let mutable publicSign: bool = false
5858
let mutable provideCommandLineArgs: bool = false
59-
let mutable realsig: bool = false
59+
let mutable realsig: bool option = None
6060
let mutable references: ITaskItem[] = [||]
6161
let mutable referencePath: string MaybeNull = null
6262
let mutable refOnly: bool = false
@@ -196,10 +196,10 @@ type public Fsc() as this =
196196
builder.AppendSwitch("--optimize-")
197197

198198
// realsig
199-
if realsig then
200-
builder.AppendSwitch("--realsig+")
201-
else
202-
builder.AppendSwitch("--realsig-")
199+
match realsig with
200+
| Some true -> builder.AppendSwitch("--realsig+")
201+
| Some false -> builder.AppendSwitch("--realsig-")
202+
| None -> ()
203203

204204
// Tailcalls
205205
if not tailcalls then
@@ -539,8 +539,11 @@ type public Fsc() as this =
539539

540540
// --realsig[+-]
541541
member _.RealSig
542-
with get () = realsig
543-
and set (b) = realsig <- b
542+
with get () =
543+
match realsig with
544+
| Some true -> true
545+
| _ -> false
546+
and set (b) = realsig <- Some b
544547

545548
// -r <string>: Reference an F# or .NET assembly.
546549
member _.References

vsintegration/tests/UnitTests/Tests.Build.fs

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ type Build() =
7979
printfn "cmd=\"%s\"" cmd
8080
AssertEqual ("--codepage:65001" + Environment.NewLine +
8181
"--optimize+" + Environment.NewLine +
82-
"--realsig-" + Environment.NewLine +
8382
"--fullpaths" + Environment.NewLine +
8483
"--flaterrors" + Environment.NewLine +
8584
"--highentropyva-" + Environment.NewLine +
@@ -95,7 +94,6 @@ type Build() =
9594
printfn "cmd=\"%s\"" cmd
9695
AssertEqual ("-g" + Environment.NewLine +
9796
"--optimize+" + Environment.NewLine +
98-
"--realsig-" + Environment.NewLine +
9997
"--fullpaths" + Environment.NewLine +
10098
"--flaterrors" + Environment.NewLine +
10199
"--highentropyva-" + Environment.NewLine +
@@ -111,7 +109,6 @@ type Build() =
111109
printfn "cmd=\"%s\"" cmd
112110
AssertEqual ("--debug:pdbonly" + Environment.NewLine +
113111
"--optimize+" + Environment.NewLine +
114-
"--realsig-" + Environment.NewLine +
115112
"--fullpaths" + Environment.NewLine +
116113
"--flaterrors" + Environment.NewLine +
117114
"--highentropyva-" + Environment.NewLine +
@@ -129,7 +126,6 @@ type Build() =
129126
AssertEqual ("--define:FOO=3" + Environment.NewLine +
130127
"--define:BAR=4" + Environment.NewLine +
131128
"--optimize+" + Environment.NewLine +
132-
"--realsig-" + Environment.NewLine +
133129
"--fullpaths" + Environment.NewLine +
134130
"--flaterrors" + Environment.NewLine +
135131
"--highentropyva-" + Environment.NewLine +
@@ -144,7 +140,6 @@ type Build() =
144140
let cmd = tool.InternalGenerateResponseFileCommands()
145141
printfn "cmd=\"%s\"" cmd
146142
AssertEqual ("--optimize+" + Environment.NewLine +
147-
"--realsig-" + Environment.NewLine +
148143
"--nowarn:52,109" + Environment.NewLine +
149144
"--fullpaths" + Environment.NewLine +
150145
"--flaterrors" + Environment.NewLine +
@@ -160,7 +155,6 @@ type Build() =
160155
let cmd = tool.InternalGenerateResponseFileCommands()
161156
printfn "cmd=\"%s\"" cmd
162157
AssertEqual ("--optimize+" + Environment.NewLine +
163-
"--realsig-" + Environment.NewLine +
164158
"--fullpaths" + Environment.NewLine +
165159
"--flaterrors" + Environment.NewLine +
166160
"--highentropyva-" + Environment.NewLine +
@@ -175,7 +169,6 @@ type Build() =
175169
let cmd = tool.InternalGenerateResponseFileCommands()
176170
printfn "cmd=\"%s\"" cmd
177171
AssertEqual ("--optimize+" + Environment.NewLine +
178-
"--realsig-" + Environment.NewLine +
179172
"--warnaserror-:52,109" + Environment.NewLine +
180173
"--fullpaths" + Environment.NewLine +
181174
"--flaterrors" + Environment.NewLine +
@@ -189,9 +182,7 @@ type Build() =
189182
tool.VersionFile <- "src/version"
190183
AssertEqual "src/version" tool.VersionFile
191184
let cmd = tool.InternalGenerateResponseFileCommands()
192-
printfn "cmd=\"%s\"" cmd
193185
AssertEqual ("--optimize+" + Environment.NewLine +
194-
"--realsig-" + Environment.NewLine +
195186
"--versionfile:src/version" + Environment.NewLine +
196187
"--fullpaths" + Environment.NewLine +
197188
"--flaterrors" + Environment.NewLine +
@@ -208,7 +199,6 @@ type Build() =
208199
printfn "cmd=\"%s\"" cmd
209200
AssertEqual ("--doc:foo.xml" + Environment.NewLine +
210201
"--optimize+" + Environment.NewLine +
211-
"--realsig-" + Environment.NewLine +
212202
"--fullpaths" + Environment.NewLine +
213203
"--flaterrors" + Environment.NewLine +
214204
"--highentropyva-" + Environment.NewLine +
@@ -224,7 +214,6 @@ type Build() =
224214
printfn "cmd=\"%s\"" cmd
225215
AssertEqual ("--sig:foo.fsi" + Environment.NewLine +
226216
"--optimize+" + Environment.NewLine +
227-
"--realsig-" + Environment.NewLine +
228217
"--fullpaths" + Environment.NewLine +
229218
"--flaterrors" + Environment.NewLine +
230219
"--highentropyva-" + Environment.NewLine +
@@ -240,7 +229,6 @@ type Build() =
240229
printfn "cmd=\"%s\"" cmd
241230
AssertEqual ("--keyfile:key.txt" + Environment.NewLine +
242231
"--optimize+" + Environment.NewLine +
243-
"--realsig-" + Environment.NewLine +
244232
"--fullpaths" + Environment.NewLine +
245233
"--flaterrors" + Environment.NewLine +
246234
"--highentropyva-" + Environment.NewLine +
@@ -256,7 +244,6 @@ type Build() =
256244
printfn "cmd=\"%s\"" cmd
257245
AssertEqual ("--noframework" + Environment.NewLine +
258246
"--optimize+" + Environment.NewLine +
259-
"--realsig-" + Environment.NewLine +
260247
"--fullpaths" + Environment.NewLine +
261248
"--flaterrors" + Environment.NewLine +
262249
"--highentropyva-" + Environment.NewLine +
@@ -269,9 +256,7 @@ type Build() =
269256
tool.Optimize <- false
270257
AssertEqual false tool.Optimize
271258
let cmd = tool.InternalGenerateResponseFileCommands()
272-
printfn "cmd=\"%s\"" cmd
273259
AssertEqual ("--optimize-" + Environment.NewLine +
274-
"--realsig-" + Environment.NewLine +
275260
"--fullpaths" + Environment.NewLine +
276261
"--flaterrors" + Environment.NewLine +
277262
"--highentropyva-" + Environment.NewLine +
@@ -285,9 +270,7 @@ type Build() =
285270
AssertEqual true tool.Tailcalls
286271
let cmd = tool.InternalGenerateResponseFileCommands()
287272
printfn "cmd=\"%s\"" cmd
288-
// REVIEW we don't put the default, is that desired?
289273
AssertEqual ("--optimize+" + Environment.NewLine +
290-
"--realsig-" + Environment.NewLine +
291274
"--fullpaths" + Environment.NewLine +
292275
"--flaterrors" + Environment.NewLine +
293276
"--highentropyva-" + Environment.NewLine +
@@ -300,9 +283,7 @@ type Build() =
300283
tool.OtherFlags <- "--yadda yadda"
301284
AssertEqual "--yadda yadda" tool.OtherFlags
302285
let cmd = tool.InternalGenerateResponseFileCommands()
303-
printfn "cmd=\"%s\"" cmd
304286
AssertEqual ("--optimize+" + Environment.NewLine +
305-
"--realsig-" + Environment.NewLine +
306287
"--fullpaths" + Environment.NewLine +
307288
"--flaterrors" + Environment.NewLine +
308289
"--highentropyva-" + Environment.NewLine +
@@ -320,7 +301,6 @@ type Build() =
320301
printfn "cmd=\"%s\"" cmd
321302
AssertEqual ("-o:oUt.dll" + Environment.NewLine +
322303
"--optimize+" + Environment.NewLine +
323-
"--realsig-" + Environment.NewLine +
324304
"--fullpaths" + Environment.NewLine +
325305
"--flaterrors" + Environment.NewLine +
326306
"--highentropyva-" + Environment.NewLine +
@@ -333,9 +313,7 @@ type Build() =
333313
tool.PdbFile <- "out.pdb"
334314
AssertEqual "out.pdb" tool.PdbFile
335315
let cmd = tool.InternalGenerateResponseFileCommands()
336-
printfn "cmd=\"%s\"" cmd
337316
AssertEqual ("--optimize+" + Environment.NewLine +
338-
"--realsig-" + Environment.NewLine +
339317
"--pdb:out.pdb" + Environment.NewLine +
340318
"--fullpaths" + Environment.NewLine +
341319
"--flaterrors" + Environment.NewLine +
@@ -349,9 +327,7 @@ type Build() =
349327
tool.Platform <- "x64"
350328
AssertEqual "x64" tool.Platform
351329
let cmd = tool.InternalGenerateResponseFileCommands()
352-
printfn "cmd=\"%s\"" cmd
353330
AssertEqual ("--optimize+" + Environment.NewLine +
354-
"--realsig-" + Environment.NewLine +
355331
"--platform:x64" + Environment.NewLine +
356332
"--fullpaths" + Environment.NewLine +
357333
"--flaterrors" + Environment.NewLine +
@@ -365,9 +341,7 @@ type Build() =
365341
tool.Platform <- "x86"
366342
AssertEqual "x86" tool.Platform
367343
let cmd = tool.InternalGenerateResponseFileCommands()
368-
printfn "cmd=\"%s\"" cmd
369344
AssertEqual ("--optimize+" + Environment.NewLine +
370-
"--realsig-" + Environment.NewLine +
371345
"--platform:x86" + Environment.NewLine +
372346
"--fullpaths" + Environment.NewLine +
373347
"--flaterrors" + Environment.NewLine +
@@ -382,9 +356,7 @@ type Build() =
382356
tool.References <- [| MakeTaskItem dll |]
383357
AssertEqual 1 tool.References.Length
384358
let cmd = tool.InternalGenerateResponseFileCommands()
385-
printfn "cmd=\"%s\"" cmd
386359
AssertEqual ("--optimize+" + Environment.NewLine +
387-
"--realsig-" + Environment.NewLine +
388360
"-r:" + dll + Environment.NewLine +
389361
"--fullpaths" + Environment.NewLine +
390362
"--flaterrors" + Environment.NewLine +
@@ -399,9 +371,7 @@ type Build() =
399371
tool.ReferencePath <- path
400372
AssertEqual path tool.ReferencePath
401373
let cmd = tool.InternalGenerateResponseFileCommands()
402-
printfn "cmd=\"%s\"" cmd
403374
AssertEqual ("--optimize+" + Environment.NewLine +
404-
"--realsig-" + Environment.NewLine +
405375
"--lib:c:\\sd\\staging\\tools\\nunit\\,c:\\Foo" + Environment.NewLine +
406376
"--fullpaths" + Environment.NewLine +
407377
"--flaterrors" + Environment.NewLine +
@@ -416,9 +386,7 @@ type Build() =
416386
tool.ReferencePath <- path
417387
AssertEqual path tool.ReferencePath
418388
let cmd = tool.InternalGenerateResponseFileCommands()
419-
printfn "cmd=\"%s\"" cmd
420389
AssertEqual ("--optimize+" + Environment.NewLine +
421-
"--realsig-" + Environment.NewLine +
422390
"--lib:c:\\program files,c:\\sd\\staging\\tools\\nunit,c:\\Foo" + Environment.NewLine +
423391
"--fullpaths" + Environment.NewLine +
424392
"--flaterrors" + Environment.NewLine +
@@ -432,9 +400,7 @@ type Build() =
432400
tool.Resources <- [| MakeTaskItem "Foo.resources" |]
433401
AssertEqual 1 tool.Resources.Length
434402
let cmd = tool.InternalGenerateResponseFileCommands()
435-
printfn "cmd=\"%s\"" cmd
436403
AssertEqual ("--optimize+" + Environment.NewLine +
437-
"--realsig-" + Environment.NewLine +
438404
"--resource:Foo.resources" + Environment.NewLine +
439405
"--fullpaths" + Environment.NewLine +
440406
"--flaterrors" + Environment.NewLine +
@@ -450,9 +416,7 @@ type Build() =
450416
tool.Sources <- [| iti; iti |]
451417
AssertEqual 2 tool.Sources.Length
452418
let cmd = tool.InternalGenerateResponseFileCommands()
453-
printfn "cmd=\"%s\"" cmd
454419
AssertEqual ("--optimize+" + Environment.NewLine +
455-
"--realsig-" + Environment.NewLine +
456420
"--fullpaths" + Environment.NewLine +
457421
"--flaterrors" + Environment.NewLine +
458422
"--highentropyva-" + Environment.NewLine +
@@ -468,9 +432,7 @@ type Build() =
468432
tool.TargetType <- "Library"
469433
AssertEqual "Library" tool.TargetType
470434
let cmd = tool.InternalGenerateResponseFileCommands()
471-
printfn "cmd=\"%s\"" cmd
472435
AssertEqual ("--optimize+" + Environment.NewLine +
473-
"--realsig-" + Environment.NewLine +
474436
"--target:library" + Environment.NewLine +
475437
"--fullpaths" + Environment.NewLine +
476438
"--flaterrors" + Environment.NewLine +
@@ -484,9 +446,7 @@ type Build() =
484446
tool.TargetType <- "Winexe"
485447
AssertEqual "Winexe" tool.TargetType
486448
let cmd = tool.InternalGenerateResponseFileCommands()
487-
printfn "cmd=\"%s\"" cmd
488449
AssertEqual ("--optimize+" + Environment.NewLine +
489-
"--realsig-" + Environment.NewLine +
490450
"--target:winexe" + Environment.NewLine +
491451
"--fullpaths" + Environment.NewLine +
492452
"--flaterrors" + Environment.NewLine +
@@ -500,9 +460,7 @@ type Build() =
500460
tool.TargetType <- "Module"
501461
AssertEqual "Module" tool.TargetType
502462
let cmd = tool.InternalGenerateResponseFileCommands()
503-
printfn "cmd=\"%s\"" cmd
504463
AssertEqual ("--optimize+" + Environment.NewLine +
505-
"--realsig-" + Environment.NewLine +
506464
"--target:module" + Environment.NewLine +
507465
"--fullpaths" + Environment.NewLine +
508466
"--flaterrors" + Environment.NewLine +
@@ -515,9 +473,7 @@ type Build() =
515473
let tool = new FSharp.Build.Fsc()
516474
tool.Utf8Output <- true
517475
let cmd = tool.InternalGenerateResponseFileCommands()
518-
printfn "cmd=\"%s\"" cmd
519476
AssertEqual ("--optimize+" + Environment.NewLine +
520-
"--realsig-" + Environment.NewLine +
521477
"--utf8output" + Environment.NewLine +
522478
"--fullpaths" + Environment.NewLine +
523479
"--flaterrors" + Environment.NewLine +
@@ -530,9 +486,7 @@ type Build() =
530486
let tool = new FSharp.Build.Fsc()
531487
tool.Win32ResourceFile <- "foo.res"
532488
let cmd = tool.InternalGenerateResponseFileCommands()
533-
printfn "cmd=\"%s\"" cmd
534489
AssertEqual ("--optimize+" + Environment.NewLine +
535-
"--realsig-" + Environment.NewLine +
536490
"--win32res:foo.res" + Environment.NewLine +
537491
"--fullpaths" + Environment.NewLine +
538492
"--flaterrors" + Environment.NewLine +
@@ -545,9 +499,7 @@ type Build() =
545499
let tool = new FSharp.Build.Fsc()
546500
tool.Win32ManifestFile <- "foo.manifest"
547501
let cmd = tool.InternalGenerateResponseFileCommands()
548-
printfn "cmd=\"%s\"" cmd
549502
AssertEqual ("--optimize+" + Environment.NewLine +
550-
"--realsig-" + Environment.NewLine +
551503
"--win32manifest:foo.manifest" + Environment.NewLine +
552504
"--fullpaths" + Environment.NewLine +
553505
"--flaterrors" + Environment.NewLine +
@@ -560,9 +512,7 @@ type Build() =
560512
let tool = new FSharp.Build.Fsc()
561513
tool.HighEntropyVA <- true
562514
let cmd = tool.InternalGenerateResponseFileCommands()
563-
printfn "cmd=\"%s\"" cmd
564515
AssertEqual ("--optimize+" + Environment.NewLine +
565-
"--realsig-" + Environment.NewLine +
566516
"--fullpaths" + Environment.NewLine +
567517
"--flaterrors" + Environment.NewLine +
568518
"--highentropyva+" + Environment.NewLine +
@@ -574,9 +524,7 @@ type Build() =
574524
let tool = new FSharp.Build.Fsc()
575525
tool.SubsystemVersion <- "6.02"
576526
let cmd = tool.InternalGenerateResponseFileCommands()
577-
printfn "cmd=\"%s\"" cmd
578527
AssertEqual ("--optimize+" + Environment.NewLine +
579-
"--realsig-" + Environment.NewLine +
580528
"--fullpaths" + Environment.NewLine +
581529
"--flaterrors" + Environment.NewLine +
582530
"--subsystemversion:6.02" + Environment.NewLine +
@@ -631,7 +579,6 @@ type Build() =
631579
"--sig:foo.fsi" + Environment.NewLine +
632580
"--keyfile:key.txt" + Environment.NewLine +
633581
"--optimize+" + Environment.NewLine +
634-
"--realsig-" + Environment.NewLine +
635582
"--pdb:out.pdb" + Environment.NewLine +
636583
"--platform:anycpu" + Environment.NewLine +
637584
"--resource:MyRes.resources" + Environment.NewLine +
@@ -675,7 +622,6 @@ type Build() =
675622
"--sig:foo.fsi"
676623
"--keyfile:key.txt"
677624
"--optimize+"
678-
"--realsig-"
679625
"--pdb:out.pdb"
680626
"--platform:anycpu"
681627
"--resource:MyRes.resources"
@@ -719,7 +665,6 @@ type Build() =
719665

720666
let expected =
721667
"--optimize+" + Environment.NewLine +
722-
"--realsig-" + Environment.NewLine +
723668
"--nowarn:52,109,110,73,85" + Environment.NewLine +
724669
"--fullpaths" + Environment.NewLine +
725670
"--flaterrors" + Environment.NewLine +

0 commit comments

Comments
 (0)