Skip to content

Commit 7efce92

Browse files
authored
Merge pull request #8 from pioarduino/merge
changes from upstream
2 parents 974b0f6 + 77a7d2a commit 7efce92

File tree

19 files changed

+127
-109
lines changed

19 files changed

+127
-109
lines changed

.github/workflows/core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macos-latest]
11-
python-version: ["3.11", "3.12", "3.13.0-rc.2"]
11+
python-version: ["3.11", "3.12", "3.13"]
1212

1313
runs-on: ${{ matrix.os }}
1414

HISTORY.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ Unlock the true potential of embedded software development with
1818
PlatformIO's collaborative ecosystem, embracing declarative principles,
1919
test-driven methodologies, and modern toolchains for unrivaled success.
2020

21+
6.1.17 (2024-??-??)
22+
~~~~~~~~~~~~~~~~~~~
23+
24+
* Added support for ``tar.xz`` tarball dependencies (`pull #4974 <https://github.com/platformio/platformio-core/pull/4974>`_)
25+
* Ensured that dependencies of private libraries are no longer unnecessarily re-installed, optimizing dependency management and reducing redundant operations (`issue #4987 <https://github.com/platformio/platformio-core/issues/4987>`_)
26+
* Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 <https://github.com/platformio/platformio-core/issues/4998>`_)
27+
* Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags <https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html>`__ option (`issue #5004 <https://github.com/platformio/platformio-core/issues/5004>`_)
28+
* Resolved an issue where the ``--project-dir`` flag did not function correctly with the `pio check <https://docs.platformio.org/en/latest/core/userguide/cmd_check.html>`__ and `pio debug <https://docs.platformio.org/en/latest/core/userguide/cmd_debug.html>`__ commands (`issue #5029 <https://github.com/platformio/platformio-core/issues/5029>`_)
29+
* Resolved an issue where the |LDF| occasionally excluded bundled platform libraries from the dependency graph (`pull #4941 <https://github.com/platformio/platformio-core/pull/4941>`_)
30+
2131
6.1.16 (2024-09-26)
2232
~~~~~~~~~~~~~~~~~~~
2333

examples

platformio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
VERSION = (6, 1, "16")
15+
VERSION = (6, 1, "17b2")
1616
__version__ = ".".join([str(s) for s in VERSION])
1717

1818
__title__ = "platformio"

platformio/builder/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@
147147
if not int(ARGUMENTS.get("PIOVERBOSE", 0)):
148148
click.echo("Verbose mode can be enabled via `-v, --verbose` option")
149149

150+
if not os.path.isdir(env.subst("$BUILD_DIR")):
151+
os.makedirs(env.subst("$BUILD_DIR"))
152+
150153
# Dynamically load dependent tools
151154
if "compiledb" in COMMAND_LINE_TARGETS:
152155
env.Tool("compilation_db")
153156

154-
if not os.path.isdir(env.subst("$BUILD_DIR")):
155-
os.makedirs(env.subst("$BUILD_DIR"))
156-
157157
env.LoadProjectOptions()
158158
env.LoadPioPlatform()
159159

platformio/builder/tools/piobuild.py

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def GetBuildType(env):
5858

5959

6060
def BuildProgram(env):
61+
env.ProcessCompileDbToolchainOption()
6162
env.ProcessProgramDeps()
6263
env.ProcessProjectDeps()
6364

@@ -90,6 +91,26 @@ def BuildProgram(env):
9091
return program
9192

9293

94+
def ProcessCompileDbToolchainOption(env):
95+
if "compiledb" not in COMMAND_LINE_TARGETS:
96+
return
97+
# Resolve absolute path of toolchain
98+
for cmd in ("CC", "CXX", "AS"):
99+
if cmd not in env:
100+
continue
101+
if os.path.isabs(env[cmd]) or '"' in env[cmd]:
102+
continue
103+
env[cmd] = where_is_program(env.subst("$%s" % cmd), env.subst("${ENV['PATH']}"))
104+
if " " in env[cmd]: # issue #4998: Space in compilator path
105+
env[cmd] = f'"{env[cmd]}"'
106+
107+
if env.get("COMPILATIONDB_INCLUDE_TOOLCHAIN"):
108+
print("Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping")
109+
for scope, includes in env.DumpIntegrationIncludes().items():
110+
if scope in ("toolchain",):
111+
env.Append(CPPPATH=includes)
112+
113+
93114
def ProcessProgramDeps(env):
94115
def _append_pio_macros():
95116
core_version = pepver_to_semver(__version__)
@@ -126,27 +147,6 @@ def _append_pio_macros():
126147
# remove specified flags
127148
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
128149

129-
env.ProcessCompileDbToolchainOption()
130-
131-
132-
def ProcessCompileDbToolchainOption(env):
133-
if "compiledb" in COMMAND_LINE_TARGETS:
134-
# Resolve absolute path of toolchain
135-
for cmd in ("CC", "CXX", "AS"):
136-
if cmd not in env:
137-
continue
138-
if os.path.isabs(env[cmd]):
139-
continue
140-
env[cmd] = where_is_program(
141-
env.subst("$%s" % cmd), env.subst("${ENV['PATH']}")
142-
)
143-
144-
if env.get("COMPILATIONDB_INCLUDE_TOOLCHAIN"):
145-
print("Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping")
146-
for scope, includes in env.DumpIntegrationIncludes().items():
147-
if scope in ("toolchain",):
148-
env.Append(CPPPATH=includes)
149-
150150

151151
def ProcessProjectDeps(env):
152152
plb = env.ConfigureProjectLibBuilder()
@@ -219,6 +219,11 @@ def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches
219219
if os.path.isdir(p):
220220
result[k][i] = os.path.abspath(p)
221221

222+
# fix relative LIBs
223+
for i, l in enumerate(result.get("LIBS", [])):
224+
if isinstance(l, FS.File):
225+
result["LIBS"][i] = os.path.abspath(l.get_path())
226+
222227
# fix relative path for "-include"
223228
for i, f in enumerate(result.get("CCFLAGS", [])):
224229
if isinstance(f, tuple) and f[0] == "-include":

platformio/builder/tools/piolib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,8 @@ def _correct_found_libs(lib_builders):
11591159
for lb in lib_builders:
11601160
if lb in found_lbs:
11611161
lb.search_deps_recursive(lb.get_search_files())
1162+
# refill found libs after recursive search
1163+
found_lbs = [lb for lb in lib_builders if lb.is_dependent]
11621164
for lb in lib_builders:
11631165
for deplb in lb.depbuilders[:]:
11641166
if deplb not in found_lbs:

platformio/check/cli.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import os
2020
import shutil
2121
from collections import Counter
22-
from os.path import dirname, isfile
2322
from time import time
2423

2524
import click
@@ -77,7 +76,7 @@ def cli( # pylint: disable=too-many-positional-arguments
7776
app.set_session_var("custom_project_conf", project_conf)
7877

7978
# find project directory on upper level
80-
if isfile(project_dir):
79+
if os.path.isfile(project_dir):
8180
project_dir = find_project_dir_above(project_dir)
8281

8382
results = []
@@ -150,7 +149,7 @@ def cli( # pylint: disable=too-many-positional-arguments
150149
print_processing_header(tool, envname, env_dump)
151150

152151
ct = CheckToolFactory.new(
153-
tool, project_dir, config, envname, tool_options
152+
tool, os.getcwd(), config, envname, tool_options
154153
)
155154

156155
result = {"env": envname, "tool": tool, "duration": time()}
@@ -250,12 +249,12 @@ def _append_defect(component, defect):
250249
components[component].update({DefectItem.SEVERITY_LABELS[defect.severity]: 1})
251250

252251
for defect in result.get("defects", []):
253-
component = dirname(defect.file) or defect.file
252+
component = os.path.dirname(defect.file) or defect.file
254253
_append_defect(component, defect)
255254

256255
if component.lower().startswith(get_project_dir().lower()):
257256
while os.sep in component:
258-
component = dirname(component)
257+
component = os.path.dirname(component)
259258
_append_defect(component, defect)
260259

261260
return components

platformio/debug/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def cli( # pylint: disable=too-many-positional-arguments
8686

8787
if not interface:
8888
return helpers.predebug_project(
89-
ctx, project_dir, project_config, env_name, False, verbose
89+
ctx, os.getcwd(), project_config, env_name, False, verbose
9090
)
9191

9292
configure_args = (
@@ -106,7 +106,7 @@ def cli( # pylint: disable=too-many-positional-arguments
106106
else:
107107
debug_config = _configure(*configure_args)
108108

109-
_run(project_dir, debug_config, client_extra_args)
109+
_run(os.getcwd(), debug_config, client_extra_args)
110110

111111
return None
112112

0 commit comments

Comments
 (0)