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

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

Merged
merged 3 commits into from Apr 25, 2023
Merged

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

merged 3 commits into from Apr 25, 2023

Conversation

ghost
Copy link

@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.
@Artturin
Copy link
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
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
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
Contributor

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

@pennae
Copy link
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
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
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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants