Closed chrbauer closed 1 month ago
My blocking problem with ghc+iconv on android was, that nix-build compiled it for aarch32, but I fixed it for aarch64. I disable aarch32 on android for now. (But it should be fixable, too)
Here is a hint, how the ghc build can be tested:
nix-shell reflex-platform/default.nix -A nixpkgsCross.android.aarch64.haskell.packages.integer-simple.ghcSplices-8_10.ghc
unpackPhase
cd ghc-8.10.7
configurePhase
make
some success: i can build an android app. installation still fails (signing problem)
signing works again, can launch the app
this works:
./try-reflex
$ cat >hello.hs <<EOF
{-# LANGUAGE OverloadedStrings #-}
import Reflex.Dom
main = mainWidget $ text "Hello, world!"
EOF
$ ghcjs hello.hs
Also the build of ghc for armv7 (aarch32). I still have to test the final app
The check still fails with "error: infinite recursion encountered, at undefined position"
But I cannot reproduce this locally:
nix-shell -p act
act workflow_dispatch --env "USER=chrbauer"
Any ideas?
@chrbauer Sorry that this wasn't made clear earlier, but we have been pushing branches working on 22.05 too. We don't want your efforts to be in vain!
@chrbauer Sorry that this wasn't made clear earlier, but we have been pushing branches working on 22.05 too. We don't want your efforts to be in vain!
No problem, I learned a lot about the project.
Indeed I was not aware that there are branches for 22.05, too. I only saw 21.05.
If you need something from my branch, feel free to copy it. It is properly working for ghcjs and android, I currently use it to build my reflex dom program. I haven't tried to build an iOS app.
Interesting parts for you could be:
Is this branch in a usable shape? Trying to use it I get
error: 'androidWithHaskellPackages' at /home/jojo/build/haskell/reflex/reflex-platform/default.nix:271:32 called without required argument 'ghcAndroidAarch32'
Hmm, using
inherit ghcAndroidAarch64 ghcAndroidAarch32
there does something, but then I am stuck with a build failure in
/nix/store/hh76nrq9yffdpwxf612cnpv6708m53dd-armv7a-unknown-linux-androideabi-ghc-integer-simple-8.10.7.drv
:
"cp" libraries/base/./GHC/Stack/CCS.hs-boot libraries/base/dist-install/build/GHC/Stack/CCS.hs-boot
cp: cannot create regular file 'libraries/base/dist-install/build/GHC/Stack/CCS.hs-boot': No such file or directory
libraries/integer-simple/ghc.mk:4: libraries/integer-simple/dist-install/build/.depend-v-p-dyn.haskell: No such file or directory
make[1]: *** [libraries/base/ghc.mk:4: libraries/base/dist-install/build/GHC/Stack/CCS.hs-boot] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:128: all] Error 2
I haven't seen this error. Can you give more details how it could be reproduced? It's very likely that I overlooked some use case
To reproduce, check out your reflex-platform somewhere and also check out git@github.com:nomeata/kaleidogen.git
, branch android
and try to build it with
NIV_OVERRIDE_reflex_platform=/home/jojo/build/haskell/reflex/reflex-platform nix-build -A android.android
(with the override pointing to your reflex-platform checkout).
This works with plain reflex-platform plus https://github.com/reflex-frp/reflex-platform/pull/794, but I get that error above with your branch.
Thanks a lot for looking!
Indeed I was not aware that there are branches for 22.05, too. I only saw 21.05.
Oh sorry! I got confused, yes we are still trying to do 21.05. We like to march through the Nixpkgs "in order" to basically bite up the breakage in smaller, easier to chew pieces.
To reproduce, check out your reflex-platform somewhere and also check out
git@github.com:nomeata/kaleidogen.git
, branchandroid
and try to build it withNIV_OVERRIDE_reflex_platform=/home/jojo/build/haskell/reflex/reflex-platform nix-build -A android.android
(with the override pointing to your reflex-platform checkout).
This works with plain reflex-platform plus #794, but I get that error above with your branch.
Thanks a lot for looking!
I pushed your fix with ghcAndroidAarch32. kaleidogen is still building on my machine.... I see in your default.nix, that you you override ghcjs-base. This is not related to the android problem, but for ghcjs it will cause troubles....
One simple idea for you could be to disable armv7a support again. (I dont want to put much effort in this branch, because of the second upgrade path from Ericson2314 et al).
Ericson2314, approaching this problem piece-wise is a very good idea....
One simple idea for you could be to disable armv7a support again.
Happy to do that, but how would I do it?
@nomeata Hm, I just run your nix-build command and the build completed successfully. I could sent you the android-app-release-unsigned.apk file.
How can this be? My system is nixos 22.05.
One simple idea for you could be to disable armv7a support again.
Happy to do that, but how would I do it?
Maybe like in this commit: https://github.com/reflex-frp/reflex-platform/pull/782/commits/587ba07fa1f48376b5f52a497208e2e41c8ac4a5
After a night of building, that worked, and the .apk was accepted by the Google Play store. Great, thanks!
Now looking forward to use an official branch soon again.
BTW, do you have a sense how hard it would be to build an app like this using just nixpkgs, to have less moving parts? For the GHCJS build I already do that, but it is unclear how much reflex-platform provides for the Android support that isn’t in nixpkgs. (To be honest, it is mostly unclear to me what it even takes to make an android app from Haskell on nix…)
BTW, here is the app, if you want to play with the result of your labor :-) https://play.google.com/store/apps/details?id=de.nomeata.kaleidogen
After a night of building, that worked, and the .apk was accepted by the Google Play store. Great, thanks!
Now looking forward to use an official branch soon again.
BTW, do you have a sense how hard it would be to build an app like this using just nixpkgs, to have less moving parts? For the GHCJS build I already do that, but it is unclear how much reflex-platform provides for the Android support that isn’t in nixpkgs. (To be honest, it is mostly unclear to me what it even takes to make an android app from Haskell on nix…)
Not sure how difficult it would be, but I would wish that we combine our efforts in building one powerful, up-to-date reflex driven platform. There is still a lot to do, e.g. for sharing my oauth2 infrastructure with web/app I just load the index.html instead of the android assets from a remote URL, so that the backend could do the required redirects. (The former approach is hard coded in the haskell activity). I would like to have more widget support (iconicframework seems to be a good option). Also I see the the ghc team is working on a new javascript and wasm backends.
Tried you app, very nice. (And as a good tester I have to report that the back button is not working on my phone ;-)
Tried you app, very nice.
Thanks! Did it run stable for you?
(And as a good tester I have to report that the back button is not working on my phone ;-)
What would you expect it to do?
The progress of this pull request is slow, because of the huge compile times after each fix, especially if ghc has to be rebuild.
Futhermore sometimes the packages on nixpkgs-22.05 itself needs to be fixed. (For the reflex packages often ali-abrar prepared already and magically a fix.) Or see https://github.com/NixOS/nixpkgs/pull/179006
There are three problems currently:
my builds are still running....