Skip to content

Conversation

@ju1m
Copy link

@ju1m ju1m commented Sep 12, 2025

Hi! Thanks for that work @jecaro!
It helped me a lot to consider obelisk as an other way to get Haskell to Android
(the other being the SimpleX way, which is much more complex and much less reproducible).

This PR downgrads GHC to enable support for Android running on aarch32 (eg. armeabi-v7a).
I've tested with success on a real phone running Android 10.

Maybe upgrading to a recent GHC instead would make it work too,
but alas I'm not sure obelisk and reflex-patform will ever get to that point anytime soon…

Feel free to merge or ignore, anyone looking to solve the same problem will find this PR anyway.

Cheers!

@jecaro
Copy link
Owner

jecaro commented Sep 12, 2025

Thx for the PR.

I'm reluctant to merge this as I got new constraints on the app from Google Play:

I suspect this might get in the way of solving these two issues. But I'm glad you made it working on an old version of android.

I leave it open as I might reconsider merging this when I'll address the two points above.

@ju1m
Copy link
Author

ju1m commented Sep 12, 2025

@jecaro, sure no problem, I've just learnt that 32bit is no longer a priority for Google, sadly I've just noticed that ob run fails with useGHC810 = false:

$ ob run
./.obelisk/impl: command not cached, building ...
✔ Built on ./.obelisk/impl [command]

Process exited with code 1; /nix/store/7wfnj6hg24p9v212qfx81a16f6rnaqzy-
nix-2.11.0/bin/nix-shell -E $'{root, pkgs, shell}: ((import root
{}).passthru.__unstable__.self.extend (_: _: {shellPackages = builtins.fromJSON
pkgs;})).project.shells.${shell}' --arg root ./. --argstr pkgs $'{"backend":"/
home/julm/src/haskell/diverk/backend","common":"/home/julm/src/haskell/diverk/
common","frontend":"/home/julm/src/haskell/diverk/frontend","obelisk-generated-
static":"/nix/store/g4228gn5xyrmsxsaxrqgf2rmvkd0vxxw-asset-manifest-
haskellManifest"}' --argstr shell ghc --run $'export $\'NIX_PATH=nixpkgs=/nix/
store/ahg8gp1z3qrw1ds5vx2324j72i7y9vjg-source\' ; bash -c \'type -p ghc\''

By the way, though it works great in chromium (v139), in firefox (v141) the front page is "frozen" with high CPU usage and without any input field showing up:

ob run :

Error : Unexpected Duplicate. syncCallbacks=True nBatch=314 nExpected=317

firefox :

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help https://xhr.spec.whatwg.org/#sync-warning
jsaddle.js:148:28

firefox thaws after interrupting ob run:

The connection to ws://localhost:8000/jsaddle was interrupted while the page was loading.

@ju1m
Copy link
Author

ju1m commented Sep 12, 2025

Strangely, https://diverk.quillet.org works fine in the same firefox

@jecaro
Copy link
Owner

jecaro commented Sep 12, 2025

Firefox not responding is a known issue.

See this entry in obelisk FAQ for details.

Basically, that's jsaddle magic, which is not working when using ghci + firefox. But when the code is fully compiled to js (as on https://diverk.quillet.org) it works fine.

@ju1m
Copy link
Author

ju1m commented Sep 12, 2025

@jecaro, and apparently it has just been fixed upstream ghcjs/jsaddle#160 :)

@alexfmpe
Copy link

I'm reluctant to merge this as I got new constraints on the app from Google Play:

I suspect this might get in the way of solving these two issues. But I'm glad you made it working on an old version of android.

I leave it open as I might reconsider merging this when I'll address the two points above.

See reflex-frp/reflex-platform#850

@jecaro
Copy link
Owner

jecaro commented Sep 30, 2025

See reflex-frp/reflex-platform#850

That's great work 👍 I'll closely follow this issue and the PRs linked.

Many thanks for your work on this @alexfmpe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants