Merge branch 'release/v3.6.4'

This commit is contained in:
Ivan Kravets
2019-01-23 20:51:48 +02:00
14 changed files with 122 additions and 70 deletions

View File

@ -4,10 +4,27 @@ Release Notes
PlatformIO 3.0
--------------
3.6.4 (2019-01-23)
~~~~~~~~~~~~~~~~~~
* Improved Project Generator for IDEs:
- Use full path to PlatformIO CLI when generating a project
(`issue #1674 <https://github.com/platformio/platformio-core/issues/1674>`_)
- CLion: Improved project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path
- Eclipse: Provide language standard to a project C/C++ indexer
(`issue #1010 <https://github.com/platformio/platformio-core/issues/1010>`_)
* Fixed an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks
* Fixed "Runtime Error: Dictionary size changed during iteration"
(`issue #2003 <https://github.com/platformio/platformio-core/issues/2003>`_)
* Fixed an error "Could not extract item..." when extracting TAR archive with symbolic items on Windows platform
(`issue #2015 <https://github.com/platformio/platformio-core/issues/2015>`_)
3.6.3 (2018-12-12)
~~~~~~~~~~~~~~~~~~
* Ignore *.asm and *.ASM files when building Arduino-based library (compatibility with Arduino builder)
* Ignore ``*.asm`` and ``*.ASM`` files when building Arduino-based library (compatibility with Arduino builder)
* Fixed spurious project's "Problems" for `PlatformIO IDE for VSCode <http://docs.platformio.org/page/ide/vscode.html>`__ when ARM mbed framework is used
* Fixed an issue with a broken headers list when generating ".clang_complete" for `Emacs <http://docs.platformio.org/page/ide/emacs.html>`__
(`issue #1960 <https://github.com/platformio/platformio-core/issues/1960>`_)
@ -50,7 +67,6 @@ PlatformIO 3.0
(`issue #1873 <https://github.com/platformio/platformio-core/issues/1873>`_)
* Fixed an issue with incorrect handling of a custom package name when using `platformio lib install <http://docs.platformio.org/page/userguide/lib/cmd_install.html>`__ or `platformio platform install <http://docs.platformio.org/page/userguide/platforms/cmd_install.html>`__ commands
3.6.0 (2018-08-06)
~~~~~~~~~~~~~~~~~~

2
docs

Submodule docs updated: c0dc83570a...a48c700ba1

View File

@ -14,7 +14,7 @@
import sys
VERSION = (3, 6, 3)
VERSION = (3, 6, 4)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -226,9 +226,9 @@ class ContentCache(object):
newlines = []
with open(self._db_path) as fp:
for line in fp.readlines():
line = line.strip()
if "=" not in line:
continue
line = line.strip()
expire, path = line.split("=")
if time() < int(expire) and isfile(path) and \
path not in paths_for_delete:

View File

@ -19,6 +19,7 @@ from __future__ import absolute_import
import hashlib
import os
import re
import sys
from glob import glob
from os.path import (basename, commonprefix, dirname, isdir, isfile, join,
@ -64,6 +65,9 @@ class LibBuilderFactory(object):
if isfile(join(path, "module.json")):
return ["mbed"]
include_re = re.compile(
r'^#include\s+(<|")(Arduino|mbed)\.h(<|")', flags=re.MULTILINE)
# check source files
for root, _, files in os.walk(path, followlinks=True):
for fname in files:
@ -72,9 +76,9 @@ class LibBuilderFactory(object):
continue
with open(join(root, fname)) as f:
content = f.read()
if "Arduino.h" in content:
if "Arduino.h" in content and include_re.search(content):
return ["arduino"]
elif "mbed.h" in content:
elif "mbed.h" in content and include_re.search(content):
return ["mbed"]
return []

View File

@ -15,6 +15,7 @@
import json
import os
import re
import sys
from os.path import abspath, basename, expanduser, isdir, isfile, join, relpath
import bottle
@ -146,7 +147,8 @@ class ProjectGenerator(object):
"project_libdeps_dir": util.get_projectlibdeps_dir(),
"systype": util.get_systype(),
"platformio_path": self._fix_os_path(
util.where_is_program("platformio")),
sys.argv[0] if isfile(sys.argv[0])
else util.where_is_program("platformio")),
"env_pathsep": os.pathsep,
"env_path": self._fix_os_path(os.getenv("PATH"))
}) # yapf: disable

View File

@ -1,8 +1,20 @@
set(ENV{PATH} "{{env_path}}")
set(PLATFORMIO_CMD "{{platformio_path}}")
% def _normalize_path(path):
% if project_dir in path:
% path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}")
% elif user_home_dir in path:
% if "windows" in systype:
% path = path.replace(user_home_dir, "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
% else:
% path = path.replace(user_home_dir, "$ENV{HOME}")
% end
% end
% return path.replace("\\", "/")
% end
SET(CMAKE_C_COMPILER "{{cc_path.replace("\\", "/")}}")
SET(CMAKE_CXX_COMPILER "{{cxx_path.replace("\\", "/")}}")
set(PLATFORMIO_CMD "{{ _normalize_path(platformio_path) }}")
SET(CMAKE_C_COMPILER "{{ _normalize_path(cc_path) }}")
SET(CMAKE_CXX_COMPILER "{{ _normalize_path(cxx_path) }}")
SET(CMAKE_CXX_FLAGS_DISTRIBUTION "{{cxx_flags}}")
SET(CMAKE_C_FLAGS_DISTRIBUTION "{{cc_flags}}")
set(CMAKE_CXX_STANDARD 11)
@ -13,15 +25,7 @@ add_definitions(-D'{{!re.sub(r"([\"\(\)#])", r"\\\1", define)}}')
% end
% for include in includes:
% if include.startswith(user_home_dir):
% if "windows" in systype:
include_directories("$ENV{HOMEDRIVE}$ENV{HOMEPATH}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
% else:
include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
% end
% else:
include_directories("{{include.replace("\\", "/")}}")
% end
include_directories("{{ _normalize_path(include) }}")
% end
FILE(GLOB_RECURSE SRC_LIST "{{project_src_dir.replace("\\", "/")}}/*.*" "{{project_lib_dir.replace("\\", "/")}}/*.*" "{{project_libdeps_dir.replace("\\", "/")}}/*.*")
FILE(GLOB_RECURSE SRC_LIST "{{ _normalize_path(project_src_dir) }}/*.*" "{{ _normalize_path(project_lib_dir) }}/*.*" "{{ _normalize_path(project_libdeps_dir) }}/*.*")

View File

@ -1,3 +1,8 @@
% import re
% STD_RE = re.compile(r"(\-std=[a-z\+]+\d+)")
% cxx_stds = STD_RE.findall(cxx_flags)
% cxx_std = cxx_stds[-1] if cxx_stds else ""
%
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="0.910961921" name="Default">
@ -6,9 +11,9 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
% if "windows" in systype:
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1291887707783033084" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${USERPROFILE}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1291887707783033084" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${USERPROFILE}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} {{ cxx_std }} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
% else:
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-869785120007741010" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${HOME}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-869785120007741010" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${HOME}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} {{ cxx_std }} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
% end
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
@ -21,9 +26,9 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
% if "windows" in systype:
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1291887707783033084" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${USERPROFILE}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1291887707783033084" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${USERPROFILE}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} {{ cxx_std }} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
% else:
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-869785120007741010" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${HOME}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-869785120007741010" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${HOME}{{cxx_path.replace(user_home_dir, '')}} ${FLAGS} {{ cxx_std }} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
% end
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>

View File

@ -4,7 +4,7 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run"
],
@ -14,7 +14,7 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run"
],
@ -23,27 +23,7 @@
{
"cmd":
[
"platformio",
"-f", "-c", "sublimetext",
"run",
"--target",
"clean"
],
"name": "Clean"
},
{
"cmd":
[
"platformio",
"-f", "-c", "sublimetext",
"test"
],
"name": "Test"
},
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
@ -54,7 +34,27 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
"clean"
],
"name": "Clean"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"test"
],
"name": "Test"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
@ -65,7 +65,7 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"run",
"--target",
@ -76,16 +76,24 @@
{
"cmd":
[
"platformio",
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"update"
],
"name": "Update platforms and libraries"
},
{
"cmd":
[
"{{ platformio_path }}",
"-f", "-c", "sublimetext",
"upgrade"
],
"name": "Upgrade PlatformIO Core"
}
],
"working_dir": "${project_path:${folder}}",
"selector": "source.c, source.c++",
"path": "{{env_path}}"
"selector": "source.c, source.c++"
}
],
"folders":
@ -98,7 +106,7 @@
{
"sublimegdb_workingdir": "{{project_dir}}",
"sublimegdb_exec_cmd": "",
"sublimegdb_commandline": "{{platformio_path}} -f -c sublimetext debug --interface=gdb --interpreter=mi -x .pioinit"
"sublimegdb_commandline": "{{ platformio_path }} -f -c sublimetext debug --interface=gdb --interpreter=mi -x .pioinit"
}
}

View File

@ -13,7 +13,7 @@
# limitations under the License.
from os import chmod
from os.path import exists, islink, join
from os.path import exists, join
from tarfile import open as tarfile_open
from time import mktime
from zipfile import ZipFile
@ -56,6 +56,10 @@ class TARArchive(ArchiveBase):
def get_item_filename(self, item):
return item.name
@staticmethod
def islink(item):
return item.islnk() or item.issym()
class ZIPArchive(ArchiveBase):
@ -80,6 +84,9 @@ class ZIPArchive(ArchiveBase):
def get_item_filename(self, item):
return item.filename
def islink(self, item):
raise NotImplementedError()
def after_extract(self, item, dest_dir):
self.preserve_permissions(item, dest_dir)
self.preserve_mtime(item, dest_dir)
@ -120,7 +127,9 @@ class FileUnpacker(object):
for item in self._unpacker.get_items():
filename = self._unpacker.get_item_filename(item)
item_path = join(dest_dir, filename)
if not islink(item_path) and not exists(item_path):
raise exception.ExtractArchiveItemError(filename, dest_dir)
try:
if not self._unpacker.islink(item) and not exists(item_path):
raise exception.ExtractArchiveItemError(filename, dest_dir)
except NotImplementedError:
pass
return True

View File

@ -794,17 +794,20 @@ def merge_dicts(d1, d2, path=None):
return d1
def get_file_contents(path):
try:
with open(path) as f:
return f.read()
except UnicodeDecodeError:
with open(path, encoding="latin-1") as f:
return f.read()
def ensure_udev_rules():
def _rules_to_set(rules_path):
result = set([])
with open(rules_path, "rb") as fp:
for line in fp.readlines():
line = line.strip()
if not line or line.startswith("#"):
continue
result.add(line)
return result
return set(l.strip() for l in get_file_contents(rules_path).split("\n")
if l.strip() and not l.startswith("#"))
if "linux" not in get_systype():
return None

View File

@ -170,7 +170,7 @@ def test_global_lib_list(clirunner, validate_cliresult):
]
versions2 = [
'ArduinoJson@5.8.2', 'ArduinoJson@5.10.1', 'AsyncMqttClient@0.8.2',
'AsyncTCP@1.0.1', 'NeoPixelBus@2.2.4', 'PJON@07fe9aa', 'PJON@1fb26fd',
'NeoPixelBus@2.2.4', 'PJON@07fe9aa', 'PJON@1fb26fd',
'PubSubClient@bef5814', 'RFcontrol@77d4eb3f8a', 'RadioHead-1.62@0.0.0'
]
assert set(versions1) >= set(versions2)

View File

@ -37,7 +37,8 @@ def pytest_generate_tests(metafunc):
if not p.is_embedded():
continue
# issue with "version `CXXABI_1.3.9' not found (required by sdcc)"
if "linux" in util.get_systype() and p.name == "intel_mcs51":
if "linux" in util.get_systype() and p.name in ("intel_mcs51",
"ststm8"):
continue
examples_dir = join(p.get_dir(), "examples")
assert isdir(examples_dir)