Skip to content

Commit 7292024

Browse files
committed
Merge branch 'release/v5.0.2'
2 parents 65297c2 + d6df6cb commit 7292024

File tree

35 files changed

+394
-197
lines changed

35 files changed

+394
-197
lines changed

.github/workflows/examples.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Run on Linux
2727
if: startsWith(matrix.os, 'ubuntu')
2828
env:
29-
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,intel_mcs51,aceinna_imu"
29+
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,siwigsm,intel_mcs51,aceinna_imu"
3030
run: |
3131
# ChipKIT issue: install 32-bit support for GCC PIC32
3232
sudo apt-get install libc6-i386
@@ -40,7 +40,7 @@ jobs:
4040
- name: Run on macOS
4141
if: startsWith(matrix.os, 'macos')
4242
env:
43-
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,microchippic32,gd32v,nuclei"
43+
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,siwigsm,microchippic32,gd32v,nuclei,lattice_ice40"
4444
run: |
4545
df -h
4646
tox -e testexamples
@@ -50,7 +50,7 @@ jobs:
5050
env:
5151
PLATFORMIO_CORE_DIR: C:/pio
5252
PLATFORMIO_WORKSPACE_DIR: C:/pio-workspace/$PROJECT_HASH
53-
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,riscv_gap"
53+
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,siwigsm,riscv_gap"
5454
run: |
5555
tox -e testexamples
5656

HISTORY.rst

+14
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ PlatformIO Core 5
88

99
**A professional collaborative platform for embedded development**
1010

11+
5.0.2 (2020-10-30)
12+
~~~~~~~~~~~~~~~~~~
13+
14+
- Initialize a new project or update the existing passing working environment name and its options (`issue #3686 <https://github.com/platformio/platformio-core/issues/3686>`_)
15+
- Automatically build PlatformIO Core extra Python dependencies on a host machine if they are missed in the registry (`issue #3700 <https://github.com/platformio/platformio-core/issues/3700>`_)
16+
- Improved "core.call" RPC for PlatformIO Home (`issue #3671 <https://github.com/platformio/platformio-core/issues/3671>`_)
17+
- Fixed a "PermissionError: [WinError 5]" on Windows when an external repository is used with `lib_deps <https://docs.platformio.org/page/projectconf/section_env_library.html#lib-deps>`__ option (`issue #3664 <https://github.com/platformio/platformio-core/issues/3664>`_)
18+
- Fixed a "KeyError: 'versions'" when dependency does not exist in the registry (`issue #3666 <https://github.com/platformio/platformio-core/issues/3666>`_)
19+
- Fixed an issue with GCC linker when "native" dev-platform is used in pair with library dependencies (`issue #3669 <https://github.com/platformio/platformio-core/issues/3669>`_)
20+
- Fixed an "AssertionError: ensure_dir_exists" when checking library updates from simultaneous subprocesses (`issue #3677 <https://github.com/platformio/platformio-core/issues/3677>`_)
21+
- Fixed an issue when `pio package publish <https://docs.platformio.org/page/core/userguide/package/cmd_publish.html>`__ command removes original archive after submitting to the registry (`issue #3716 <https://github.com/platformio/platformio-core/issues/3716>`_)
22+
- Fixed an issue when multiple `pio lib install <https://docs.platformio.org/page/core/userguide/lib/cmd_install.html>`__ command with the same local library results in duplicates in ``lib_deps`` (`issue #3715 <https://github.com/platformio/platformio-core/issues/3715>`_)
23+
- Fixed an issue with a "wrong" timestamp in device monitor output using `"time" filter <https://docs.platformio.org/page/core/userguide/device/cmd_monitor.html#filters>`__ (`issue #3712 <https://github.com/platformio/platformio-core/issues/3712>`_)
24+
1125
5.0.1 (2020-09-10)
1226
~~~~~~~~~~~~~~~~~~
1327

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ profile:
3131
python -m cProfile -o .tox/.tmp/cprofile.prof -m platformio ${PIOARGS}
3232
snakeviz .tox/.tmp/cprofile.prof
3333

34+
pack:
35+
python setup.py sdist
36+
3437
publish:
3538
python setup.py sdist upload

README.rst

+13-17
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@ PlatformIO
1616
.. image:: https://img.shields.io/badge/license-Apache%202.0-blue.svg
1717
:target: https://pypi.python.org/pypi/platformio/
1818
:alt: License
19-
.. image:: https://img.shields.io/badge/PlatformIO-Community-orange.svg
20-
:alt: Community Forums
21-
:target: https://community.platformio.org?utm_source=github&utm_medium=core
19+
.. image:: https://img.shields.io/badge/PlatformIO-Labs-orange.svg
20+
:alt: Community Labs
21+
:target: https://piolabs.com/?utm_source=github&utm_medium=core
2222

2323
**Quick Links:** `Web <https://platformio.org?utm_source=github&utm_medium=core>`_ |
2424
`PlatformIO IDE <https://platformio.org/platformio-ide?utm_source=github&utm_medium=core>`_ |
2525
`Project Examples <https://github.com/platformio/platformio-examples/>`__ |
2626
`Docs <https://docs.platformio.org?utm_source=github&utm_medium=core>`_ |
2727
`Donate <https://platformio.org/donate?utm_source=github&utm_medium=core>`_ |
28-
`Contact Us <https://platformio.org/contact?utm_source=github&utm_medium=core>`_
28+
`Contact Us <https://piolabs.com/?utm_source=github&utm_medium=core>`_
2929

30-
**Social:** `Twitter <https://twitter.com/PlatformIO_Org>`_ |
31-
`LinkedIn <https://www.linkedin.com/company/platformio/>`_ |
30+
**Social:** `LinkedIn <https://www.linkedin.com/company/platformio/>`_ |
31+
`Twitter <https://twitter.com/PlatformIO_Org>`_ |
3232
`Facebook <https://www.facebook.com/platformio>`_ |
33-
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
34-
`Bintray <https://bintray.com/platformio>`_ |
35-
`Community <https://community.platformio.org?utm_source=github&utm_medium=core>`_
33+
`Community Forums <https://community.platformio.org?utm_source=github&utm_medium=core>`_
3634

3735
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-ide-laptop.png
3836
:target: https://platformio.org?utm_source=github&utm_medium=core
@@ -51,20 +49,18 @@ Get Started
5149
-----------
5250

5351
* `What is PlatformIO? <https://docs.platformio.org/page/what-is-platformio.html?utm_source=github&utm_medium=core>`_
54-
55-
Instruments
56-
-----------
57-
5852
* `PlatformIO IDE <https://platformio.org/platformio-ide?utm_source=github&utm_medium=core>`_
5953
* `PlatformIO Core (CLI) <https://docs.platformio.org/page/core.html?utm_source=github&utm_medium=core>`_
60-
* `Library Management <https://docs.platformio.org/page/librarymanager/index.html?utm_source=github&utm_medium=core>`_
6154
* `Project Examples <https://github.com/platformio/platformio-examples?utm_source=github&utm_medium=core>`__
55+
56+
Solutions
57+
---------
58+
59+
* `Library Management <https://docs.platformio.org/page/librarymanager/index.html?utm_source=github&utm_medium=core>`_
6260
* `Desktop IDEs Integration <https://docs.platformio.org/page/ide.html?utm_source=github&utm_medium=core>`_
6361
* `Continuous Integration <https://docs.platformio.org/page/ci/index.html?utm_source=github&utm_medium=core>`_
64-
* `Advanced Scripting API <https://docs.platformio.org/page/projectconf/advanced_scripting.html?utm_source=github&utm_medium=core>`_
6562

66-
Professional
67-
------------
63+
**Advanced**
6864

6965
* `Debugging <https://docs.platformio.org/page/plus/debugging.html?utm_source=github&utm_medium=core>`_
7066
* `Unit Testing <https://docs.platformio.org/page/plus/unit-testing.html?utm_source=github&utm_medium=core>`_

docs

Submodule docs updated 250 files

platformio/__init__.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import sys
1616

17-
VERSION = (5, 0, 1)
17+
VERSION = (5, 0, 2)
1818
__version__ = ".".join([str(s) for s in VERSION])
1919

2020
__title__ = "platformio"
@@ -47,7 +47,7 @@
4747
__default_requests_timeout__ = (10, None) # (connect, read)
4848

4949
__core_packages__ = {
50-
"contrib-piohome": "~3.3.0",
50+
"contrib-piohome": "~3.3.1",
5151
"contrib-pysite": "~2.%d%d.0" % (sys.version_info.major, sys.version_info.minor),
5252
"tool-unity": "~1.20500.0",
5353
"tool-scons": "~2.20501.7" if sys.version_info.major == 2 else "~4.40001.0",
@@ -57,8 +57,7 @@
5757
}
5858

5959
__check_internet_hosts__ = [
60-
"140.82.118.3", # Github.com
61-
"35.231.145.151", # Gitlab.com
60+
"185.199.110.153", # Github.com
6261
"88.198.170.159", # platformio.org
6362
"github.com",
6463
"platformio.org",

platformio/builder/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
PROGNAME="program",
7979
PROG_PATH=join("$BUILD_DIR", "$PROGNAME$PROGSUFFIX"),
8080
PYTHONEXE=get_pythonexe_path(),
81+
IDE_EXTRA_DATA={},
8182
)
8283

8384
if not int(ARGUMENTS.get("PIOVERBOSE", 0)):

platformio/builder/tools/pioide.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def _dump_defines(env):
9393
defines = []
9494
# global symbols
9595
for item in processDefines(env.get("CPPDEFINES", [])):
96-
defines.append(env.subst(item).replace("\\", ""))
96+
item = item.strip()
97+
if item:
98+
defines.append(env.subst(item).replace("\\", ""))
9799

98100
# special symbol for Atmel AVR MCU
99101
if env["PIOPLATFORM"] == "atmelavr":
@@ -164,14 +166,17 @@ def DumpIDEData(env, globalenv):
164166
"cxx_path": where_is_program(env.subst("$CXX"), env.subst("${ENV['PATH']}")),
165167
"gdb_path": where_is_program(env.subst("$GDB"), env.subst("${ENV['PATH']}")),
166168
"prog_path": env.subst("$PROG_PATH"),
167-
"flash_extra_images": [
168-
{"offset": item[0], "path": env.subst(item[1])}
169-
for item in env.get("FLASH_EXTRA_IMAGES", [])
170-
],
171169
"svd_path": _get_svd_path(env),
172170
"compiler_type": env.GetCompilerType(),
173171
"targets": globalenv.DumpTargets(),
172+
"extra": dict(
173+
flash_images=[
174+
{"offset": item[0], "path": env.subst(item[1])}
175+
for item in env.get("FLASH_EXTRA_IMAGES", [])
176+
]
177+
),
174178
}
179+
data["extra"].update(env.get("IDE_EXTRA_DATA", {}))
175180

176181
env_ = env.Clone()
177182
# https://github.com/platformio/platformio-atom-ide/issues/34

platformio/builder/tools/platformio.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from SCons.Script import SConscript # pylint: disable=import-error
2828

2929
from platformio import __version__, fs
30-
from platformio.compat import string_types
30+
from platformio.compat import MACOS, string_types
3131
from platformio.package.version import pepver_to_semver
3232

3333
SRC_HEADER_EXT = ["h", "hpp"]
@@ -69,7 +69,7 @@ def BuildProgram(env):
6969
if (
7070
env.get("LIBS")
7171
and env.GetCompilerType() == "gcc"
72-
and env.PioPlatform().is_embedded()
72+
and (env.PioPlatform().is_embedded() or not MACOS)
7373
):
7474
env.Prepend(_LIBFLAGS="-Wl,--start-group ")
7575
env.Append(_LIBFLAGS=" -Wl,--end-group")

platformio/clients/http.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ def send_request(self, method, path, **kwargs):
133133
def fetch_json_data(self, method, path, **kwargs):
134134
cache_valid = kwargs.pop("cache_valid") if "cache_valid" in kwargs else None
135135
if not cache_valid:
136-
return self.raise_error_from_response(
137-
self.send_request(method, path, **kwargs)
138-
)
136+
return self._parse_json_response(self.send_request(method, path, **kwargs))
139137
cache_key = ContentCache.key_from_args(
140138
method, path, kwargs.get("params"), kwargs.get("data")
141139
)
@@ -144,11 +142,12 @@ def fetch_json_data(self, method, path, **kwargs):
144142
if result is not None:
145143
return json.loads(result)
146144
response = self.send_request(method, path, **kwargs)
145+
data = self._parse_json_response(response)
147146
cc.set(cache_key, response.text, cache_valid)
148-
return self.raise_error_from_response(response)
147+
return data
149148

150149
@staticmethod
151-
def raise_error_from_response(response, expected_codes=(200, 201, 202)):
150+
def _parse_json_response(response, expected_codes=(200, 201, 202)):
152151
if response.status_code in expected_codes:
153152
try:
154153
return response.json()

platformio/clients/registry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,6 @@ def get_package(self, type_, owner, name, version=None):
142142
cache_valid="1h",
143143
)
144144
except HTTPClientError as e:
145-
if e.response.status_code == 404:
145+
if e.response is not None and e.response.status_code == 404:
146146
return None
147147
raise e

platformio/commands/debug/command.py

+33-17
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
from platformio import app, exception, fs, proc
2525
from platformio.commands.debug import helpers
2626
from platformio.commands.debug.exception import DebugInvalidOptionsError
27+
from platformio.commands.platform import platform_install as cmd_platform_install
2728
from platformio.package.manager.core import inject_contrib_pysite
29+
from platformio.platform.exception import UnknownPlatform
30+
from platformio.platform.factory import PlatformFactory
2831
from platformio.project.config import ProjectConfig
2932
from platformio.project.exception import ProjectEnvsNotAvailableError
3033
from platformio.project.helpers import is_platformio_project, load_project_ide_data
@@ -73,18 +76,29 @@ def cli(ctx, project_dir, project_conf, environment, verbose, interface, __unpro
7376
env_options = config.items(env=env_name, as_dict=True)
7477
if not set(env_options.keys()) >= set(["platform", "board"]):
7578
raise ProjectEnvsNotAvailableError()
76-
debug_options = helpers.validate_debug_options(ctx, env_options)
79+
80+
try:
81+
platform = PlatformFactory.new(env_options["platform"])
82+
except UnknownPlatform:
83+
ctx.invoke(
84+
cmd_platform_install,
85+
platforms=[env_options["platform"]],
86+
skip_default_package=True,
87+
)
88+
platform = PlatformFactory.new(env_options["platform"])
89+
90+
debug_options = helpers.configure_initial_debug_options(platform, env_options)
7791
assert debug_options
7892

7993
if not interface:
8094
return helpers.predebug_project(ctx, project_dir, env_name, False, verbose)
8195

82-
configuration = load_project_ide_data(project_dir, env_name)
83-
if not configuration:
84-
raise DebugInvalidOptionsError("Could not load debug configuration")
96+
ide_data = load_project_ide_data(project_dir, env_name)
97+
if not ide_data:
98+
raise DebugInvalidOptionsError("Could not load a build configuration")
8599

86100
if "--version" in __unprocessed:
87-
result = proc.exec_command([configuration["gdb_path"], "--version"])
101+
result = proc.exec_command([ide_data["gdb_path"], "--version"])
88102
if result["returncode"] == 0:
89103
return click.echo(result["out"])
90104
raise exception.PlatformioException("\n".join([result["out"], result["err"]]))
@@ -99,23 +113,25 @@ def cli(ctx, project_dir, project_conf, environment, verbose, interface, __unpro
99113
nl=False,
100114
)
101115

102-
debug_options["load_cmds"] = helpers.configure_esp32_load_cmds(
103-
debug_options, configuration
104-
)
116+
try:
117+
debug_options = platform.configure_debug_options(debug_options, ide_data)
118+
except NotImplementedError:
119+
# legacy for ESP32 dev-platform <=2.0.0
120+
debug_options["load_cmds"] = helpers.configure_esp32_load_cmds(
121+
debug_options, ide_data
122+
)
105123

106124
rebuild_prog = False
107125
preload = debug_options["load_cmds"] == ["preload"]
108126
load_mode = debug_options["load_mode"]
109127
if load_mode == "always":
110-
rebuild_prog = preload or not helpers.has_debug_symbols(
111-
configuration["prog_path"]
112-
)
128+
rebuild_prog = preload or not helpers.has_debug_symbols(ide_data["prog_path"])
113129
elif load_mode == "modified":
114130
rebuild_prog = helpers.is_prog_obsolete(
115-
configuration["prog_path"]
116-
) or not helpers.has_debug_symbols(configuration["prog_path"])
131+
ide_data["prog_path"]
132+
) or not helpers.has_debug_symbols(ide_data["prog_path"])
117133
else:
118-
rebuild_prog = not isfile(configuration["prog_path"])
134+
rebuild_prog = not isfile(ide_data["prog_path"])
119135

120136
if preload or (not rebuild_prog and load_mode != "always"):
121137
# don't load firmware through debug server
@@ -139,9 +155,9 @@ def cli(ctx, project_dir, project_conf, environment, verbose, interface, __unpro
139155

140156
# save SHA sum of newly created prog
141157
if load_mode == "modified":
142-
helpers.is_prog_obsolete(configuration["prog_path"])
158+
helpers.is_prog_obsolete(ide_data["prog_path"])
143159

144-
if not isfile(configuration["prog_path"]):
160+
if not isfile(ide_data["prog_path"]):
145161
raise DebugInvalidOptionsError("Program/firmware is missed")
146162

147163
# run debugging client
@@ -151,7 +167,7 @@ def cli(ctx, project_dir, project_conf, environment, verbose, interface, __unpro
151167
from platformio.commands.debug.process.client import GDBClient, reactor
152168

153169
client = GDBClient(project_dir, __unprocessed, debug_options, env_options)
154-
client.spawn(configuration["gdb_path"], configuration["prog_path"])
170+
client.spawn(ide_data["gdb_path"], ide_data["prog_path"])
155171

156172
signal.signal(signal.SIGINT, lambda *args, **kwargs: None)
157173
reactor.run()

0 commit comments

Comments
 (0)