anaconda / anaconda-client

Anaconda Server Client
https://anaconda.org
BSD 3-Clause "New" or "Revised" License
146 stars 240 forks source link

Make `arch` and `platform` inside index.json optional #696

Closed 0xbe7a closed 8 months ago

0xbe7a commented 10 months ago

When a noarch package is built, conda-build currently sets the arch and platform fields to null. rattler-build does not even include them when a noarch package is built, as they are optional anyway (see https://docs.conda.io/projects/conda-build/en/stable/resources/package-spec.html#repo-si). This PR sets arch and platform to null instead of panicking if the fields are missing.

wolfv commented 10 months ago

Awesome! Did you try and upload a package like this? I am just wondering if some other parts of the Anaconda infrastructure might have problems with these fields missing. We can also change the serde configuration in rattler to emit these fields with null values ...

0xbe7a commented 10 months ago

I tried uploading a package created by rattler-build to anaconda, and apart from this small problem, everything worked perfectly. My initial fix was to include the null in the index.json, but it seems that the better solution is to make the anaconda client follow the specification here, since the fields are optional anyway.

dholth commented 10 months ago

Reminds me of https://github.com/conda/conda-index/issues/132

Many packages do and many do not include redundant information in the index fragment for repodata.json

pavelzw commented 9 months ago

@vshevchenko-anaconda could you take a look at this PR? Would be great to get this merged.

wolfv commented 8 months ago

yaaay!