0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/buildscripts/scons.py

39 lines
1021 B
Python
Raw Normal View History

2019-04-10 17:42:47 +02:00
#!/usr/bin/env python3
"""Scons module."""
2016-07-12 04:17:22 +02:00
import os
import sys
2019-12-20 15:03:04 +01:00
SCONS_VERSION = os.environ.get('SCONS_VERSION', "3.1.2")
2016-07-12 04:17:22 +02:00
MONGODB_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SCONS_DIR = os.path.join(MONGODB_ROOT, 'src', 'third_party', 'scons-' + SCONS_VERSION,
'scons-local-' + SCONS_VERSION)
if not os.path.exists(SCONS_DIR):
print("Could not find SCons in '%s'" % (SCONS_DIR))
sys.exit(1)
SITE_TOOLS_DIR = os.path.join(MONGODB_ROOT, 'site_scons')
sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path
# pylint: disable=C0413
from mongo.pip_requirements import verify_requirements, MissingRequirements
try:
verify_requirements('etc/pip/compile-requirements.txt')
except MissingRequirements as ex:
print(ex)
sys.exit(1)
2016-07-12 04:17:22 +02:00
try:
import SCons.Script
except ImportError as import_err:
print("Could not import SCons from '%s'" % (SCONS_DIR))
print("ImportError:", import_err)
sys.exit(1)
if __name__ == '__main__':
SCons.Script.main()