Conversation
e6661ec to
d68818c
Compare
scheibelp
left a comment
There was a problem hiding this comment.
Let me know if you disagree with the suggestions.
| patch('pkgconfig.patch', when='@:3.3.2') | ||
|
|
||
| def fetch_remote_versions(self): | ||
| """fix for https://github.com/LLNL/spack/issues/5356""" |
There was a problem hiding this comment.
IMO a description of the issue would be good here vs. a link.
There was a problem hiding this comment.
all right, will do!
the idea of the link was just: in case we improve upon the situation generally, the link can be grep-ed and updated.
| def fetch_remote_versions(self): | ||
| """fix for https://github.com/LLNL/spack/issues/5356""" | ||
| return dict(map(lambda u: | ||
| (u, self.url_for_version(Version(u))), |
There was a problem hiding this comment.
This constrains the function to checksum only existing versions in this package. IMO it would be better to call:
spack.util.web.find_versions_of_archive([], list_url...)
Or at least I think it will work if archive_urls is an empty list. Then this function should be able to automatically find new releases.
There was a problem hiding this comment.
thx for the idea, I tried to test that but it did not find version for me.
can you give me a more explicit example, please? I actually wanted to avoid the scraper in find_versions_of_archive since it is:
- not deterministic
- pics a random release if several are found for a version (which will randomly break the hash)
There was a problem hiding this comment.
ah I think I managed, will push an update! :)
| (u, self.url_for_version(Version(u))), | ||
| self.versions)) | ||
|
|
||
| def url_for_version(self, version): |
There was a problem hiding this comment.
Is this strictly required if the fetch_remote_versions function is overridden? The definition in Package appears to do a direct replacement vs. searching for a releases/ directory.
There was a problem hiding this comment.
since I do need that functionality in the member function above, and it's exactly what url_for_version would do I think it's useful to keep it in a separate call, no?
d68818c to
d24e7ad
Compare
|
@scheibelp what do you think of the changes? :) |
| """Ignore additional source artifacts uploaded with releases, | ||
| only keep known versions | ||
| fix for https://github.com/LLNL/spack/issues/5356""" | ||
| return dict(map(lambda u: |
There was a problem hiding this comment.
Although flake is OK with this, IMO it could be more-clearly formatted:
return dict(map(
lambda u: (u, self.url_for_version(u)),
spack.util.web.find_versions_of_archive(
self.all_urls, self.list_url, self.list_depth)
))
Other than that your changes LGTM. No need to fight flake though if it's hard to format it in a matter that flake accepts. I'll get another chance to check this in a few hours. If you think the formatting is fine let me know.
There was a problem hiding this comment.
no problem, will adjust to your recommended line-breaking
d24e7ad to
1ea170a
Compare
|
LGTM, I'll merge this when the tests pass. There seems to be a slowdown on travis at the moment, in particular with the mac builds, so I don't think this will happen today. |
|
@scheibelp all tests passed but code coverage fails in one (I don't know why) |
|
Sorry I was looking over this again and I noticed the following conversation at #5373 (comment):
What I meant there was: I think your implementation of Does that make sense? Or do you feel it is clearer to still override |
|
@ax3l BTW the test coverage is not an issue for me (and I think it's confused) but I do think |
GitHub releases with additional `.tar.gz` source archive uploads to their actual tag tend to return random selections of which archive shall be taken. This fixes it for protobuf with a rather deep hack. Before: ``` $ spack checksum protobuf ==> Found 10 versions of protobuf: 3.4.1 https://github.com/google/protobuf/archive/v3.4.1.tar.gz 3.4.0rc3 https://github.com/google/protobuf/archive/v3.4.0rc3.tar.gz 3.4.0rc2 https://github.com/google/protobuf/archive/v3.4.0rc2.tar.gz 3.4.0rc1 https://github.com/google/protobuf/archive/v3.4.0rc1.tar.gz 3.4.0 https://github.com/google/protobuf/releases/download/v3.4.0/protobuf-ruby-3.4.0.tar.gz 3.3.2 https://github.com/google/protobuf/archive/v3.3.2.tar.gz 3.3.1 https://github.com/google/protobuf/archive/v3.3.1.tar.gz 3.3.0rc1 https://github.com/google/protobuf/archive/v3.3.0rc1.tar.gz 3.3.0 https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-ruby-3.3.0.tar.gz 3.2.1 https://github.com/google/protobuf/archive/v3.2.1.tar.gz ``` Now: ``` $ spack checksum protobuf ==> Found 4 versions of protobuf: 3.4.0 https://github.com/google/protobuf/archive/v3.4.0.tar.gz 3.3.0 https://github.com/google/protobuf/archive/v3.3.0.tar.gz 3.2.0 https://github.com/google/protobuf/archive/v3.2.0.tar.gz 3.1.0 https://github.com/google/protobuf/archive/v3.1.0.tar.gz 3.0.2 https://github.com/google/protobuf/archive/v3.0.2.tar.gz ```
Add review comments. Allows to automatically fetch new versions again and still only keeps the original source of the tag instead of chosing additional `.tar.gz` artifacts that come with the release.
not needed to overwrite
1ea170a to
2627708
Compare
|
@scheibelp you are right, I do not need to overwrite the |
|
Thanks! |
GitHub releases with additional
.tar.gzsource archive uploads to their actual tag tend to return random selections of which archive shall be taken. Related to #5356This fixes it for protobuf with a hack to prioritize GitHub Source Archives over additional release artifacts. The interesting observation is also, that the pick from the
list_urlis also not deterministic.I would propose to rewrite
lib/spack/spack/util/webto use for pages, links and versions an ordered dict to get at least determinism into the version url fetching.Before (note the wrong pick in the
3.3.0&3.4.0release!):Now: