platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

c_cpp_properties.json don’t update if core_dir have the drive letter in lower case

Open Psyjonas opened this issue 3 years ago • 3 comments

What kind of issue is this?

  • [ ] PlatformIO Core. If you’ve found a bug, please provide an information below.

Configuration

Operating system: Windows 10 Pro + VS Code version 1.63.2

PlatformIO Version (platformio --version): PlatformIO Core, version 5.2.4

Description of problem

I have a test project located in "D:\Test\Proj" and want to configure de core_dir to the folder "D:\Test\Core" If I don’t configure the core_dir or configure with “D:\Test\Core”, the c_cpp_properties.json is updated If I configure with “d:\Test\Core” or “…\Core”, the c_cpp_properties.json don’t update

If problems with PlatformIO Build System:

The content of platformio.ini:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
; core_dir = D:\Test\Core
; core_dir = d:\Test\Core
; core_dir = ..\Core

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = espidf

Additional info

If I capitalize the driver letter before this code in “platformio\builder\main.py”, it solves the problem.

env.Replace(
    PROJECT_DIR=get_project_dir(),
    PROJECT_CORE_DIR=config.get("platformio", "core_dir"),
    PROJECT_PACKAGES_DIR=config.get("platformio", "packages_dir"),
    PROJECT_WORKSPACE_DIR=config.get("platformio", "workspace_dir"),
    PROJECT_LIBDEPS_DIR=config.get("platformio", "libdeps_dir"),
    PROJECT_INCLUDE_DIR=config.get("platformio", "include_dir"),
    PROJECT_SRC_DIR=config.get("platformio", "src_dir"),
    PROJECTSRC_DIR="$PROJECT_SRC_DIR",  # legacy for dev/platform
    PROJECT_TEST_DIR=config.get("platformio", "test_dir"),
    PROJECT_DATA_DIR=config.get("platformio", "data_dir"),
    PROJECTDATA_DIR="$PROJECT_DATA_DIR",  # legacy for dev/platform
    PROJECT_BUILD_DIR=config.get("platformio", "build_dir"),
    BUILD_CACHE_DIR=config.get("platformio", "build_cache_dir"),
    LIBSOURCE_DIRS=[
        config.get("platformio", "lib_dir"),
        os.path.join("$PROJECT_LIBDEPS_DIR", "$PIOENV"),
        config.get("platformio", "globallib_dir"),
    ],
)

Psyjonas avatar Feb 04 '22 02:02 Psyjonas

If I configure with “d:\Test\Core”

Could you build a project?

ivankravets avatar Feb 08 '22 15:02 ivankravets

No, I get this error:

*** Multiple ways to build the same target were specified for: D:\Test\Proj.pio\build\esp32dev\esp_efuse_api.o (from ['D:\Test\Core\packages\framework-espidf\components\efuse\src\esp32\esp_efuse_api.c'] and from ['D:\Test\Core\packages\framework-espidf\components\efuse\src\esp_efuse_api.c']) File "D:\Test\Core\platforms\espressif32\builder\frameworks\espidf.py", line 622, in compile_source_files

For some reason is compiling every file to the root folder (D:\Test\Proj\.pio\build\esp32dev)

Psyjonas avatar Feb 09 '22 11:02 Psyjonas

With the "core_dir = ..\Core" it builds

Psyjonas avatar Feb 09 '22 11:02 Psyjonas

Should be fixed in the latest development version. Please re-test with pio upgrade --dev.

ivankravets avatar Apr 25 '23 07:04 ivankravets