LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Source code control question

Hi guys,

 

I'm not entirely sure where I should pose this question, but I've got a quick question about how to do source code control when developing multiple libraries. 

 

Lets say I develop many libraries, and incorporate these in many projects. All libraries and projects are git repoed. 

 

Normally in my project folders, I just reference the library. That way whenever I open my project, it automatically pull in the newest version of the library. My question is when I don't want to do that, and I want to "freeze" a library on an older version and only include that version of the library in my main project. (This is to maintain stability of the library.) Is the correct way to that to duplicate the library files into the directory of the project, and then just include that frozen copy of the library into the source control of the project?

 

Not really sure what's best practice here. Occasionally I have a need to be able to open up a previous version of the source files, and edit an old version without pulling in all the newest versions of the associated libraries.

 

Thanks for any help,

 

-Wavepacket


------------------------------------------------------------------------------------

Please join the conversation to keep LabVIEW relevant for future engineers. Price hikes plus SaaS model has many current engineers seriously concerned...

Read the Conversation Here, LabVIEW-subscription-model-for-2022
0 Kudos
Message 1 of 19
(1,890 Views)

I think the real solution is to make distributions of libraries so your code can reference the version it needs.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 19
(1,867 Views)

100% agree with Bill.

 

VI Packages used to be the cool thing (well, I still use them) to create versioned components for the development environment. Typically I'd put common components like this into their own repo, so that they can be developed and versioned discretely. Then, when I need use of one, I'd copy the package into a "Dependencies" folder in my project so other devs know which version the source requires (along with documentation stating that, of course).

 

You can do similar things with NI Package Manager but my experience with it is a lot less. 

Message 3 of 19
(1,860 Views)

My solution is to have a project for my reuse libraries and I build them into Packed Project Libraries (PPLs).  I then copy the PPLs into the projects that need them.

 

I know others who would use subprojects in GIT.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 19
(1,850 Views)

I would keep each library in a folder of it's own and use GIT to freeze that folder to a specific ID or label. If you need to use an old one you can easily do a Switch and update to change the code version.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 19
(1,817 Views)

VIPM is another way to make versioned distributions of your libraries, it also can put them into the palettes for easier use. Unfortunately a lot of the really cool stuff requires the paid version of VIPM, but the free features are certainly enough to get a decent toolkit made. Spend some time learning how to make packages in VIPM and you'll be glad you did:

Spoiler
FireFistRedhawk_1-1630496741085.pngFireFistRedhawk_0-1630497038506.png

 


FireFistRedhawk_1-1630497053766.png

 


 


 

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 6 of 19
(1,811 Views)

@billko wrote:

I think the real solution is to make distributions of libraries so your code can reference the version it needs.


I'm still learning. Is "source distribution" (link here) what you are referencing? 


------------------------------------------------------------------------------------

Please join the conversation to keep LabVIEW relevant for future engineers. Price hikes plus SaaS model has many current engineers seriously concerned...

Read the Conversation Here, LabVIEW-subscription-model-for-2022
0 Kudos
Message 7 of 19
(1,795 Views)

@crossrulz wrote:

My solution is to have a project for my reuse libraries and I build them into Packed Project Libraries (PPLs).  I then copy the PPLs into the projects that need them.

 

I know others who would use subprojects in GIT.


So I was reading about this yesterday, and crept across an apparent issue that PPLs can't include malleable vis? Is that true? Some of my general purpose libraries have .vims, so my understanding right now is that I can't act on my need with PPLs. Maybe my understanding of PPLs isn't right though...


------------------------------------------------------------------------------------

Please join the conversation to keep LabVIEW relevant for future engineers. Price hikes plus SaaS model has many current engineers seriously concerned...

Read the Conversation Here, LabVIEW-subscription-model-for-2022
0 Kudos
Message 8 of 19
(1,792 Views)

@WavePacket wrote:

@crossrulz wrote:

My solution is to have a project for my reuse libraries and I build them into Packed Project Libraries (PPLs).  I then copy the PPLs into the projects that need them.

 

I know others who would use subprojects in GIT.


So I was reading about this yesterday, and crept across an apparent issue that PPLs can't include malleable vis? Is that true? Some of my general purpose libraries have .vims, so my understanding right now is that I can't act on my need with PPLs. Maybe my understanding of PPLs isn't right though...


I think the issue was that the top VI couldn't include it, but it's easy enough to try and build one. 🙂 VIM's are 'new' by LV standard, so somehow that test wasn't included in the verification process, it seems.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 19
(1,786 Views)

@Yamaeda wrote:

I would keep each library in a folder of it's own and use GIT to freeze that folder to a specific ID or label. If you need to use an old one you can easily do a Switch and update to change the code version.


I'm thinking though the mechanics of this suggestion.

 

Let's say I've got project P which includes library L. P & L are in separate repos. My workflow is often that I'm simultaneously working on many projects, and L, somewhat organically. Occasionally P gets to a specific version (let's label this version p_lts) which is released as a long term support, and it requires a specific version of L (labeled l_lts). P & L then progress organically to newer versions.

 

So someday I'll need to edit p_lts and l_lts even though they aren't the most recent versions. If P & L are separate git repos, then if I rollback P to p_lts, there isn't a "built" in tool which will recall L to l_lts.

 

Do I separately maintain that record (word doc, for example) of what version to rollback L too? 


------------------------------------------------------------------------------------

Please join the conversation to keep LabVIEW relevant for future engineers. Price hikes plus SaaS model has many current engineers seriously concerned...

Read the Conversation Here, LabVIEW-subscription-model-for-2022
0 Kudos
Message 10 of 19
(1,781 Views)