-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Rework of freetype/harfbuzz recipes #1825
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smart and clearly documented thanks!
I haven't tried the run time, but code and build log makes sense and looks fine.
The title says WIP
, but looks like ready to merge to me. Let me know when you want to merge it.
For records, below are some relevant CI build log parts.
Initial state) recipes to be built contains harfbuzz and freetype
�[0K$ docker run -e CI p4a /bin/sh -c "$COMMAND"
[INFO]: recipes modified: {'harfbuzz', 'freetype'}
[INFO]: recipes to build: {'harfbuzz', 'freetype'}
[INFO]: Found a single valid recipe set: ['freetype', 'hostpython3', 'libffi', 'openssl', 'sqlite3', 'harfbuzz', 'python3']
[INFO]: Trying to find a bootstrap that matches the given recipes.
[INFO]: Found 3 acceptable bootstraps: ['service_only', 'webview', 'sdl2']
[INFO]: Using the first of these: service_only
[INFO]: Found a single valid recipe set: ['freetype', 'hostpython3', 'libffi', 'openssl', 'sqlite3', 'harfbuzz', 'python3', 'genericndkbuild', 'six', 'pyjnius', 'android']
[INFO]: recipes to build (no broken): {'harfbuzz', 'freetype'}
[INFO]: requirements: harfbuzz,freetype,python3
[INFO]: -> directory context testapps/
running apk
...
- build freetype without harfbuzz
�[1m[INFO]�[0m: �[1m�[32mBuilding freetype for armeabi-v7a�[0m�[39m
�[1m[INFO]�[0m: First Build of freetype (without harfbuzz, for now...)
�[1m[INFO]�[0m: Build freetype for First time (without harfbuzz)
�[1m[INFO]�[0m: Configure args are: --disable-shared
---prefix=/home/user/.local/share/python-for-android/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/install
---without-zlib
---with-png=no
---host=arm-linux-androideabi
�[1m[INFO]�[0m: �[36m-> directory context /home/user/.local/share/python-for-android/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype�[39m
...
- build harfbuzz with freetype
�[1m[INFO]�[0m: �[1m�[32mBuilding harfbuzz for armeabi-v7a�[0m�[39m
�[1m[INFO]�[0m: �[36m-> directory context /home/user/.local/share/python-for-android/build/other_builds/harfbuzz/armeabi-v7a__ndk_target_21/harfbuzz�[39m
stty: 'standard input': Inappropriate ioctl for device
�[1m[INFO]�[0m: �[90m->�[0m running configure --without-icu --host=arm-linux-androidea...(and 153 more)�[0m
stty: 'standard input': Inappropriate ioctl for device
�[1m[INFO]�[0m: �[90m->�[0m running make -j 2�[0m
stty: 'standard input': Inappropriate ioctl for device
�[1m[INFO]�[0m: �[90m->�[0m running cp src/.libs/libharfbuzz.so /home/user/.local/shar...(and 98 more)�[0m
...
- build freetype with harfbuzz support
�[1m[INFO]�[0m: Second Build of freetype: enabling harfbuzz support ...
�[1m[INFO]�[0m: Build freetype for Second time (with harfbuzz)
�[1m[INFO]�[0m: Configure args are: --prefix=/home/user/.local/share/python-for-android/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype
---enable-shared
---without-zlib
---with-png=no
---host=arm-linux-androideabi
---disable-static
�[1m[INFO]�[0m: �[36m-> directory context /home/user/.local/share/python-for-android/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype�[39m
stty: 'standard input': Inappropriate ioctl for device
�[1m[INFO]�[0m: �[90m->�[0m running configure --prefix=/home/user/.local/share/python-...(and 166 more)�[0m
stty: 'standard input': Inappropriate ioctl for device
�[1m[INFO]�[0m: �[90m->�[0m running make -j 2�[0m
stty: 'standard input': Inappropriate ioctl for device
�[1m[INFO]�[0m: �[90m->�[0m running cp objs/.libs/libfreetype.so /home/user/.local/sha...(and 99 more)�[0m
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @opacam, very clean!
I'll test this with the matplotlib recipe tomorrow, but no objection to merging before then if it's clearly working.
d2b88f7
to
99be9b2
Compare
Yesterday, I labeled this The push I made today was made to apply the changes mentioned by @AndreMiras, thanks 😄!!! |
I'm having a build issue on the matplotlib branch with harfbuzz not producing a .so output, probably not a major thing but just noting to not merge quite yet while I check it out. |
I haven't been able to resolve the issue I'm having. I'm testing by adding freetype and harfbuzz to the requirements of the basic python3 testapp, but it consistently fails at the following part of the build:
Building with --disable-shared does work, but then of course the second freetype build fails. @opacam Did you have any issue like this, any idea what's wrong? |
mmmm...this is strange...probably I faced this 3 years ago when I made the initial changes but not now... I just did a build with the following requirements using
This builds fine on my system Also tested with the basic
Also builds fine for me...so...:thinking:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good
@inclement is the harfbuzz shared lib generated somewhere at least? I mean could it be somewhere, but the linker doesn't find it because some |
No, this happens even with a clean build, and harfbuzz does not generate any .so file. I've been trying to work out if it's supposed to do that before running this part of the build, or if this part of the build shouldn't be trying to link it in the first place. I've found it difficult to even work out where the -lharfbuzz is coming from. |
Would anyone be able to provide the full build_arch debug logs for freetype and harfbuzz in one of the testapps? I'd like to compare with the output I'm getting. |
Oh right actually the recipe that doesn't build for you is |
@AndreMiras Actually I forgot about travis, but it doesn't print the debug level output which is what I'm most interested in. I've been meaning to add an option to output that to a file (i.e. add a file log output to the default logger). Unless we have such a thing already. |
@inclement, Let me do one build and I will send you the log |
The build log I'm getting is at https://gist.github.com/inclement/484db3a42ec4225b175a3d3e68212707 |
Also posted my config.log at https://gist.github.com/inclement/7f87e55802e76f0c30d9e43d60b726df, could be interesting to compare. |
The harfbuzz build log: https://gist.github.com/opacam/4e252db3ba4f6d6124bf177833cecdab |
Thanks @opacam. I have to sleep now, but I'll do some detective work tomorrow. I'm sure it will be some small issue! |
The config.log at https://gist.github.com/opacam/abcda143a57d8f3c08bcac3816101583 |
No problem @inclement, tomorrow I will be connected almost all day, so let me know if you need anything |
@inclement, Good morning, I've find the problem... I've been checking the logs we post yesterday, they are almost the same but I noticed that your build system has the development libraries for libharfbuzz, mine not, so I installed the So the system's harfbuzz development files are conflicting with our harfbuzz files...and this shouldn't happen...I will try to find a solution for that...if I remember well we face something similar with libffi recently. I found this comparing our config.log from harfbuzz: Your freetype's flags/libs from your harfbuzz's configure.log (line 1122):
Here are mine before installing
|
This comment has been minimized.
This comment has been minimized.
99be9b2
to
288ce6a
Compare
To fix cyclic dependency between freetype and harfbuzz and to produce shared libraries, because we use those libraries in multiple recipes and building those libraries as shared libraries can reduce a little the apk size in some circumstances (when we build multiple recipes that depends on those libraries)
288ce6a
to
5691837
Compare
Ok, modified the recipes to fix the conflict between system's harfbuzz development files and our harfbuzz recipe (I also simplified the logic to be more readable and maintainable compared to the first version I posted). Now we should be able to build the harfbuzz recipe even if we have installed the I tested it in both situations with the Pillow test app (#1826) and seems to work fine for me, travis give us a green tick mark...so...@inclement, when you have time, could you test it again please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work 👏
Very nice work @opacam, I thought it might be something like this but I got lost inside libtool! I've tested again, including both with/without harfbuzz in the matplotlib PR, without any issues. |
To fix cyclic dependency between
freetype
andharfbuzz
and to produce shared librariesAnd because we use those libraries in multiple recipes and building those libraries as shared libraries can reduce a little the apk size in some circumstances (when we build multiple recipes that depends on those libraries)
This changes are friendly with #1822 which needs shared libraries for
freetype
andharfbuzz
Important note: if
freetype
andharfbuzz
are inrequirements
, then the cyclic dependency of those libraries will be solved otherwise the library will be build without linking with the other library (as expected)As a side note: tested with a Pillow test app and arch armv7a (#1826)