Skip to content

Fix compile --build-path not working with relative paths #1423

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

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

silvanocerza
Copy link
Contributor

@silvanocerza silvanocerza commented Aug 31, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Fix a bug in a command and relative gRPC interface.

  • What is the current behavior?

Calling arduino-cli compile --build-path ../build-path -b arduino:avr:uno ~/Arduino/Blink fails with an unclear error cause of the relative build path:

Couldn't deeply cache core build: Rel: can't make ../build-path relative to /tmp/arduino-core-cache                                                
Running normal build of the core...                                                                                                                
                                                                                                                                                   
Error during build: Rel: can't make /home/alien/workspace/build-path/core/core.a relative to ../build-path

The related gRPC function has the same behaviour.

  • What is the new behavior?

Using a relative build path doesn't cause issues anymore and it's handled without problems:

~/workspace/arduino-cli
$ ./arduino-cli compile --build-path ../build-path -b arduino:avr:uno ~/Arduino/Blink
Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

~/workspace/arduino-cli
$ ls ../build-path 
Blink.ino.eep  Blink.ino.hex                  Blink.ino.with_bootloader.hex  compile_commands.json  includes.cache  preproc
Blink.ino.elf  Blink.ino.with_bootloader.bin  build.options.json             core                   libraries       sketch

Nope.

  • Other information:

Fixes #630.


See how to contribute

@silvanocerza silvanocerza requested a review from a team August 31, 2021 12:49
@silvanocerza silvanocerza self-assigned this Aug 31, 2021
@silvanocerza silvanocerza merged commit dad5e9c into master Aug 31, 2021
@silvanocerza silvanocerza deleted the scerza/fix-compile-relative-build-path branch August 31, 2021 13:24
@rsora rsora added type: imperfection Perceived defect in any part of project topic: gRPC Related to the gRPC interface topic: CLI Related to the command line interface labels Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"compile --build-path" does not work for relative paths
3 participants