mirror of
https://github.com/thead-yocto-mirror/meta-openembedded
synced 2026-09-26 04:35:40 +02:00
* Refresh patches * Add a patch to skip checking PYTHONHASHSEED Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
72 lines
2.7 KiB
Diff
72 lines
2.7 KiB
Diff
From 69c409195ede704ed7e9298ed4942cc70a52e099 Mon Sep 17 00:00:00 2001
|
|
From: Changqing Li <changqing.li@windriver.com>
|
|
Date: Tue, 25 Jun 2019 14:25:08 +0800
|
|
Subject: [PATCH] do not import target module while cross compile
|
|
|
|
Some modules such as dynamic library maybe cann't be imported
|
|
while cross compile, we just check whether does the module exist.
|
|
|
|
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
|
|
|
update to version 4.10.5, and switch to python3
|
|
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
|
|
|
Upstream-Status: Inappropriate [embedded specific]
|
|
|
|
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
|
---
|
|
buildtools/wafsamba/samba_bundled.py | 27 +++++++++++++++++++--------
|
|
1 file changed, 19 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
|
|
index 7d2d855..01dcb56 100644
|
|
--- a/buildtools/wafsamba/samba_bundled.py
|
|
+++ b/buildtools/wafsamba/samba_bundled.py
|
|
@@ -4,6 +4,7 @@ import sys
|
|
from waflib import Build, Options, Logs
|
|
from waflib.Configure import conf
|
|
from wafsamba import samba_utils
|
|
+import importlib.util, os
|
|
|
|
def PRIVATE_NAME(bld, name):
|
|
'''possibly rename a library to include a bundled extension'''
|
|
@@ -241,17 +242,27 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, libname, modulename, minversion='0.0.0'):
|
|
# versions
|
|
minversion = minimum_library_version(conf, libname, minversion)
|
|
|
|
- try:
|
|
- m = __import__(modulename)
|
|
- except ImportError:
|
|
- found = False
|
|
- else:
|
|
+ # Find module in PYTHONPATH
|
|
+ spec = importlib.util._find_spec_from_path(modulename, [os.environ["PYTHONPATH"]])
|
|
+ if spec:
|
|
try:
|
|
- version = m.__version__
|
|
- except AttributeError:
|
|
+ module = importlib.util.module_from_spec(spec)
|
|
+ spec.loader.load_module(module)
|
|
+ except ImportError:
|
|
found = False
|
|
+
|
|
+ if conf.env.CROSS_COMPILE:
|
|
+ # Some modules such as dynamic library maybe cann't be imported
|
|
+ # while cross compile, we just check whether the module exist
|
|
+ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (spec.name))
|
|
+ found = True
|
|
else:
|
|
- found = tuplize_version(version) >= tuplize_version(minversion)
|
|
+ try:
|
|
+ version = module.__version__
|
|
+ except AttributeError:
|
|
+ found = False
|
|
+ else:
|
|
+ found = tuplize_version(version) >= tuplize_version(minversion)
|
|
if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
|
|
Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
|
|
sys.exit(1)
|
|
--
|
|
2.25.1
|
|
|