Path white space causing errors in emBuild

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Path white space causing errors in emBuild

      Hey Segger support and community, I'm trying to use emBuild to automate builds for a Nordic nRF52 project (SDK 15.0.0). The build fails due to white space in included file paths.

      Here's the environment I'm using:
      - MacOS 10.13.6
      - Segger Embedded Studio for Arm 3.34a
      - SEGGER Embedded Studio for ARM emBuild - Release 3.34a


      I successfully compile the project when using Segger Embedded studio. The build commands that it produces starts as follows, wrapping paths and options in quotes:
      "/Applications/SEGGER Embedded Studio for ARM 3.34a/gcc/arm-none-eabi/bin/cc1" ...

      When I run emBuild, quotes are not included around the path to the compiler or around options that include file paths. It results in an error.
      /Applications/SEGGER Embedded Studio for ARM 3.34a/gcc/arm-none-eabi/bin/cc1

      I've made some progress by specify the "studiodir" option with escape characters before the whitespace:

      Shell-Script

      1. emBuild -config Release -verbose -studiodir '/Applications/SEGGER\ Embedded\ Studio\ for\ ARM\ 3.34a' -echo /usr/local/nRF5_SDK_15.0.0_a53641a/examples/project/application/pca10040/s132/ses/projcet.emProject

      However, there's other include paths in the project that contain white space, and those cause further errors.

      For example, when I compile with Segger Embedded Studio, the following -isystem option is surrounded in quotes:
      "-isystem/Users/raykampmeier/Library/SEGGER/SEGGER Embedded Studio/v3/packages/include"

      When using emBuild, there are no quotes around this option, resulting in an error:
      -isystem/Users/raykampmeier/Library/SEGGER/SEGGER Embedded Studio/v3/packages/include



      Is there a way to have emBuild automatically wrap options in quotes? Or any suggestions for how to get around this?

      -Ray
    • I certainly understand that in general it's preferred that file paths don't include spaces or special characters. In this case it's caused by Segger's choice to include spaces in path locations.

      So it seems there's two problems:
      1. Segger's tools are installed at paths that includes spaces. Not ideal.
      /Applications/SEGGER Embedded Studio for ARM 3.34a
      ~/Library/SEGGER/SEGGER Embedded Studio

      2. Segger's emBuild tool doesn't escape spaces and special characters in include paths.

      A fix for #2 would prevent the issue altogether. Perhaps additionally Segger can start installing their tools to paths without spaces to avoid future issues.


      Segger team, any help here?

      much thanks
      -Ray