tools: Use kconfiglib from package

pull/5682/merge
Roland Dobai 2020-09-21 11:37:23 +02:00
rodzic b845bb5787
commit 883cbc416e
15 zmienionych plików z 46 dodań i 10476 usunięć

Wyświetl plik

@ -152,9 +152,6 @@ exclude =
components/unity/unity, components/unity/unity,
examples/build_system/cmake/import_lib/main/lib/tinyxml2, examples/build_system/cmake/import_lib/main/lib/tinyxml2,
examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib, examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib,
# other third-party libraries
tools/kconfig_new/kconfiglib.py,
tools/kconfig_new/menuconfig.py,
# autogenerated scripts # autogenerated scripts
components/protocomm/python/constants_pb2.py, components/protocomm/python/constants_pb2.py,
components/protocomm/python/sec0_pb2.py, components/protocomm/python/sec0_pb2.py,

Wyświetl plik

@ -46,7 +46,7 @@ variables:
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/config/target-test.yml" CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/tools/ci/config/target-test.yml"
# Versioned esp-idf-doc env image to use for all document building jobs # Versioned esp-idf-doc env image to use for all document building jobs
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v6" ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env:v7"
# before each job, we need to check if this job is filtered by bot stage/job filter # before each job, we need to check if this job is filtered by bot stage/job filter

Wyświetl plik

@ -74,11 +74,6 @@ This is the list of licenses for tools included in this repository, which are us
* :idf:`KConfig <tools/kconfig>` is Copyright (C) 2002 Roman Zippel and others, and is licensed under the GNU General Public License V2. * :idf:`KConfig <tools/kconfig>` is Copyright (C) 2002 Roman Zippel and others, and is licensed under the GNU General Public License V2.
* :idf_file:`Kconfiglib <tools/kconfig_new/kconfiglib.py>` is Copyright (C) 2011-2019, Ulf Magnusson, and is licensed under the ISC License.
* :idf_file:`Menuconfig of Kconfiglib <tools/kconfig_new/menuconfig.py>` is Copyright (C) 2018-2019, Nordic Semiconductor ASA and Ulf Magnusson, and is licensed under the ISC License.
Documentation Documentation
------------- -------------

Wyświetl plik

@ -276,7 +276,7 @@ The three fragment types share a common grammar:
**Condition Checking** **Condition Checking**
Condition checking enable the linker script generation to be configuration-aware. Depending on whether expressions involving configuration values Condition checking enable the linker script generation to be configuration-aware. Depending on whether expressions involving configuration values
are true or not, a particular set of values for a key can be used. The evaluation uses ``eval_string`` from :idf_file:`tools/kconfig_new/kconfiglib.py` are true or not, a particular set of values for a key can be used. The evaluation uses ``eval_string`` from kconfiglib package
and adheres to its required syntax and limitations. Supported operators are as follows: and adheres to its required syntax and limitations. Supported operators are as follows:
- comparison - comparison

Wyświetl plik

@ -244,7 +244,7 @@ CMake
**条件检查** **条件检查**
条件检查使得链接脚本生成机制可以感知配置。含有配置值的表达式是否为真,决定了使用哪些特定键值。检查使用的是 :idf_file:`tools/kconfig_new/kconfiglib.py` 脚本的 ``eval_string``,遵循该脚本要求的语法和局限性,支持: 条件检查使得链接脚本生成机制可以感知配置。含有配置值的表达式是否为真,决定了使用哪些特定键值。检查使用的是 kconfiglib 脚本的 ``eval_string``,遵循该脚本要求的语法和局限性,支持:
- 比较 - 比较
- 小于 ``<`` - 小于 ``<``

Wyświetl plik

@ -18,6 +18,7 @@ pygdbmi<=0.9.0.2
# The pygdbmi required max version 0.9.0.2 since 0.9.0.3 is not copatible with latest gdbgui (>=0.13.2.0) # The pygdbmi required max version 0.9.0.2 since 0.9.0.3 is not copatible with latest gdbgui (>=0.13.2.0)
reedsolo>=1.5.3,<=1.5.4 reedsolo>=1.5.3,<=1.5.4
bitstring>=3.1.6 bitstring>=3.1.6
kconfiglib==13.7.1
# windows-curses are required in Windows command line but cannot be installed in MSYS2. A requirement like # windows-curses are required in Windows command line but cannot be installed in MSYS2. A requirement like
# "windows-curses; sys_platform == 'win32'" would want to install the package on both of them. There is no environment # "windows-curses; sys_platform == 'win32'" would want to install the package on both of them. There is no environment

Wyświetl plik

@ -239,7 +239,6 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
# Or if the config generation tool changes # Or if the config generation tool changes
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${idf_path}/tools/kconfig_new/confgen.py") set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${idf_path}/tools/kconfig_new/confgen.py")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${idf_path}/tools/kconfig_new/kconfiglib.py")
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES "${sdkconfig_header}" "${sdkconfig_cmake}") ADDITIONAL_MAKE_CLEAN_FILES "${sdkconfig_header}" "${sdkconfig_cmake}")

Wyświetl plik

@ -2,7 +2,7 @@
kconfig_new is the kconfig support used by the CMake-based build system. kconfig_new is the kconfig support used by the CMake-based build system.
It uses a fork of [kconfiglib](https://github.com/ulfalizer/Kconfiglib) which adds a few small features (newer upstream kconfiglib also has the support we need, we just haven't updated yet). See comments at top of kconfiglib.py for details It depends on the [kconfiglib](https://github.com/ulfalizer/Kconfiglib) package.
## confserver.py ## confserver.py

Wyświetl plik

@ -21,23 +21,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
from future.utils import iteritems
import argparse import argparse
import json import json
import kconfiglib
import os import os
import os.path import os.path
import re import re
import sys import sys
import tempfile import tempfile
from future.utils import iteritems
import gen_kconfig_doc import gen_kconfig_doc
try:
from . import kconfiglib
except Exception:
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import kconfiglib
__version__ = "0.1" __version__ = "0.1"
if "IDF_CMAKE" not in os.environ: if "IDF_CMAKE" not in os.environ:

Wyświetl plik

@ -7,16 +7,12 @@ from __future__ import print_function
import argparse import argparse
import confgen import confgen
import json import json
import kconfiglib
import os import os
import sys import sys
import tempfile import tempfile
from confgen import FatalError, __version__
try: from confgen import FatalError, __version__
from . import kconfiglib
except Exception:
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import kconfiglib
# Min/Max supported protocol versions # Min/Max supported protocol versions
MIN_PROTOCOL_VERSION = 1 MIN_PROTOCOL_VERSION = 1

Wyświetl plik

@ -21,15 +21,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
import os
import re import re
import sys import kconfiglib
try:
from . import kconfiglib
except Exception:
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import kconfiglib
# Indentation to be used in the generated file # Indentation to be used in the generated file
INDENT = ' ' INDENT = ' '

Wyświetl plik

@ -1,14 +1,14 @@
#!/usr/bin/env python #!/usr/bin/env python
import kconfiglib
import os import os
import sys import sys
import unittest import unittest
try: try:
from . import kconfiglib import gen_kconfig_doc
except Exception: except ImportError:
sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))) sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..')))
import kconfiglib import gen_kconfig_doc
import gen_kconfig_doc
class ConfigTargetVisibilityTestCase(unittest.TestCase): class ConfigTargetVisibilityTestCase(unittest.TestCase):

Wyświetl plik

@ -14,17 +14,8 @@
# limitations under the License. # limitations under the License.
# #
import os
from pyparsing import Word, alphanums, printables, Combine, Literal, hexnums, quotedString, Optional, nums, removeQuotes, oneOf, Group, infixNotation, opAssoc from pyparsing import Word, alphanums, printables, Combine, Literal, hexnums, quotedString, Optional, nums, removeQuotes, oneOf, Group, infixNotation, opAssoc
import kconfiglib
import sys
try:
from . import kconfiglib
except Exception:
parent_dir_name = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
kconfig_new_dir = os.path.abspath(parent_dir_name + "/kconfig_new")
sys.path.insert(0, kconfig_new_dir)
import kconfiglib
class SDKConfig: class SDKConfig: