diff --git a/bypy/linux/__main__.py b/bypy/linux/__main__.py index acff193a92..3768195bda 100644 --- a/bypy/linux/__main__.py +++ b/bypy/linux/__main__.py @@ -276,9 +276,9 @@ def create_tarfile(env, compression_level='9'): try: shutil.rmtree(base) except EnvironmentError as err: - if err.errno != errno.ENOENT: + if err.errno not in (errno.ENOENT, errno.EBUSY): 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)) with tarfile.open(dist, mode='w', format=tarfile.PAX_FORMAT) as tf: cwd = os.getcwd() diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index 53c8de0ed2..898caad665 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -316,6 +316,9 @@ class BuildTest(unittest.TestCase): raise unittest.SkipTest('Skipping Qt build test as sanitizer is enabled') from qt.core import QApplication, QFontDatabase, QImageReader, QLoggingCategory, QNetworkAccessManager, QSslSocket, QTimer 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 calibre.utils.img import image_from_data, image_to_data, test