Git Product home page Git Product logo

Comments (12)

maluoi avatar maluoi commented on June 11, 2024 1

Awesome, okay! I can reproduce this, I'll dig around with it and see what I can do to fix it :) Thanks!

Also, I am getting successful builds if I leave out -DSK_BUILD_TESTS=OFF.

from stereokit.

maluoi avatar maluoi commented on June 11, 2024 1

Okay, I'm still a little fuzzy on the details, but it looks like static libraries shouldn't be stripped. This is likely a step that should be done after a final executable is built instead? I've disabled stripping for static builds, and the cmake commands you've pointed out work great now. Lemme know if it fixes the issue in your context :)

from stereokit.

maluoi avatar maluoi commented on June 11, 2024

What sort of cmake commands are you (or rust) using to build this? I'm not familiar with raw make files unfortunately, so if I can get this in terms of cmake, that'd be a bit more helpful. I think I've mostly seen this when my cmake commands aren't quite right? Like mismatching ABIs or version things.

Notable things here, I always build SK against NDK 25.2.9519653 in both CI/CD and my local dev machine. That's probably not critical here, I would generally expect 26 to just work. Also, the cmake presets are configured to build Android, and these have worked well for me so far. It might be worth directly invoking those build presets to verify there's not environmental issues.

from stereokit.

mvvvv avatar mvvvv commented on June 11, 2024

Looking at the build.make produced. For Linux and Android I'm using the cmake v3.28.3 from the /usr/bin/cmake.
The differences are about the tools used from the ndk (clang+ ... llvm-objcopy ...) or from linux (/usr/bin/c++ ... /usr/bin/objcopy ...)
I add the linux build.make to show you what are the diffences
build.make.txt

from stereokit.

mvvvv avatar mvvvv commented on June 11, 2024

I wonder if the ndk tools are more sensitive about these debug options which should not be in a release build script IMHO

from stereokit.

maluoi avatar maluoi commented on June 11, 2024

These lines?

StereoKit/CMakeLists.txt

Lines 464 to 466 in a62695d

COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $<TARGET_FILE:StereoKitC> $<TARGET_FILE_DIR:StereoKitC>/$<TARGET_FILE_BASE_NAME:StereoKitC>${SK_BIN_DEBUG_EXT}
COMMAND ${CMAKE_STRIP} --strip-debug $<TARGET_FILE:StereoKitC>
COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=$<TARGET_FILE_DIR:StereoKitC>/$<TARGET_FILE_BASE_NAME:StereoKitC>${SK_BIN_DEBUG_EXT} $<TARGET_FILE:StereoKitC>

The only thing they're doing is stripping debug symbols out of the binary, and putting them in a separate file. I wanted to have debug symbols around for release, but not embedded in the release binaries. This shouldn't have any impact here. I do this in the official StereoKit Android builds from Linux in CI/CD, so this path definitely does work in the right environment. I'm mostly expecting that rust is doing something a bit differently from the build presets that's tripping the build up.

from stereokit.

mvvvv avatar mvvvv commented on June 11, 2024

Maybe it's a ndk problem. I'll try older version tomorrow.

from stereokit.

maluoi avatar maluoi commented on June 11, 2024

I'd also definitely recommend trying to build straight from the presets, and see if they work. If they work, then the issue is not with the NDK, and if they don't work, then the issue is not related to rust's invocation.

cmake --preset Android_Arm64_Release
cmake --build --preset Android_Arm64_Release

from stereokit.

mvvvv avatar mvvvv commented on June 11, 2024

The build from the presets work. I will use them. Thanks.

from stereokit.

mvvvv avatar mvvvv commented on June 11, 2024

After going through everything again to use the presets I came across the same error. At least now I know how to reproduce it. The problem comes from the need to produce a static library StereoKit/bin/intermediate/Linux_x64_Release/libStereoKitC.a
For this, using the presets, I configure with the following command :
cmake --preset Linux_x64_Release -DSK_BUILD_SHARED_LIBS=OFF -DSK_BUILD_TESTS=OFF
then I launch :
cmake --build --preset Linux_x64_Release

While the same command for Debug instead of Release works.

from stereokit.

mvvvv avatar mvvvv commented on June 11, 2024

Android_Arm64_Debug compiles and Android_Arm64_Release does not. With the same error.

from stereokit.

mvvvv avatar mvvvv commented on June 11, 2024

Well done!! Everything compiles perfectly and works on Linux and Android. For the record, I cannot use the presets because it risks using several versions of LLvm and this prevents the use of this same static library. I therefore use the cmake-rs tool, the aim of which is to ensure that I use a compatible toolchain from what I understand.

from stereokit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.