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

treewide: completely remove types.loaOf #96042

Merged
merged 3 commits into from Sep 2, 2020
Merged

Conversation

rnhmjoj
Copy link
Contributor

@rnhmjoj rnhmjoj commented Aug 22, 2020

Motivation for this change

Finalise the removal of loaOf, started with #63103.
See also #77189 (comment).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

Why don't we turn the warning in the type into something fatal to help people out?
Also mention in the release notes that it is now removed entirely?

@infinisil
Copy link
Member

Also: While the warning mentioned that loaOf is deprecated, it only triggered when a list was assigned to it. So naturally the next step is to only remove support for assigning lists, and add a warning for loaOf being used itself. So something like this:

{
  loaOf = lib.warn "loaOf is deprecated blabla..." attrsOf;
}

@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Aug 23, 2020

Uhm, it looks like changing options to attrsOf broke the manual, for some reason.

@infinisil
Copy link
Member

Option references in docbook are:

  • opt-foo._.bar when foo is listOf (submodule ..)
  • opt-foo._name_.bar for attrsOf (submodule ..)
  • opt-foo._name__.bar for loaOf (submodule ..)

This is why the manual fails, the references need to be changed from _name__ to _name_

@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Aug 23, 2020

Thank you, done. I don't know how the Nixos options integration in docbook happen, so is there a file that needs to be updated for the removal? I couldn't find any more references to loaOf.

@infinisil
Copy link
Member

No idea either, haven't looked into it

@jtojnar
Copy link
Contributor

jtojnar commented Aug 23, 2020

We replace the ? in ids for _ here:

<xsl:variable name="id" select="concat('opt-', str:replace(str:replace(str:replace(str:replace(attr[@name = 'name']/string/@value, '*', '_'), '&lt;', '_'), '>', '_'), '?', '_'))" />

The id just comes from the option name itself IIRC.

@worldofpeace worldofpeace added this to To Do in 20.09 Blockers via automation Aug 30, 2020
@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Aug 31, 2020

@jtojnar, sorry but I understand very little of what's going on in that file. I still don't see anything related to loaOf in it, what should be changed?

@jtojnar
Copy link
Contributor

jtojnar commented Sep 1, 2020

We can drop the outermost replace if no other type adds ? to the generated option name lika loaOf did in getSubOptions.

@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Sep 1, 2020

Ok, I think I get it. It's because loaOf uses <name?> as a placeholder.
Yes, it seems no other type does this and the manual builds, so it should be safe to remove.

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.

LGTM

lib/types.nix Outdated Show resolved Hide resolved
lib/types.nix Outdated Show resolved Hide resolved
Remove the substitution for the <name?> placeholder used by loaOf,
now that the type has been deprecated.
Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

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

Diff LGTM, thanks!

@worldofpeace worldofpeace merged commit 18348c7 into NixOS:master Sep 2, 2020
20.09 Blockers automation moved this from To Do to Done Sep 2, 2020
@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Sep 2, 2020

Thank you all!

@worldofpeace
Copy link
Contributor

Absolutely, and I return the thanks ten fold ✨

cole-h added a commit to cole-h/home-manager that referenced this pull request Sep 2, 2020
loaOf has been deprecated for a long time and is now in the process of
removal (see NixOS/nixpkgs#96042). Thus, we
remove it here, too.
cole-h added a commit to cole-h/home-manager that referenced this pull request Sep 2, 2020
loaOf has been deprecated for a long time and is now in the process of
removal (see NixOS/nixpkgs#96042). Thus, we
remove it here, too.
marsam added a commit to marsam/nix-darwin that referenced this pull request Sep 3, 2020
types.loaOf has been deprecated for a long time and is now in the
process of removal. See: NixOS/nixpkgs#96042
@infinisil infinisil mentioned this pull request Sep 4, 2020
1 task
timokau added a commit that referenced this pull request Sep 8, 2020
The package was broken due to [1], which is fixed upstream in [2]. The
repo has moved to nix-community, so we might as well encode the redirect
here.

[1] #96042
[2] nix-community/home-manager@0399839
aakropotkin pushed a commit to aakropotkin/home-manager that referenced this pull request Sep 9, 2020
loaOf has been deprecated for a long time and is now in the process of
removal (see NixOS/nixpkgs#96042). Thus, we
remove it here, too.
@worldofpeace worldofpeace removed this from Done in 20.09 Blockers Oct 5, 2020
@worldofpeace worldofpeace added this to In progress in 20.09 Blockers via automation Oct 5, 2020
@worldofpeace worldofpeace moved this from In progress to Done in 20.09 Blockers Oct 5, 2020
jrolfs pushed a commit to jrolfs/nix-darwin that referenced this pull request Oct 6, 2020
types.loaOf has been deprecated for a long time and is now in the
process of removal. See: NixOS/nixpkgs#96042
malte-v pushed a commit to malte-v/home-manager that referenced this pull request Feb 24, 2021
loaOf has been deprecated for a long time and is now in the process of
removal (see NixOS/nixpkgs#96042). Thus, we
remove it here, too.
theutz pushed a commit to theutz/nix-darwin that referenced this pull request Apr 19, 2023
types.loaOf has been deprecated for a long time and is now in the
process of removal. See: NixOS/nixpkgs#96042
@rnhmjoj rnhmjoj deleted the loaOf branch July 10, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants