Skip to content

Absolute paths in .project file prevent sharing of Arduino projects #34

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
neuweiler opened this issue Aug 11, 2013 · 20 comments
Closed

Comments

@neuweiler
Copy link
Contributor

When more than one developer is working on a project (e.g. like on https://github.com/neuweiler/GEVCU ) some path variables are stored in the .project file which usually could be shared in a repository. Although one sets the arduino paths in global preferences, they are stored in the .project file and not in the workspace settings:

Here's an excerpt of my .project file:

<variableList>
<variable>
<name>ArduinoHardwareLibPath</name>
<value>file:/Z:/development/arduino/arduino-1.5.2/hardware/arduino/sam/libraries</value>
</variable>
<variable>
<name>ArduinoPinPath</name>
<value>file:/Z:/development/arduino/arduino-1.5.2/hardware/arduino/sam/variants</value>
</variable>
<variable>
<name>ArduinoPlatformPath</name>
<value>file:/Z:/development/arduino/arduino-1.5.2/hardware/arduino/sam</value>
</variable>
</variableList>

Is it possible to move these to another location so the .project file can be shared on different platforms like it is the case with standard eclipse projects?

@jantje
Copy link
Member

jantje commented Aug 11, 2013

I haven't considered multi user yet for the plugin. Not sure how I could handle this as well.
I'll consider this as a potential improvement.
Jantje

@neuweiler
Copy link
Contributor Author

Sure, would be a valuable benefit. Maybe you could solve it by using
global variables.
I think there must be a way to store these settings in the .settings
folder / standard workspace preferences.
Michael

On 11.08.2013 14:55, jantje wrote:

I haven't considered multi user yet for the plugin. Not sure how I
could handle this as well.
I'll consider this as a potential improvement.
Jantje


Reply to this email directly or view it on GitHub
#34 (comment).

@neuweiler
Copy link
Contributor Author

Wait, there may be a solution to this:

The following variables are defined in the .project file. But they all
start with the installation path of the Arduino IDE which is already
specified in the preferences. Would it be possible to concatenate the
paths on the fly by using the preferences path and the respective
hardware sub-directory instead of defining the project variables?

 <variableList>
     <variable>
         <name>ArduinoHardwareLibPath</name>

file:/Z:/development/arduino/arduino-1.5.2/hardware/arduino/sam/libraries


ArduinoPinPath
file:/Z:/development/arduino/arduino-1.5.2/hardware/arduino/sam/variants


ArduinoPlatformPath
file:/Z:/development/arduino/arduino-1.5.2/hardware/arduino/sam

We need a fix for this quite urgently in a multi-user environment.
Otherwise we'll loose the fight to Visual Studio.

Michael

On 11.08.2013 14:55, jantje wrote:

I haven't considered multi user yet for the plugin. Not sure how I
could handle this as well.
I'll consider this as a potential improvement.
Jantje


Reply to this email directly or view it on GitHub
#34 (comment).

@jantje
Copy link
Member

jantje commented Aug 19, 2013

Michael
These declarations are needed by eclipse for the linked paths. Basically these are the start of linked folders.
As each project can link to different locations the declarations must be at the project level and not at the workspace level. This is one of the major changes with Arduino IDE V1.5.x

I'm not sure how to understand your fight comment

@neuweiler
Copy link
Contributor Author

Jantje,

I think the solution would be to store the path variables of the linked
resources like this:

ArduinoHardwareLibPath = ${ArduinoPath}\hardware\arduinosam_\libraries
ArduinoPinPath = ${ArduinoPath}_\hardware\arduinosam_\variants
ArduinoPlatformPath = ${ArduinoPath}_\hardware\arduinosam

I've tested it manually and it works. The only problem: How to get the
"sam" or "avr" path parts ? But I think that should be solvable with
some parsing of the platform path.

The ArduinoPath is workspace dependant. But as long as you can't set the
arduino dev env path on a project level anyway but only via
window->preferences, I think this should suffice.

Michael

On 20.08.2013 00:53, jantje wrote:

Michael
These declarations are needed by eclipse for the linked paths.
Basically these are the start of linked folders.
As each project can link to different locations the declarations must
be at the project level and not at the workspace level. This is one of
the major changes with Arduino IDE V1.5.x

I'm not sure how to understand your fight comment


Reply to this email directly or view it on GitHub
#34 (comment).

@dniklaus
Copy link

Would be very nice if this issue could be addressed soon!

Dieter

@jantje
Copy link
Member

jantje commented Mar 28, 2014

Dieter
I discussed this issue lately with Michael and he didn't see this as an issue anymore.
What is your pain?

@dniklaus
Copy link

dniklaus commented Apr 1, 2014

Hi Jan

Many thanks for writing me!
We are a few SW developers of a Swiss IT Consulting company, organized as a
volunteers community, creating embedded SW running on Arduino. It's mostly
about education and also for fun. The current project is a 3wheel robot
control SW, hosted on https://gitorious.org/lintilla/lintilla-embedded.

If you'd like to clone it, to see what we're doing, create an account on
gitorious.org and send me your user name, I'll add you as a contributor.

We are using your EclipseArduino bundle (
http://www.baeyens.it/eclipse/download/product/V2.2_win32.2014-01-19_15-16-30.tar.gzz),
which works very well. Thank you for this great job!

I'm struggling with the absolute path setting for the Arduino IDE and also
with the fact, that the project must be always cloned into the same path
(C:\git\erni\lintilla-embedded).

Furthermore, if a developer is using Linux, the hassle with the paths gets
to the next level... ;-)

Well, all in all, these are not killer issues, but there is always some
interaction needed, after cloning the project.

Best regards,

Didi Niklaus

Am 28.03.2014 20:17 schrieb "jantje" [email protected]:

Dieter
I discussed this issue lately with Michael and he didn't see this as an
issue anymore.
What is your pain?

Reply to this email directly or view it on GitHubhttps://github.com//issues/34#issuecomment-38957859
.

@jantje
Copy link
Member

jantje commented Apr 1, 2014

This is how Michael told me he worked around the problem:

The issue is not fixed in itself but we've found a viable workaround to it:
.project is in .gitignore
a file .project.copy needs to be copied manually to .project the first time
selecting the project's properties and re-selecting the board/com port, results in the absolute paths being replaced with the correct ones.

So it's not perfect yet but we can live with it so well that I foregot about it.

I hope this works for you to.

@jantje
Copy link
Member

jantje commented Apr 10, 2014

As I couldn't sleep I fixed this one. Can you give it a test?
You''l have to wait 24 hours for the next build to update the nightly update site or the product site.

@jantje
Copy link
Member

jantje commented Apr 15, 2014

Seems I'm not case sensetive enough ;-)
Should be build tonight.

@jantje jantje closed this as completed Apr 20, 2014
jantje added a commit that referenced this issue Jul 1, 2014
…ath is set with the resource link and that fails. Replaced the defenition of the env var with the fqn
jantje added a commit that referenced this issue Jul 1, 2014
This should be fixed properly one day but as I don't own a mac ...
@jantje jantje reopened this Jul 3, 2014
@jantje
Copy link
Member

jantje commented Jul 3, 2014

I had to revert to the original code as there were plenty of issues

amorellgarcia pushed a commit to amorellgarcia/arduino-eclipse-plugin that referenced this issue Jul 10, 2014
…riant_path is set with the resource link and that fails. Replaced the defenition of the env var with the fqn
amorellgarcia pushed a commit to amorellgarcia/arduino-eclipse-plugin that referenced this issue Jul 10, 2014
This should be fixed properly one day but as I don't own a mac ...
@jantje jantje added the status: no good solution found (yet) We don't know how to fix this. label Jun 27, 2015
@jantje jantje added the status: workaround documented A workaround has been confirmed to solve this issue. label Dec 17, 2015
@jantje
Copy link
Member

jantje commented Jan 6, 2016

I think I found a solution to this. :-)

With the new Arduino IDE less plugin I no longer use the linked resources but link directly to the actual path on the system.
This is a real problem for version control because now all disk locations used must be on the same location for all users of a shared project (due to this info being in the .project file).
To avoid this I was thinking: If one would create workspace linked resources the plugin could look for the "most matching linked resource" If none is found there will be a full path link
If one is found the link is made starting from the most matching workspace level linked resource.

That means that as a project you can decide on the number, names, locations of the "workspace level linked resources" and any project member can have them on a different location.
So you guys don't need me :-)

The only part I expect to have to change for this to work is:
https://github.com/jantje/arduino-eclipse-plugin/blob/bigChange/it.baeyens.arduino.core/src/it/baeyens/arduino/tools/ArduinoHelpers.java#L247

If you look at the "old" implementation it should be pretty clear what needs to be done.
https://github.com/jantje/arduino-eclipse-plugin/blob/master/it.baeyens.arduino.core/src/it/baeyens/arduino/tools/ArduinoHelpers.java#L244

Input is welcomed.

@jantje
Copy link
Member

jantje commented Nov 13, 2016

I just fixed #463 and I think this fixes this problem as well.
Because you can add path variables at the workspace level (in windows->preferences->general->workspace->linked resources) and these will be used to replace the start of locations stored in .project files you can easily reference completely different locations (even different OS'es). For instance I created a GIT reference to point to the root of my GIT repositories and a TEENSY to point to my teensy install.
If I share this project including the .project file and someone clones the repository and pits GIT and TEENSY to the respective locations on his system then he can use the project without any further changes.

@olowo726
Copy link

Running 4.0 I found two issues in .settings/org.eclipse.cdt.core.prefs with prevented me from sharing projects.

  1. Sometimes the absolute path to eclipse installation is used instead of eclipse variable. For example
    ....A.RECIPE.C.COMBINE.PATTERN.1/value="C:\eclipse\/arduinoPlugin.... should be
    ....A.RECIPE.C.COMBINE.PATTERN.1/value="${eclipse_home}/arduinoPlugin.....
  2. Absolute path to products used in some cases. For example in A.RECIPE.C.COMBINE.PATTERN.1/value the absolute path to the map file is used. I replaced it with ${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.map and then we could share our projects.

@jantje
Copy link
Member

jantje commented Mar 21, 2017

The A.RECIPE.XXX.PATTERN.[number] are absolute on purpose.

@olowo726
Copy link

Why is that? The absolute paths to build products prevents us from having our project in different directories and the absolute path to the eclipse installations forces us to install eclipse in the same location on all machines (uniformity in the team is often a good thing but hard to enforce).

@jantje
Copy link
Member

jantje commented Mar 22, 2017

That is because of the parsing that needs to be done in expanded format. I've written a long explanation about this somewhere not so long ago but I can't remember where.

@jantje
Copy link
Member

jantje commented May 25, 2017

I think this issue is fixed if you create path variables for all locations used.

@jantje jantje added Status: waiting for confirmation fix works The nightly contains a fix but the fix has not yet been confirmed to work. and removed status: no good solution found (yet) We don't know how to fix this. labels May 25, 2017
@jantje jantje removed the Status: waiting for confirmation fix works The nightly contains a fix but the fix has not yet been confirmed to work. label Jul 8, 2017
@jantje
Copy link
Member

jantje commented Jul 8, 2017

I declare this issue fixed. Please reopen if not fixed.

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

No branches or pull requests

4 participants