summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2020-01-07 22:54:59 +0000
committerChandan Singh <chandan@chandansingh.net>2020-01-07 23:33:29 +0000
commit78d366a929122cbc643e72d22c5850504ee50e22 (patch)
treed4951c1ac27b95598e5ccaaaf1d2bfcaf79aaf62
parent51263e21ccdc80b72e7fc0edf614922616a8ac29 (diff)
downloadbuildstream-chandan/no-warn-bwrap.tar.gz
setup.py: Remove check for bubblewrapchandan/no-warn-bwrap
Bubblewrap is not a hard requirement for BuildStream now that it supports other sandboxing mechanisms, i.e. buildbox-run and remote execution. Aside from that, this check is already a bit misplaced in `setup.py`. Bubblewrap is a runtime requirement, so warning about it at build time isn't quite right. It makes sense when BuildStream is being installed from source, but not when it is installed from any binary distribution. Note that the corresponding sandbox implementation already does this check at runtime.
-rwxr-xr-xsetup.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/setup.py b/setup.py
index 7c546e798..2d24fd533 100755
--- a/setup.py
+++ b/setup.py
@@ -51,56 +51,6 @@ except ImportError:
sys.exit(1)
-##################################################################
-# Bubblewrap requirements
-##################################################################
-REQUIRED_BWRAP_MAJOR = 0
-REQUIRED_BWRAP_MINOR = 1
-REQUIRED_BWRAP_PATCH = 2
-
-
-def warn_bwrap(reason):
- print(reason +
- "\nBuildStream requires Bubblewrap (bwrap {}.{}.{} or better),"
- " during local builds, for"
- " sandboxing the build environment.\nInstall it using your package manager"
- " (usually bwrap or bubblewrap) otherwise you will be limited to"
- " remote builds only.".format(REQUIRED_BWRAP_MAJOR, REQUIRED_BWRAP_MINOR, REQUIRED_BWRAP_PATCH))
-
-
-def bwrap_too_old(major, minor, patch):
- if major < REQUIRED_BWRAP_MAJOR:
- return True
- elif major == REQUIRED_BWRAP_MAJOR:
- if minor < REQUIRED_BWRAP_MINOR:
- return True
- elif minor == REQUIRED_BWRAP_MINOR:
- return patch < REQUIRED_BWRAP_PATCH
- else:
- return False
- else:
- return False
-
-
-def check_for_bwrap():
- platform = sys.platform
-
- if platform.startswith('linux'):
- sandbox = os.environ.get('BST_FORCE_SANDBOX', "bwrap")
- if sandbox != 'bwrap':
- return
- bwrap_path = shutil.which('bwrap')
- if not bwrap_path:
- warn_bwrap("Bubblewrap not found")
- return
-
- version_bytes = subprocess.check_output([bwrap_path, "--version"]).split()[1]
- version_string = str(version_bytes, "utf-8")
- major, minor, patch = map(int, version_string.split("."))
- if bwrap_too_old(major, minor, patch):
- warn_bwrap("Bubblewrap too old")
-
-
###########################################
# List the pre-built man pages to install #
###########################################
@@ -153,7 +103,6 @@ bst_install_entry_points = {
}
if not os.environ.get('BST_ARTIFACTS_ONLY', ''):
- check_for_bwrap()
bst_install_entry_points['console_scripts'] += [
'bst = buildstream._frontend:cli'
]