Skip to content
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

Skia build failing (MacOS 12.3) #22

Open
Danotelo757 opened this issue Apr 24, 2022 · 1 comment
Open

Skia build failing (MacOS 12.3) #22

Danotelo757 opened this issue Apr 24, 2022 · 1 comment

Comments

@Danotelo757
Copy link

Followed the instructions here for building Skia for mac but the build keeps failing at theskia Abdulhamid$ ninja -C out/Release-x64 skia modules. command.

The previous commands run find, but this command returns the following errors:

(base) Abdulhamids-Mac-Pro:skia Abdulhamid$ ninja -C out/Release-x64 skia modules ninja: Entering directory out/Release-x64' [1/1759] compile ../../third_party/externals/libwebp/src/utils/random_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.random_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.random_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/random_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.random_utils.o ../../third_party/externals/libwebp/src/utils/random_utils.c:14:10: fatal error: 'string.h' file not found #include <string.h> ^~~~~~~~~~ 1 error generated. [2/1759] compile ../../third_party/externals/libwebp/src/utils/quant_levels_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.quant_levels_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.quant_levels_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/quant_levels_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.quant_levels_utils.o ../../third_party/externals/libwebp/src/utils/quant_levels_utils.c:15:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [3/1759] compile ../../third_party/externals/libwebp/src/utils/rescaler_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.rescaler_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.rescaler_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/rescaler_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.rescaler_utils.o ../../third_party/externals/libwebp/src/utils/rescaler_utils.c:14:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [4/1759] compile ../../third_party/externals/libwebp/src/utils/filters_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.filters_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.filters_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/filters_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.filters_utils.o In file included from ../../third_party/externals/libwebp/src/utils/filters_utils.c:14: In file included from /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src/utils/filters_utils.h:17: In file included from /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src/webp/types.h:20: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found #include_next <inttypes.h> ^~~~~~~~~~~~ 1 error generated. [5/1759] compile ../../third_party/externals/libwebp/src/utils/bit_writer_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.bit_writer_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.bit_writer_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/bit_writer_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.bit_writer_utils.o ../../third_party/externals/libwebp/src/utils/bit_writer_utils.c:15:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [6/1759] compile ../../third_party/externals/libwebp/src/utils/color_cache_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.color_cache_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.color_cache_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/color_cache_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.color_cache_utils.o ../../third_party/externals/libwebp/src/utils/color_cache_utils.c:14:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [7/1759] compile ../../third_party/externals/libwebp/src/utils/huffman_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.huffman_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.huffman_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/huffman_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.huffman_utils.o ../../third_party/externals/libwebp/src/utils/huffman_utils.c:14:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [8/1759] compile ../../third_party/externals/libwebp/src/utils/thread_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.thread_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.thread_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/thread_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.thread_utils.o ../../third_party/externals/libwebp/src/utils/thread_utils.c:14:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [9/1759] compile ../../third_party/externals/libwebp/src/utils/utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.utils.o ../../third_party/externals/libwebp/src/utils/utils.c:14:10: fatal error: 'stdlib.h' file not found #include <stdlib.h> ^~~~~~~~~~ 1 error generated. [10/1759] compile ../../third_party/externals/libwebp/src/utils/bit_reader_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.bit_reader_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.bit_reader_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/bit_reader_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.bit_reader_utils.o In file included from ../../third_party/externals/libwebp/src/utils/bit_reader_utils.c:18: /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src/utils/bit_reader_inl_utils.h:23:10: fatal error: 'string.h' file not found #include <string.h> // for memcpy ^~~~~~~~~~ 1 error generated. [11/1759] compile ../../third_party/externals/libwebp/src/utils/quant_levels_dec_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.quant_levels_dec_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.quant_levels_dec_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/quant_levels_dec_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.quant_levels_dec_utils.o In file included from ../../third_party/externals/libwebp/src/utils/quant_levels_dec_utils.c:17: In file included from /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src/utils/quant_levels_dec_utils.h:17: In file included from /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src/webp/types.h:20: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found #include_next <inttypes.h> ^~~~~~~~~~~~ 1 error generated. [12/1759] compile ../../third_party/externals/libwebp/src/mux/muxinternal.c FAILED: obj/third_party/externals/libwebp/src/mux/libwebp.muxinternal.o cc -MD -MF obj/third_party/externals/libwebp/src/mux/libwebp.muxinternal.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/mux/muxinternal.c -o obj/third_party/externals/libwebp/src/mux/libwebp.muxinternal.o ../../third_party/externals/libwebp/src/mux/muxinternal.c:15:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [13/1759] compile ../../third_party/externals/libwebp/src/utils/huffman_encode_utils.c FAILED: obj/third_party/externals/libwebp/src/utils/libwebp.huffman_encode_utils.o cc -MD -MF obj/third_party/externals/libwebp/src/utils/libwebp.huffman_encode_utils.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/utils/huffman_encode_utils.c -o obj/third_party/externals/libwebp/src/utils/libwebp.huffman_encode_utils.o ../../third_party/externals/libwebp/src/utils/huffman_encode_utils.c:14:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. [14/1759] compile ../../third_party/externals/libwebp/src/mux/anim_encode.c FAILED: obj/third_party/externals/libwebp/src/mux/libwebp.anim_encode.o cc -MD -MF obj/third_party/externals/libwebp/src/mux/libwebp.anim_encode.o.d -DNDEBUG -DWEBP_SWAP_16BIT_CSP -w -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\' -O3 -stdlib=libc++ -mmacosx-version-min=10.9 -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp/src -isystem /Users/Abdulhamid/deps/skia/third_party/externals/libwebp -c ../../third_party/externals/libwebp/src/mux/anim_encode.c -o obj/third_party/externals/libwebp/src/mux/libwebp.anim_encode.o ../../third_party/externals/libwebp/src/mux/anim_encode.c:13:10: fatal error: 'assert.h' file not found #include <assert.h> ^~~~~~~~~~ 1 error generated. ninja: build stopped: subcommand failed.

@ryandesign
Copy link

In macOS 12.3, Apple removed /usr/bin/python. Perhaps because of this, or for other reasons, you might have created your own python symlink pointing to a version of python 3. If you do this, the find_xcode_sysroot.py script, which is part of the skia build, does not work correctly. Here is an example of the script working correctly with python 2:

$ python2 skia/gn/find_xcode_sysroot.py macosx
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk

Here is an example of the script working incorrectly with python 3:

$ python3 skia/gn/find_xcode_sysroot.py macosx
b'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk\n'

You can see the result of the wrong script output in the portion of the log you posted where it says:

-isysroot b\'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk\\n\'

Since this isn't valid syntax for the -isysroot flag, this causes the subsequent failure to find the files that are in the SDK:

../../third_party/externals/libwebp/src/utils/random_utils.c:14:10: fatal error: 'string.h' file not found 

The workaround for the problem would be to ensure that your python symlink points to a version of python 2, not python 3.

The fix would be to rewrite find_xcode_sysroot.py so that it returns the correct output under python 3. This was already done in this upstream commit: google@7bc4c9a

diff --git a/gn/find_xcode_sysroot.py b/gn/find_xcode_sysroot.py
index be5b687e0390..e514271bc391 100755
--- a/gn/find_xcode_sysroot.py
+++ b/gn/find_xcode_sysroot.py
@@ -12,4 +12,5 @@
 
 (sdk,) = sys.argv[1:]
 
-print(subprocess.check_output(['xcrun', '--sdk', sdk, '--show-sdk-path']))
+print(subprocess.check_output([
+    'xcrun', '--sdk', sdk, '--show-sdk-path']).decode('utf-8'))

Similar changes are made to other scripts in that commit.

Perhaps the aseprite fork of skia could be updated to include that commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants