hi guys, i've been trying to run a `maxosX64` targ...
# kotlin-native
w
hi guys, i've been trying to run a
maxosX64
target project on my apple silicon mac, and everything with the build goes fine, but the
run
task keeps getting skipped.
Copy code
> Task :app:compileKotlinMacosX64 UP-TO-DATE
> Task :app:linkDebugExecutableMacosX64 UP-TO-DATE
> Task :app:runDebugExecutableMacosX64 SKIPPED
any ideas? I've tried on multiple projects and running a clean build. kotlin
1.6.10
running with
./gradlew runDebugExecutableMacosX64
r
Probably because Kotlin/Native has configured the run tasks to automatically be skipped on unsupported platforms. I would think Rosetta would let it be ran, so that may be unintentional, but IDK. Does it work with
macosArm64
?
l
Just out of curiosity, what happens if you add ‘arch -x86_64 ’ before your gradle command?
I wouldn’t be surprised if the plugin saw it wasn’t on Arm64 and decided that there’s no way to run X86. I looked through the plugin source code at one point, and noticed that there’s a lot of layers of abstraction. It may not be trivial for them to add in an exception for Rosetta.
w
yeah i was expecting rosetta to take care of it, so I am confused. I wanted to just switch it to
macosArm64
but a multiplatform library i am depending on doesn't seem to support that yet (issue already open)
@Landry Norris could you clarify on the full command? doesn't
-x
exclude a task?
l
Mac OS has an arch command. Running arch -x86_64 {some terminal command} runs the command in Rosetta
w
ohh let me try
neat
still is getting skipped 😞
l
arch -x86_64 ./gradlew runDebugExecuteableMacosX64
w
yeah that's what i tried
Skipping task ':runDebugExecutableMacosX64' as task onlyIf is false.
not sure where the source code for that would be, but probably like you guys said with a platform check
l
I don't know what else to try.
r
you might be able to override it with something like
tasks["runDebugExecutableMacosX64"].setOnlyIf { true }
w
doesn't seem to change anything, thanks though
r
make sure you do
setOnlyIf {}
and not
onlyIf {}
because the first (in theory) should replace existing filters while the second appends
but maybe there's other filters also happening 🤷
I've never actually tried this
w
i added your snippet exactly at the end of my
build.gradle
r
do you get the same output
Skipping task ':runDebugExecutableMacosX64' as task onlyIf is false.
?
w
yeah 😞
r
ok then I've got nothing, sorry
w
thanks for the try 🙂
r
You might want to open a youtrack ticket for this use-case
👍 1
a
Hello, @William Reed! Have you tried to run executable from Terminal? It should be located somewhere at
/build/bin/macosX64/debugExecutable/...
w
ahhh that works, thank you! @Artyom Degtyarev [JB]
a
😊 Anyway, the fact that you were unable to run it by Gradle task seems strange. Maybe you could file an issue at kotl.in/issue with a project and your environment info? This would really help us figuring out the root cause.
w
Yup that's on my TODO list for today
🙏 1