mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
See if forcibly loading the correct libxml2 dylib before running the tests fixes the lxml test failure on CI
This commit is contained in:
parent
f95180349c
commit
0bdde99372
@ -6,8 +6,7 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from setup import Command
|
from setup import Command, ismacos, is_ci
|
||||||
|
|
||||||
TEST_MODULES = frozenset('srv db polish opf css docx cfi matcher icu smartypants build misc dbcli ebooks'.split())
|
TEST_MODULES = frozenset('srv db polish opf css docx cfi matcher icu smartypants build misc dbcli ebooks'.split())
|
||||||
|
|
||||||
|
|
||||||
@ -41,6 +40,12 @@ class Test(Command):
|
|||||||
self.info(f'Re-execing with LD_PRELOAD={os.environ["LD_PRELOAD"]}')
|
self.info(f'Re-execing with LD_PRELOAD={os.environ["LD_PRELOAD"]}')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
os.execl('setup.py', *sys.argv)
|
os.execl('setup.py', *sys.argv)
|
||||||
|
if is_ci and ismacos:
|
||||||
|
import ctypes
|
||||||
|
sys.libxml2_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libxml2.dylib'))
|
||||||
|
sys.libxslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libxslt.dylib'))
|
||||||
|
sys.libexslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libexslt.dylib'))
|
||||||
|
print(sys.libxml2_dylib, sys.libxslt_dylib, sys.libexslt_dylib, file=sys.stderr, flush=True)
|
||||||
from calibre.utils.run_tests import (
|
from calibre.utils.run_tests import (
|
||||||
filter_tests_by_name, remove_tests_by_name, run_cli, find_tests
|
filter_tests_by_name, remove_tests_by_name, run_cli, find_tests
|
||||||
)
|
)
|
||||||
|
@ -161,6 +161,7 @@ username = api
|
|||||||
if ismacos:
|
if ismacos:
|
||||||
os.environ['SSL_CERT_FILE'] = os.path.abspath(
|
os.environ['SSL_CERT_FILE'] = os.path.abspath(
|
||||||
'resources/mozilla-ca-certs.pem')
|
'resources/mozilla-ca-certs.pem')
|
||||||
|
os.environ['DYLD_LIBRARY_PATH'] = os.path.join(SW, 'lib') # needed to ensure correct libxml2.dylib is loaded
|
||||||
|
|
||||||
install_env()
|
install_env()
|
||||||
run_python('setup.py test')
|
run_python('setup.py test')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user