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

utillinux: set default wordlist for look #34486

Closed
wants to merge 1 commit into from

Conversation

WilliButz
Copy link
Member

Motivation for this change

change introduced in v2.31
(kernel.org version)

right now using look, without specifying a dictionary manually with the -a flag just results in the error:

look: /usr/share/dict/words: No such file or directory
Things done

This adds a wrapper for look because it uses the environment variable
'WORDLIST', with a fallback to /usr/share/dict/words when looking for a dictionary.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@WilliButz
Copy link
Member Author

I am not sure if it is necessary to add scowl to propagatedBuildInputs as this already seems to work fine on my local machine, but I have a feeling this might cause problems when the package is built on a remote host.

This adds a wrapper for `look` because it uses the environment variable
'WORDLIST', with a fallback to `/usr/share/dict/words` when looking for a dictionary.
@WilliButz
Copy link
Member Author

I rebase this on to staging :)

@WilliButz WilliButz changed the base branch from master to staging February 1, 2018 09:51
@edolstra
Copy link
Member

edolstra commented Feb 1, 2018

Strong 👎. scowl increases the util-linux closure size by 99 MiB, which is a lot.

@7c6f434c
Copy link
Member

7c6f434c commented Feb 1, 2018 via email

Copy link
Member

@fpletz fpletz left a comment

Choose a reason for hiding this comment

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

Adding a 36MB dependency to a derivation that is present on all NixOS systems with no real benefit is not acceptable IMHO. Additionally, at least, this wrapping should not be done when minimal is true.

Another option would be to add a module that sets the WORDLIST environment variable to scowl or a directory in /run/current-system that would link all dict directories in environment.systemPackages together, similar to shell completions. We could also patch look to look there first instead of /usr.

7c6f434c added a commit to 7c6f434c/nixpkgs that referenced this pull request Feb 2, 2018
The expression now supports having `words.txt` in some place without tens
and tens of megabytes of all the wordlist and spelling dictionaries. Set
`singleWordlist` parameter to the string of region and size settings. For
example:
```
scowl.override{singleWordlist = "en-gb-ise 60";}
```

Should be useful for NixOS#34486
@7c6f434c
Copy link
Member

7c6f434c commented Feb 2, 2018

OK, GitHub doesn't want to show it immediately, but in 00cafb4 I did add an option to install a single worldlist. The build it not optimised much for this case, though (I do skip building spelling dictionaries if they will not be installed).

Edited to add: apparently, the best way to make the cross-reference show up already is to complain about it in a comment…

@fpletz fpletz closed this Mar 4, 2018
@WilliButz WilliButz deleted the fix-utillinux-look branch March 4, 2018 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants