Skip to content

Allows a Windows build to be build on Linux for dev testing - #6188

Open
ramonsmits wants to merge 1 commit into
masterfrom
fix-persistence-manifest-lookup
Open

ramonsmits wants to merge 1 commit into
masterfrom
fix-persistence-manifest-lookup

Conversation

@ramonsmits

@ramonsmits ramonsmits commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

TL;DR This allows a Windows build to be build on Linux for dev testing.

A PowerShell module built on Linux (-p:WindowsSelfContained=true) accepts no value for -StorageType. New-ServiceControlInstance and New-ServiceControlAuditInstance then fail on the ValidateSet check.

  • The name of an embedded persistence.manifest contains the directory separator of the operating system that built the assembly: / on Linux, \ on Windows.
  • ServiceControlPersisters accepted only \, so a Linux build found no manifest.
  • The lookup now accepts the two separators.

A build on Windows is not affected, thus the release builds have no change in behavior. PersistenceManifestTests covers the manifest lists.

@ramonsmits ramonsmits changed the title 🐛 Find persistence manifests in an installer engine built on Linux Find persistence manifests in an installer engine built on Linux Nov 25, 2026
@ramonsmits
ramonsmits force-pushed the fix-persistence-manifest-lookup branch 2 times, most recently from 609efdf to 31c49dc Compare November 25, 2026 14:08
@ramonsmits ramonsmits changed the title Find persistence manifests in an installer engine built on Linux 🐛 Give embedded persistence manifests the same name on each build OS Nov 25, 2026
@ramonsmits
ramonsmits force-pushed the fix-persistence-manifest-lookup branch from 31c49dc to 89385bd Compare November 25, 2026 14:12
The name of an embedded manifest came from %(RecursiveDir), which contains the directory separator of the operating system that builds the assembly. The lookup expected '\'. An installer engine built on Linux found no persistence manifest, and the PowerShell cmdlets accepted no value for -StorageType.

The project file now writes '/' in the resource name on each operating system, and the lookup uses '/'.
@ramonsmits
ramonsmits force-pushed the fix-persistence-manifest-lookup branch from 89385bd to e31ecca Compare November 25, 2026 14:12
@ramonsmits ramonsmits changed the title 🐛 Give embedded persistence manifests the same name on each build OS Give embedded persistence manifests the same name on each build OS Nov 25, 2026
@ramonsmits ramonsmits changed the title Give embedded persistence manifests the same name on each build OS Allows a Windows build to be build on Linux for dev testing Nov 25, 2026
<Manifest Include="..\..\deploy\Particular.ServiceControl\Transports\**\transport.manifest" />
<EmbeddedResource Include="@(Zip)" LogicalName="%(Filename)%(Extension)" />
<EmbeddedResource Include="@(Manifest)" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="@(Manifest)" LogicalName="$([System.String]::Copy('%(RecursiveDir)').Replace($([System.IO.Path]::DirectorySeparatorChar), $([System.IO.Path]::AltDirectorySeparatorChar)))%(Filename)%(Extension)" />

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic here is that on the OS where this is run DirectorySeparatorChar behaves differenly and both are unified to AltDirectorySeparatorChar which is fixed


primaryPersistenceManifests = resourceNames
.Where(name => name.StartsWith(@"Particular.ServiceControl\Persisters"))
.Where(name => name.StartsWith("Particular.ServiceControl/Persisters/"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the end slash matter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants