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

spaces-in-path for custom linker script in $PROJECT_DIR #2479

Closed
wants to merge 1 commit into from

Conversation

thijses
Copy link

@thijses thijses commented Aug 13, 2024

Summary
quick fix for a spaces-in-path error when using a linker script inside $PROJECT_DIR

lines 371~373:
https://github.com/thijses/Arduino_Core_STM32/blob/e7d39cc6ee10d52506fe8f9baff1d0479a1cda6c/tools/platformio/platformio-build.py#L371

produces (in my case) the string:

$PROJECT_DIR\boards/variants\BKS_H2O_1003400D\ldscript.ld

which later gets translated to a full/absolute path, where the spaces in my windows username are not accounted for.
Adding some quotes around the whole thing fixes it (on my machine).

(some of the other path strings (which include an absolute path early on) do not suffer from this issue, so i suspect that someone has already attempted to prevent spaces-in-path errors by dynamically adding quotes at some point, but has not accounted for unparsed paths ('$PROJECT_DIR') when checking for spaces.)

I came across this while trying to impement the example shown here:
https://github.com/maxgerhardt/pio-custom-stm32duino-variants

this fixes a spaces-in-path error i got, because:
lines 371~373 produce (in my case):
'$PROJECT_DIR\boards/variants\BKS_H2O_1003400D\ldscript.ld'
which then gets translated to a full/absolute path, where the spaces in my windows username are not accounted for.
I added some quotes around the whole thing, which fixes it for me.
(some of the other path strings (which include an absolute path early on) do not suffer from this issue, so i suspect that someone has already attempted to prevent spaces-in-path errors by dynamically adding quotes at some point, but has not accounted for unparsed paths ('$PROJECT_DIR') when checking for spaces.)

Signed-off-by: Thijs van Liempd <[email protected]>
@fpistm
Copy link
Member

fpistm commented Aug 13, 2024

Hi @thijses
Thanks for the PR, @valeros, please could you review this change to pio script?

@valeros
Copy link
Contributor

valeros commented Aug 14, 2024

Thanks for pinging, I've pushed a PR with the latest changes, including the fix for this issue.

@fpistm fpistm closed this in #2481 Aug 14, 2024
@fpistm fpistm added the fix 🩹 Bug fix label Aug 14, 2024
@fpistm fpistm added the duplicate This issue or pull request already exists label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists fix 🩹 Bug fix
Projects
Development

Successfully merging this pull request may close these issues.

3 participants