Make `rosetta error` more verbose

Hey everyone,

while trying to codesign a x86_64 Python app using an arm64 system, I often stumble across an rosetta error like the one depicted down here:

rosetta error: unable to mmap __TEXT: 1 
 /var/db/oah/.../.../libomp.dylib.aotzsh: abort      PYTORCH_ENABLE_MPS_FALLBACK=1 ./diarize_x86_64 mps 

This happens after I codesign the app and then try to run it in a Rosetta2 zsh. This thread is not about the error itself (since I am trying to solve it somewhere else). It is about making this rosetta error more verbose so we can actually work with it. If I run this app/executable on a native x86_64 system, the error is much more informative (and it can actually be debugged):

error  dlopen(/var/folders/ws/***/T/yyy/sklearn/__check_build/_check_build.cpython-39-darwin.so, 2): Library not loaded: @rpath/libomp.dylib
  Referenced from: /var/folders/ws/***/T/yyy/sklearn/__check_build/_check_build.cpython-39-darwin.so
  Reason: no suitable image found.  Did find:
	/private/var/folders/ws/***/T/yyy/sklearn/__check_build/../../libomp.dylib: code signing blocked mmap() of '/private/var/folders/ws/***/T/yyy/sklearn/__check_build/../../libomp.dylib'
___________________________________________________________________________
Contents of /var/folders/ws/***/T/yyy/sklearn/__check_build:
__init__.py               __pycache__               _check_build.cpython-39-darwin.so
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.

If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.

If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.

It would be great, if we could get this output using a Rosetta2 zsh with an arm64 system, because the simple rosetta error is hard (or impossible) to debug. Is there a way to do this?

Make `rosetta error` more verbose
 
 
Q