mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Avoid problem with long command for "gcc-ar" under Windows
This commit is contained in:
@ -52,7 +52,7 @@ commonvars.AddVariables(
|
|||||||
DefaultEnvironment(
|
DefaultEnvironment(
|
||||||
tools=[
|
tools=[
|
||||||
"gcc", "g++", "as", "ar", "gnulink",
|
"gcc", "g++", "as", "ar", "gnulink",
|
||||||
"platformio", "upload"
|
"platformio", "pioupload", "pioar"
|
||||||
],
|
],
|
||||||
toolpath=[join("$PIOBUILDER_DIR", "tools")],
|
toolpath=[join("$PIOBUILDER_DIR", "tools")],
|
||||||
variables=commonvars,
|
variables=commonvars,
|
||||||
|
@ -30,6 +30,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
|||||||
|
|
||||||
env.AutodetectUploadPort()
|
env.AutodetectUploadPort()
|
||||||
env.Append(UPLOADERFLAGS=["-P", "$UPLOAD_PORT"])
|
env.Append(UPLOADERFLAGS=["-P", "$UPLOAD_PORT"])
|
||||||
|
|
||||||
if env.subst("$BOARD") == "raspduino":
|
if env.subst("$BOARD") == "raspduino":
|
||||||
_rpi_sysgpio("/sys/class/gpio/export", 18)
|
_rpi_sysgpio("/sys/class/gpio/export", 18)
|
||||||
_rpi_sysgpio("/sys/class/gpio/gpio18/direction", "out")
|
_rpi_sysgpio("/sys/class/gpio/gpio18/direction", "out")
|
||||||
|
35
platformio/builder/tools/pioar.py
Normal file
35
platformio/builder/tools/pioar.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
|
# See LICENSE for details.
|
||||||
|
|
||||||
|
import atexit
|
||||||
|
from os import remove
|
||||||
|
from tempfile import mkstemp
|
||||||
|
|
||||||
|
MAX_SOURCES_LENGTH = 8000 # Windows CLI has limit with command length to 8192
|
||||||
|
|
||||||
|
|
||||||
|
def _huge_sources_hook(sources):
|
||||||
|
if len(str(sources)) < MAX_SOURCES_LENGTH:
|
||||||
|
return sources
|
||||||
|
|
||||||
|
_, tmp_file = mkstemp()
|
||||||
|
with open(tmp_file, "w") as f:
|
||||||
|
f.write(str(sources).replace("\\", "/"))
|
||||||
|
|
||||||
|
atexit.register(remove, tmp_file)
|
||||||
|
|
||||||
|
return "@%s" % tmp_file
|
||||||
|
|
||||||
|
|
||||||
|
def exists(_):
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def generate(env):
|
||||||
|
|
||||||
|
env.Replace(
|
||||||
|
_huge_sources_hook=_huge_sources_hook,
|
||||||
|
ARCOM=env.get("ARCOM", "").replace(
|
||||||
|
"$SOURCES", "${_huge_sources_hook(SOURCES)}"))
|
||||||
|
|
||||||
|
return env
|
Reference in New Issue
Block a user