I run emacs in docker to manage these issues https://github.com/wwarner/emacs-native-dockerfiles