buildcache: skip unrecognized metadata files#40941
Conversation
|
fyi @kwryankrattiger |
ee6fad6 to
934b4b7
Compare
934b4b7 to
5ea0da6
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@scottwittenburg given the lack of time I took over your PR instead of reviewing it. |
alalazo
left a comment
There was a problem hiding this comment.
I didn't test this extensively, but from a first read it seems fine. I just left a few comments that, in case, can be addressed in a later PR.
|
|
||
| # Ensure this version is not too new. | ||
| try: | ||
| layout_version = int(spec_dict.get("buildcache_layout_version", 0)) |
There was a problem hiding this comment.
(Not a request, just a comment) Do we have any formal specification (a schema?) of what a spec_dict looks like?
There was a problem hiding this comment.
I believe there was, but pretty sure it's unused or outdated
| _get_valid_spec_file( | ||
| local_specfile_stage.save_filename, | ||
| CURRENT_BUILD_CACHE_LAYOUT_VERSION, | ||
| ) |
There was a problem hiding this comment.
(Just a comment) Wondering if we can turn this double nested try/except into a context manager
|
|
||
| def build_cache_relative_path(): | ||
| return _build_cache_relative_path | ||
| return BUILD_CACHE_RELATIVE_PATH |
There was a problem hiding this comment.
(minor) This function and the one below are probably unnecessary
| else: | ||
| raise ValueError("{0} not a valid spec file type".format(spec_file)) | ||
| spec_dict["buildcache_layout_version"] = 1 | ||
| spec_dict["buildcache_layout_version"] = CURRENT_BUILD_CACHE_LAYOUT_VERSION |
There was a problem hiding this comment.
(Minor) We should probably decide whether it's buildcache or build_cache
| shutil.rmtree(tmpdir) | ||
| raise e | ||
| else: | ||
| elif layout_version == 1: |
There was a problem hiding this comment.
Do we need an else case here for unknown layouts?
This commit improves forward compatibility of Spack with newer build cache metadata formats. Before this commit, invalid or unrecognized metadata would be fatal errors, now they just cause a mirror to be skipped. Co-authored-by: Harmen Stoppels <[email protected]>
This commit improves forward compatibility of Spack with newer build cache metadata formats. Before this commit, invalid or unrecognized metadata would be fatal errors, now they just cause a mirror to be skipped. Co-authored-by: Harmen Stoppels <[email protected]>
This commit improves forward compatibility of Spack with newer build cache metadata formats. Before this commit, invalid or unrecognized metadata would be fatal errors, now they just cause a mirror to be skipped. Co-authored-by: Harmen Stoppels <[email protected]>
This commit improves forward compatibility of Spack with newer build cache metadata formats. Before this commit, invalid or unrecognized metadata would be fatal errors, now they just cause a mirror to be skipped. Co-authored-by: Harmen Stoppels <[email protected]>
This commit improves forward compatibility of Spack with newer build cache metadata formats. Before this commit, invalid or unrecognized metadata would be fatal errors, now they just cause a mirror to be skipped. Co-authored-by: Harmen Stoppels <[email protected]>
This commit improves forward compatibility of Spack with newer build cache metadata formats. Before this commit, invalid or unrecognized metadata would be fatal errors, now they just cause a mirror to be skipped. Co-authored-by: Harmen Stoppels <[email protected]>
This PR ensures that unrecognized metadata files do not cause download failure, but are skipped.
This improves forward compatibility with future metadata formats.