-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
manual fails to build on master #37903
Comments
This is a bug, the docs should not depend on an aarch64 builder. |
nix-build -A manual.x86_64-linux nixos/release.nix works |
Maybe related. After recent changes to `master` SLNOS manual builds started to fail too.
The errors look like this
```screen
runtime error: file /nix/store/<censored>-docbook-xsl-ns-1.79.1/xml/xsl/docbook/lib/lib.xsl line 60 element choose
xsltApplySequenceConstructor: A potential infinite template recursion was detected.
You can adjust xsltMaxDepth (--maxdepth) in order to raise the maximum number of nested template calls and variables/params (currently set to 3000).
Templates:
#0 name string.subst
#1 name string.subst
#2 name string.subst
#3 name string.subst
#4 name string.subst
#5 name string.subst
#6 name string.subst
#7 name string.subst
#8 name string.subst
#9 name string.subst
#10 name string.subst
#11 name string.subst
#12 name string.subst
#13 name string.subst
#14 name string.subst
Variables:
#0
replacement
target
string
#1
target
string
#2
string
#3
<etc>
```
I thought that maybe SLNOS f*cked something up in a docstring somewhere and bisected it to some commit that started triggering the bug, but applying that commit with its deps to master didn't produce any errors. Eventually I discovered that applying enough nixos-related commits from SLNOS to master in any order triggered the bug (seriously).
The fix that helped SLNOS to start building again was
```diff
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index aaaaaaaaaaa..bbbbbbbbbbb 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -302,20 +302,21 @@ in rec {
# Generate the NixOS manpages.
manpages = runCommand "nixos-manpages"
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
allowedReferences = ["out"];
}
''
# Generate manpages.
mkdir -p $out/share/man
xsltproc --nonet \
+ --maxdepth 6000 \
--param man.output.in.separate.dir 1 \
--param man.output.base.dir "'$out/share/man/'" \
--param man.endnotes.are.numbered 0 \
--param man.break.after.slash 1 \
--stringparam target.database.document "${olinkDB}/olinkdb.xml" \
${docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
${manual-combined}/man-pages-combined.xml
'';
}
```
(It like pretty much proposes this fix in the error message above, duh. But I spent three hours bisecting like an idiot instead.)
I guess that either nixos added some unrelated module which now pushes it over the `maxdepth` edge when applying enough patches from SLNOS or the manual builder got really inefficient recently. I did notice that `nix-build -A config.system.build.manual.manpages ./nixos/default.nix` does take quite walltime to build on `master`, which is the main reason why bisecting took so long, but I'm too lazy to investigate further.
|
I investigated the xsltproc thing a bit more:
I went for adding an equivalent patch to which might be overly aggressive. If that does look reasonable I'll open a PR for it. |
It does look reasonable to me. Please do open a PR.
|
|
See NixOS#37903 (comment) for details. With the previous patch and some custom modules included in `configuration.nix` the above bug is very easy to trigger. This is a simplest workaround I have. A proper solution would look like NixOS#37903 (comment).
Issue description
Someone in IRC reported that the manual fails to build on master. I tried just now and it fails with an architecture error:
error: a 'aarch64-linux' is required to build '/nix/store/lw85sjkph6rxj4piw00i2pnnj2436gb1-options-db.xml.drv', but I am a 'x86_64-linux'
I'm not sure if this is supposed to not work anymore and requires building of all architectures to build the options db for the manual itself, or if this is a bug that needs fixed.
Steps to reproduce
git clone https://github.com/NixOS/nixpkgs --branch=master
nix-build -A manual nixos/release.nix
Technical details
"x86_64-linux"
Linux 4.14.27, NixOS, 18.03.git.61ede376684 (Impala)
yes
yes
nix-env (Nix) 2.0
"nixos-18.03pre130932.cc4677c36ee"
/home/sam/nixpkgs/custom
The text was updated successfully, but these errors were encountered: