punic
punic copied to clipboard
Versioning does not work if not in the x.y.z format
Given the following content in the Punfile
- FooBar:
- name: FooBar
version: 1.2
you get an error:
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/punfile.rs:85:109
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
That only works if your dependency has the x.y.z version formatting
- FooBar:
- name: FooBar
version: 1.2.0
I think version should be a free-form string.
Also that does not make sense to have to specify the version number in the Punfile, it should be automatically done somehow. I know there's no strong adherence with Carthage, so it should do it with some kind of hashing of the .xcframework.
Also the documentation states that version should be - prefixed, which isn't true.
Great thanks for the feedback @nomadplanet, we're trying not to be dependent of Carthage's .resolved files, at least not exclusively which is why the Punfile is regarded as the source of truth for what dependencies are downloaded. Although the best way is to look at the .resolved file to automatically determine the versioning and we can add that as an optional instead of using Punfile to determine versions. The hashing of the .xcframework can work as well but you would need to keep track of the hashes per framework to determine what to download since there's no human readable format behind such mapping.
We will definitely try to fix this for the next release.
@DrewKiino any news?