From 5511541d20d85e3853a3c012abef2843e0359a08 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Tue, 11 Dec 2018 16:00:28 +0800 Subject: [PATCH 1/4] ci: fix build test with IDF_PATH unset on Windows --- tools/ci/test_build_system_cmake.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index b308b9afe6..acb8f269c6 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -230,9 +230,9 @@ function run_tests() print_status "Can build with IDF_PATH unset and inferred by build system" clean_build_dir - sed -i.bak "s%\$ENV{IDF_PATH}%${IDF_PATH}%" CMakeLists.txt # expand to a hardcoded path - (unset IDF_PATH && cd build && - cmake -G Ninja .. && ninja) || failure "Ninja build failed" + sed -i.bak "s%\$ENV{IDF_PATH}%\${ci_idf_path}%" CMakeLists.txt # expand to a hardcoded path + (ci_idf_path=${IDF_PATH} && unset IDF_PATH && cd build && + cmake -G Ninja -D ci_idf_path=${ci_idf_path} .. && ninja) || failure "Ninja build failed" mv CMakeLists.txt.bak CMakeLists.txt assert_built ${APP_BINS} ${BOOTLOADER_BINS} ${PARTITION_BIN} From 5d6e21795bef14e4b1a64a2970b953efa314c9d8 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Tue, 11 Dec 2018 20:07:18 +0800 Subject: [PATCH 2/4] tools: fix makefile converter windows path issue --- tools/cmake/convert_to_cmake.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/cmake/convert_to_cmake.py b/tools/cmake/convert_to_cmake.py index d792dd11b5..5eea50f81c 100755 --- a/tools/cmake/convert_to_cmake.py +++ b/tools/cmake/convert_to_cmake.py @@ -118,6 +118,10 @@ def convert_project(project_path): # Convert components as needed for p in component_paths: + if "MSYSTEM" in os.environ: + cmd = ["cygpath", "-w", p] + p = subprocess.check_output(cmd).strip() + convert_component(project_path, p) project_name = project_vars["PROJECT_NAME"] From 72cd1ac43f7912bd37114e665423d57e024ee2c0 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Thu, 13 Dec 2018 18:24:06 +0800 Subject: [PATCH 3/4] mbedtls: fix issue with non idf.py build on windows --- components/mbedtls/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index e138c2df8f..2f052e1805 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -18,7 +18,12 @@ endfunction() # Needed to for include_next includes to work from within mbedtls include_directories("${COMPONENT_PATH}/port/include") -if(MSYS) +# Needed in order to workaround issue with improper conversion to native path +# when building on MSYS2. This ensures that when building on MSYS, Unix style +# paths are used. +set(msystem $ENV{MSYSTEM}) + +if(MSYS OR msystem) set(CMAKE_HOST_UNIX 1) endif() From d3938c8a6659ff179968d26404512b771a01b8a3 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Thu, 13 Dec 2018 18:19:59 +0800 Subject: [PATCH 4/4] ldgen: fix issue when not built in msys2 Closes https://github.com/espressif/esp-idf/issues/2812 --- make/ldgen.mk | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/make/ldgen.mk b/make/ldgen.mk index 2cbb6f43f8..12d7d2d97c 100644 --- a/make/ldgen.mk +++ b/make/ldgen.mk @@ -7,17 +7,26 @@ LDGEN_FRAGMENT_FILES = $(COMPONENT_LDFRAGMENTS) # the components define ldgen_process_template $(BUILD_DIR_BASE)/ldgen.section_infos: $(LDGEN_SECTIONS_INFO_FILES) $(IDF_PATH)/make/ldgen.mk - printf "$(foreach section_info,$(LDGEN_SECTIONS_INFO_FILES),$(section_info)\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos - sed -E -i.bak 's|^[[:blank:]]*||g' $(BUILD_DIR_BASE)/ldgen.section_infos - rm $(BUILD_DIR_BASE)/ldgen.section_infos.bak ifeq ($(OS), Windows_NT) - mv $(BUILD_DIR_BASE)/ldgen.section_infos $(BUILD_DIR_BASE)/ldgen.section_infos.temp - cygpath -w -f $(BUILD_DIR_BASE)/ldgen.section_infos.temp > $(BUILD_DIR_BASE)/ldgen.section_infos - rm -f $(BUILD_DIR_BASE)/ldgen.section_infos.temp + printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(subst \,/,$(shell cygpath -w $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos +else + printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(info)\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos endif $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos @echo 'Generating $(notdir $(2))' +ifeq ($(OS), Windows_NT) + $(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \ + --input $(1) \ + --config $(SDKCONFIG) \ + --fragments $(LDGEN_FRAGMENT_FILES) \ + --output $(2) \ + --sections $(BUILD_DIR_BASE)/ldgen.section_infos \ + --kconfig $(IDF_PATH)/Kconfig \ + --env "COMPONENT_KCONFIGS=$(foreach k, $(COMPONENT_KCONFIGS), $(shell cygpath -w $(k)))" \ + --env "COMPONENT_KCONFIGS_PROJBUILD=$(foreach k, $(COMPONENT_KCONFIGS_PROJBUILD), $(shell cygpath -w $(k)))" \ + --env "IDF_CMAKE=n" +else $(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \ --input $(1) \ --config $(SDKCONFIG) \ @@ -28,6 +37,7 @@ $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_ --env "COMPONENT_KCONFIGS=$(COMPONENT_KCONFIGS)" \ --env "COMPONENT_KCONFIGS_PROJBUILD=$(COMPONENT_KCONFIGS_PROJBUILD)" \ --env "IDF_CMAKE=n" +endif endef define ldgen_create_commands