Skip to content

Commit 2b7cb0d

Browse files
authored
Add target_compatible_with toolchain constraints (#48)
Mojo can cross compile CPU and GPU targets, but the single wheels we pull only have the configuration for the same OS / arch target (we could support pulling 2 wheels for a single toolchain, but aren't right now). Mojo cannot cross compile OS differences (linux -> macOS or macOS -> linux) because of OS specific GPU libraries in the compiler. This correctly reflects that in remote execution scenarios.
1 parent 3c37356 commit 2b7cb0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mojo/extensions.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ toolchain(
9191
"@platforms//cpu:{cpu}",
9292
"@platforms//os:{os}",
9393
],
94+
target_compatible_with = [ # Wheels only contain support libraries for 1 platform and cross OS compilation is not supported.
95+
"@platforms//cpu:{cpu}",
96+
"@platforms//os:{os}",
97+
],
9498
toolchain = "@mojo_toolchain_{platform}//:mojo_toolchain",
9599
toolchain_type = "@rules_mojo//:toolchain_type",
96100
)

0 commit comments

Comments
 (0)