ericfreese / node-freetype2

MIT License
32 stars 20 forks source link

Update to freetype 2.11 #42

Closed aminya closed 2 years ago

aminya commented 2 years ago

I tried to update to freetype 2.11 in this commit, but I faced some build errors for missing symbols during link time

I updated the version, removed the previous .freetype-some-version file and ran:

pnpm run vendor

Then the build failed:


freetype2\build\Release\freetype2.exp
libfreetype.lib(ftinit.obj) : error LNK2001: unresolved external symbol ft_sdf_renderer_class [D:\a\node-freetype2\node-freetype2\build\freetype2.vcxproj]
libfreetype.lib(ftinit.obj) : error LNK2001: unresolved external symbol ft_bitmap_sdf_renderer_class [D:\a\node-freetype2\node-freetype2\build\freetype2.vcxproj]
D:\a\node-freetype2\node-freetype2\build\Release\freetype2.node : fatal error LNK1120: 2 unresolved externals [D:\a\node-freetype2\node-freetype2\build\freetype2.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\runneradmin\setup-pnpm\node_modules\.pnpm\pnpm@6.29.1\node_modules\pnpm\dist\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\hostedtoolcache\\windows\\node\\14.18.3\\x64\\node.exe" "C:\\Users\\runneradmin\\setup-pnpm\\node_modules\\.pnpm\\pnpm@6.29.1\\node_modules\\pnpm\\dist\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\a\node-freetype2\node-freetype2
gyp ERR! node -v v14.18.3
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok 
 ELIFECYCLE  Command failed with exit code 1.
Julusian commented 2 years ago

You probably need to update https://github.com/ericfreese/node-freetype2/blob/master/gyp/libfreetype.gyp to include some of the new source files they added

aminya commented 2 years ago

Where is the list of files? I wish we could just glob them all. It is worthless to list them manually. The build breaks every time the list of files changes.

Julusian commented 2 years ago

Maybe this list? https://github.com/ericfreese/node-freetype2/commit/7db7b7999f6006db3828cfee1e2b18a60f70b1ab#diff-f6a73d3af65b36c45f7b244b26e2a6041b38c94cdd6c9d8bcbc3a90de7b83a1aL317-L356 of which only src/sdf/sdf.c was added. Or this is new too https://github.com/ericfreese/node-freetype2/commit/7db7b7999f6006db3828cfee1e2b18a60f70b1ab#diff-f6a73d3af65b36c45f7b244b26e2a6041b38c94cdd6c9d8bcbc3a90de7b83a1aR411-R412

You could try using globs, but I wouldnt be surprised if that introduces other issues. Various of the files will be behind feature flags, some of which will require additional dependencies and so globbing sounds like it will instead turn into a game of blocking out various files you dont want to build instead of specifying what you do want to build, so will likely not save any effort.

This is partly why I am using cmake in a jpeg-turbo wrapper, but I am thinking of switching to this method so that I can use prebuildify. The 5 minutes to update a list of files every few months is really not that bad to me