Skip to content

compile command fails when sketch on different drive from custom build path #2156

Closed

Description

Describe the problem

Under the following conditions:

  • A custom build path is set via the --build-path flag.
  • The build path is on a different drive from the sketch.

compilation fails:

Error during build: Cannot find build path: Rel: can't make C:\Users\per\AppData\Local\Temp\build-path relative to E:\FooSketch

To reproduce

$ arduino-cli version
arduino-cli.exe  Version: git-snapshot Commit: 2c2a5cc6 Date: 2023-04-24T05:04:04Z

$ arduino-cli sketch new "e:/FooSketch"
Sketch created in: e:\FooSketch

$ arduino-cli compile --build-path "c:/Users/per/AppData/Local/Temp/build-path" --fqbn arduino:avr:uno "e:/FooSketch"
Error during build: Cannot find build path: Rel: can't make c:\Users\per\AppData\Local\Temp\build-path relative to E:\FooSketch

Expected behavior

Compilation is possible when custom build path is on a different drive from sketch.

Arduino CLI version

2c2a5cc

Operating system

Windows

Operating system version

11

Additional context

I bisected the regression to 78bfa74


I was not able to reproduce the fault on Linux or macOS


The fault does not occur when --build-path is not used in the command even when that command uses a default build path on a different drive from the sketch.


The fault also occurs when using the gRPC interface.


Although the use of --build-path in command line commands is probably not so common, custom build paths are used for the compile operations ran by Arduino IDE 2.x to generate the compilation database for Arduino Language Server, which makes the regression more impactful.


Originally reported at: https://forum.arduino.cc/t/data-item-properties-in-ide-2-1/1118282

Additional reports

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Activity

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

Metadata

Assignees

Labels

conclusion: resolvedIssue was resolvedos: windowsSpecific to Windows operating systemtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions