mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
feat: idf_tools.py export support env var "IDF_SKIP_TOOLS_CHECK"
This commit is contained in:
parent
f326d5d7ce
commit
e1781df75b
@ -2122,8 +2122,12 @@ def process_tool(
|
||||
|
||||
if not tool.versions_installed:
|
||||
if tool.get_install_type() == IDFTool.INSTALL_ALWAYS:
|
||||
handle_missing_versions(tool, tool_name, install_cmd, prefer_system_hint)
|
||||
tool_found = False
|
||||
if os.getenv('IDF_SKIP_TOOLS_CHECK', '0') == '1':
|
||||
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.
|
||||
return tool_export_paths, tool_export_vars, tool_found
|
||||
|
||||
|
@ -312,6 +312,19 @@ class TestUsage(TestUsageBase):
|
||||
|
||||
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
|
||||
@unittest.skipIf(sys.platform == 'win32', reason='Tools for UNIX differ')
|
||||
|
Loading…
x
Reference in New Issue
Block a user