mamba-org / rattler

Rust crates to work with the Conda ecosystem.
BSD 3-Clause "New" or "Revised" License
229 stars 44 forks source link

Parse `platform` into `Option<Platform>` instead of `Option<String>` #161

Open wolfv opened 1 year ago

wolfv commented 1 year ago

In the IndexJson struct we could parse platform (or rather the subdir field) into the Platform enum (with an escape hatch for Platform::Other(String) I would argue.

Similarly I would say that we can remove arch and subdir fields, and only reconstruct them for serialization?

Basically, the relationship is as follows: subdir is <platform> - <arch> with the special that for 64 arch is x86_64 and for 32 arch is x86.

Johnwillliam commented 7 months ago

@wolfv I wouldn't mind trying this one, could you explain how I could easily test this?

baszalmstra commented 7 months ago

I think this one is a bit tricky because the relationship with platform, subdir and arch dont necesarily always hold I believe.

We have been talking about splitting the Platform enum into os and arch but many combinations of os and arch dont make sense (win-powerpc, wasm-s390x?). So Im inclined to keep the current enum.