mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
feat: idf_tools.py export support env var "IDF_SKIP_TOOLS_CHECK"
This commit is contained in:
@@ -2122,8 +2122,12 @@ def process_tool(
|
|||||||
|
|
||||||
if not tool.versions_installed:
|
if not tool.versions_installed:
|
||||||
if tool.get_install_type() == IDFTool.INSTALL_ALWAYS:
|
if tool.get_install_type() == IDFTool.INSTALL_ALWAYS:
|
||||||
handle_missing_versions(tool, tool_name, install_cmd, prefer_system_hint)
|
if os.getenv('IDF_SKIP_TOOLS_CHECK', '0') == '1':
|
||||||
tool_found = False
|
warn(f'Tool {tool_name} is not installed and IDF_SKIP_TOOLS_CHECK is set. '
|
||||||
|
'This may cause build failures.')
|
||||||
|
else:
|
||||||
|
handle_missing_versions(tool, tool_name, install_cmd, prefer_system_hint)
|
||||||
|
tool_found = False
|
||||||
# If a tool found, but it is optional and does not have versions installed, use whatever is in PATH.
|
# If a tool found, but it is optional and does not have versions installed, use whatever is in PATH.
|
||||||
return tool_export_paths, tool_export_vars, tool_found
|
return tool_export_paths, tool_export_vars, tool_found
|
||||||
|
|
||||||
|
@@ -312,6 +312,19 @@ class TestUsage(TestUsageBase):
|
|||||||
|
|
||||||
self.assertNotIn(tool_to_test, output)
|
self.assertNotIn(tool_to_test, output)
|
||||||
|
|
||||||
|
def test_export_with_required_tools_check_skipped(self):
|
||||||
|
self.run_idf_tools_with_error(['export'], assertError=True)
|
||||||
|
|
||||||
|
new_os_environ = os.environ.copy()
|
||||||
|
new_os_environ['IDF_SKIP_TOOLS_CHECK'] = '1'
|
||||||
|
with patch('os.environ', new_os_environ):
|
||||||
|
self.run_idf_tools_with_action(['export'])
|
||||||
|
|
||||||
|
self.run_idf_tools_with_action(['install', OPENOCD])
|
||||||
|
output = self.run_idf_tools_with_action(['export'])
|
||||||
|
self.assertIn('%s/tools/openocd-esp32/%s/openocd-esp32/bin' %
|
||||||
|
(self.temp_tools_dir, OPENOCD_VERSION), output)
|
||||||
|
|
||||||
|
|
||||||
# TestUsageUnix tests installed tools on UNIX platforms
|
# TestUsageUnix tests installed tools on UNIX platforms
|
||||||
@unittest.skipIf(sys.platform == 'win32', reason='Tools for UNIX differ')
|
@unittest.skipIf(sys.platform == 'win32', reason='Tools for UNIX differ')
|
||||||
|
Reference in New Issue
Block a user