Skip to content
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

fix: default value for conda_packages in repodata.json #441

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

BenjaminLowry
Copy link
Contributor

I am using rattler in a context that has to deal with really old repodata.json files that don't have the "packages.conda" field and thus they fail with this error message:

called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: Error("missing field `packages.conda`", line: 205, column: 1) }

I recognize that packages.conda has been created by conda build/index for years now, but this means rattler isn't backwards compatible with the (very) old state of repodatas and it is not trivial to upgrade the repodatas that I am dealing with. Without this, I will be potentially blocked from using rattler in important contexts. Rattler would still produce this field as an empty map by default, and it would default to an empty map when it's missing from a repodata.json that it deserializes.

Thoughts? Also let me know if I'm missing other changes necessary in order to do this.

Copy link
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Makes sense to me! Thanks!

@baszalmstra
Copy link
Collaborator

If you can fix the formatting issue, Ill merge it!

@BenjaminLowry
Copy link
Contributor Author

Thanks for the lightning fast review!

@baszalmstra
Copy link
Collaborator

Oh you also need to change this in the sparse repodata reading. in sparse/mod.rs from the top of my mind.

@BenjaminLowry
Copy link
Contributor Author

@baszalmstra Okay added there as well, I didn't add a similar test as what exists in that file because that recursive repodata requires a channel url, unless I could give it a dummy one?

@BenjaminLowry
Copy link
Contributor Author

And I think windows flaked?

@baszalmstra
Copy link
Collaborator

I think you can pass it a file path as well, but dont worry about it. The change is small enough. Ill merge when CI turns green!

@baszalmstra baszalmstra merged commit f3c30ff into conda:main Dec 15, 2023
13 checks passed
@baszalmstra baszalmstra changed the title Default value for conda_packages in repodata.json fix: default value for conda_packages in repodata.json Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants