Merge branch 'bugfix/build_spaces_in_path_tools' into 'master'

tools: fix issues related to spaces in paths in install and export scripts

Closes IDFGH-5913

See merge request espressif/esp-idf!15430
This commit is contained in:
Ivan Grokhotkov
2021-10-18 06:49:49 +00:00
8 changed files with 50 additions and 52 deletions

View File

@@ -4190,4 +4190,3 @@ tools/unit-test-app/tools/CreateSectionTable.py
tools/unit-test-app/tools/UnitTestParser.py
tools/unit-test-app/unit_test.py
tools/windows/eclipse_make.py
tools/windows/idf_exe/idf_main.c

View File

@@ -625,17 +625,17 @@
"version_regex": "([0-9.]+)",
"versions": [
{
"name": "1.0.1",
"name": "1.0.2",
"status": "recommended",
"win32": {
"sha256": "53eb6aaaf034cc7ed1a97d5c577afa0f99815b7793905e9408e74012d357d04a",
"size": 11297,
"url": "https://dl.espressif.com/dl/idf-exe-v1.0.1.zip"
"sha256": "93d45466cd2c86231f0693a60f68833db7bc63da17e876b2a64298a8869b916f",
"size": 7223,
"url": "https://dl.espressif.com/dl/idf-exe-v1.0.2.zip"
},
"win64": {
"sha256": "53eb6aaaf034cc7ed1a97d5c577afa0f99815b7793905e9408e74012d357d04a",
"size": 11297,
"url": "https://dl.espressif.com/dl/idf-exe-v1.0.1.zip"
"sha256": "93d45466cd2c86231f0693a60f68833db7bc63da17e876b2a64298a8869b916f",
"size": 7223,
"url": "https://dl.espressif.com/dl/idf-exe-v1.0.2.zip"
}
}
]

View File

@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 3.5)
project(idfexe)
set(VERSION 1.0.1)
set(VERSION 1.0.2)
set(ARCHIVE_NAME idf-exe-v${VERSION}.zip)
add_executable(idf idf_main.c)
target_compile_definitions(idf PRIVATE -DVERSION=\"${VERSION}\")
set_target_properties(idf PROPERTIES C_STANDARD 99)
target_link_libraries(idf "-lshlwapi")
target_link_libraries(idf "shlwapi")
if(CMAKE_BUILD_TYPE STREQUAL Release)
add_custom_command(TARGET idf

View File

@@ -1,16 +1,8 @@
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
//
// 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
/*
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <windows.h>
#include <shlwapi.h>
@@ -19,7 +11,11 @@
#define LINESIZE 1024
#ifdef __GNUC__
static void fail(LPCSTR message, ...) __attribute__((noreturn));
#else
__declspec(noreturn) static void fail(LPCSTR message, ...);
#endif
static void fail(LPCSTR message, ...)
{
@@ -66,7 +62,7 @@ int main(int argc, LPTSTR argv[])
LPCTSTR idfpy_script_name = TEXT("idf.py");
/* Get IDF_PATH */
TCHAR idf_path[LINESIZE] = {};
TCHAR idf_path[LINESIZE] = { 0 };
if (GetEnvironmentVariable(TEXT("IDF_PATH"), idf_path, sizeof(idf_path)) == 0) {
DWORD err = GetLastError();
if (err == ERROR_ENVVAR_NOT_FOUND) {
@@ -76,13 +72,13 @@ int main(int argc, LPTSTR argv[])
}
}
/* Prepare the command line: python.exe %IDF_PATH%\\tools\idf.py <rest of the args> */
TCHAR cmdline[LINESIZE] = {};
StringCchCat(cmdline, sizeof(cmdline), TEXT("python.exe "));
/* Prepare the command line: python.exe "%IDF_PATH%\\tools\idf.py" <rest of the args> */
TCHAR cmdline[LINESIZE] = { 0 };
StringCchCat(cmdline, sizeof(cmdline), TEXT("python.exe \""));
StringCchCat(cmdline, sizeof(cmdline), idf_path);
StringCchCat(cmdline, sizeof(cmdline), TEXT("\\tools\\"));
StringCchCat(cmdline, sizeof(cmdline), idfpy_script_name);
StringCchCat(cmdline, sizeof(cmdline), TEXT(" "));
StringCchCat(cmdline, sizeof(cmdline), TEXT("\" "));
for (int i = 1; i < argc; ++i) {
StringCchCat(cmdline, sizeof(cmdline), argv[i]);
StringCchCat(cmdline, sizeof(cmdline), TEXT(" "));