Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building for Android requires all home-modules to be present in .cabal file #1054

Open
walseb opened this issue Dec 21, 2023 · 0 comments
Open

Comments

@walseb
Copy link

walseb commented Dec 21, 2023

Hello!

It seems that when building for Android, Obelisk expects all home modules to be present in other-modules. This is not the case when running ob run.

I think ideally, when running an Android build, it should error or at least warn when all home modules aren't present in the .cabal file, as the error message when one isn't included is a cryptic linking error:

Linking dist/build/frontend/frontend ...
/nix/store/jfkmqz20q8fsaqizcml86adxqyzlwllx-binutils-2.38/bin/ld: /build/frontend/dist/build/libHSfrontend-0.1-3H5TQNpcrWIGkwWxyRkSDc.a(Frontend.o): in function `u1NVz_srt':
(.data.u1NVz_srt+0x8): undefined reference to `frontendzm0zi1zm3H5TQNpcrWIGkwWxyRkSDc_PagesziArticle_app_closure'
/nix/store/jfkmqz20q8fsaqizcml86adxqyzlwllx-binutils-2.38/bin/ld: /build/frontend/dist/build/libHSfrontend-0.1-3H5TQNpcrWIGkwWxyRkSDc.a(Frontend.o): in function `c1NRX_info':
(.text.s1NsT_info+0x106): undefined reference to `frontendzm0zi1zm3H5TQNpcrWIGkwWxyRkSDc_PagesziArticle_app_info'
/nix/store/jfkmqz20q8fsaqizcml86adxqyzlwllx-binutils-2.38/bin/ld: (.text.s1NsT_info+0x154): undefined reference to `frontendzm0zi1zm3H5TQNpcrWIGkwWxyRkSDc_PagesziArticle_app_info'
/nix/store/jfkmqz20q8fsaqizcml86adxqyzlwllx-binutils-2.38/bin/ld: (.text.s1NsT_info+0x1a2): undefined reference to `frontendzm0zi1zm3H5TQNpcrWIGkwWxyRkSDc_PagesziArticle_app_info'
/nix/store/jfkmqz20q8fsaqizcml86adxqyzlwllx-binutils-2.38/bin/ld: (.text.s1NsT_info+0x1f0): undefined reference to `frontendzm0zi1zm3H5TQNpcrWIGkwWxyRkSDc_PagesziArticle_app_info'
/nix/store/jfkmqz20q8fsaqizcml86adxqyzlwllx-binutils-2.38/bin/ld: (.text.s1NsT_info+0x23e): undefined reference to `frontendzm0zi1zm3H5TQNpcrWIGkwWxyRkSDc_PagesziArticle_app_info'
/nix/store/jfkmqz20q8fsaqizcml86adxqyzlwllx-binutils-2.38/bin/ld: /build/frontend/dist/build/libHSfrontend-0.1-3H5TQNpcrWIGkwWxyRkSDc.a(Frontend.o):(.text.s1NsT_info+0x28c): more undefined references to `frontendzm0zi1zm3H5TQNpcrWIGkwWxyRkSDc_PagesziArticle_app_info' follow
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)

A quick fix might be running the android build with -Wmissing-home-modules by default, or maybe simply setting up the starting ob init project with -Wmissing-home-modules, or the error equivalent of that flag if that exists.

See #1053 for more details.

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

No branches or pull requests

1 participant