summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-09-12 13:40:13 -0700
committerDamjan Marion <dmarion@me.com>2018-09-13 00:32:35 +0000
commit9ce6a21aaa76cd40c95ebbcb5fc6e48a8f5dfdb9 (patch)
tree5656afec4a81b93dcda22b5af8b41c051f246bd8
parentb1232555e91b286feab5667b5a22f29aa8e96626 (diff)
Fix: vppapigen make build fails on fresh install
Steps to reproduce: vagrant@localhost:/vagrant$ build-root/vagrant/build.sh ... @@@@ Building vpp in /vagrant/build-root/build-vpp-native/vpp @@@@ [51/1169] Generating API header /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json FAILED: cd /vagrant/build-root/build-vpp-native/vpp/vlibmemory && mkdir -p /vagrant/build-root/build-vpp-native/vpp/vlibmemory && /vagrant/src/tools/vppapigen/vppapigen --includedir /vagrant/src --input /vagrant/src/vlibmemory/memclnt.api JSON --output /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json AttributeError: 'module' object has no attribute 'dumps' This seems to be due to JSON.py namespace colliding with the standard lib json.py Change-Id: If389e4e05ef0c166b0c2b3bef7ec0185298679a8 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--build-data/platforms.mk4
-rw-r--r--extras/rpm/vpp.spec4
-rw-r--r--src/tools/vppapigen/CMakeLists.txt2
-rwxr-xr-xsrc/tools/vppapigen/vppapigen.py4
-rw-r--r--src/tools/vppapigen/vppapigen_c.py (renamed from src/tools/vppapigen/C.py)0
-rw-r--r--src/tools/vppapigen/vppapigen_json.py (renamed from src/tools/vppapigen/JSON.py)0
6 files changed, 7 insertions, 7 deletions
diff --git a/build-data/platforms.mk b/build-data/platforms.mk
index fafddc64a0d..d06720272c6 100644
--- a/build-data/platforms.mk
+++ b/build-data/platforms.mk
@@ -78,9 +78,9 @@ install-deb: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
: dev package needs a couple of additions ; \
echo ../$(INSTALL_PREFIX)$(ARCH)/vpp/bin/vppapigen /usr/bin \
>> deb/debian/vpp-dev.install ; \
- echo ../$(INSTALL_PREFIX)$(ARCH)/vpp/share/vpp/C.py /usr/share/vpp \
+ echo ../$(INSTALL_PREFIX)$(ARCH)/vpp/share/vpp/vppapigen_c.py /usr/share/vpp \
>> deb/debian/vpp-dev.install ; \
- echo ../$(INSTALL_PREFIX)$(ARCH)/vpp/share/vpp/JSON.py /usr/share/vpp \
+ echo ../$(INSTALL_PREFIX)$(ARCH)/vpp/share/vpp/vppapigen_json.py /usr/share/vpp \
>> deb/debian/vpp-dev.install ; \
echo ../../extras/japi/java/jvpp/gen/jvpp_gen.py /usr/bin \
>> deb/debian/vpp-dev.install ; \
diff --git a/extras/rpm/vpp.spec b/extras/rpm/vpp.spec
index 13397513a2b..a66b46c5ae6 100644
--- a/extras/rpm/vpp.spec
+++ b/extras/rpm/vpp.spec
@@ -263,8 +263,8 @@ for i in $(ls %{_mu_build_dir}/../extras/japi/java/jvpp/gen/jvppgen/*.py); do
install -p -m666 ${i} %{buildroot}%{python2_sitelib}/jvppgen
done;
-install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/C.py %{buildroot}/usr/share/vpp
-install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/JSON.py %{buildroot}/usr/share/vpp
+install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_c.py %{buildroot}/usr/share/vpp
+install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_json.py %{buildroot}/usr/share/vpp
# sample plugin
mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
diff --git a/src/tools/vppapigen/CMakeLists.txt b/src/tools/vppapigen/CMakeLists.txt
index 0d982fe29f8..ce25cb0c9e7 100644
--- a/src/tools/vppapigen/CMakeLists.txt
+++ b/src/tools/vppapigen/CMakeLists.txt
@@ -21,4 +21,4 @@ install(
COMPONENT vpp-dev
)
-install(FILES C.py JSON.py DESTINATION share/vpp COMPONENT vpp-dev)
+install(FILES vppapigen_c.py vppapigen_json.py DESTINATION share/vpp COMPONENT vpp-dev)
diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py
index f3094ec0a84..9d04ec24cfc 100755
--- a/src/tools/vppapigen/vppapigen.py
+++ b/src/tools/vppapigen/vppapigen.py
@@ -785,14 +785,14 @@ def main():
'/../share/vpp/')
for c in cand:
c += '/'
- if os.path.isfile(c + args.output_module + '.py'):
+ if os.path.isfile('{}vppapigen_{}.py'.format(c, args.output_module.lower())):
pluginpath = c
break
else:
pluginpath = args.pluginpath + '/'
if pluginpath == '':
raise Exception('Output plugin not found')
- module_path = pluginpath + args.output_module + '.py'
+ module_path = '{}vppapigen_{}.py'.format(pluginpath, args.output_module.lower())
try:
plugin = imp.load_source(args.output_module, module_path)
diff --git a/src/tools/vppapigen/C.py b/src/tools/vppapigen/vppapigen_c.py
index b56e0722122..b56e0722122 100644
--- a/src/tools/vppapigen/C.py
+++ b/src/tools/vppapigen/vppapigen_c.py
diff --git a/src/tools/vppapigen/JSON.py b/src/tools/vppapigen/vppapigen_json.py
index 2991bec57ac..2991bec57ac 100644
--- a/src/tools/vppapigen/JSON.py
+++ b/src/tools/vppapigen/vppapigen_json.py
#003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
__init__ file for directory tools
"""