Jump to content

VI Package Builder reports "friends" (community scope) as missing


Recommended Posts

With the latest version of VIPM (2021.0 build 2696), the VI Package Builder reports friends of a library as missing even though those friends are not used in the code that's built.

Quote

"Friend libraries are allowed to access community scoped members of the class that's being built. However, the class being built does not actually depend on these friends -- actually, it's the other way around." (Jim)

In the small example I attached, I created a class "TheClass.lvclass" which has one method "SomeSharedFeature.vi" which is set to community scope. Another class "TheFriend.lvclass" uses this method, and is therefor defined as friend in "TheClass". All the LabVIEW files are located in the /source folder.

I created a source distribution to export "TheClass" to another place, a folder named /build (mainly because the original project where this error occurred does the same). 

When I use "community-scope.vipb" to build a package, everything works as expected. But when I remove or rename the location of "TheFriend" (eg rename /source to /___source),  then VI Package Builder complains about missing files:

scope.png

 

 

community-scope.zip

  • Like 1
Link to comment
Share on other sites

Thanks for taking time to post a good example. We did tighten some things up in 2021 that now results in VIPM finding some dependencies that it were not previously found — specifically, 2020 and earlier would not find dependencies inside of broken VI‘s, disable structures, or code that gets compiled out. However, it appears that we are now pulling in these edit-time Friend classes that aren’t really dependencies. Will take a look and see how we can address is. Thanks.

  • Like 1
Link to comment
Share on other sites

I just checked the code and, indeed, it was this change (to included Edit Time Dependencies) that caused the friend class to get identified as a dependency.

I think there's a possible solution -- when reading the linker info one can pass an Exclude Edit Time Dependencies.  When this is set to TRUE, then Friend classes are not included in the linker info. I think this will work, since I just confirmed that Parent classes are returned in the linker info, regardless of whether one sets Exclude Edit Time Dependencies to TRUE or FALSE, so I think one can effectively determine a Friend relationship by getting the linker info twice (once with the flag set to TRUE and once with it set to FALSE) to determine if the Edit Time Dependency lvclass is a friend or a parent.  I can't think, off hand, of any other types of lvclass relationships that would show up in the linker info of an lvclass other than Parent and Friend.  Can you?

PS - The example you submitted didn't have a .dragon file in it ;)

image.png

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.