Open icewind opened 2 years ago
Hmm, what do you mean by "launch a simple wasm on iPhone"?
Are we talking about web build here?
Yep. I'm launching a web build in the mobile browser(Safari and Chrome). The same build work fine in a desktop browser(Chrome, Safari, and FF). By launching I mean I started a web server in my local network and opened the page using the phone. UPDATE: Looks like it is unrelated to any code. Because the empty application crashes with the same error
use macroquad::prelude::*;
#[macroquad::main("MQTest")]
async fn main() {
loop {
clear_background(RED);
next_frame().await
}
}
I'm also using pretty basic page to launch it
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="styles/style.css" rel="stylesheet" />
</head>
<body>
<canvas id="glcanvas" tabindex="1" />
</body>
<script src="https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js"></script>
<script>
load("/target/wasm32-unknown-unknown/debug/mqtest.wasm");
</script>
</html>
Ok. I found the issue. Using custom optimisation level in Carto.toml
the compiler produces wasm binary that is not starting on iOS. For some reason. Removed these lines
[profile.dev.package.'*']
opt-level = 3
Without it the binary compiled with both debug
and release
modes is working fine on iOS. Btw iOS version is 15.4.1
I am facing a similar issue, except removing the said lines or even changing the opt-level to 2 or 1 does not cause it to start, still. It starts just fine on Chrome, Firefox, DuckDuckGo and Brave browsers in iOS; my app does not start on Safari browser in iOS. I am using an iPad, but the issue seems to be something with Safari. There are no console errors, either. I know it is loading blah.wasm because I am running python http.server and it shows every request served, and I can see that safari receives it. I also had to manually update the version of mq_js_bundle.js because the gl.js version is out of date? I don’t know why it won’t work and willing to run tests or anything if that helps
Hmm, any chance you can post the whole browser console output? Maybe there is at least something there?
Does the examples from macroquad.rs work?
Hi. I'm trying to launch a simple wasm on iPhone and it fails with the following error
Meanwhile it works just fine on desktop(MacOS). I'm using macroquad version
0.3
with the following code