Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

*.10 version truncated to *.1 in manifest #45

Open
der-eismann opened this issue Dec 21, 2022 · 1 comment
Open

*.10 version truncated to *.1 in manifest #45

der-eismann opened this issue Dec 21, 2022 · 1 comment
Labels
priority: immediate Should be immediately addressed. type: bug Something isn't working.

Comments

@der-eismann
Copy link
Contributor

I just built a package with version 2.10 set. When I build the recipe, the resulting manifest.x86_64.jsonc contains the following line:

"source-version": "2.1"

When I change the version to 2.11 in the stone.yaml, it is showing the correct version in the manifest as well. Looks like something is truncating the 0 from the version.

Example can be seen in snekpit/main#19

@ermo
Copy link
Member

ermo commented Dec 21, 2022

This is an artefact of how YAML is parsed by the dyaml parser we use; unquoted values that look like floats will be implicitly coerced to floats by dyaml before we encounter them and save them as strings:

[16:17:25] TRACE     boulder.controller.Controller.build: Parsing recipe file stone.yml
[16:17:25] TRACE       '- Parsing YamlSchema for member: name
[16:17:25] TRACE        '- Parsing YAML key 'name':
[16:17:25] TRACE         '- <string> (= 'lzo')
[16:17:25] TRACE       '- Parsing YamlSchema for member: versionIdentifier
[16:17:25] TRACE        '- Parsing YAML key 'version':
[16:17:25] TRACE         '- <string> (= '2.1')

The solution (or workaround, depending on your perspective) could be to make it a LINT error to not have the version string quoted in the stone.yml recipe (as a very firm hint to every single packager that the version field is considered an arbitrary string).

For now, the outcome is that you will need to manually ensure you that you properly quote problematic float-parseable version strings.

@livingsilver94 livingsilver94 added priority: immediate Should be immediately addressed. type: bug Something isn't working. labels Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: immediate Should be immediately addressed. type: bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

3 participants