You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will start by explaining the behavior of the various components, and how they work together. I will then propose an adjustment to how we do things.
Our fetch_remote_version override
The fetch_remote_version method is used by Spack to get the list of available versions when invoking spack checksum <package>. The package_base class provides a default implementation, but we often override it with an implementation that fetches versions directly from self.list_url (with a bit of filtering).
list_url
list_url is an attribute that Spack uses in its own implementation of fetch_remove_version to expand the set of URLs to search for versions. When we provide our own fetch_remote_version method, Spack no longer directly uses list_url for anything (as far as I can tell).
url
By default, Spack uses the version pattern specified in url to determine how it should look for versions in the various URLs it spiders. For example, a specification of:
tells Spack to search for versions of the form vX_YY_ZZ in not only the URL as specified on the line, but the list_url as well, and any directories the spidering mechanism can access (including subdirectories of the landing page).
Of course, since we often provide explicit url_for_version and fetch_remote_version overrides, the url is likely only used when printing package information via spack info <package>.
Problems with our current mechanism:
Incurred technical debt using our own implementation(s) of fetch_remote_version
The output from a list_url of (e.g.) https://api.github.com/repos/NuSoftHEP/nutools/tags is paginated, keeping only 30 versions unless the ?per_page=<some number bigger than 30> suffix is added to the URL.
where version_patterns follows the following convention:
All versions from 3.15.04 up to (but excluding) 3.16.03 have a tarball version string of the form .../vX_YY_ZZ.tar.gz
All versions from 3.16.03 and above have a tarball version string of the form .../X.YY.ZZ.tar.gz
The class FnalGithubPackage is a mixin class provided through the fnal-github-package Spack package from the fnal_art repository. Under the covers, FnalGitHubPackage, provides urls and list_url attributes as well as a homepage attribute if one is not already provided by the package itself.
Consequences of this suggestion
No more custom implementations of fetch_remote_version.
Versions following the pattern vX_YY_ZZ will no longer be automatically listed during spack checksum <package>, but if a particular version is desired spack checksum <package> <version> with an explicit version will still work due to the url_for_version definition. I think this is okay because going forward, we are getting away from the UPS-style version strings.
If this suggestion is approved, tags will need to be generated that follow the dot-delimited pattern, and not the UPS-style one. We've started to do this with the nutools packages (and perhaps others).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have many package recipes that contain blurbs like:
I will start by explaining the behavior of the various components, and how they work together. I will then propose an adjustment to how we do things.
Our
fetch_remote_versionoverrideThe
fetch_remote_versionmethod is used by Spack to get the list of available versions when invokingspack checksum <package>. Thepackage_baseclass provides a default implementation, but we often override it with an implementation that fetches versions directly fromself.list_url(with a bit of filtering).list_urllist_urlis an attribute that Spack uses in its own implementation offetch_remove_versionto expand the set of URLs to search for versions. When we provide our ownfetch_remote_versionmethod, Spack no longer directly useslist_urlfor anything (as far as I can tell).urlBy default, Spack uses the version pattern specified in
urlto determine how it should look for versions in the various URLs it spiders. For example, a specification of:tells Spack to search for versions of the form
vX_YY_ZZin not only the URL as specified on the line, but thelist_urlas well, and any directories the spidering mechanism can access (including subdirectories of the landing page).Of course, since we often provide explicit
url_for_versionandfetch_remote_versionoverrides, theurlis likely only used when printing package information viaspack info <package>.Problems with our current mechanism:
fetch_remote_versionlist_urlof (e.g.) https://api.github.com/repos/NuSoftHEP/nutools/tags is paginated, keeping only 30 versions unless the?per_page=<some number bigger than 30>suffix is added to the URL.The suggestion
The above blurb should be replaced with:
where
version_patternsfollows the following convention:3.15.04up to (but excluding)3.16.03have a tarball version string of the form.../vX_YY_ZZ.tar.gz3.16.03and above have a tarball version string of the form.../X.YY.ZZ.tar.gzThe class
FnalGithubPackageis a mixin class provided through thefnal-github-packageSpack package from thefnal_artrepository. Under the covers,FnalGitHubPackage, providesurlsandlist_urlattributes as well as ahomepageattribute if one is not already provided by the package itself.Consequences of this suggestion
fetch_remote_version.X.YY.ZZwill automatically be recognized from https://github.com/NuSoftHEP/nutools/tags.vX_YY_ZZwill no longer be automatically listed duringspack checksum <package>, but if a particular version is desiredspack checksum <package> <version>with an explicit version will still work due to theurl_for_versiondefinition. I think this is okay because going forward, we are getting away from the UPS-style version strings.If this suggestion is approved, tags will need to be generated that follow the dot-delimited pattern, and not the UPS-style one. We've started to do this with the nutools packages (and perhaps others).
Beta Was this translation helpful? Give feedback.
All reactions