elixir-desktop / android-example-app

Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime
MIT License
95 stars 9 forks source link

Unable to build required Erlang version with wxwidgets 3.2.0 on macOS Big Sur #4

Closed Nicd closed 1 year ago

Nicd commented 1 year ago

I'm on Big Sur and I have wxwidgets 3.2.0 and the latest kerl from Homebrew. When I try to build the required Erlang version, I run into this issue:

➜  ~ kerl build git https://github.com/diodechain/otp.git diode/beta 24.beta
Checking out Erlang/OTP git repository from https://github.com/diodechain/otp.git...
Building Erlang/OTP 24.beta from git, please wait...
DOCUMENTATION INFORMATION (See: /Users/nicd/.kerl/builds/24.beta/otp_build_git.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
  const wxBitmap * Result = &This->GetBitmap();
                            ^~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
gmake[3]: *** [Makefile:163: x86_64-apple-darwin20.6.0/wxe_wrapper_5.o] Error 1
gmake[3]: Leaving directory '/Users/nicd/.kerl/builds/24.beta/otp_src_git/lib/wx/c_src'
gmake[2]: *** [/Users/nicd/.kerl/builds/24.beta/otp_src_git/make/otp_subdir.mk:29: opt] Error 2
gmake[2]: Leaving directory '/Users/nicd/.kerl/builds/24.beta/otp_src_git/lib/wx'
gmake[1]: *** [/Users/nicd/.kerl/builds/24.beta/otp_src_git/make/otp_subdir.mk:29: opt] Error 2
gmake[1]: Leaving directory '/Users/nicd/.kerl/builds/24.beta/otp_src_git/lib'
gmake: *** [Makefile:498: libs] Error 2

Please see /Users/nicd/.kerl/builds/24.beta/otp_build_git.log for full details.
➜  ~ brew info wxwidgets
==> wxwidgets: stable 3.2.0 (bottled), HEAD

Looks like I'm running into this issue that's present on the iOS demo app too: https://github.com/elixir-desktop/ios-example-app/issues/3 that depends on https://github.com/erlang/otp/issues/5893.

What would actually be required to be able to use OTP 24 or 25 from asdf with this project? Would it be a lot of work? I don't have a lot of knowledge on this, or time, but I could take a look at least.

dominicletz commented 1 year ago

Everything is actually in place for that change. There are two changes I would like to do: 1) Switch the pre-built android (and iOS) binaries to stable OTP 24 2) Change the release deployment so that the Elixir version is imported from the built system (as today) but the Erlang/OTP libraries are kept from the pre-built binaries

So in effect no matter which combination of OTP/Elixir are installed with this setup it should keep working as long as your local Elixir version is compatible with OTP24.

Nicd commented 1 year ago

Can you elaborate a bit on those? How would those be done in concrete terms? I guess I'd need to get pre-built binaries for stable OTP 24 on x86-64, armv7, armv8 and somehow package them like in the assets currently?

dominicletz commented 1 year ago

@Nicd I've updated the sample app and this repo now to use the new official OTP 25.0.4 release -- so the custom plumbing needed before can now be ignored. (Also the CI is working now) - Would be great if you could give this update a test, and if it works I'll close this issue.

Nicd commented 1 year ago

Awesome! I tried it and the build succeeds:

BUILD SUCCESSFUL in 9s

Then it flashes a big ✓ symbol on my phone (the app logo) and automatically closes after about a second. Not sure how to get log information as to what prevents it from starting?

Nicd commented 1 year ago

Ah, I found the "Logcat" tab that can show the process log in Android Studio, that shows it's an unset env var (RELEASE_SYS_CONFIG). I can debug with that. Thanks so much for updating it!