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

Update toml11-devel usage for 4.0.0 #1625

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

kontura
Copy link
Contributor

@kontura kontura commented Aug 13, 2024

This should fix the rawhide build.

@kontura
Copy link
Contributor Author

kontura commented Aug 13, 2024

I believe the failed Pre Commit formatting is wrong, I prefer the current format.

@evan-goode
Copy link
Member

Thanks. I will wait for this before releasing DNF 5.2.6.0.

I believe the failed Pre Commit formatting is wrong, I prefer the current format.

Maybe the current format is better, but I think it's still better just to keep the formatter happy.

Adds missing cmake check for toml11.

It preserves the old API use with conditional compilation based on the
found toml11-devel version.

Uses `toml::ordered_value` to keep the order of values from files.
https://toruniina.github.io/toml11/docs/features/configure_types/#preserving-order-of-values-in-tables
(It now uses `toml::ordered_map` instead of `libdnf5::PreserveOrderMap`
they do the same thing but the libdnf5 version is missing a constructor).
It now preserves comments but they are not used and it shoudn't have an
effect.

The `source_location` API was changed.
https://toruniina.github.io/toml11/docs/reference/source_location/

It simplifies formatting of `syntax_error`s.
Resolves compilation error with new `toml11-devel-4.0.0` version.
It adds conditional compilation based on the found toml11 version.

Adds TC - `type_config` which is required for conversion.
https://toruniina.github.io/toml11/docs/features/value/#converting-to-tomlvalue

The `toml::format` was changed and no longer accepts template args:
https://toruniina.github.io/toml11/docs/reference/serializer/

Use `ordered_value` to preserve order in toml otherwise the ordering is
unstable which may cause failing tests.

The default formatting was changed from:
```
version = "1.0"

[[packages]]
comment = "Added by 'versionlock add' command on 2024-08-15 08:41:28"
name = "htop"

conditions = [
{comparator="=",key="evr",value="3.3.0-3.fc40"},
]
```

to

```
version = "1.0"

[[packages]]
comment = "Added by 'versionlock add' command on 2024-08-15 08:48:16"
name = "htop"

[[packages.conditions]]
value = "3.3.0-4.fc41"
comparator = "="
key = "evr"
```

This shouldn't have any effect on the users.
Adds TC - `type_config` which is required for conversion.
https://toruniina.github.io/toml11/docs/features/value/#converting-to-tomlvalue

The `toml::format` was changed and no longer accepts template args:
https://toruniina.github.io/toml11/docs/reference/serializer/

Use `ordered_value` to preserve order, otherwise `std::unordered_map` is
used internally which may result in different order on each run which
may casue failing tests.

It was necessary to specify the formating for some values because the
tests rely on it. However even with the same formatting there still are
changes (spacing is different), update the tests to pass for both toml11
versions.
@kontura
Copy link
Contributor Author

kontura commented Aug 20, 2024

To make the f41 and rawhide builds work we need: https://src.fedoraproject.org/rpms/toml11/pull-request/5 and https://src.fedoraproject.org/rpms/toml11/pull-request/4.

Since the builds on those versions are failing anyway I guess we don't need to block this PR on that.

@kontura kontura marked this pull request as ready for review August 20, 2024 07:48
@jan-kolarik
Copy link
Member

To make the f41 and rawhide builds work we need: https://src.fedoraproject.org/rpms/toml11/pull-request/5 and https://src.fedoraproject.org/rpms/toml11/pull-request/4.

Since the builds on those versions are failing anyway I guess we don't need to block this PR on that.

Thanks for taking care of it!

@jan-kolarik jan-kolarik added this pull request to the merge queue Aug 20, 2024
Merged via the queue into rpm-software-management:main with commit 1746eab Aug 20, 2024
11 of 20 checks passed
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.

3 participants