Check VelopackApp on compatible architectures

This commit is contained in:
Caelan Sayler
2024-01-24 11:44:01 +00:00
parent 654885a49e
commit 79a0ae3dab
3 changed files with 5 additions and 3 deletions

View File

@@ -25,7 +25,8 @@ public class OsxPackCommandRunner : PackageBuilder<OsxPackOptions>
_ => throw new Exception($"Unsupported Mach-O machine type '{binary.Machine}'.")
};
if (machine != VelopackRuntimeInfo.SystemArch) {
// x64 is supported on arm64 but not the other way around
if (machine != RuntimeCpu.x64 && machine != VelopackRuntimeInfo.SystemArch) {
Log.Warn($"Skipping VelopackApp verification, because system architecture ({VelopackRuntimeInfo.SystemArch}) does not match main binary architecture ({machine}).");
return;
}

View File

@@ -69,7 +69,8 @@ public class WindowsPackCommandRunner : PackageBuilder<WindowsPackOptions>
_ => throw new Exception($"Unsupported PE machine type '{binary.MachineType}'.")
};
if (machine != VelopackRuntimeInfo.SystemArch) {
// x86 is supported everywhere, otherwise we only check if the architecture matches the system architecture
if (machine != RuntimeCpu.x86 && machine != VelopackRuntimeInfo.SystemArch) {
Log.Warn($"Skipping VelopackApp verification, because system architecture ({VelopackRuntimeInfo.SystemArch}) does not match main binary architecture ({machine}).");
return;
}

View File

@@ -162,7 +162,7 @@ public class WindowsPackTests
Assert.Throws<UserInfoException>(() => runner.Run(options).GetAwaiterResult());
}
[SkippableFact(Skip = "Need to sort out test binary architecture")]
[SkippableFact]
public void PackRefuseBuildingUnawareApp()
{
Skip.IfNot(VelopackRuntimeInfo.IsWindows);