Skip to content

Setting build-path to nested subdirectory #235

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

Closed
GeorgeHahn opened this issue Jun 15, 2017 · 19 comments
Closed

Setting build-path to nested subdirectory #235

GeorgeHahn opened this issue Jun 15, 2017 · 19 comments
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself

Comments

@GeorgeHahn
Copy link

GeorgeHahn commented Jun 15, 2017

Related to #4 - if the build dir is set to a folder within the working directory (eg ./build), a recursive folder structure is created (see #4 for an example).

Issue #4 notes that an error message was added to guard against this behavior. This error message should be extended to cover any folder contained within the working directory.

@matthijskooijman
Copy link
Collaborator

Hm, I thought we already fixed this and allowed a build directory within the sketch directory. If not, then it's certainly on my list of things that should be made possible :-)

@luni64
Copy link

luni64 commented Nov 21, 2018

Any news on that? It still get an error when I define the build directory in the sketch directory
Rel: can't make C:\Users\lutz\source\newProject(1)\bin\core\core.a relative to bin
Any workaround?

@facchinm
Copy link
Member

@luni64 would you mind attaching the full compiler output? The problem looks a bit Windows specific

@luni64
Copy link

luni64 commented Nov 21, 2018

Thanks for your quick reply.

Here the compiler output: output.txt, and here -in case you need the command line parameters- the tasks.json tasks.zip

@facchinm
Copy link
Member

Thanks for the log.
I think there might be a workaround by using an absolute path for -build-path= (I would write $PWD/bin on Linux). The piece of code that kicks in is

coreDotARelPath, err := filepath.Rel(buildPath, coreArchiveFilePath)
if err != nil {
return i18n.WrapError(err)
}

For some reason ctx.BuildPath is still relative in that snippet; I'll take a look tomorrow to understand what is happening 🙂

facchinm added a commit to facchinm/arduino-builder that referenced this issue Nov 21, 2018
@facchinm
Copy link
Member

@luni64 I just pushed a test PR here #308 , as soon as the binary is ready it would be cool if you could test it in your environment!

@luni64
Copy link

luni64 commented Nov 21, 2018

Sure, I'll test it as soon as it is available

@luni64
Copy link

luni64 commented Nov 21, 2018

That didn't work, refuses to compile at all now. Here the log:

> Executing task: & 'C:/Program Files/arduino-1.8.5/arduino-builder' -verbose=1 -logger=human '-hardware= C:\Program Files\arduino-1.8.5\hardware' -build-path=bin '-tools=C:\Program Files\arduino-1.8.5\tools-builder' '-tools=C:\Program Files\arduino-1.8.5\hardware\tools\avr' -fqbn=teensy:avr:teensy31:usb=serial,speed=96,opt=o2std,keys=en-us src\main.cpp <

FindFirstFile C:\Users\lutz\source\newProject(1)\ C:\Program Files\arduino-1.8.5\hardware: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
The terminal process terminated with exit code: 1

@facchinm
Copy link
Member

@luni64 there's a space between -hardware= and the actual path; I think one of the patches we merged for the commandline (removing the ', ' as separator) made the builder become a bit more picky. May you retest without the space? Thanks!

@luni64
Copy link

luni64 commented Nov 22, 2018

Thanks, that fixed it. Works perfectly now.

@facchinm
Copy link
Member

@luni64 if you could retest the same PR, I changed the place where the fix is applied, there should be no regression but it's better to check before confirming that it works fine 🙂

@luni64
Copy link

luni64 commented Nov 22, 2018

Thanks again,
just retested it, the new version works as well. I noticed that it generates an additional *.hex file with the BoardName in it? Is there any documentation on the name of the generated output? Looks like it generates

  1. sketchname + Extension + hex and
  2. sketchname + Extension + BoardID + hex.
    Can I rely on 1) ?

@facchinm
Copy link
Member

Super, thanks.
The extra hex is with_bootloader ? That thing is terribly broken right now, should be fixed by #295 .

Instead, if you refer to the real boardID (like uno or similar), that step is handled by the java IDE using "Sketch/Export compiled binary" menu, and the boardID follows board's variant (you can find this information in boards.txt for the given core).

@booniiiel
Copy link

hi, I got the similar problem My arduino IDE need to be closed and open again in order to upload the code to arduino uno. Before this, i had edited the path in preference, does it related?
The error I got:

Rel: can't make C:\Users\UserName\AppData\Local\Temp\arduino_cache_239826\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a relative to D:\Arduino\hex
Error compiling for board Arduino/Genuino Uno.

@facchinm
Copy link
Member

Yes, they are related; the build folder should be in the same partition of the IDE installation. It is a windows specific problem 😞 We must shorten the commandline and paths because of other win limitations, and we achieve this by making paths relative.
But on win, two paths on different partitions can't be relative.

I'd suggest to avoid moving the default build folder and use "Sketch/Export Compiled Binary" menu in case you need to save the final hex.

@booniiiel
Copy link

Yes, they are related; the build folder should be in the same partition of the IDE installation. It is a windows specific problem 😞 We must shorten the commandline and paths because of other win limitations, and we achieve this by making paths relative.
But on win, two paths on different partitions can't be relative.

I'd suggest to avoid moving the default build folder and use "Sketch/Export Compiled Binary" menu in case you need to save the final hex.

i see.. so in order to get the arduino back to normal, i need to delete the build path that i created?

@facchinm
Copy link
Member

Just remove build.path entry in preferences.txt . This will tell the IDE to automatically create a correct temporary build directory in the "right" path.

@booniiiel
Copy link

Thank you! I got it back to normal 😊

@facchinm
Copy link
Member

facchinm commented Jan 3, 2019

Closing as fixed

@facchinm facchinm closed this as completed Jan 3, 2019
@rsora rsora added the status: waiting for information More information must be provided before work can proceed label Sep 22, 2021
@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself and removed status: waiting for information More information must be provided before work can proceed labels Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself
Projects
None yet
Development

No branches or pull requests

7 participants