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

Put quotes around include path options #8595

Merged
merged 1 commit into from
Nov 9, 2018
Merged

Put quotes around include path options #8595

merged 1 commit into from
Nov 9, 2018

Conversation

moonchen
Copy link
Contributor

Description

This fixes a compile error when the path has space characters. I tested on my local machine only on GCC_ARM.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

This fixes a compile error when the path has space characters.
@cmonr
Copy link
Contributor

cmonr commented Oct 31, 2018

Would you mind sharing the command that this fixes, as well as more details about the env your working in/with?

It would be good to know in case there might be more issues like this.

@moonchen
Copy link
Contributor Author

I'm on macOS. My project is under a directory named OneDrive - Arm. Here is an excerpt from the output when I run mbed compile.

Compile [  0.1%]: mbed_tz_context.c
[ERROR] arm-none-eabi-gcc: error: Arm: No such file or directory
arm-none-eabi-gcc: error: Arm/work: No such file or directory
arm-none-eabi-gcc: error: Arm/work/red-mbed-os-example-ble: No such file or directory
arm-none-eabi-gcc: error: Arm/work/red-mbed-os-example-ble/mbed-os: No such file or directory
arm-none-eabi-gcc: error: Arm/work/red-mbed-os-example-ble/mbed-os/features: No such file or directory
arm-none-eabi-gcc: error: Arm/work/red-mbed-os-example-ble/mbed-os/features/unsupported: No such file or directory
arm-none-eabi-gcc: error: Arm/work/red-mbed-os-example-ble/mbed-os/features/unsupported/tests: No such file or directory
arm-none-eabi-gcc: error: Arm/work/red-mbed-os-example-ble/mbed-os/features/unsupported/tests/mbed: No such file or directory
arm-none-eabi-gcc: error: Arm/work/red-mbed-os-example-ble/mbed-os/features/unsupported/tests/mbed/env: No such file or directory

I tracked the cause down to the file BUILD/TARGET/TOOLCHAIN/.include_nnnnnnnnnnnnnnnnn.txt. The file contained include path options in the form of -IPATH NAME which was being interpreted as two different options.

@cmonr
Copy link
Contributor

cmonr commented Oct 31, 2018

Ah! I see. That's a good catch.

The alternative fix for this would be to escape each space, but I think this has the benefit of adding a known, fixed number of quotes (2 per file invlide) whereas attempting to escape each space would be highly dependent on the file path (could be 0, could be a lot mroe than 2).

@cmonr
Copy link
Contributor

cmonr commented Nov 8, 2018

@theotherjimmy A quick review.

This was actualyl why I was thinking about double quotes in the other PR.

@cmonr
Copy link
Contributor

cmonr commented Nov 9, 2018

Note: This PR is now a part of a rollup PR (#8694).

No further work is needed here, as once that PR is merged, this PR will also be closed and marked as merged.

If any more commits are made in this PR, this PR will remain open and have to go through CI on its own.

@cmonr cmonr merged commit 2c77c1e into ARMmbed:master Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants