Skip to content

Commit

Permalink
Merge pull request #122 from zonkyio/windows-arm
Browse files Browse the repository at this point in the history
#116 Add support for running in x86 emulation on Windows ARM platform
  • Loading branch information
tomix26 authored Nov 24, 2023
2 parents a66ae39 + 4ebfe31 commit 07c4766
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ public InputStream getPgBinary(String system, String machineHardware) throws IOE
return resource.getInputStream();
}

if (StringUtils.equals(system, "Darwin") && StringUtils.equals(machineHardware, "aarch64")) {
if ((StringUtils.equals(system, "Darwin") && StringUtils.equals(machineHardware, "aarch64"))
|| (StringUtils.equals(system, "Windows") && StringUtils.equals(architecture, "arm_64"))) {
resource = findPgBinary(normalize(format("postgres-%s-%s.txz", system, "x86_64")));
if (resource != null) {
logger.warn("No native binaries supporting aarch64 architecture found. " +
"Trying to use binaries for amd64 architecture instead: '{}'. " +
"Make sure you have Rosetta 2 emulation enabled. " +
logger.warn("No native binaries supporting ARM architecture found. " +
"Trying to use binaries for x64 architecture instead: '{}'. " +
"Make sure you have enabled emulation for this purpose. " +
"Note that performance may be degraded.", resource.getFilename());
return resource.getInputStream();
}
Expand Down

0 comments on commit 07c4766

Please sign in to comment.