-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Move renames to their appropriate places #61570
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.
I think this is a great idea. The only way it could be better is if documentation for these renamings is centralized somewhere (but I don't know where or how, so this is just aspirational commentary).
@infinisil does anyone disagree this PR is a good idea? Any obstacles to merging, other than finishing it? |
Nope, finishing is really the only thing. I have more time from now on so maybe I can get to this soon |
I would love that. Every once in a while the issue this PR resolves bites me. |
A centralized list for these renames is not good because: - It breaks disabledModules for modules that have a rename defined - Adding/removing renames for a module means having to find them in the central file - Merge conflicts due to multiple people editing the central file
6f6b221
to
4ee3e8b
Compare
Rebased on master and did it for all options. Difference of
(the first is just a whitespace from editorconfig I'd guess) With this I can be sure that I didn't miss anything. I also added an explanatory message to rename.nix that people shouldn't put stuff there anymore. |
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.
Thank you very much @infinisil! 🎉
Oh, well I guess renamed options won't show up in the manual. So here's a super fancy way to verify I didn't miss anything: git log -p -1 | rg '[+-].*mk.*Module(.*)' -or '$1' | sort | uniq -u Look at the changes of the last commit that do a |
One last thing before merging: I want to check out the evaluation time difference. If that's not a problem I'll merge |
Done that, ran
{
"cpuTime": 221.438,
"envs": {
"number": 299007965,
"elements": 380066660,
"bytes": 7824660720
},
"list": {
"elements": 297212376,
"bytes": 2377699008,
"concats": 8066450
},
"values": {
"number": 533774798,
"bytes": 12810595152
},
"symbols": {
"number": 166745,
"bytes": 6623422
},
"sets": {
"number": 60350420,
"bytes": 15206771776,
"elements": 613498684
},
"sizes": {
"Env": 16,
"Value": 24,
"Bindings": 8,
"Attr": 24
},
"nrOpUpdates": 21191561,
"nrOpUpdateValuesCopied": 435964457,
"nrThunks": 336088985,
"nrAvoided": 361443150,
"nrLookups": 164188255,
"nrPrimOpCalls": 149614461,
"nrFunctionCalls": 266629750,
"gc": {
"heapSize": 12281708544,
"totalBytes": 46943907840
}
}
{
"cpuTime": 231.007,
"envs": {
"number": 299008253,
"elements": 380067020,
"bytes": 7824668208
},
"list": {
"elements": 297212376,
"bytes": 2377699008,
"concats": 8066450
},
"values": {
"number": 533775620,
"bytes": 12810614880
},
"symbols": {
"number": 166746,
"bytes": 6623426
},
"sets": {
"number": 60350420,
"bytes": 15206777104,
"elements": 613498906
},
"sizes": {
"Env": 16,
"Value": 24,
"Bindings": 8,
"Attr": 24
},
"nrOpUpdates": 21191561,
"nrOpUpdateValuesCopied": 435964457,
"nrThunks": 336089249,
"nrAvoided": 361443990,
"nrLookups": 164188375,
"nrPrimOpCalls": 149614917,
"nrFunctionCalls": 266629942,
"gc": {
"heapSize": 11627298816,
"totalBytes": 46943922224
}
}
{
"cpuTime": 225.745,
"envs": {
"number": 298980818,
"elements": 380032705,
"bytes": 7823954728
},
"list": {
"elements": 297148656,
"bytes": 2377189248,
"concats": 8065678
},
"values": {
"number": 533741824,
"bytes": 12809803776
},
"symbols": {
"number": 166742,
"bytes": 6623401
},
"sets": {
"number": 60343148,
"bytes": 15198102256,
"elements": 613139878
},
"sizes": {
"Env": 16,
"Value": 24,
"Bindings": 8,
"Attr": 24
},
"nrOpUpdates": 21189442,
"nrOpUpdateValuesCopied": 435598183,
"nrThunks": 336070225,
"nrAvoided": 361421402,
"nrLookups": 164189015,
"nrPrimOpCalls": 149605563,
"nrFunctionCalls": 266605507,
"gc": {
"heapSize": 11747434496,
"totalBytes": 46932711536
}
}
{
"cpuTime": 221.895,
"envs": {
"number": 298981106,
"elements": 380033065,
"bytes": 7823962216
},
"list": {
"elements": 297148656,
"bytes": 2377189248,
"concats": 8065678
},
"values": {
"number": 533742646,
"bytes": 12809823504
},
"symbols": {
"number": 166743,
"bytes": 6623405
},
"sets": {
"number": 60343148,
"bytes": 15198107584,
"elements": 613140100
},
"sizes": {
"Env": 16,
"Value": 24,
"Bindings": 8,
"Attr": 24
},
"nrOpUpdates": 21189442,
"nrOpUpdateValuesCopied": 435598183,
"nrThunks": 336070489,
"nrAvoided": 361422242,
"nrLookups": 164189135,
"nrPrimOpCalls": 149606019,
"nrFunctionCalls": 266605699,
"gc": {
"heapSize": 11828625408,
"totalBytes": 46932808208
}
} In short: No significant difference. |
Turns out this is wrong, even with this change it doesn't work. A |
I opened #76857 which fixes this |
With this change, disabledModules applies recursively, meaning if you have a module "foo.nix" with imports = [ ./bar.nix ]; then setting disabledModules = [ "foo.nix" ]; will disable both "foo.nix" and "bar.nix", whereas previously only "foo.nix" would be disabled. This change along with NixOS#61570 allows modules to be fully disabled even when they have some `mkRenamedOption` imports.
With this change, disabledModules applies recursively, meaning if you have a module "foo.nix" with imports = [ ./bar.nix ]; then setting disabledModules = [ "foo.nix" ]; will disable both "foo.nix" and "bar.nix", whereas previously only "foo.nix" would be disabled. This change along with NixOS#61570 allows modules to be fully disabled even when they have some `mkRenamedOption` imports.
#76857 is now merged, so along with this PR, it's now possible to disable modules even when they have renames :) |
With this change, disabledModules applies recursively, meaning if you have a module "foo.nix" with imports = [ ./bar.nix ]; then setting disabledModules = [ "foo.nix" ]; will disable both "foo.nix" and "bar.nix", whereas previously only "foo.nix" would be disabled. This change along with NixOS#61570 allows modules to be fully disabled even when they have some `mkRenamedOption` imports. (cherry picked from commit de5f73d)
This was a mistake in #61570, this does not belong to prometheus
Having a centralized list of renamed/changed/removed options is bad
because
disabledModules
, because disabling a module that has arenamed option wouldn't disable the rename, but of course if the module
is disabled, the rename doesn't actually work because the option it
renames to doesn't exist anymore.
edit this file instead of declaring renames right where it makes sense.
This is only a partial PR. I can update this PR with the rest if nobody has any complaints.
Motivation for this change
Things done
I have not tested this.
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)