Skip to content

Commit 4ebfe31

Browse files
committed
#116 add support for running in x86 emulation on Windows ARM platform
1 parent a66ae39 commit 4ebfe31

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/io/zonky/test/db/postgres/embedded/DefaultPostgresBinaryResolver.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ public InputStream getPgBinary(String system, String machineHardware) throws IOE
6363
return resource.getInputStream();
6464
}
6565

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

0 commit comments

Comments
 (0)