mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Support building in container
This commit is contained in:
parent
67bb8299c6
commit
149d680e60
@ -276,9 +276,9 @@ def create_tarfile(env, compression_level='9'):
|
|||||||
try:
|
try:
|
||||||
shutil.rmtree(base)
|
shutil.rmtree(base)
|
||||||
except EnvironmentError as err:
|
except EnvironmentError as err:
|
||||||
if err.errno != errno.ENOENT:
|
if err.errno not in (errno.ENOENT, errno.EBUSY):
|
||||||
raise
|
raise
|
||||||
os.mkdir(base)
|
os.makedirs(base, exist_ok=True) # when base is a mount point deleting it fails with EBUSY
|
||||||
dist = os.path.join(base, '%s-%s-%s.tar' % (calibre_constants['appname'], calibre_constants['version'], arch))
|
dist = os.path.join(base, '%s-%s-%s.tar' % (calibre_constants['appname'], calibre_constants['version'], arch))
|
||||||
with tarfile.open(dist, mode='w', format=tarfile.PAX_FORMAT) as tf:
|
with tarfile.open(dist, mode='w', format=tarfile.PAX_FORMAT) as tf:
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
|
@ -316,6 +316,9 @@ class BuildTest(unittest.TestCase):
|
|||||||
raise unittest.SkipTest('Skipping Qt build test as sanitizer is enabled')
|
raise unittest.SkipTest('Skipping Qt build test as sanitizer is enabled')
|
||||||
from qt.core import QApplication, QFontDatabase, QImageReader, QLoggingCategory, QNetworkAccessManager, QSslSocket, QTimer
|
from qt.core import QApplication, QFontDatabase, QImageReader, QLoggingCategory, QNetworkAccessManager, QSslSocket, QTimer
|
||||||
QLoggingCategory.setFilterRules('''qt.webenginecontext.debug=true''')
|
QLoggingCategory.setFilterRules('''qt.webenginecontext.debug=true''')
|
||||||
|
if hasattr(os, 'geteuid') and os.geteuid() == 0:
|
||||||
|
# likely a container build, webengine cannot run as root with sandbox
|
||||||
|
os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = '--no-sandbox'
|
||||||
from qt.webengine import QWebEnginePage
|
from qt.webengine import QWebEnginePage
|
||||||
|
|
||||||
from calibre.utils.img import image_from_data, image_to_data, test
|
from calibre.utils.img import image_from_data, image_to_data, test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user