Skip to content

doc/default.nix: make the manual build on more than one core#225921

Merged
fricklerhandwerk merged 3 commits intomasterfrom
unknown repository
Apr 25, 2023
Merged

doc/default.nix: make the manual build on more than one core#225921
fricklerhandwerk merged 3 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Apr 12, 2023

Let's build the manual with more than one core. Maybe people will take better care of it now that it is less painful to build.

Let's build the manual with more than one core.  Maybe people will
take better care of it now that it is less painful to build.
@ghost ghost requested a review from fricklerhandwerk as a code owner April 12, 2023 17:27
@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Apr 12, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 12, 2023
@Artturin
Copy link
Copy Markdown
Member

Artturin commented Apr 13, 2023

Can't test

(before and after this pr)

nix build ".#htmlDocs.nixpkgsManual"

nixpkgs-manual> cp -r doc-support/result/highlightjs/highlight.pack.js highlightjs/
nixpkgs-manual> cp: cannot stat 'doc-support/result/highlightjs/highlight.pack.js': No such file or directory

@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 13, 2023

nix build ".#htmlDocs.nixpkgsManual"

Try

nix build -f doc

But yeah we should give the manual an entry in pkgs/top-level/all-packages.nix. Right now it has its own wonky entry point.

@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 13, 2023

But yeah we should give the manual an entry in pkgs/top-level/all-packages.nix

@fricklerhandwerk
Copy link
Copy Markdown
Contributor

@pennae you're certainly more qualified than me to assess this.

@pennae
Copy link
Copy Markdown
Contributor

pennae commented Apr 16, 2023

this looks like a good thing, but unfortunately it changes the output of the rendering process for some reason. the makefile must be missing some dependencies to make that happen, but for the md rendering part specifically we can do this.

let's do this instead to get most of the benefits until the rendering infra can be migrated away from pandoc:

diff --git a/doc/Makefile b/doc/Makefile
index ee98a3ee921..208f23f5023 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -19,6 +19,9 @@ pandoc_flags = --extract-media=$(pandoc_media_dir) \
 .PHONY: all
 all: validate format out/html/index.html out/epub/manual.epub
 
+.PHONY: render-md
+render-md: ${MD_TARGETS}
+
 .PHONY: debug
 debug:
        nix-shell --run "xmloscopy --docbook5 ./manual.xml ./manual-full.xml"
diff --git a/doc/default.nix b/doc/default.nix
index ac405c37903..4f55c95a04c 100644
--- a/doc/default.nix
+++ b/doc/default.nix
@@ -20,6 +20,10 @@ in pkgs.stdenv.mkDerivation {
     ln -s ${doc-support} ./doc-support/result
   '';
 
+  preBuild = ''
+    make -j$NIX_BUILD_CORES render-md
+  '';
+
   installPhase = ''
     dest="$out/share/doc/nixpkgs"
     mkdir -p "$(dirname "$dest")"

@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 24, 2023

Latest push implements @pennae's suggestion.

@fricklerhandwerk fricklerhandwerk merged commit ed312cb into NixOS:master Apr 25, 2023
@fricklerhandwerk
Copy link
Copy Markdown
Contributor

Thanks a lot, everyone!

@ghost ghost deleted the pr/make-the-manual-build-fast-yes-yes branch May 5, 2023 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants