Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ jobs:

- name: Publish AOT
shell: bash
# Isolate bin/obj — see PackTUnitFilesModule.
run: >-
dotnet publish TUnit.TestProject/TUnit.TestProject.csproj -c Release
--use-current-runtime -p:Aot=true -o TESTPROJECT_AOT --framework net10.0
-p:BaseOutputPath=bin/aot-testproject/
-p:BaseIntermediateOutputPath=obj/aot-testproject/
"-p:Version=${{ steps.gitversion.outputs.semVer }}"
"-p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemVer }}"
"-p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }}"
Expand Down
5 changes: 5 additions & 0 deletions TUnit.Pipeline/Modules/PackTUnitFilesModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

namespace TUnit.Pipeline.Modules;

// Runs concurrently with PublishMockTestsAOTModule / PublishNugetTesterAOTModule by design.
// Correctness depends on those modules using isolated BaseOutputPath/BaseIntermediateOutputPath
// so their recompiles never touch bin/Release/{tfm}/*.dll — this module uses NoBuild=true and
// packs whatever is on disk, so any rewrite of those DLLs would ship strong-name-mismatched
// packages. See issue #5622.
[DependsOn<GetPackageProjectsModule>]
[DependsOn<GenerateVersionModule>]
public class PackTUnitFilesModule : Module<List<PackedProject>>
Expand Down
4 changes: 4 additions & 0 deletions TUnit.Pipeline/Modules/PublishMockTestsAOTModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ protected override ModuleConfiguration Configure() => ModuleConfiguration.Create
Properties =
[
new KeyValue("Aot", "true"),
// Isolate bin/obj so the AOT recompile of ProjectReferences never
// overwrites DLLs that PackTUnitFilesModule packages with --no-build.
new KeyValue("BaseOutputPath", $"bin/aot-{framework}/"),
new KeyValue("BaseIntermediateOutputPath", $"obj/aot-{framework}/"),
],
Framework = framework,
}, new CommandExecutionOptions
Expand Down
5 changes: 4 additions & 1 deletion TUnit.Pipeline/Modules/PublishNugetTesterAOTModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ protected override ModuleConfiguration Configure() => ModuleConfiguration.Create
Properties =
[
new KeyValue("Aot", "true"),
new KeyValue("TUnitVersion", version.ValueOrDefault!.SemVer!)
new KeyValue("TUnitVersion", version.ValueOrDefault!.SemVer!),
// Isolate bin/obj — see PackTUnitFilesModule.
new KeyValue("BaseOutputPath", $"bin/aot-{framework}/"),
new KeyValue("BaseIntermediateOutputPath", $"obj/aot-{framework}/"),
],
Framework = framework,
}, new CommandExecutionOptions
Expand Down
Loading