Add support for Apple M1 by kara-todd · Pull Request #322 · touilleMan/godot-python

I have been trying to build this on my m1 mac and I am running into some issues :(

The full error is below... but I think the issue is here building for macOS-x86_64 but attempting to link with file built for macOS-arm64

I don't understand why it's trying to build for macOS-x86_64 did I fail to set this somewhere?

(venv) bash-3.2$ scons platform=osx-aarch64 CC=clang release
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
clang -o build/osx-aarch64/pythonscript/libpythonscript.dylib -m64 -L/Users/username/godot-python/build/osx-aarch64/platforms/osx-aarch64/cpython_build/lib -Wl,-rpath,'@loader_path/lib' -install_name @rpath/libpythonscript.dylib -dynamiclib build/osx-aarch64/pythonscript/pythonscript.os -lpython3.9
ld: warning: ignoring file /Users/username/godot-python/build/osx-aarch64/platforms/osx-aarch64/cpython_build/lib/libpython3.9.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_PyCapsule_GetName", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyCapsule_GetPointer", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyCapsule_IsValid", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyDict_GetItemString", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyErr_Format", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyEval_InitThreads", referenced from:
      _godot_gdnative_init in pythonscript.os
  "_PyEval_RestoreThread", referenced from:
      _godot_gdnative_terminate in pythonscript.os
  "_PyEval_SaveThread", referenced from:
      _godot_gdnative_init in pythonscript.os
  "_PyExc_ImportError", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyExc_TypeError", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyImport_ImportModule", referenced from:
      _godot_gdnative_init in pythonscript.os
  "_PyModule_GetName", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_PyObject_GetAttrString", referenced from:
      ___Pyx_ImportFunction in pythonscript.os
  "_Py_FinalizeEx", referenced from:
      _godot_gdnative_terminate in pythonscript.os
  "_Py_InitializeEx", referenced from:
      _godot_gdnative_init in pythonscript.os
  "_Py_SetProgramName", referenced from:
      _godot_gdnative_init in pythonscript.os
  "_Py_SetPythonHome", referenced from:
      _godot_gdnative_init in pythonscript.os
  "__Py_Dealloc", referenced from:
      _godot_gdnative_init in pythonscript.os
      ___Pyx_ImportFunction in pythonscript.os
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/osx-aarch64/pythonscript/libpythonscript.dylib] Error 1
scons: building terminated because of errors.