Giter Club home page Giter Club logo

Comments (1)

ryandesign avatar ryandesign commented on July 30, 2024

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.

from skia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.