Skip to content

Commit e2c6fc5

Browse files
committed
Add arm64 binary too
1 parent 13d1a1f commit e2c6fc5

3 files changed

Lines changed: 34 additions & 27 deletions

File tree

4 KB
Binary file not shown.
0 Bytes
Binary file not shown.

windows_shim/release.py

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
IS_WINDOWS: bool = os.name == "nt"
1717

18+
target_triplets: list[str] = [
19+
"x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc"
20+
]
21+
1822

1923
def main() -> None:
2024
if not IS_WINDOWS:
@@ -28,37 +32,40 @@ def main() -> None:
2832
else None
2933
)
3034

31-
subprocess.run(
32-
[
33-
"cargo",
34-
"build",
35-
"--quiet",
36-
"--manifest-path",
37-
str(dotslash_windows_shim_root / "Cargo.toml"),
38-
"--bin=dotslash_windows_shim",
39-
"--release",
40-
"--target=x86_64-pc-windows-msvc",
41-
],
42-
check=True,
43-
env={
44-
**os.environ,
45-
"RUSTC_BOOTSTRAP": "1",
46-
"RUSTFLAGS": "-Clink-arg=/DEBUG:NONE", # Avoid embedded pdb path
47-
},
48-
)
35+
for triplet in target_triplets:
36+
subprocess.run(
37+
[
38+
"cargo",
39+
"build",
40+
"--quiet",
41+
"--manifest-path",
42+
str(dotslash_windows_shim_root / "Cargo.toml"),
43+
"--bin=dotslash_windows_shim",
44+
"--release",
45+
f"--target={triplet}",
46+
],
47+
check=True,
48+
env={
49+
**os.environ,
50+
"RUSTC_BOOTSTRAP": "1",
51+
"RUSTFLAGS": "-Clink-arg=/DEBUG:NONE", # Avoid embedded pdb path
52+
},
53+
)
4954

50-
src = (
51-
(
52-
target_dir
53-
or (dotslash_windows_shim_root / "target" / "x86_64-pc-windows-msvc")
55+
src = (
56+
(
57+
target_dir
58+
or (dotslash_windows_shim_root / "target" / triplet)
59+
)
60+
/ "release"
61+
/ "dotslash_windows_shim.exe"
5462
)
55-
/ "release"
56-
/ "dotslash_windows_shim.exe"
57-
)
5863

59-
dest = dotslash_windows_shim_root / "dotslash_windows_shim-x86_64.exe"
64+
arch = triplet.partition('-')[0]
65+
66+
dest = dotslash_windows_shim_root / f"dotslash_windows_shim-{arch}.exe"
6067

61-
shutil.copy(src, dest)
68+
shutil.copy(src, dest)
6269

6370

6471
if __name__ == "__main__":

0 commit comments

Comments
 (0)