Skip to content

Commit

Permalink
Fix issue with code builder when build path contains spaces // Resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Dec 18, 2015
1 parent 1a47cfc commit 186580d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ PlatformIO 2.0
(`issue #379 <https://github.com/platformio/platformio/issues/379>`_)
* Fixed reset method for Espressif NodeMCU (ESP-12E Module)
(`issue #380 <https://github.com/platformio/platformio/issues/380>`_)
* Fixed issue with code builder when build path contains spaces
(`issue #387 <https://github.com/platformio/platformio/issues/387>`_)


2.6.0 (2015-12-15)
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 = (2, 6, "1.dev2")
VERSION = (2, 6, "1.dev3")
__version__ = ".".join([str(s) for s in VERSION])

__title__ = "platformio"
Expand Down
13 changes: 7 additions & 6 deletions platformio/builder/scripts/espressif.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
"-cp", "$UPLOAD_PORT",
"-cf", "$SOURCE"
],
UPLOADCMD='$UPLOADER $UPLOADERFLAGS',
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS',

PROGNAME="firmware",
PROGSUFFIX=".elf"
Expand All @@ -104,9 +104,10 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
BUILDERS=dict(
ElfToBin=Builder(
action=" ".join([
"$UPLOADER",
"-eo", join("$PLATFORMFW_DIR", "bootloaders",
"eboot", "eboot.elf"),
'"$UPLOADER"',
"-eo",
'"%s"' % join("$PLATFORMFW_DIR", "bootloaders",
"eboot", "eboot.elf"),
"-bo", "$TARGET",
"-bm", "dio",
"-bf", "${BOARD_OPTIONS['build']['f_cpu'][:2]}",
Expand Down Expand Up @@ -147,7 +148,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
"-i", "$UPLOAD_PORT",
"-f", "$SOURCE"
],
UPLOADCMD='$UPLOADEROTA $UPLOADERFLAGS'
UPLOADCMD='"$UPLOADEROTA" $UPLOADERFLAGS'
)
except socket.error:
pass
Expand All @@ -163,7 +164,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
BUILDERS=dict(
ElfToBin=Builder(
action=" ".join([
"$UPLOADER",
'"$UPLOADER"',
"-eo", "$SOURCES",
"-bo", "${TARGETS[0]}",
"-bm", "qio",
Expand Down
2 changes: 1 addition & 1 deletion platformio/builder/scripts/frameworks/cmsis.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if "mbed" in env.get("BOARD_OPTIONS", {}).get("frameworks", {}):
env.Append(
LINKFLAGS=[
"-Wl,-T",
'-Wl,-T"%s"' %
join(
"$PIOPACKAGES_DIR", "framework-mbed", "variant",
env.subst("$BOARD").upper(), "mbed",
Expand Down
7 changes: 4 additions & 3 deletions platformio/builder/scripts/ststm32.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@
UPLOADERFLAGS=[
join("$BUILD_DIR", "firmware.elf"),
"-batch",
"-x", join("$PROJECT_DIR", "upload.gdb")
"-x",
'"%s"' % join("$PROJECT_DIR", "upload.gdb")
],

UPLOADCMD="$UPLOADER $UPLOADERFLAGS"
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS'
)
else:
env.Replace(
Expand All @@ -55,7 +56,7 @@
"0x08000000" # flash start adress
],

UPLOADCMD="$UPLOADER $UPLOADERFLAGS"
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS'
)


Expand Down
2 changes: 1 addition & 1 deletion platformio/builder/scripts/titiva.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-lm4flash", "lm4flash"),
UPLOADCMD="$UPLOADER $SOURCES"
UPLOADCMD='"$UPLOADER" $SOURCES'
)

env.Append(
Expand Down
8 changes: 6 additions & 2 deletions platformio/builder/tools/pioar.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ def _huge_sources_hook(sources):

tmp_file = join(gettempdir(), "pioarargs-%s" % md5(_sources).hexdigest())
with open(tmp_file, "w") as f:
f.write(_sources)
# fix space in paths
for line in _sources.split(".o "):
if not line.endswith(".o"):
line += ".o"
f.write('"%s" ' % line)

return "@%s" % tmp_file
return '@"%s"' % tmp_file


def exists(_):
Expand Down
2 changes: 1 addition & 1 deletion platformio/builder/tools/platformio.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def BuildProgram(env):
if ("LDSCRIPT_PATH" in env and
not any(["-Wl,-T" in f for f in env['LINKFLAGS']])):
env.Append(
LINKFLAGS=["-Wl,-T", "$LDSCRIPT_PATH"]
LINKFLAGS=['-Wl,-T"$LDSCRIPT_PATH"']
)

# enable "cyclic reference" for linker
Expand Down

0 comments on commit 186580d

Please sign in to comment.