Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix building freetype 2.6.1 on macOS clang 18#29247

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 1 commit intomatplotlib:mainfromdopplershift:fix-macos-build
Dec 10, 2024

Conversation

dopplershift
Copy link
Contributor

PR summary

Freetype 2.6.1 has an outdated copy of a zlib header (like from ~1998) which has a bad check for choosing whether to define Byte on macOS. This adds a patched version of the zconf.h header that has a proper check forMACTYPES, which is defined by the macOS SDK.

For posterity, the failure occurred over on conda-forge and looked like:

FAILED: subprojects/freetype-2.6.1/libfreetype.a.p/src_gzip_ftgzip.c.o x86_64-apple-darwin13.4.0-clang -Isubprojects/freetype-2.6.1/libfreetype.a.p -Isubprojects/freetype-2.6.1 -I../subprojects/freetype-2.6.1 -I../subprojects/freetype-2.6.1/include -fvisibility=hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -isystem /Users/runner/miniforge3/conda-bld/matplotlib-suite_1733188751163/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/matplotlib-suite_1733188751163/work=/usr/local/src/conda/matplotlib-base-3.9.3 -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/matplotlib-suite_1733188751163/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl=/usr/local/src/conda-prefix -D_FORTIFY_SOURCE=2 -isystem /Users/runner/miniforge3/conda-bld/matplotlib-suite_1733188751163/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/include -mmacosx-version-min=10.13 -mmacosx-version-min=10.13 -DFT2_BUILD_LIBRARY '-DFT_CONFIG_CONFIG_H=<ftconfig.h>' '-DFT_CONFIG_OPTIONS_H=<ftoption.h>' -MD -MQ subprojects/freetype-2.6.1/libfreetype.a.p/src_gzip_ftgzip.c.o -MF subprojects/freetype-2.6.1/libfreetype.a.p/src_gzip_ftgzip.c.o.d -o subprojects/freetype-2.6.1/libfreetype.a.p/src_gzip_ftgzip.c.o -c ../subprojects/freetype-2.6.1/src/gzip/ftgzip.cIn file included from ../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:65:In file included from ../subprojects/freetype-2.6.1/src/gzip/zlib.h:34:../subprojects/freetype-2.6.1/src/gzip/zconf.h:228:12: error: unknown type name 'Byte'  228 |    typedef Byte  FAR Bytef;      |            ^In file included from ../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:83:../subprojects/freetype-2.6.1/src/gzip/inftrees.h:22:7: error: unknown type name 'Byte'   22 |       Byte Exop;        /* number of extra bits or operation */      |       ^../subprojects/freetype-2.6.1/src/gzip/inftrees.h:23:7: error: unknown type name 'Byte'   23 |       Byte Bits;        /* number of bits in this code or subcode */      |       ^In file included from ../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:91:../subprojects/freetype-2.6.1/src/gzip/inftrees.c:247:21: error: use of undeclared identifier 'Byte'  247 |           r.bits = (Byte)l;     /* bits to dump before this table */      |                     ^../subprojects/freetype-2.6.1/src/gzip/inftrees.c:248:21: error: use of undeclared identifier 'Byte'  248 |           r.exop = (Byte)j;     /* bits in this table */      |                     ^../subprojects/freetype-2.6.1/src/gzip/inftrees.c:258:17: error: use of undeclared identifier 'Byte'  258 |       r.bits = (Byte)(k - w);      |                 ^../subprojects/freetype-2.6.1/src/gzip/inftrees.c:263:19: error: use of undeclared identifier 'Byte'  263 |         r.exop = (Byte)(*p < 256 ? 0 : 32 + 64);     /* 256 is end-of-block */      |                   ^../subprojects/freetype-2.6.1/src/gzip/inftrees.c:268:19: error: use of undeclared identifier 'Byte'  268 |         r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */      |                   ^In file included from ../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:93:../subprojects/freetype-2.6.1/src/gzip/infcodes.c:50:3: error: unknown type name 'Byte'   50 |   Byte lbits;           /* ltree bits decoded per branch */      |   ^../subprojects/freetype-2.6.1/src/gzip/infcodes.c:51:3: error: unknown type name 'Byte'   51 |   Byte dbits;           /* dtree bits decoder per branch */      |   ^../subprojects/freetype-2.6.1/src/gzip/infcodes.c:70:17: error: use of undeclared identifier 'Byte'   70 |     c->lbits = (Byte)bl;      |                 ^../subprojects/freetype-2.6.1/src/gzip/infcodes.c:71:17: error: use of undeclared identifier 'Byte'   71 |     c->dbits = (Byte)bd;      |                 ^../subprojects/freetype-2.6.1/src/gzip/infcodes.c:204:9: error: use of undeclared identifier 'Byte'  204 |         OUTBYTE(*f++)      |         ^../subprojects/freetype-2.6.1/src/gzip/infutil.h:83:27: note: expanded from macro 'OUTBYTE'   83 | #define OUTBYTE(a) {*q++=(Byte)(a);m--;}      |                           ^In file included from ../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:93:../subprojects/freetype-2.6.1/src/gzip/infcodes.c:213:7: error: use of undeclared identifier 'Byte'  213 |       OUTBYTE(c->sub.lit)      |       ^../subprojects/freetype-2.6.1/src/gzip/infutil.h:83:27: note: expanded from macro 'OUTBYTE'   83 | #define OUTBYTE(a) {*q++=(Byte)(a);m--;}      |                           ^../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:305:23: warning: incompatible pointer types assigning to 'Bytef *' (aka 'int *') from 'FT_Byte[4096]' (aka 'unsigned char[4096]') [-Wincompatible-pointer-types]  305 |     zstream->next_in  = zip->buffer;      |                       ^ ~~~~~~~~~~~../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:354:26: warning: incompatible pointer types assigning to 'Bytef *' (aka 'int *') from 'FT_Byte[4096]' (aka 'unsigned char[4096]') [-Wincompatible-pointer-types]  354 |       zstream->next_in   = zip->input;      |                          ^ ~~~~~~~~~~../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:356:26: warning: incompatible pointer types assigning to 'Bytef *' (aka 'int *') from 'FT_Byte[4096]' (aka 'unsigned char[4096]') [-Wincompatible-pointer-types]  356 |       zstream->next_out  = zip->buffer;      |                          ^ ~~~~~~~~~~~../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:401:23: warning: incompatible pointer types assigning to 'Bytef *' (aka 'int *') from 'FT_Byte[4096]' (aka 'unsigned char[4096]') [-Wincompatible-pointer-types]  401 |     zstream->next_in  = zip->input;      |                       ^ ~~~~~~~~~~../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:416:24: warning: incompatible pointer types assigning to 'Bytef *' (aka 'int *') from 'FT_Byte *' (aka 'unsigned char *') [-Wincompatible-pointer-types]  416 |     zstream->next_out  = zip->cursor;      |                        ^ ~~~~~~~~~~~../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:435:20: warning: incompatible pointer types assigning to 'FT_Byte *' (aka 'unsigned char *') from 'Bytef *' (aka 'int *') [-Wincompatible-pointer-types]  435 |         zip->limit = zstream->next_out;      |                    ^ ~~~~~~~~~~~~~~~~~../subprojects/freetype-2.6.1/src/gzip/ftgzip.c:730:22: warning: incompatible pointer types assigning to 'Bytef *' (aka 'int *') from 'FT_Byte *' (aka 'unsigned char *') [-Wincompatible-pointer-types]  730 |     stream.next_out  = output;      |                      ^ ~~~~~~7 warnings and 14 errors generated.

I'm using the Meson support for dropping in a new entire file, but the diff vs. the version that shipped with freetype 2.6.1:

--- zconf.h.orig2024-12-02 16:53:07+++ zconf.h2024-12-02 16:53:14@@ -215,7 +215,7 @@ #   define FAR #endif-#if !defined(MACOS) && !defined(TARGET_OS_MAC)+#if !defined(__MACTYPES__) typedef unsigned char  Byte;  /* 8 bits */ #endif typedef unsigned int   uInt;  /* 16 bits or more */

Research shows this change came tozlib around 1.2.0, released over 20 years ago. 🤯

Freetype 2.6.1 has an outdated copy of a zlib header which has a badcheck for choosing whether to define Byte on macOS. This adds a patchedversion of the zconf.h header that has a proper check for __MACTYPES__,which is defined by the macOS SDK.
@tacaswelltacaswell added this to thev3.10.0 milestoneDec 10, 2024
@tacaswelltacaswell merged commit4eb0464 intomatplotlib:mainDec 10, 2024
37 of 38 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestDec 10, 2024
@dopplershiftdopplershift deleted the fix-macos-build branchDecember 10, 2024 18:12
QuLogic added a commit that referenced this pull requestDec 10, 2024
…247-on-v3.10.xBackport PR#29247 on branch v3.10.x (Fix building freetype 2.6.1 on macOS clang 18)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@greglucasgreglucasgreglucas approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.10.0
Development

Successfully merging this pull request may close these issues.

3 participants
@dopplershift@greglucas@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp