LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
_carl

Support Relative Paths in Build Specs

Status: New

At present, build paths in build specs are stored as absolute paths, unless the path happens to be in the same folder as the project. Relative paths that are a level or more up from the project folder are not supported. Modifying the XML directly does not support relative paths either.

 

_carl_0-1711030809967.png

 

When working on multi-developer projects, where source control root folders may be different, this can be a serious annoyance.  One of the better workarounds at the moment is to build to a non-desired relative path (within the project folder) and then to run a post-build action to move the generated files to the desired location.

 

But it shouldn't have to be this way -- relative paths should just work.  (They are supported elsewhere in projects, such as with dependencies.)

 

(Note: this is the follow-up to a post on the LabVIEW forum about the same issue.)

11 Comments
wiebe@CARYA
Knight of NI

The default destination path is in fact relative, until you change it to something not relative. It (probably) stays relative as long as the roots are shared.

 

The problem (borderline bug) is, there's no way to make it relative again, at least not from within LabVIEW's IDE.

 

You can (I have) changed the path back to relative, by copying a new build spec's path (that is relative) in the .lvproj XML.

_carl
Member

@wiebe@CARYA,

 

I don't believe that's entirely true --- my experience (and that of others, per feedback in the post I linked), is that relative paths are only supported if they're within the same folder as the project.  If you want a relative path that is up a level or more from the project folder, then this is not supported -- and manually changing the XML to a relative path of this nature is not recognized by LabVIEW either.

wiebe@CARYA
Knight of NI

I think it's entirely true, depending on what you consider a relative path. 

 

According to the LabVIEW build spec, the relativity of the path stops at the root of the project. Maybe actually 1 level higher; I never build in my project directory and the paths are still relative. This might have changed between LV versions.

 

If you could go up further and stay relative, any\all paths on a volume would be relative (sharing the volume), an absolute path being a path sharing nothing, and if that was the case, it would simply work as expected.

 

So you could say there are a few related but separate issues (probably not a complete list):

1) LabVIEW doesn't need to turn a relative path into an absolute path like it does now

2) There's no way to see if the path is absolute or relative

3) There's no way to change an absolute path to relative, and vice versa (which could be convenient too)

_carl
Member

I'd add:

4) There's no way to provide a relative path that's more than a folder up from the project file.  Even if you provide it in the XML, LabVIEW chokes.

5) Inconsistent behavior between how relative paths are implemented in build specs and other project dependencies. Relative pathing (at more than one folder up) is supported elsewhere in projects.

wiebe@CARYA
Knight of NI

And it's very tricky to get it exactly right.

 

Things should be relative up from the project folder, not including the project folder.

 

DLL methods (VIs in a DLL build spec) for instance are stored relative to the project's folder (including the folder). If the repo is at the same level, it doesn't include this folder. Checking out the code in another folder silently removes all method, and you have to manually add them. Another casualty of relative path problems. 

raphschru
Active Participant

Actually the path stays relative as long as the destination directory is in the project folder (relative to "project") or one level higher (relative to "common").

 

Also if a path becomes absolute, you can make it relative again just by re-selecting a destination directory in the build spec properties (make sure it is at least relative to the "common" folder). Then validate and save the project. The changes should reflect on the XML and "Bld_localDestDir" should now be relative.

wiebe@CARYA
Knight of NI

>Also if a path becomes absolute, you can make it relative again just by re-selecting a destination directory in the build spec properties (make sure it is at least relative to the "common" folder). Then validate and save the project.

 

My experience is once it's absolute it never goes back. But this is one of those LabVIEW thinks you simply have to adapt to LabVIEW's way, or you'll drive yourself insane. So I haven't tested this in a few years (maybe even a decade).

 

What is "validate the project"? That could make the difference.

raphschru
Active Participant

 : > What is "validate the project"?

 

I meant press "OK" on the build spec properties dialog.

I have tested changing the destination folder back to relative and it works at least for LV2021.

wiebe@CARYA
Knight of NI

I might try it.

 

I'm in a yak shaving spurt anyway 😫.