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

nixos/documentation: add option to generate caches #86489

Merged
merged 4 commits into from Jun 18, 2020
Merged

Conversation

@rnhmjoj
Copy link
Contributor

rnhmjoj commented May 1, 2020

Motivation for this change

An alternative approach to #76841 to generate manual pages caches. This will fix #14472.

Things done
  • Tested using sandboxing (nix.useSandbox on 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 (mass-rebuild)
  • Tested execution of all binary files (apropos, whatis, mandb works as intended)
  • 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.
@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented May 4, 2020

Some notes:

  • I tried to avoid using symlinkJoin by dumping all the paths in a man.conf inside the runCommandLocal and calling mandb -C man.con. However it kept overwriting the index for each path so that the index only contained the pages of the very last package.

  • Maybe the patch should use a custom name instead of man_db.conf if we want to avoid indexing non-Nix packages on the system. I'm not sure whether this is expected or advisable.

@matthewbauer matthewbauer mentioned this pull request May 9, 2020
0 of 10 tasks complete
nixos/modules/misc/documentation.nix Outdated Show resolved Hide resolved
nixos/modules/misc/documentation.nix Show resolved Hide resolved
@rnhmjoj rnhmjoj force-pushed the rnhmjoj:mandb branch from 4b6d343 to 052f6c0 May 11, 2020
@rnhmjoj rnhmjoj requested review from edolstra and nbp as code owners May 11, 2020
Copy link
Member

lheckemann left a comment

I like this!

nixos/modules/misc/documentation.nix Outdated Show resolved Hide resolved
nixos/modules/misc/documentation.nix Show resolved Hide resolved
@rnhmjoj rnhmjoj force-pushed the rnhmjoj:mandb branch from 052f6c0 to fb4d7db May 23, 2020
@eraserhd
Copy link
Contributor

eraserhd commented Jun 15, 2020

Bump, this looks nice and has been idle for 23 days.

@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Jun 15, 2020

@eraserhd: It's essentially ready. I'm waiting for @lheckemann and @Infinisil to complete their review. If you want to try it out, cherry-pick the commits on master because staging is likely broken.

@lheckemann
Copy link
Member

lheckemann commented Jun 16, 2020

Sorry, didn't realise you were waiting for approval! mind wanders to NixOS/rfcs#30

rnhmjoj added 4 commits May 11, 2020
When using --with-config-file, all man-db programs completely ignore the
systemwide configuration in /etc/man_db.conf: it means on NixOS there is
no way to change the configuration without rebuilding man-db, which in
turn causes a mass-rebuild.

To solve this problem this commit removes the NixOS-specific
configuration in man-db, which wasn't the appropriate place to begin
with: the package is expected to work on non-NixOS systems as well. Also
a small patch now ensure /etc/man_db.conf is used, if available, before
the bundled configuration.
Previously the NixOS-specific configuration for man-db was in the
package itself and /etc/man.conf was completely ignored.
This change moves it to /etc/man_db.conf, making declarative
configuration practical again.

It's now possible to generate the mandb caches for all packages
installed through NixOS `environment.systemPackages` at build-time.
The standard location for the stateful cache (/var/cache/man) is also
configured to allow users to run `mandb` manually if they wish.

Since generating the cache can be expensive the option is off by
default.
@rnhmjoj rnhmjoj force-pushed the rnhmjoj:mandb branch from fb4d7db to 4dd95c0 Jun 18, 2020
@ofborg ofborg bot added the 8.has: changelog label Jun 18, 2020
@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Jun 18, 2020

Documented the change in the 20.09 release notes.

@rnhmjoj rnhmjoj merged commit 7e57c52 into NixOS:staging Jun 18, 2020
11 of 13 checks passed
11 of 13 checks passed
grahamcofborg-eval Calculating Changed Outputs
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4dd95c0"; rev="4dd95c0cfc19bf7c4b9e5b5f3098d6b28d503037"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4dd95c0"; rev="4dd95c0cfc19bf7c4b9e5b5f3098d6b28d503037"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4dd95c0"; rev="4dd95c0cfc19bf7c4b9e5b5f3098d6b28d503037"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4dd95c0"; rev="4dd95c0cfc19bf7c4b9e5b5f3098d6b28d503037"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4dd95c0"; rev="4dd95c0cfc19bf7c4b9e5b5f3098d6b28d503037"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4dd95c0"; rev="4dd95c0cfc19bf7c4b9e5b5f3098d6b28d503037"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4dd95c0"; rev="4dd95c0cfc19bf7c4b9e5b5f3098d6b28d503037"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@rnhmjoj rnhmjoj deleted the rnhmjoj:mandb branch Jun 19, 2020
@doronbehar
Copy link
Contributor

doronbehar commented Jun 29, 2020

Thank you @rnhmjoj for tackling this ❤️, the issue has bothered since always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.