mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 02:27:13 +02:00
Resolved a critical issue related to the usage of the `-include
` flag // Resolve #4682
This commit is contained in:
@ -25,6 +25,7 @@ PlatformIO Core 6
|
|||||||
* Refactored |UNITTESTING| engine to resolve compiler warnings with "-Wpedantic" option (`pull #4671 <https://github.com/platformio/platformio-core/pull/4671>`_)
|
* Refactored |UNITTESTING| engine to resolve compiler warnings with "-Wpedantic" option (`pull #4671 <https://github.com/platformio/platformio-core/pull/4671>`_)
|
||||||
* Eliminated erroneous warning regarding the use of obsolete PlatformIO Core when downgrading to the stable version (`issue #4664 <https://github.com/platformio/platformio-core/issues/4664>`_)
|
* Eliminated erroneous warning regarding the use of obsolete PlatformIO Core when downgrading to the stable version (`issue #4664 <https://github.com/platformio/platformio-core/issues/4664>`_)
|
||||||
* Updated the `pio project metadata <https://docs.platformio.org/en/latest/core/userguide/project/cmd_metadata.html>`__ command to return C/C++ flags as parsed Unix shell arguments when dumping project build metadata
|
* Updated the `pio project metadata <https://docs.platformio.org/en/latest/core/userguide/project/cmd_metadata.html>`__ command to return C/C++ flags as parsed Unix shell arguments when dumping project build metadata
|
||||||
|
* Resolved a critical issue related to the usage of the ``-include`` flag within the `build_flags <https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html>`__ option, specifically when employing dynamic variables (`issue #4682 <https://github.com/platformio/platformio-core/issues/4682>`_)
|
||||||
* Removed PlatformIO IDE for Atom from the documentation as `Atom has been deprecated <https://github.blog/2022-06-08-sunsetting-atom/>`__
|
* Removed PlatformIO IDE for Atom from the documentation as `Atom has been deprecated <https://github.blog/2022-06-08-sunsetting-atom/>`__
|
||||||
|
|
||||||
6.1.7 (2023-05-08)
|
6.1.7 (2023-05-08)
|
||||||
|
2
docs
2
docs
Submodule docs updated: 50bbe8ac61...daa389f68b
@ -200,13 +200,16 @@ def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches
|
|||||||
# fix relative CPPPATH & LIBPATH
|
# fix relative CPPPATH & LIBPATH
|
||||||
for k in ("CPPPATH", "LIBPATH"):
|
for k in ("CPPPATH", "LIBPATH"):
|
||||||
for i, p in enumerate(result.get(k, [])):
|
for i, p in enumerate(result.get(k, [])):
|
||||||
|
p = env.subst(p)
|
||||||
if os.path.isdir(p):
|
if os.path.isdir(p):
|
||||||
result[k][i] = os.path.abspath(p)
|
result[k][i] = os.path.abspath(p)
|
||||||
|
|
||||||
# fix relative path for "-include"
|
# fix relative path for "-include"
|
||||||
for i, f in enumerate(result.get("CCFLAGS", [])):
|
for i, f in enumerate(result.get("CCFLAGS", [])):
|
||||||
if isinstance(f, tuple) and f[0] == "-include":
|
if isinstance(f, tuple) and f[0] == "-include":
|
||||||
result["CCFLAGS"][i] = (f[0], env.File(os.path.abspath(f[1].get_path())))
|
p = env.subst(f[1].get_path())
|
||||||
|
if os.path.exists(p):
|
||||||
|
result["CCFLAGS"][i] = (f[0], os.path.abspath(p))
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@ def test_generic_build(clirunner, validate_cliresult, tmpdir):
|
|||||||
("-DTEST_SINGLE_MACRO", "-DTEST_SINGLE_MACRO"),
|
("-DTEST_SINGLE_MACRO", "-DTEST_SINGLE_MACRO"),
|
||||||
('-DTEST_STR_SPACE="Andrew Smith"', '"-DTEST_STR_SPACE=Andrew Smith"'),
|
('-DTEST_STR_SPACE="Andrew Smith"', '"-DTEST_STR_SPACE=Andrew Smith"'),
|
||||||
("-Iextra_inc", "-Iextra_inc"),
|
("-Iextra_inc", "-Iextra_inc"),
|
||||||
|
(
|
||||||
|
"-include $PROJECT_DIR/lib/component/component-forced-include.h",
|
||||||
|
"component-forced-include.h",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
tmpdir.join("platformio.ini").write(
|
tmpdir.join("platformio.ini").write(
|
||||||
@ -95,6 +99,10 @@ projenv.Append(CPPDEFINES="POST_SCRIPT_MACRO")
|
|||||||
#error "POST_SCRIPT_MACRO"
|
#error "POST_SCRIPT_MACRO"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef I_AM_FORCED_COMPONENT_INCLUDE
|
||||||
|
#error "I_AM_FORCED_COMPONENT_INCLUDE"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef COMMENTED_MACRO
|
#ifdef COMMENTED_MACRO
|
||||||
#error "COMMENTED_MACRO"
|
#error "COMMENTED_MACRO"
|
||||||
#endif
|
#endif
|
||||||
@ -124,6 +132,11 @@ void dummy(void);
|
|||||||
void dummy(void ) {};
|
void dummy(void ) {};
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
component_dir.join("component-forced-include.h").write(
|
||||||
|
"""
|
||||||
|
#define I_AM_FORCED_COMPONENT_INCLUDE
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
result = clirunner.invoke(cmd_run, ["--project-dir", str(tmpdir), "--verbose"])
|
result = clirunner.invoke(cmd_run, ["--project-dir", str(tmpdir), "--verbose"])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
|
Reference in New Issue
Block a user