libui-rs / libui

Rust bindings to the minimalist, native, cross-platform UI toolkit `libui-ng`
Apache License 2.0
46 stars 5 forks source link

MacOS build fails #1

Closed Seercat3160 closed 1 year ago

Seercat3160 commented 1 year ago

Commit e1cf3b17a8c2c6f90cf83489ccc17a283e51f43a removed libui-ffi/libui/darwin/map.m as part of the update to that submodule, now the build fails for libui-ffi on MacOS because the buildscript uses it as a source file.

Exact error (from a GitHub Actions macos-latest runner building my crate depending on libui f15bf265087493605ab266bc538cea3256199fd8):

running: "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-I" "libui//common" "-I" "libui//darwin" "-DNS_FORMAT_ARGUMENT(A)=" "-o" "/redacted/target/release/build/libui-ffi-f9cf6421af3a6c37/out/libui/darwin/map.o" "-c" "libui/darwin/map.m"
cargo:warning=clang: error: no such file or directory: 'libui/darwin/map.m'
cargo:warning=clang: error: no input files
exit status: 1

--- stderr

error occurred: Command "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-I" "libui//common" "-I" "libui//darwin" "-DNS_FORMAT_ARGUMENT(A)=" "-o" "/redacted/target/release/build/libui-ffi-f9cf6421af3a6c37/out/libui/darwin/map.o" "-c" "libui/darwin/map.m" with args "cc" did not execute successfully (status code exit status: 1).

Otherwise, this is a really useful crate and I appreciate your effort to update iui to use libui-ng.

nptr commented 1 year ago

Thanks for the info, I did not see that! I'll fix it later today. Commits to development branch are not fully tested. And it's the default checkout branch. I should probably change that too.

I am also waiting on this libui-ng PR and will then push a new version to crates.

Seercat3160 commented 1 year ago

Thanks! I'm fully aware that the development branch is untested, that's part of why I'm using it and it's not like I'm doing anything important with it, just a personal project. Go ahead and close this if you want, or wait until it's fixed, I'll leave it open for now.

nptr commented 1 year ago

Fixed it. May I ask which MacOS version you are using? To get a feeling what libui-ng really is compatible to.

Seercat3160 commented 1 year ago

This is all using MacOS 12.6.5, according to the build log. I can't help to debug, as I don't actually have a Mac and I'm just running the MacOS build as part of CI testing through GitHub Actions.

Unfortunately the build still fails with 4195659b507565d48726612c9ecb9b2ffd377255, stating that it can't link to some symbols. Reading through the diff of libui-ng in terms of the submodule bump that broke the Mac build, I see that those particular ones were refactored into a new file so of course the compiler couldn't link, it didn't compile part of the program. I've fixed this in my PR (#2) and my program seems to build with that, but I haven't checked whether anything that isn't breaking the build has changed that could cause problems in future.

I would suggest taking a closer look through the changes when updating the dependencies to ensure that nothing like this has happened (files being added/removed) or perhaps something less obvious, such as renamed symbols. It might be useful to setup GitHub Actions to build the crate examples on each commit/pull-request to ensure no regressions such as this.

I'm aware that this crate and libui-ng are in alpha and have no guarantees about anything (and I'm not expecting any), and I decided to use it anyway, so I thought I'd at least try to help out to the best of my ability.

nptr commented 1 year ago

Ups, I was in a hurry with yesterdays fix. Thanks for you PR. I'll consider adding some CI steps.