Open brentpicasso opened 9 months ago
I checked my android buildozer build and it appears the uppercase variant is used there. Does that mean the uppercase variant is the "correct" version?
libSDL2*.so
It looks like this issue has come up before: https://github.com/kivy/buildozer/issues/566
If case insensitivity still the default for macOS, it might be easiest to move to a case insensitive disk.
In the recipe, it is mixed case: https://github.com/kivy/kivy-ios/blob/master/kivy_ios/recipes/sdl2/__init__.py#L8
so there is probably a string conversion going on somewhere in either kivy-ios or the rest of the build system (xcode)
I checked my mac, and it is current set to case insensitive
Brents-Mac-mini:kivy-ios macmini$ nano blah.txt
Brents-Mac-mini:kivy-ios macmini$ cat blah.txt
asdf
Brents-Mac-mini:kivy-ios macmini$ cat BLAH.txt
asdf
@tcaduser thanks. I see in that link the SDL2 is upper case, which I think is the correct form. So we need to find out what thing is causing the lower case form?
If your filesystem is case insensitive, it means that the same exact file is being referenced twice.
Looking on your linker line, I see the same libraries being listed multiple times:
-lsdl2
-lSDL2
-lsdl2_image
-lSDL2_image
-lsdl2_mixer
-lSDL2_mixer
-lsdl2_ttf
-lSDL2_ttf
ordinarily a linker shouldn't care if the same filename is listed multiple times, so it may mean that the case difference is confusing clang:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
so you would need to find the recipe referencing the libraries with different case sensitivity.
So you mean grepping this repository's files for a lower case form of lsdl2? We can do that.
what I am seeing is that the recipes are referencing themselves with the mixed case name:
jsanchez@jslaptop:~/git/kivy-ios/kivy_ios$ grep -s -i SDL2 */*/* | grep libr
recipes/sdl2_image/__init__.py: library = "Xcode/build/Release-{plat.sdk}/libSDL2_image.a"
recipes/sdl2/__init__.py: library = "Xcode/SDL/build/Release-{plat.sdk}/libSDL2.a"
recipes/sdl2_mixer/__init__.py: library = "Xcode/build/Release-{plat.sdk}/libSDL2_mixer.a"
recipes/sdl2_ttf/__init__.py: library = "Xcode/build/Release-{plat.sdk}/libSDL2_ttf.a"
and the dependent packages are using the case insensitive name:
recipes/audiostream/__init__.py: depends = ["python", "sdl2", "sdl2_mixer"]
recipes/curly/__init__.py: depends = ["python", "libcurl", "sdl2", "sdl2_image"]
recipes/ffpyplayer/__init__.py: depends = ["python", "sdl2", "ffmpeg"]
recipes/kivy/__init__.py: depends = ["sdl2", "sdl2_image", "sdl2_mixer", "sdl2_ttf", "ios",
recipes/sdl2_image/__init__.py: depends = ["sdl2"]
recipes/sdl2_mixer/__init__.py: depends = ["sdl2"]
recipes/sdl2_ttf/__init__.py: depends = ["libpng", "sdl2"]
Since I've never seen this problem before, but I haven't build a package in a while, I am guessing that either
Your version of XCode is too new
or
Your version of XCode is too old
Thanks, I'll check the xcode version.
When you say "mixed cased name" - do you mean the uppercase form (SDL2) and the case insensitive name is the lower case form (sdl2) ?
also note that the linker is being passed: -Xlinker -no_deduplicate
perhaps from XCode itself.
-no_deduplicate
Don't run deduplication pass in linker
my hypothesis, based on: https://forums.developer.apple.com/forums/thread/44905
is that XCode may have a bug in setting this flag.
Are you doing the final compile? It looks like you are doing a Debug build. Can you choose a Release build in XCode, and see if that flag magically goes away.
Please note that a flag like this is to prevent symbol clashes and resulting in bad behavior.
Checked two things:
I can try upgrading to 15.
In order to go to Xcode 15 I first have to upgrade to MacOS 13.5.
Perspective: my builds were previously running correctly on kivy 2.2.1 - the problems only started when I upgraded to kivy 2.3.0 and this latest kivy-ios,
XCode was the same (14.3) under the previous setup.
Given this, could it be possible something in kivy-ios was regressed?
I don't know. The owners of this project are doing a lot of changes. I would look into your XCode build configuration and see if you can remove the no_deduplicate flag manually. Release and Debug flags are things that you can control in gui
or you can see if the owners of this project would be willing to filter out duplicated library names when generating the xcode project
Thanks for all of the help! I will check those and get back. Hopefully the project maintainers chime in.
@brentpicasso can you please share a screenshot of "Frameworks, Libraries, and Embedded content" from XCode?
Since we moved from libname.a
to libname.xcframework
something may gone wrong during your Xcode project migration.
@misl6 Here you go:
That's why.
The libname.a
files should not be there (even if still available under dist/lib/**/*
)
Can you try to remove them?
That section should look like that after the changes:
@misl6 thank you for the help>
I'm not following - in my screenshots I don't see libname.a listed there. Where are you seeing it?
I searched my project.pbxproj and there are no references to the string libname in there...
You can do this in the gui for XCode. Remove all of the names with the ".a" extension from the assets list, and then try to rebuild. This should then edit the pbxproj for you
On Thu, Feb 8, 2024 at 12:40 PM Brent Picasso @.***> wrote:
I searched my project.pbxproj and there are no references to the string libname in there...
— Reply to this email directly, view it on GitHub https://github.com/kivy/kivy-ios/issues/893#issuecomment-1934724791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS6BJMZPMPFQXDUH5D4V53YSUL2HAVCNFSM6AAAAABC6NKPMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZUG4ZDINZZGE . You are receiving this because you were mentioned.Message ID: @.***>
Oh, so not specifically "libname.a" - but remove anything with a ".a" extension from the gui.
I can try that. Thank you.
I think so. The .xcframework directories are the new way. Having bare .a files is no longer preferred method.
I think I got it, thanks for the help!
@misl6 is there a migration guide this info could be added to?
Versions
I'm seeing duplicate symbols for libsdl libraries. This seems to be due to differences in case for libsdl files.
See attached output of xcode build.
Example from build output:
My initial questions
Which variant of these is correct?
Suggestions on how to fix? I'm happy to submit a PR. :+1:
libsdl_duplicate_symbols.txt
Steps I did to observe this:
I did a complete rebuild of the toolchain (deleted build and dist) and re-installed with this command:
python3 toolchain.py build python3 kivy==2.3.0 pillow ffmpeg ffpyplayer