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,
examples/build_system/cmake/import_lib/main/lib/tinyxml2,
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
components/protocomm/python/constants_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"
# 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

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_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
-------------

Wyświetl plik

@ -276,7 +276,7 @@ The three fragment types share a common grammar:
**Condition Checking**
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:
- comparison

Wyświetl plik

@ -244,7 +244,7 @@ CMake
**条件检查**
条件检查使得链接脚本生成机制可以感知配置。含有配置值的表达式是否为真,决定了使用哪些特定键值。检查使用的是 :idf_file:`tools/kconfig_new/kconfiglib.py` 脚本的 ``eval_string``,遵循该脚本要求的语法和局限性,支持:
条件检查使得链接脚本生成机制可以感知配置。含有配置值的表达式是否为真,决定了使用哪些特定键值。检查使用的是 kconfiglib 脚本的 ``eval_string``,遵循该脚本要求的语法和局限性,支持:
- 比较
- 小于 ``<``
@ -538,4 +538,4 @@ ESP-IDF v4.0 变更了链接脚本片段文件使用的一些语法:
这是根据默认协议条目 ``iram -> iram0_text`` 生成的规则。默认协议指定了 ``iram -> iram0_text`` 条目,因此生成的规则同样也放在被 ``iram0_text`` 标记的地方。由于该规则是根据默认协议生成的,因此在同一目标下收集的所有规则下排在第一位。
目前使用的链接脚本模板是 :component_file:`{IDF_TARGET_PATH_NAME}/ld/{IDF_TARGET_PATH_NAME}.project.ld.in`,由 ``{IDF_TARGET_PATH_NAME}`` 组件指定,生成的脚本存放在构建目录下。

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)
reedsolo>=1.5.3,<=1.5.4
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; 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
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
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.
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

Wyświetl plik

@ -21,23 +21,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
from future.utils import iteritems
import argparse
import json
import kconfiglib
import os
import os.path
import re
import sys
import tempfile
from future.utils import iteritems
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"
if "IDF_CMAKE" not in os.environ:

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -1,14 +1,14 @@
#!/usr/bin/env python
import kconfiglib
import os
import sys
import unittest
try:
from . import kconfiglib
except Exception:
import gen_kconfig_doc
except ImportError:
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):

Wyświetl plik

@ -14,17 +14,8 @@
# limitations under the License.
#
import os
from pyparsing import Word, alphanums, printables, Combine, Literal, hexnums, quotedString, Optional, nums, removeQuotes, oneOf, Group, infixNotation, opAssoc
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
import kconfiglib
class SDKConfig: