Skip to content

Commit 3cdf31d

Browse files
committed
shadowcopy doesn't work with public sign
1 parent 36e5c9b commit 3cdf31d

File tree

3 files changed

+58
-48
lines changed

3 files changed

+58
-48
lines changed

src/FSharpSource.targets

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
<IsPortableProfile>true</IsPortableProfile>
2525
</PropertyGroup>
2626
<PropertyGroup>
27-
<OtherFlags>$(OtherFlags) --publicsign+ --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
27+
<OtherFlags Condition="'$(TargetFramework)' == 'coreclr'">$(OtherFlags) --delaysign+</OtherFlags>
28+
<OtherFlags Condition="'$(TargetFramework)' != 'coreclr'">$(OtherFlags) --publicsign+</OtherFlags>
29+
<OtherFlags>$(OtherFlags) --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
2830
<DefineConstants>STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY;$(DefineConstants)</DefineConstants>
2931
<StrongNames>true</StrongNames>
3032
<MicroBuildAssemblyVersion>$(FSCoreVersion)</MicroBuildAssemblyVersion>
@@ -33,7 +35,9 @@
3335
</When>
3436
<When Condition="'$(AssemblyName)' == 'FSharp.LanguageService' or '$(AssemblyName)' == 'FSharp.LanguageService.Compiler' or '$(AssemblyName)' == 'FSharp.Editor' or '$(AssemblyName)' == 'FSharp.VS.FSI' or '$(AssemblyName)' == 'FSharp.ProjectSystem.FSharp'">
3537
<PropertyGroup>
36-
<OtherFlags>$(OtherFlags) --publicsign+ --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
38+
<OtherFlags Condition="'$(TargetFramework)' == 'coreclr'">$(OtherFlags) --delaysign+</OtherFlags>
39+
<OtherFlags Condition="'$(TargetFramework)' != 'coreclr'">$(OtherFlags) --publicsign+</OtherFlags>
40+
<OtherFlags>$(OtherFlags) --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
3741
<DefineConstants>STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY;$(DefineConstants)</DefineConstants>
3842
<StrongNames>true</StrongNames>
3943
<MicroBuildAssemblyVersion>15.4.1.0</MicroBuildAssemblyVersion>
@@ -51,7 +55,9 @@
5155
</When>
5256
<Otherwise>
5357
<PropertyGroup Condition="'$(SIGN_WITH_MSFT_KEY)' == 'true'">
54-
<OtherFlags>$(OtherFlags) --publicsign+ --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
58+
<OtherFlags Condition="'$(TargetFramework)' == 'coreclr'">$(OtherFlags) --delaysign+</OtherFlags>
59+
<OtherFlags Condition="'$(TargetFramework)' != 'coreclr'">$(OtherFlags) --publicsign+</OtherFlags>
60+
<OtherFlags>$(OtherFlags) --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
5561
<DefineConstants>STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY;$(DefineConstants)</DefineConstants>
5662
<StrongNames>true</StrongNames>
5763
<MicroBuildAssemblyVersion>$(FSCoreVersion)</MicroBuildAssemblyVersion>

tests/fsharp/core/tests_core.fs

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -163,51 +163,54 @@ module Events =
163163
do! run cfg dir
164164
})
165165

166-
167-
module ``FSI-Shadowcopy`` =
168-
169-
[<Test>]
170-
// "%FSI%" %fsi_flags% < test1.fsx
171-
[<FSharpSuiteTestCase("core/fsi-shadowcopy", "")>]
172-
// "%FSI%" %fsi_flags% --shadowcopyreferences- < test1.fsx
173-
[<FSharpSuiteTestCase("core/fsi-shadowcopy", "--shadowcopyreferences-")>]
174-
let ``shadowcopy disabled`` (flags: string) = check (attempt {
175-
let { Directory = dir; Config = cfg } = testContext ()
176-
177-
let ``exec <`` l p = Command.exec dir cfg.EnvironmentVariables { Output = Inherit; Input = Some(RedirectInput(l)) } p >> checkResult
178-
let ``fsi <`` = Printf.ksprintf (fun flags l -> Commands.fsi (``exec <`` l) cfg.FSI flags [])
179-
let fileguard = (Commands.getfullpath dir) >> FileGuard.create
180-
181-
// if exist test1.ok (del /f /q test1.ok)
182-
use testOkFile = fileguard "test1.ok"
183-
184-
do! ``fsi <`` "%s %s" cfg.fsi_flags flags "test1.fsx"
185-
186-
// if NOT EXIST test1.ok goto SetError
187-
do! testOkFile |> NUnitConf.checkGuardExists
188-
})
189-
190-
[<Test>]
191-
// "%FSI%" %fsi_flags% /shadowcopyreferences+ < test2.fsx
192-
[<FSharpSuiteTestCase("core/fsi-shadowcopy", "/shadowcopyreferences+")>]
193-
// "%FSI%" %fsi_flags% --shadowcopyreferences < test2.fsx
194-
[<FSharpSuiteTestCase("core/fsi-shadowcopy", "--shadowcopyreferences")>]
195-
let ``shadowcopy enabled`` (flags: string) = check (attempt {
196-
let { Directory = dir; Config = cfg } = testContext ()
197-
198-
let ``exec <`` l p = Command.exec dir cfg.EnvironmentVariables { Output = Inherit; Input = Some(RedirectInput(l)) } p >> checkResult
199-
let ``fsi <`` = Printf.ksprintf (fun flags l -> Commands.fsi (``exec <`` l) cfg.FSI flags [])
200-
let fileguard = (Commands.getfullpath dir) >> FileGuard.create
201-
202-
// if exist test2.ok (del /f /q test2.ok)
203-
use testOkFile = fileguard "test2.ok"
204-
205-
// "%FSI%" %fsi_flags% /shadowcopyreferences+ < test2.fsx
206-
do! ``fsi <`` "%s %s" cfg.fsi_flags flags "test2.fsx"
207-
208-
// if NOT EXIST test2.ok goto SetError
209-
do! testOkFile |> NUnitConf.checkGuardExists
210-
})
166+
//
167+
// Shadowcopy does not work for public signed assemblies
168+
// =====================================================
169+
//
170+
//module ``FSI-Shadowcopy`` =
171+
//
172+
// [<Test>]
173+
// // "%FSI%" %fsi_flags% < test1.fsx
174+
// [<FSharpSuiteTestCase("core/fsi-shadowcopy", "")>]
175+
// // "%FSI%" %fsi_flags% --shadowcopyreferences- < test1.fsx
176+
// [<FSharpSuiteTestCase("core/fsi-shadowcopy", "--shadowcopyreferences-")>]
177+
// let ``shadowcopy disabled`` (flags: string) = check (attempt {
178+
// let { Directory = dir; Config = cfg } = testContext ()
179+
//
180+
// let ``exec <`` l p = Command.exec dir cfg.EnvironmentVariables { Output = Inherit; Input = Some(RedirectInput(l)) } p >> checkResult
181+
// let ``fsi <`` = Printf.ksprintf (fun flags l -> Commands.fsi (``exec <`` l) cfg.FSI flags [])
182+
// let fileguard = (Commands.getfullpath dir) >> FileGuard.create
183+
//
184+
// // if exist test1.ok (del /f /q test1.ok)
185+
// use testOkFile = fileguard "test1.ok"
186+
//
187+
// do! ``fsi <`` "%s %s" cfg.fsi_flags flags "test1.fsx"
188+
//
189+
// // if NOT EXIST test1.ok goto SetError
190+
// do! testOkFile |> NUnitConf.checkGuardExists
191+
// })
192+
//
193+
// [<Test>]
194+
// // "%FSI%" %fsi_flags% /shadowcopyreferences+ < test2.fsx
195+
// [<FSharpSuiteTestCase("core/fsi-shadowcopy", "/shadowcopyreferences+")>]
196+
// // "%FSI%" %fsi_flags% --shadowcopyreferences < test2.fsx
197+
// [<FSharpSuiteTestCase("core/fsi-shadowcopy", "--shadowcopyreferences")>]
198+
// let ``shadowcopy enabled`` (flags: string) = check (attempt {
199+
// let { Directory = dir; Config = cfg } = testContext ()
200+
//
201+
// let ``exec <`` l p = Command.exec dir cfg.EnvironmentVariables { Output = Inherit; Input = Some(RedirectInput(l)) } p >> checkResult
202+
// let ``fsi <`` = Printf.ksprintf (fun flags l -> Commands.fsi (``exec <`` l) cfg.FSI flags [])
203+
// let fileguard = (Commands.getfullpath dir) >> FileGuard.create
204+
//
205+
// // if exist test2.ok (del /f /q test2.ok)
206+
// use testOkFile = fileguard "test2.ok"
207+
//
208+
// // "%FSI%" %fsi_flags% /shadowcopyreferences+ < test2.fsx
209+
// do! ``fsi <`` "%s %s" cfg.fsi_flags flags "test2.fsx"
210+
//
211+
// // if NOT EXIST test2.ok goto SetError
212+
// do! testOkFile |> NUnitConf.checkGuardExists
213+
// })
211214

212215

213216

tests/fsharpqa/testenv/bin/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/HostedCompilerServer.*
55
/ILComparer.*
66
/diff.*
7+
/System.Collections.Immutable.*
78
/x86/
89
/AMD64/
910
/nunit/

0 commit comments

Comments
 (0)