Skip to content

lib/types: init {types.attrsWith}#354738

Merged
infinisil merged 6 commits intoNixOS:masterfrom
hsjobeki:lib/attrsWith
Dec 2, 2024
Merged

lib/types: init {types.attrsWith}#354738
infinisil merged 6 commits intoNixOS:masterfrom
hsjobeki:lib/attrsWith

Conversation

@hsjobeki
Copy link
Contributor

@hsjobeki hsjobeki commented Nov 9, 2024

types.attrsWith combines attrsOf and lazyAttrsOf with a configurable lazy = true/false parameter.

Other parameters are possible and on hold see: #344216

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@hsjobeki hsjobeki requested review from infinisil and roberth November 9, 2024 10:23
@github-actions github-actions bot added 6.topic: module system About "NixOS" module system internals 6.topic: lib The Nixpkgs function library labels Nov 9, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 9, 2024
@infinisil
Copy link
Member

@hsjobeki Btw the "Co-Authored-By: @hsjobeki" doesn't appear to work :P

@hsjobeki
Copy link
Contributor Author

@infinisil Depraction message works now. With/without type merging.

@github-actions github-actions bot removed the 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. label Dec 2, 2024
Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at this together in a meeting with @hsjobeki, looking good, let's deal with any issues if they come up!

@infinisil infinisil merged commit 23a7a7d into NixOS:master Dec 2, 2024
@kachick kachick mentioned this pull request Dec 3, 2024
13 tasks
@paparodeo
Copy link
Contributor

this change seems like it broke one of the ofborg eval tests.

nix-build --arg pkgs 'import ./. {}' ./lib/tests/release.nix

https://gist.github.com/GrahamcOfBorg/7d1ce79b712e477612915ee9247188c8

@K900
Copy link
Contributor

K900 commented Dec 3, 2024

So do we revert this or does anyone have a quick fix?

@K900
Copy link
Contributor

K900 commented Dec 3, 2024

Reverted.

@Mic92
Copy link
Member

Mic92 commented Dec 3, 2024

We will add lib-tests soon to github ci.

@hsjobeki
Copy link
Contributor Author

hsjobeki commented Dec 3, 2024

@infinisil @K900 Please just remove the failing test line. It was only there for testing the "nice" deprecation message. But it seems the test framework cannot handle that yet.

I would need to first fix the test framework. Which is a bit more work.

I am not sure what the convention is for reverting a revert but i opened up this one:

#361391

@Mic92
Copy link
Member

Mic92 commented Dec 3, 2024

The convention is to revert the revert and than potentially fix the issue.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/use-cases-of-option-type-internals/57317/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: lib The Nixpkgs function library 6.topic: module system About "NixOS" module system internals 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants