in build_aarch64_wheel.py [0:0]
def embed_libgomp(host: RemoteHost, use_conda, wheel_name) -> None:
host.run_cmd("pip3 install auditwheel")
host.run_cmd("conda install -y patchelf" if use_conda else "sudo apt-get install -y patchelf")
from tempfile import NamedTemporaryFile
with NamedTemporaryFile() as tmp:
tmp.write(embed_library_script.encode('utf-8'))
tmp.flush()
host.upload_file(tmp.name, "embed_library.py")
print('Embedding libgomp into wheel')
if host.using_docker():
host.run_cmd(f"python3 embed_library.py {wheel_name} --update-tag")
else:
host.run_cmd(f"python3 embed_library.py {wheel_name}")