summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Gartung <gartung@fnal.gov>2020-10-01 12:39:59 -0500
committerGitHub <noreply@github.com>2020-10-01 12:39:59 -0500
commita380ceb139734aa9947212e2bc18055420dd9a0b (patch)
tree0098bb2e402552a6f4c620c62ac7d3ae3143b4e8 /lib
parente0c7f5ae3d1ba22abe1aac3175f6c5dc777df3a5 (diff)
downloadspack-a380ceb139734aa9947212e2bc18055420dd9a0b.tar.gz
spack-a380ceb139734aa9947212e2bc18055420dd9a0b.tar.bz2
spack-a380ceb139734aa9947212e2bc18055420dd9a0b.tar.xz
spack-a380ceb139734aa9947212e2bc18055420dd9a0b.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/binary_distribution.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py
index 268f4bbe0d..242a1d2b66 100644
--- a/lib/spack/spack/binary_distribution.py
+++ b/lib/spack/spack/binary_distribution.py
@@ -6,6 +6,7 @@
import codecs
import os
import re
+import sys
import tarfile
import shutil
import tempfile
@@ -460,7 +461,11 @@ def write_buildinfo_file(spec, workdir, rel=False):
tty.warn(msg)
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)
binary_to_relocate.append(rel_path_name)
if relocate.needs_text_relocation(m_type, m_subtype):