You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

crossenv

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crossenv - pypi Package Compare versions

Comparing version
1.1.4
to
1.2.0
+1
-1
crossenv.egg-info/PKG-INFO
Metadata-Version: 2.1
Name: crossenv
Version: 1.1.4
Version: 1.2.0
Summary: A cross-compiling tool for Python extension modules

@@ -5,0 +5,0 @@ Home-page: https://github.com/benfogle/crossenv

@@ -22,3 +22,3 @@ import venv

__version__ = '1.1.4'
__version__ = '1.2.0'

@@ -326,17 +326,17 @@ logger = logging.getLogger(__name__)

self.host_platform = None
# Ask the makefile a few questions too
if not os.path.exists(self.host_makefile):
raise FileNotFoundError("Cannot find Makefile")
if os.path.exists(self.host_makefile):
with open(self.host_makefile, 'r') as fp:
lines = list(fp.readlines())
for line in lines:
line = line.strip()
if line.startswith('_PYTHON_HOST_PLATFORM='):
host_platform = line.split('=',1)[-1].strip()
if host_platform:
self.host_platform = host_platform
break
else:
lines = []
self.host_platform = None
with open(self.host_makefile, 'r') as fp:
lines = list(fp.readlines())
for line in lines:
line = line.strip()
if line.startswith('_PYTHON_HOST_PLATFORM='):
host_platform = line.split('=',1)[-1].strip()
if host_platform:
self.host_platform = host_platform
break
if self.host_platform is None:

@@ -374,12 +374,22 @@ # It was probably natively compiled, but not necessarily for this

cmdline = self.host_cc + [arg]
try:
return subprocess.check_output(cmdline, universal_newlines=True)
except (subprocess.CalledProcessError, FileNotFoundError):
return None
return subprocess.run(cmdline,
universal_newlines=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
if run_compiler('--version') is None:
# I guess we could continue...but why?
if not shutil.which(self.host_cc[0]):
raise RuntimeError(
"Cannot run cross-compiler (%r)! Extension modules won't "
"Cannot find cross-compiler (%r)! Extension modules won't "
"build! Use --cc to correct." % ' '.join(self.host_cc))
# Check that it runs, but failing this is a warning. Some compilers,
# like QNX's qcc, do not have useful arguments we can pass to get a
# successful return value.
res = run_compiler('--version')
if res.returncode != 0:
logger.warning(
"Test run of %r exited with code %d: %s" % (
self.host_cc, res.returncode, res.stderr))
# If it doesn't have --version, it certainly won't have
# -print-sysroot or -dumpmachine
return

@@ -389,9 +399,10 @@

if self.host_sysroot is None:
self.host_sysroot = run_compiler('-print-sysroot')
if self.host_sysroot:
self.host_sysroot = self.host_sysroot.strip()
res = run_compiler('-print-sysroot')
if res.returncode == 0:
self.host_sysroot = res.stdout.strip()
# Sanity check that this is the right compiler. (See #24, #27.)
found_triple = run_compiler('-dumpmachine').strip().strip()
if found_triple:
res = run_compiler('-dumpmachine')
found_triple = res.stdout.strip()
if res.returncode == 0 and found_triple:
expected = self.host_sysconfigdata.build_time_vars['HOST_GNU_TYPE']

@@ -398,0 +409,0 @@ if not self._compare_triples(found_triple, expected):

Metadata-Version: 2.1
Name: crossenv
Version: 1.1.4
Version: 1.2.0
Summary: A cross-compiling tool for Python extension modules

@@ -5,0 +5,0 @@ Home-page: https://github.com/benfogle/crossenv