-
Notifications
You must be signed in to change notification settings - Fork 1.9k
libsodium-recipe-update to url #3042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I can also make it backwards compatible for someone asking for older versions. Due to the way the url is formatted at the moment of the download it involved re-writing the url properties from the class within the LibsodiumRecipe subclass. It also involves a urllib request to the github api to build a dictionary with all the releases and their individual urls. If you would prefer that instead please advise and I will request a new pull or do a new commit over this one. I find it more future proof but it is a bit more intrusive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
Yeah having it backward compatible would be ideal indeed at least for a little while
@AndreMiras , figured out a way to make it backward compatible being minimally invasive to the super class. Tested it building with a specific version or just requiring libsodium, which will maintain the old behavior of using version 1.0.16. HTH! |
Last two commits were cosmetic updates. Feel free to merge after your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for giving a stab a it 🙏
I think a more appropriated approach would be to override the versioned_url()
property.
But now that I'm thinking why don't we simply assume the version can contain the suffix and call it a day?
For instance valid versions could be:
- 1.0.20-RELEASE
- 1.0.17-RELEASE
- 1.0.16
And the url
attribute would be:
url = 'https://github.com/jedisct1/libsodium/archive/refs/tags/{version}.tar.gz'
Note how the url
is constructed using the tags
rather than the releases
Hey @AndreMiras , tried messing with versioned_url and url but it felt like a band aid. No matter what you do there, there's still a hardcoded url format at the subclass attribute level that's poped into _url through the metaclass. Url and versioned_url indirectly call _url. Plus playing with the url property caused some recursion issues. IMHO the right place to make the url right is at the attribute level of the subclass. If not, any future changes to the recipe.py could have undesired effects. Regarding the simplification afterwards, I would be happy to push that instead. I don't think though someone building and specifying the requirements would know that they need to append '-RELEASE' to newer versions. The libsodium version is 1.0.18 not 1.0.18-RELEASE. But it is an option. E.g., Another good option could be something like this:
Let me know what you prefer and I shall push the commit! :) |
Another good option modifying the versioned_url property only and avoiding any changes in the subclass attributes. This way we do not touch the url property that causes all the recursion issues nor I check for env exports in the attributes.
|
Yes your second solution is what I meant by overriding the |
Hey @AndreMiras , just sent a last commit. Did not use the 'https://github.com/jedisct1/libsodium/archive/refs/tags/{version}.tar.gz' url as suggested as it results in build errors and the file downloaded is a different one (file name is the same but size is different). The url that was there in the first place seems like the right one. Did not use the https://download.libsodium.org/libsodium/releases/ either as all the old unsupported versions (like 1.0.16) are under a different folder too, so url consistency is also a problem. Let me know... |
Btw, I did try two builds, one with the default version and one with a newer version and both built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good thanks for the follow up and thank you for testing both locally.
I made a minor suggestion, let me know what you think.
Also if you know how to squash and rebase, give it a try, otherwise I can try to do it upon merge.
055a5fc
to
4aa4ba5
Compare
libsodium-recipe-update to url libsodium-recipe-update to url libsodium-recipe-update to url libsodium-recipe-update to url libsodium-recipe-update to url
4aa4ba5
to
3ae66d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good thank you, will merge after the CI is done
@AndreMiras , edited with the hardcoded line (good catch btw), added the commit and squashed all the commits. |
libsodium releases changed their url formatting since version 1.0.18.
Anyone trying to use newer versions of libsodium would receive the error ->
Suggest updating the url formatting to support newer versions and the default version to start at 1.0.18 instead of 1.0.16.
Background: encounter the above error trying to specify pynacl==1.5.0 as a requirement within my spec file. The apk compiled and was missing references from the libsodium libs upon execution. As I specified libsodium==1.0.18,pynacl==1.5.0 I saw the error.
PS (BACKWARDS COMPATIBILITY CAVEAT) -> anyone hardcoding as a requirement something lower than 1.0.18 (i.e., 1.0.16 or lower) would receive this error after this change. Using libsodium without any version specified would result in a successful download of 1.0.18.