Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbed complie can't find ARM complier 6 in the PATH with quotes #875

Closed
jamesbeyond opened this issue Mar 22, 2019 · 7 comments
Closed

mbed complie can't find ARM complier 6 in the PATH with quotes #875

jamesbeyond opened this issue Mar 22, 2019 · 7 comments

Comments

@jamesbeyond
Copy link
Contributor

jamesbeyond commented Mar 22, 2019

Description

While using mbed-cli with ARMC6. I found a strange behaviour.
based on this doc, I can just put ARMC6 in the system PATH env var, then use it from there.

mbed compile -t ARM -m K64F

If I do
set PATH=%PATH%;c:\Program Files\ARMCompiler6.11\bin
mbed compile runs just fine. however if I run with quotes around ARMC6 bins
set PATH=%PATH%;"c:\Program Files\ARMCompiler6.11\bin"
mbed compile fail to detect ARMC6

and throw errors:

 [mbed] Working path "c:\mbed\examples\mbed-os-psa-compliance-tests-example" (program)
usage: make.py [-h] [-m MCU] [--custom-targets CUSTOM_TARGETS_DIRECTORY]
               [-t TOOLCHAIN] [--color] [--cflags CFLAGS]
               [--asmflags ASMFLAGS] [--ldflags LDFLAGS] [-c]
               [--profile PROFILE] [--app-config APP_CONFIG]
               [-p PROGRAM | -n PROGRAM | -L | -S [{matrix,toolchains,targets}]]
               [-j JOBS] [-v] [--silent] [-D MACROS] [-f GENERAL_FILTER_REGEX]
               [--stats-depth STATS_DEPTH] [--automated] [--host HOST_TEST]
               [--extra EXTRA] [--peripherals PERIPHERALS]
               [--dep DEPENDENCIES] [--source SOURCE_DIR]
               [--duration DURATION] [--build BUILD_DIR] [-N ARTIFACT_NAME]
               [--ignore IGNORE] [-b BAUD] [--rpc] [--usb] [--dsp] [--testlib]
               [--build-data BUILD_DATA] [-l LINKER_SCRIPT]
make.py: error: Could not find executable for ARMC6.
Currently set search path: No path set
[mbed] ERROR: "c:\python27\python.exe" returned error.
       Code: 2
       Path: "c:\mbed\examples\mbed-os-psa-compliance-tests-example"
       Command: "c:\python27\python.exe -u c:\mbed\examples\mbed-os-psa-compliance-tests-example\mbed-os\tools\make.py -D MBEDTLS_USER_CONFIG_FILE="../comp_config.h" -t ARM -m LPC55S69_S --profile release --source . --build .\BUILD\LPC55S69_S\ARM-RELEASE --app-config mbed-os/tools/psa/tfm/mbed_app.json"
       Tip: You could retry the last command with "-v" flag for verbose output

In both of the SET methods, armclang runs absolutely fine.
mbed-cli version 1.9.2 are used.

Issue request type

[ ] Question
[ ] Enhancement
[x] Bug
@theotherjimmy
Copy link
Contributor

@jamesbeyond This looks like it might be a bug with windows environment variables. What does echo %PATH% after the path with quotes give you?

@ciarmcom
Copy link
Member

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-1049

@jamesbeyond
Copy link
Contributor Author

Hi @theotherjimmy,
The broken one shows

C:\Program Files\Microsoft VS Code\bin;C:\Users\qinshi01\AppData\Roaming\npm;C:\Program Files (x86)\Nmap;"c:\Program Files\ARMCompiler6.11\bin"

Which also include the quotes in the PATH Variable

@theotherjimmy
Copy link
Contributor

@jamesbeyond Then don't use quotes in the path variable.

@jamesbeyond
Copy link
Contributor Author

Hi @theotherjimmy,
I think this is not about how I use the tools. this is about customer experiences.
This gives customers the impression that our tools are fundamentally broken. Because they are following the instructions, and use complete valid settings but end up with unusable tools.
Arm compiler 6 works complete fine with quotes in the PATH,

C:\>set PATH=%PATH%;"c:\Program Files\ARMCompiler6.11\bin"
C:\>armclang --help
Product: ARM Compiler 6.11 Professional
Component: ARM Compiler 6.11
Tool: armclang [5d3b4200]

our customer will be struggle to find-out what went wrong with mbed-cli, as it is complains it can't find armclang

@bridadan
Copy link
Contributor

It's quite common to wrap paths in Windows with quotes, so I'm with @jamesbeyond on this one. I don't think it should be to difficult to strip the quotes.

@jamesbeyond I can't work on a solution right this second due to activities around the upcoming release. However if you have time (and are motivated 😄) I'd be happy to point you in the direction for a patch. I think the appropriate place to do the proper clean up of toolchain paths would happen here: https://github.com/ARMmbed/mbed-os/blob/e69aa15aea92a6d7803280fde2dd9682fb8b0d92/tools/settings.py#L102. You would want to loop over the paths similar to what is done above and do the proper normalization.

@bridadan
Copy link
Contributor

bridadan commented Apr 5, 2019

Fix up here: ARMmbed/mbed-os#10333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants