Skip to content

Checksum match#28989

Merged
trws merged 7 commits intospack:developfrom
trws:checksum-match
Feb 23, 2022
Merged

Checksum match#28989
trws merged 7 commits intospack:developfrom
trws:checksum-match

Conversation

@trws
Copy link
Copy Markdown
Contributor

@trws trws commented Feb 16, 2022

This is a minimal change toward getting the right archive from places
like github in checksum and create. The heuristic is:

  • if an archive url exists, prefer it and take its version
    • if a reference package is available
      • generate a url from the package with pkg.url_from_version
      • if they match
        • stop considering other URLs for this version
        • otherwise, continue replacing the url for the version
    • otherwise use specified archive url list to generate a list of urls with
      substitute_version
      • if url matches one in the list, use it and don't re-assign it
  • if all else fails, just keep assigning over the url repeatedly like it used to

I doubt this will always work, but it should address a variety of
versions of this bug. A good test right now is spack checksum gh,
which checksums macos binaries without this, and the correct source
packages with it.

fixes #15985
fixes #14129
fixes #13940

@trws
Copy link
Copy Markdown
Contributor Author

trws commented Feb 16, 2022

@spackbot re-run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Feb 16, 2022

I've started that pipeline for you!

@trws trws requested a review from tldahlgren February 16, 2022 23:17
tldahlgren
tldahlgren previously approved these changes Feb 18, 2022
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I tested this on a number of packages using different url mechanisms and it provides the same outputs as the current processing on the system I usually use.

(It did alert me to a couple of packages with checksum issues for older versions (e.g., petsc, kafka). Not sure if it is worth correcting those older package versions.)

@tldahlgren
Copy link
Copy Markdown
Contributor

Deferring merge in case @adamjstewart wants to weigh in as well.

Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this fix #14129? Would adding a url_for_version to that specific package fix it?

@trws
Copy link
Copy Markdown
Contributor Author

trws commented Feb 18, 2022

It actually does fix that one also, I made a mistake when testing it, will fix the top post to close on merge.

adamjstewart
adamjstewart previously approved these changes Feb 18, 2022
@trws
Copy link
Copy Markdown
Contributor Author

trws commented Feb 18, 2022

Seems the doc update broke the sphinx build. It's fixed and passing now but dismissed your review @adamjstewart.

adamjstewart
adamjstewart previously approved these changes Feb 19, 2022
@trws
Copy link
Copy Markdown
Contributor Author

trws commented Feb 20, 2022

@spackbot re-run pipeline

@trws
Copy link
Copy Markdown
Contributor Author

trws commented Feb 22, 2022

@spackbot re-run pipeline

sigh

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Feb 22, 2022

I've started that pipeline for you!

trws and others added 7 commits February 22, 2022 15:51
This is a minimal change toward getting the right archive from places
like github.  The heuristic is:

* if an archive url exists, take its version
* generate a url from the package with pkg.url_from_version
* if they match
  * stop considering other URLs for this version
  * otherwise, continue replacing the url for the version

I doubt this will always work, but it should address a variety of
versions of this bug.  A good test right now is `spack checksum gh`,
which checksums macos binaries without this, and the correct source
packages with it.

fixes spack#15985
related to spack#14129
related to spack#13940
Since create can't rely on an existing package, this commit adds another
pair of heuristics:
1. if the current version is a specifically listed archive, don't
   replace it
2. if the current url matches the result of applying
   `spack.url.substitute_version(a, ver)` for any a in archive_urls,
   prefer it and don't replace it

fixes spack#13940
@trws
Copy link
Copy Markdown
Contributor Author

trws commented Feb 22, 2022

Rebase to get a version where the e4s setup can build. Sorry to do this again @adamjstewart, but could you re-approve?

@trws trws enabled auto-merge (squash) February 23, 2022 00:33
@trws trws merged commit a9ba401 into spack:develop Feb 23, 2022
bvanessen pushed a commit to bvanessen/spack that referenced this pull request Mar 2, 2022
* cmd/checksum: prefer url matching url_from_version

This is a minimal change toward getting the right archive from places
like github.  The heuristic is:

* if an archive url exists, take its version
* generate a url from the package with pkg.url_from_version
* if they match
  * stop considering other URLs for this version
  * otherwise, continue replacing the url for the version

I doubt this will always work, but it should address a variety of
versions of this bug.  A good test right now is `spack checksum gh`,
which checksums macos binaries without this, and the correct source
packages with it.

fixes spack#15985
related to spack#14129
related to spack#13940

* add heuristics to help create as well

Since create can't rely on an existing package, this commit adds another
pair of heuristics:
1. if the current version is a specifically listed archive, don't
   replace it
2. if the current url matches the result of applying
   `spack.url.substitute_version(a, ver)` for any a in archive_urls,
   prefer it and don't replace it

fixes spack#13940

* clean up style and a lingering debug import

* ok flake8, you got me

* document reference_package argument

* Update lib/spack/spack/util/web.py

Co-authored-by: Adam J. Stewart <[email protected]>

* try to appease sphinx

Co-authored-by: Adam J. Stewart <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants