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

bug: DocBook validation errors on Darwin #4142

Closed
2 tasks done
takeda opened this issue Jun 22, 2023 · 24 comments
Closed
2 tasks done

bug: DocBook validation errors on Darwin #4142

takeda opened this issue Jun 22, 2023 · 24 comments
Assignees
Labels

Comments

@takeda
Copy link

takeda commented Jun 22, 2023

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

I updated nix-darwin, home-manager and nixpkgs and after that it refuses to build due to issues with manpages:

building '/nix/store/grcyxm6s51nxqh8288611x2635wfxlxr-docbook-xsl-ns-1.79.2.drv'...
building '/nix/store/njjcgh3bkc8p0md376m1y00vp7j96yg8-manual-combined.drv'...
unpacking sources
unpacking source archive /nix/store/vq0ifa979q5344vxqr98bqfmspyc85an-docbook-xsl-1.79.2.tar.bz2

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element variablelist: Relax-NG validity error : Did not expect element variablelist there
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element varlistentry: Relax-NG validity error : Did not expect element varlistentry there
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element varlistentry: Relax-NG validity error : Expecting element example, got varlistentry
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element varlistentry: Relax-NG validity error : Expecting element bridgehead, got varlistentry
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1504: element listitem: Relax-NG validity error : Did not expect element listitem there
  1500  not bound to an attribute.</simpara>
  1501  <simpara>Some arguments are already passed by default, of which the
  1502  following <emphasis>cannot</emphasis> be changed with this option:</simpara>
  1503  <itemizedlist>
  1504  <listitem><para><simpara><varname>lib</varname>: The nixpkgs library.</simpara>
  1505  </para></listitem>
  1506  <listitem><para><simpara><varname>config</varname>: The results of all options after merging the values from all modules together.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml fails to validate
error: builder for '/nix/store/njjcgh3bkc8p0md376m1y00vp7j96yg8-manual-combined.drv' failed with exit code 3;
       last 10 log lines:
       > /nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1504: element listitem: Relax-NG validity error : Did not expect element listitem there
       >   1500        not bound to an attribute.</simpara>
       >   1501    <simpara>Some arguments are already passed by default, of which the
       >   1502     following <emphasis>cannot</emphasis> be changed with this option:</simpara>
       >   1503    <itemizedlist>
       >   1504  <listitem><para><simpara><varname>lib</varname>: The nixpkgs library.</simpara>
       >   1505 </para></listitem>
       >   1506      <listitem><para><simpara><varname>config</varname>: The results of all options after merging the values from all modules together.</simpara>
       >
       > /nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml fails to validate
       For full logs, run 'nix log /nix/store/njjcgh3bkc8p0md376m1y00vp7j96yg8-manual-combined.drv'.
error: 1 dependencies of derivation '/nix/store/lqxhvymj7bss21lfb5lxw0h3l16l7qck-man-pages.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4a9vr63rd7hgrl0grnq3a88py08qg1s5-home-manager-applications.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wnqi2vb3vfhp29p4v47714s8ybwi9i2l-home-manager-fonts.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3n6911xxzxsfyad4gn15z4lvx9zqp7i7-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rc7g3071nsvla846j11iqcw1f8qbxfrq-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2idk7b5zp12h02dc3iw3fsg8lqbvw60q-activation-dk255056.drv' failed to build
error: 1 dependencies of derivation '/nix/store/7x5v7vx50i6lw12ax73ppvwdh18c0i29-darwin-system-23.11pre496909.3fb3ce0b6b8+darwin4.0000000.drv' failed to build

Here's output of nix log /nix/store/njjcgh3bkc8p0md376m1y00vp7j96yg8-manual-combined.drv

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element variablelist: Relax-NG validity error : Did not expect element variablelist there
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element varlistentry: Relax-NG validity error : Did not expect element varlistentry there
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element varlistentry: Relax-NG validity error : Expecting element example, got varlistentry
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1491: element varlistentry: Relax-NG validity error : Expecting element bridgehead, got varlistentry
  1487  </section>
  1488  </chapter>
  1489   <appendix xml:id="ch-options">
  1490    <title>Configuration Options</title>
  1491    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="home-manager-options" xml:base="nmd-result/home-manager-options.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><simpara>Additional arguments passed to each module in addition to ones
  1492  like <literal>lib</literal>, <literal>config</literal>,
  1493  and <literal>pkgs</literal>, <literal>modulesPath</literal>.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml:1504: element listitem: Relax-NG validity error : Did not expect element listitem there
  1500  not bound to an attribute.</simpara>
  1501  <simpara>Some arguments are already passed by default, of which the
  1502  following <emphasis>cannot</emphasis> be changed with this option:</simpara>
  1503  <itemizedlist>
  1504  <listitem><para><simpara><varname>lib</varname>: The nixpkgs library.</simpara>
  1505  </para></listitem>
  1506  <listitem><para><simpara><varname>config</varname>: The results of all options after merging the values from all modules together.</simpara>

/nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml fails to validate

Maintainer CC

No response

System information

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 22.4.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.15.0`
 - channels(root): `"darwin, home-manager, nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@takeda takeda added bug triage Issues or feature request that have not been triaged yet labels Jun 22, 2023
@ncfavier
Copy link
Member

You updated to what version? Did you run sudo nix-channel --update? Can you post the output of sudo nix-channel --list?

@takeda
Copy link
Author

takeda commented Jun 22, 2023

Yes, I run: sudo -H nix-channel --update

The output is:

darwin https://github.com/LnL7/nix-darwin/archive/master.tar.gz
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

@ncfavier
Copy link
Member

cc @pennae, since this class of errors has historically been following nixpkgs changes, and you were de-docbookifying things recently.

@ncfavier ncfavier changed the title bug: bug: DocBook validation errors on Darwin Jun 22, 2023
@ncfavier ncfavier removed the triage Issues or feature request that have not been triaged yet label Jun 22, 2023
@pennae
Copy link

pennae commented Jun 22, 2023

the error message from schema validation is (unsurprisingly) not very useful. we'd guess that the actual error as a good distance away in the xml file, would need the file to find out. given that the home-manager docs system is neither fully nixpkgs nor fully its own we're not even sure we can do anything to resolve this

@ncfavier
Copy link
Member

My current guess (still investigating) is the change to mdDoc, which is used in a couple places in HM.

@ncfavier ncfavier mentioned this issue Jun 22, 2023
@ncfavier
Copy link
Member

Couldn't reproduce in CI. :( @takeda could you share the contents of /nix/store/bk13pbmm5lw1nvm1b8xajzbbj4vrsqar-manual-combined/manual-combined.xml?

@seh
Copy link

seh commented Jun 22, 2023

Here's my manual-combined.xml file (in a ZIP archive to satisfy GitHub's file upload restrictions).

@takeda
Copy link
Author

takeda commented Jun 22, 2023

Here's my manual-combined.xml.gz

@rycee
Copy link
Member

rycee commented Jun 23, 2023

From what I can tell _module.args contains <simpara> inside <para>, which is not allowed. For example

<para><simpara><varname>lib</varname>: The nixpkgs library.</simpara>
</para>

I've seen this before and thought it was fixed. I'll have a look at what has changed. @takeda Meanwhile, could you make certain that you are using an up to date version of Home Manager?

@ncfavier
Copy link
Member

It looks like #3680 (comment) still applies.

@ncfavier
Copy link
Member

Finally managed to reproduce this. It happens iff using a post-NixOS/nixpkgs#237557 nixpkgs (so, as of now, any unstable channel) AND mdDoc is still a _type wrapper, which NixOS/nixpkgs#237557 undid but nix-darwin works around here.

@ncfavier
Copy link
Member

So the underlying problem is still the same: HM is not ready to properly render _module.args's description, but it was now made visible again.

@emilazy
Copy link
Contributor

emilazy commented Jun 23, 2023

Yes, we've also run into this in nix-darwin. I am working on moving nix-darwin over to using the new upstream NixOS options processor and documentation generator; it is quite easy and removes a lot of duplicated code and complexity, and the old DocBook options can be converted to Markdown automatically. Would Home Manager be interested in moving from nmd to that? I am happy to work on this for HM too if so.

@ncfavier
Copy link
Member

Yes yes yes yes yes please yes.

@emilazy
Copy link
Contributor

emilazy commented Jun 23, 2023

lol, noted :)

I have to finish off nix-darwin first, and Home Manager has an actual manual and not just configuration docs, so it'll probably be a few days. In the meantime I would recommend affected users temporarily disable manual.manpages.enable (and manual.html.enable if you have it on) and look up options in the online copy instead. You can subscribe to this issue to learn when you can toggle it back on.

@seh
Copy link

seh commented Jun 23, 2023

I would recommend affected users temporarily disable manual.manpages.enable

I can confirm that disabling this option in my home.nix file allows me to get past this problem, and on to the next problem.

@takeda
Copy link
Author

takeda commented Jun 24, 2023

I've seen this before and thought it was fixed. I'll have a look at what has changed. @takeda Meanwhile, could you make certain that you are using an up to date version of Home Manager?

@rycee I run nix-channel --update and it updated nixpkgs, home-manager, and nix-darwin to whatever was recent at the time I created the ticket.

If there's a way to do a double check it somehow (like maybe I can get the git hash for each channel) then let me know and I check. But those channels should be latest as of yesterday.

@ncfavier
Copy link
Member

@takeda it's fine, we've confirmed the bug is with the latest versions.

@rycee
Copy link
Member

rycee commented Jun 24, 2023

@takeda Could you try pulling the latest home-manager master now and see if the documentation builds?

@hraban
Copy link
Contributor

hraban commented Jun 24, 2023

@takeda Could you try pulling the latest home-manager master now and see if the documentation builds?

Fwiw it fixed it for me. Thanks.

@rycee
Copy link
Member

rycee commented Jun 24, 2023

@hraban Thanks a lot! Would you mind trying it once more? I made a slightly different solution that should be better.

@hraban
Copy link
Contributor

hraban commented Jun 24, 2023

@rycee this version works as well:

    'github:nix-community/home-manager/29872a1c8f5ed2fde270afb0583d1fabce5e0459' (2023-06-24)
  → 'github:nix-community/home-manager/68aebb45de644b81a71f0c7b8b22ad51c9a0df7a' (2023-06-24)

@rycee
Copy link
Member

rycee commented Jun 24, 2023

@hraban Excellent, thanks a lot for trying it out! I'll close this issue with the hope that it is not just working for you. If anybody still have problems, please reopen the issue.

@takeda
Copy link
Author

takeda commented Jun 26, 2023

@ncfavier @rycee apologies for the delay. I'm confirming that the issue was resolved for me as well. Thank you!

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

No branches or pull requests

9 participants