@@ -49,6 +49,7 @@ import {
4949 ancestorNodeModulesPaths ,
5050 copyDirectoryPreservingSymlinks ,
5151 validateWindowsPackagedPayload ,
52+ WindowsPrimaryNativeProbeError ,
5253 WindowsPackagedPayloadValidationError ,
5354 WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT ,
5455 WINDOWS_SERVER_ASAR_IGNORE_GLOBS ,
@@ -612,6 +613,34 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
612613 ) ;
613614 } ) ;
614615
616+ it . effect ( "rejects a cross-architecture Windows payload without its primary executable" , ( ) =>
617+ Effect . scoped (
618+ Effect . gen ( function * ( ) {
619+ const fs = yield * FileSystem . FileSystem ;
620+ const path = yield * Path . Path ;
621+ const fixture = yield * makeWindowsPayloadFixture ( { copyUnpackedNatives : true } ) ;
622+ const executablePath = path . join ( fixture . packagedAppDir , fixture . appExecutableName ) ;
623+ yield * fs . remove ( executablePath ) ;
624+
625+ const error = yield * validateWindowsPackagedPayload ( {
626+ stageDistDir : fixture . stageDistDir ,
627+ appExecutableName : fixture . appExecutableName ,
628+ targetArch : "arm64" ,
629+ } ) . pipe ( Effect . flip ) ;
630+
631+ assert . instanceOf ( error , WindowsPrimaryNativeProbeError ) ;
632+ assert . equal ( error . executablePath , executablePath ) ;
633+ } ) ,
634+ ) . pipe (
635+ Effect . provide (
636+ Layer . mergeAll (
637+ Layer . succeed ( HostProcessPlatform , "win32" ) ,
638+ Layer . succeed ( HostProcessArchitecture , "x64" ) ,
639+ ) ,
640+ ) ,
641+ ) ,
642+ ) ;
643+
615644 it . effect ( "rejects a packaged sidecar whose ASAR-unpacked native is missing" , ( ) =>
616645 Effect . scoped (
617646 Effect . gen ( function * ( ) {
0 commit comments