Multiple License Files

4 views
Skip to first unread message

Rob Groner

unread,
Apr 29, 2021, 3:10:36 PM4/29/21
to Spack
Spack does a pretty good job with the license files, allowing us to keep them all stored under a  central directory.  Very nice.  However, I have a situation I haven't had before and I can't seem to find a way to make it work within Spack.

An app we use has decided to change its license file format with the latest release.  Since we try to keep 2 versions of any particular app on the system, that means we have 2 different license files to keep track of.  The license files are different in name and format.

If there were some way to define "license_files" per version in the package.py, I think that would work.  But I can't see how to do that.  I tried changing the value of "license_files" in the install() function depending on the version, but apparently the value for global_license_file had already been set.  And I can't change the value of global_license_file (it's an attribute)

The description online for license_files is that it's a list of strings that the software searches for when looking for a license.  I'm not entirely sure what that means...which software, spack or the app being installed??  I figured I would just put both licenses in license_files and have spack install/symlink them both....since each version of the app is only going to use the license it expects and will leave the other license file alone.  However, when Spack created the links from the values in license_files to the global_license_file....they were all pointing to the same file.  Looking in the package.py:global_license_file() method, sure enough, it just takes the value of the first entry in license_files.

So I can't quite figure out how you would ever use the list of strings in license_files.  Clearly it's not for designating multiple license files, as they all get symlinked to a single "global_license_file".

Are there any suggestions for how I can designate that myapp@8.5 uses one license file, and myapp@8.8 uses another?

Thanks.

Gamblin, Todd

unread,
May 5, 2021, 4:54:41 AM5/5/21
to Rob Groner, Spack
One thing to try is something like:

@property
def license_files(self):
return “foo” if self.spec.satisfies(“@:8.5”) else “bar"

I am not 100% sure this covers all the places where license_files is used but I think it might.

-Todd


--
You received this message because you are subscribed to the Google Groups "Spack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spack+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spack/8f5ce8fb-d1e0-41af-ab45-21c266fe3df5n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages