-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
pkgs.formats.toml: fix TOML semantics by upgrading tomlkit #245440
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, does this need to be backported?
version = "0.11.6"; | ||
version = "0.11.4"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Downgrading packages should be exceptional: Is the new behavior a bug or a feature?
- If it's a feature we should either
- Introduce a new
tomlkit_11_4
attribute and use that, or - Define the older version internally to the
pkgs.formats
code (this way we don't have a new attribute to maintain)
- Introduce a new
- If it's a bug we should add a comment here saying that we're waiting for the bug to get fixed before upgrading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right :)
It turns out that tomlkit 0.11.8 (the latest version) doesn't have this bug either. So doing an upgrade and introducing the tests seems way more appropriate.
The challenge is that tomlkit is now built with poetry and.... poetry also depends on tomlkit.
So I think until we bootstrap poetry itself, we need to keep 0.11.6 as tomlkit_11_6
, similar to your suggestion.
I'll make those changes. Hopefully I don't mess it up :-)
Thanks for the quick review, btw!
Not sure if this is the cleanest way to go about this, so I'm open to suggestions.
We need to have it merged into the 23.05 release, if that's what you are asking (sorry, I'm not yet very familiar with the nixpkgs release process / terminology). |
Alright I'm calling it a day on this for now. Thanks for the help and sorry for all the churn :) I've added a commit to my branch which has option 3 implemented that I mentioned above (a patch which makes I'll squash / drop those commits depending on the solution we go with before we merge this in. |
After discussing this upstream on python-poetry/tomlkit#305, it turns out that I've updated this PR accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Could you split this into separate commits like this?
- Remove poetry dependency on tomlkit and set `format = "pyproject" on tomlkit
- Update tomlkit to 0.11.8
- Introduce the test case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks!
f689956 broke pylint and by extension all nixos tests. |
Note that this PR was tagged by OfBorg as very large rebuild and thus it should not have been merged to master. |
Ah sorry I forgot to pay attention the label. Here's a Hydra failure for reference, also fails on |
Looks like pylint is aware of this problem: pylint-dev/pylint#8633 |
Picked into #244135. |
The generated format seems to have changed with the merge of <NixOS/nixpkgs#245440>.
Description of changes
This fixes #237521 by upgrading tomlkit to 0.11.8.
It also introduces tests to make sure this behavior is kept, as some of our configurations (such as telegraf) depend on it.
Tested these changes by running
nix build .\#tests.pkgs-lib.formats
.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)