The old patch would dynamically glob within Emacs.app/Contents/MacOS/lib/gcc
using the full absolute path to Emacs.app. If there are obsure characters like
"[]" and others in the absolute path, it can cause glob search within the
native-compile-setup-environment-variables function to fail, in turn preventing
native-comp from working.
The fix is to hard-code the relative paths from Emacs' invocation-directory
(**/Emacs.app/Contents/MacOS) into the environment setup function itself,
making it very simple and effectively just joining a few strings and setting an
environment variable.
It did require a little bit of cleanup and better organization of the
GCC/libgccjit releated code in the build script, creating a new GccInfo class
which is the central place for determining various paths and information about
GCC and libgccjit which the build will be using.
The old patch would dynamically glob within Emacs.app/Contents/MacOS/lib/gcc using the full absolute path to Emacs.app. If there are obsure characters like "[]" and others in the absolute path, it can cause glob search within the native-compile-setup-environment-variables function to fail, in turn preventing native-comp from working.
The fix is to hard-code the relative paths from Emacs' invocation-directory (**/Emacs.app/Contents/MacOS) into the environment setup function itself, making it very simple and effectively just joining a few strings and setting an environment variable.
It did require a little bit of cleanup and better organization of the GCC/libgccjit releated code in the build script, creating a new GccInfo class which is the central place for determining various paths and information about GCC and libgccjit which the build will be using.