Skip to content

Commit

Permalink
Merge branch 'release/v4.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Feb 17, 2020
2 parents f7d4bf5 + 82f36a1 commit 80acd52
Show file tree
Hide file tree
Showing 15 changed files with 217 additions and 68 deletions.
33 changes: 22 additions & 11 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
Release Notes
=============

.. _release_notes_4_0:
.. _release_notes_4:

PlatformIO Core 4
-----------------

4.2.1 (2020-02-17)
~~~~~~~~~~~~~~~~~~

* Improved VSCode template with special ``forceInclude`` field for direct includes via ``-include`` flag (`issue #3379 <https://github.com/platformio/platformio-core/issues/3379>`_)
* Improved support of PIO Home on card-sized PC (Raspberry Pi, etc.) (`issue #3313 <https://github.com/platformio/platformio-core/issues/3313>`_)
* Froze "marshmallow" dependency to 2.X for Python 2 (`issue #3380 <https://github.com/platformio/platformio-core/issues/3380>`_)
* Fixed "TypeError: unsupported operand type(s)" when system environment variable is used by project configuration parser (`issue #3377 <https://github.com/platformio/platformio-core/issues/3377>`_)
* Fixed an issue when Library Dependency Finder (LDF) ignores custom "libLDFMode" and "libCompatMode" options in `library.json <http://docs.platformio.org/page/librarymanager/config.html>`__
* Fixed an issue when generating of compilation database "compile_commands.json" does not work with Python 2.7 (`issue #3378 <https://github.com/platformio/platformio-core/issues/3378>`_)

PlatformIO Core 4.0
-------------------

4.2.0 (2020-02-12)
~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -182,8 +193,8 @@ PlatformIO Core 4.0
- Fixed "systemd-udevd" warnings in `99-platformio-udev.rules <http://docs.platformio.org/page/faq.html#platformio-udev-rules>`__ (`issue #2442 <https://github.com/platformio/platformio-core/issues/2442>`_)
- Fixed an issue when package cache (Library Manager) expires too fast (`issue #2559 <https://github.com/platformio/platformio-core/issues/2559>`_)

PlatformIO Core 3.0
-------------------
PlatformIO Core 3
-----------------

3.6.7 (2019-04-23)
~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -783,8 +794,8 @@ PlatformIO Core 3.0
(`issue #742 <https://github.com/platformio/platformio-core/issues/742>`_)
* Stopped supporting Python 2.6

PlatformIO Core 2.0
--------------------
PlatformIO Core 2
-----------------

2.11.2 (2016-08-02)
~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -1569,8 +1580,8 @@ PlatformIO Core 2.0
* Fixed bug with creating copies of source files
(`issue #177 <https://github.com/platformio/platformio-core/issues/177>`_)

PlatformIO Core 1.0
-------------------
PlatformIO Core 1
-----------------

1.5.0 (2015-05-15)
~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -1760,8 +1771,8 @@ PlatformIO Core 1.0
error (`issue #81 <https://github.com/platformio/platformio-core/issues/81>`_)
* Several bug fixes, increased stability and performance improvements

PlatformIO Core 0.0
-------------------
PlatformIO Core Preview
-----------------------

0.10.2 (2015-01-06)
~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion platformio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION = (4, 2, 0)
VERSION = (4, 2, 1)
__version__ = ".".join([str(s) for s in VERSION])

__title__ = "platformio"
Expand Down
12 changes: 10 additions & 2 deletions platformio/builder/tools/compilation_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import SCons

from platformio.builder.tools.platformio import SRC_ASM_EXT, SRC_C_EXT, SRC_CXX_EXT
from platformio.proc import where_is_program

# Implements the ability for SCons to emit a compilation database for the MongoDB project. See
# http://clang.llvm.org/docs/JSONCompilationDatabase.html for details on what a compilation
Expand All @@ -49,7 +50,7 @@ def __init__(self, value):
self.Decider(changed_since_last_build_node)


def changed_since_last_build_node(child, target, prev_ni, node):
def changed_since_last_build_node(*args, **kwargs):
""" Dummy decider to force always building"""
return True

Expand Down Expand Up @@ -145,7 +146,6 @@ def ScanCompilationDb(node, env, path):


def generate(env, **kwargs):

static_obj, shared_obj = SCons.Tool.createObjBuilders(env)

env["COMPILATIONDB_COMSTR"] = kwargs.get(
Expand Down Expand Up @@ -195,6 +195,14 @@ def generate(env, **kwargs):
)

def CompilationDatabase(env, target):
# Resolve absolute path of toolchain
for cmd in ("CC", "CXX", "AS"):
if cmd not in env:
continue
env[cmd] = where_is_program(
env.subst("$%s" % cmd), env.subst("${ENV['PATH']}")
)

result = env.__COMPILATIONDB_Database(target=target, source=[])

env.AlwaysBuild(result)
Expand Down
14 changes: 4 additions & 10 deletions platformio/builder/tools/piolib.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,22 +727,16 @@ def lib_archive(self):
@property
def lib_ldf_mode(self):
return self.validate_ldf_mode(
self.env.GetProjectOption(
"lib_ldf_mode",
self._manifest.get("build", {}).get(
"libLDFMode", LibBuilderBase.lib_ldf_mode.fget(self)
),
self._manifest.get("build", {}).get(
"libLDFMode", LibBuilderBase.lib_ldf_mode.fget(self)
)
)

@property
def lib_compat_mode(self):
return self.validate_compat_mode(
self.env.GetProjectOption(
"lib_compat_mode",
self._manifest.get("build", {}).get(
"libCompatMode", LibBuilderBase.lib_compat_mode.fget(self)
),
self._manifest.get("build", {}).get(
"libCompatMode", LibBuilderBase.lib_compat_mode.fget(self)
)
)

Expand Down
2 changes: 1 addition & 1 deletion platformio/commands/debug/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def spawn(self, patterns): # pylint: disable=too-many-branches
"\nCould not launch Debug Server '%s'. Please check that it "
"is installed and is included in a system PATH\n\n"
"See documentation or contact [email protected]:\n"
"http://docs.platformio.org/page/plus/debugging.html\n"
"https://docs.platformio.org/page/plus/debugging.html\n"
% server_executable
)

Expand Down
14 changes: 12 additions & 2 deletions platformio/commands/home/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@

from platformio import exception
from platformio.compat import WINDOWS
from platformio.managers.core import get_core_package_dir, inject_contrib_pysite
from platformio.managers.core import (
build_contrib_pysite_deps,
get_core_package_dir,
inject_contrib_pysite,
)


@click.command("home", short_help="PIO Home")
Expand Down Expand Up @@ -50,7 +54,13 @@ def cli(port, host, no_open, shutdown_timeout):

# import contrib modules
inject_contrib_pysite()
from autobahn.twisted.resource import WebSocketResource

try:
from autobahn.twisted.resource import WebSocketResource
except: # pylint: disable=bare-except
build_contrib_pysite_deps(get_core_package_dir("contrib-pysite"))
from autobahn.twisted.resource import WebSocketResource

from twisted.internet import reactor
from twisted.web import server

Expand Down
2 changes: 1 addition & 1 deletion platformio/commands/run/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def handle_legacy_libdeps(project_dir, config):
"DEPRECATED! A legacy library storage `{0}` has been found in a "
"project. \nPlease declare project dependencies in `platformio.ini`"
" file using `lib_deps` option and remove `{0}` folder."
"\nMore details -> http://docs.platformio.org/page/projectconf/"
"\nMore details -> https://docs.platformio.org/page/projectconf/"
"section_env_library.html#lib-deps".format(legacy_libdeps_dir),
fg="yellow",
)
Expand Down
2 changes: 1 addition & 1 deletion platformio/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,6 @@ class TestDirNotExists(PlatformioException):
"A test folder '{0}' does not exist.\nPlease create 'test' "
"directory in project's root and put a test set.\n"
"More details about Unit "
"Testing: http://docs.platformio.org/page/plus/"
"Testing: https://docs.platformio.org/page/plus/"
"unit-testing.html"
)
109 changes: 76 additions & 33 deletions platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"configurations": [
{
"name": "!!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags"
},
{
% import os
% import platform
% from os.path import commonprefix, dirname, isdir
% import re
%
% import click
%
% systype = platform.system().lower()
%
Expand All @@ -17,38 +14,79 @@
% return " " in flag and systype == "windows"
% end
%
% def _split_flags(flags):
% def split_args(args_string):
% return click.parser.split_arg_string(to_unix_path(args_string))
% end
%
% def filter_args(args, allowed, ignore=None):
% if not allowed:
% return []
% end
%
% ignore = ignore or []
% result = []
% i = 0
% flags = flags.strip()
% while i < len(flags):
% current_arg = []
% while i < len(flags) and flags[i] != " ":
% if flags[i] == '"':
% quotes_idx = flags.find('"', i + 1)
% current_arg.extend(flags[i + 1:quotes_idx])
% i = quotes_idx + 1
% else:
% current_arg.append(flags[i])
% i = i + 1
% end
% end
% arg = "".join(current_arg)
% if arg.strip():
% result.append(arg.strip())
% length = len(args)
% while(i < length):
% if any(args[i].startswith(f) for f in allowed) and not any(
% args[i].startswith(f) for f in ignore):
% result.append(args[i])
% if i + 1 < length and not args[i + 1].startswith("-"):
% i += 1
% result.append(args[i])
% end
% end
% i = i + 1
% i += 1
% end
% return result
% end
%
% def _find_abs_path(inc, inc_paths):
% for path in inc_paths:
% if os.path.isfile(os.path.join(path, inc)):
% return os.path.join(path, inc)
% end
% end
% return inc
% end
%
% def _find_forced_includes(flags, inc_paths):
% result = []
% for f in flags:
% inc = ""
% if f.startswith("-include") and f.split("-include")[1].strip():
% inc = f.split("-include")[1].strip()
% elif not f.startswith("-"):
% inc = f
% end
% if inc:
% result.append(_find_abs_path(inc, inc_paths))
% end
% end
% return result
% end
%
% cleaned_includes = []
% for include in includes:
% if "toolchain-" not in dirname(commonprefix([include, cc_path])) and isdir(include):
% if "toolchain-" not in os.path.dirname(os.path.commonprefix(
% [include, cc_path])) and os.path.isdir(include):
% cleaned_includes.append(include)
% end
% end
%
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
% cc_stds = STD_RE.findall(cc_flags)
% cxx_stds = STD_RE.findall(cxx_flags)
% cc_m_flags = split_args(cc_flags)
% forced_includes = _find_forced_includes(
% filter_args(cc_m_flags, ["-include"]), cleaned_includes)
%
{
"configurations": [
{
"name": "!!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags"
},
{
% if systype == "windows":
"name": "Win32",
% elif systype == "darwin":
Expand Down Expand Up @@ -79,21 +117,26 @@
""
],
"intelliSenseMode": "clang-x64",
% import re
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
% cc_stds = STD_RE.findall(cc_flags)
% cxx_stds = STD_RE.findall(cxx_flags)
%
% if cc_stds:
"cStandard": "c{{ cc_stds[-1] }}",
% end
% if cxx_stds:
"cppStandard": "c++{{ cxx_stds[-1] }}",
% end
% if forced_includes:
"forcedInclude": [
% for include in forced_includes:
"{{ include }}",
% end
""
],
% end
"compilerPath": "{{ cc_path }}",
"compilerArgs": [
% for flag in [ '"%s"' % _escape(f) if _escape_required(f) else f for f in _split_flags(
% cc_flags) if f.startswith(("-m", "-i", "@"))]:
% for flag in [
% '"%s"' % _escape(f) if _escape_required(f) else f
% for f in filter_args(cc_m_flags, ["-m", "-i", "@"], ["-include"])
% ]:
"{{ flag }}",
% end
""
Expand Down
Loading

0 comments on commit 80acd52

Please sign in to comment.