Buildcache: Need to check the binary is not a Mach-o binary in a linux package or an ELF binary in a macOS package. (#18670)
* Need to check the binary is not a Mach-o binary in a linux package or an ELF binary in a macOS package. * use sys.platform * Darwin -> darwin for sys.platform
This commit is contained in:
		| @@ -6,6 +6,7 @@ | |||||||
| import codecs | import codecs | ||||||
| import os | import os | ||||||
| import re | import re | ||||||
|  | import sys | ||||||
| import tarfile | import tarfile | ||||||
| import shutil | import shutil | ||||||
| import tempfile | import tempfile | ||||||
| @@ -460,7 +461,11 @@ def write_buildinfo_file(spec, workdir, rel=False): | |||||||
|                         tty.warn(msg) |                         tty.warn(msg) | ||||||
| 
 | 
 | ||||||
|             if relocate.needs_binary_relocation(m_type, m_subtype): |             if relocate.needs_binary_relocation(m_type, m_subtype): | ||||||
|                 if not filename.endswith('.o'): |                 if ((m_subtype in ('x-executable', 'x-sharedlib') | ||||||
|  |                     and sys.platform != 'darwin') or | ||||||
|  |                    (m_subtype in ('x-mach-binary') | ||||||
|  |                     and sys.platform == 'darwin') or | ||||||
|  |                    (not filename.endswith('.o'))): | ||||||
|                     rel_path_name = os.path.relpath(path_name, prefix) |                     rel_path_name = os.path.relpath(path_name, prefix) | ||||||
|                     binary_to_relocate.append(rel_path_name) |                     binary_to_relocate.append(rel_path_name) | ||||||
|             if relocate.needs_text_relocation(m_type, m_subtype): |             if relocate.needs_text_relocation(m_type, m_subtype): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Patrick Gartung
					Patrick Gartung