Juniper / contrail-installer

Install scripts for OpenContrail
29 stars 64 forks source link

Contain Build Error AttributeError: 'module' object has no attribute 'SetupBuildEnvironment': #171

Closed salimep closed 3 years ago

salimep commented 3 years ago

Dears,

We are facing an issue while building contrail packages from source getting below exception

kindly advise , i tried to search SetupBuildEnvironment' attributes module but none found

Error

sudo scons -j ${JOBS_COUNT:-$(grep -c processor /proc/cpuinfo || echo 1)} --without-dpdk
scons: Reading SConscript files ...
AttributeError: 'module' object has no attribute 'SetupBuildEnvironment':
  File "/home/salim/bin/SConstruct", line 15:
    env = rules.SetupBuildEnvironment(conf)
salim@contrail:~/bin$ sudo scons -j ${JOBS_COUNT:-$(grep -c processor /proc/cpuinfo || echo 1)} --without-dpdk
scons: Reading SConscript files ...
AttributeError: 'module' object has no attribute 'SetupBuildEnvironment':
  File "/home/salim/bin/SConstruct", line 15:
    env = rules.SetupBuildEnvironment(conf)

imported rules module in python

Python 2.7.6 (default, Nov 13 2018, 12:45:42)

[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rules
>>> dir(rules)
['Predicate', 'RuleSet', 'VERSION', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'add_perm', 'add_rule', 'always_allow', 'always_deny', 'always_false', 'always_true', 'compat', 'default_app_config', 'has_perm', 'is_active', 'is_authenticated', 'is_group_member', 'is_staff', 'is_superuser', 'perm_exists', 'permissions', 'predicate', 'predicates', 'remove_perm', 'remove_rule', 'rule_exists', 'rulesets', 'set_perm', 'set_rule', 'test_rule']
>>> 

configuration file

# -*- mode: python; -*-

#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#

# repository root directory
import os
import sys

sys.path.append('tools/build')

import rules
conf = Configure(DefaultEnvironment(ENV = os.environ))
env = rules.SetupBuildEnvironment(conf)

SConscript(dirs=['controller', 'vrouter', 'tools/sandesh'])

SConscript('openstack/nova_contrail_vif/SConscript',
           variant_dir='build/noarch/nova_contrail_vif')

if os.path.exists("openstack/contrail-nova-extensions/contrail_network_api/SConscript"):
    SConscript('openstack/contrail-nova-extensions/contrail_network_api/SConscript',
               variant_dir='build/noarch/contrail_nova_networkapi')

SConscript('openstack/neutron_plugin/SConscript',
           variant_dir='build/noarch/neutron_plugin')

if os.path.exists("openstack/ceilometer_plugin/SConscript"):
    SConscript('openstack/ceilometer_plugin/SConscript',
               variant_dir='build/noarch/ceilometer_plugin')

if os.path.exists("contrail-f5/SConscript"):
    SConscript('contrail-f5/SConscript',
               variant_dir='build/noarch/contrail-f5')