NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.44k stars 13.65k forks source link

[nix-darwin/home-manager] manual-combined.xml fails to validate #196651

Closed CorbanR closed 1 year ago

CorbanR commented 1 year ago

Steps To Reproduce

Steps to reproduce the behavior: I use nix flakes to manage my local darwin config, and started getting that manual-combined.xml to validate error. After doing a bit of git bisect I tracked it to commit https://github.com/NixOS/nixpkgs/commit/6259b29f290e27b8853982bfded52d3f0653bdc2

Build anything after https://github.com/NixOS/nixpkgs/commit/6259b29f290e27b8853982bfded52d3f0653bdc2 when using both nix-darwin and home-manager to manage your local system and you will see the error.

Build anything before, such as https://github.com/NixOS/nixpkgs/commit/46e516e4434ca65e31ecb1e3df4f03c7e2fe953d and the error goes away.

NOTE: this does not appear to be an issue with either nix-darwin or home-manager

Build log

error: builder for '/nix/store/38i5bxw4h8d5ngijf9j6pbqvfin5vcz5-darwin-manual-combined.drv' failed with exit code 3;
       last 10 log lines:
       > manual-combined.xml:14: element variablelist: Relax-NG validity error : Did not expect element variablelist there
       >     10         <para>Nix modules for darwin.</para>
       >     11   </preface>
       >     12      <chapter xml:id="sec-options">
       >     13   <title>Configuration Options</title>
       >     14    <variablelist xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="configuration-variable-list" xml:base="generated/options-db.xml"><varlistentry><term xlink:href="#opt-_module.args" xml:id="opt-_module.args"><option>_module.args</option></term><listitem><para/><para><emphasis>Type:</emphasis> lazy attribute set of raw value</para><para><emphasis>Declared by:</emphasis></para><simplelist><member><filename xlink:href="https://github.com/LnL7/nix-darwin/blob/ef56fd8979b5f4e800c4716f62076e00600b1172/">
       >     15                &lt;lib/modules.nix&gt;
       >     16               </filename></member></simplelist></listitem></varlistentry><varlistentry><term xlink:href="#opt-documentation.enable" xml:id="opt-documentation.enable"><option>documentation.enable</option></term><listitem><para>Whether to install documentation of packages from
       >
       > manual-combined.xml fails to validate
       For full logs, run 'nix log /nix/store/38i5bxw4h8d5ngijf9j6pbqvfin5vcz5-darwin-manual-combined.drv'.
error: 1 dependencies of derivation '/nix/store/pxy9rw964rsmlrd5ab26iqrdhh6gz996-darwin-manpages.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jccwswlfp1k8m2zmd9l7dqalcmsqclz1-darwin-manual-html.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1caq3s3xdpy7zp49k8ky7x126p7g2nmq-system-applications.drv' failed to build
error: 1 dependencies of derivation '/nix/store/nf85fcnmciky8d2na8yinlcn0b0qbdc0-darwin-system-22.11.20221018.5c77b29+darwin4.ef56fd8.drv' failed to build

Additional context

I'm using nix flakes to manage my local configuration. I'm using github:NixOS/nixpkgs/nixpkgs-unstable channel in most cases. Rest of the steps are in the reproduce section

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 21.6.0, macOS 12.6`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.11.0`
 - channels(root): `"nixpkgs"`
warning: Nix search path entry '/nix/store/nfnv71kd0559a68d6vxqgcris30kdjm0-source' does not exist, ignoring
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
CorbanR commented 1 year ago

@roberth and @Ma27 (Notifying as requested by ticket)

andrevmatos commented 1 year ago

Same issue here. Reverting #194035 fixes it for unstable.

Ma27 commented 1 year ago

I can take a look this afternoon when I'm on the train to Paris :)

themaxhero commented 1 year ago

Same issue here, I had to disable manual on home-manager as a workaround.

manual.manpages.enable = false; on my home-manager

i-am-logger commented 1 year ago

I can confirm @themaxhero temp solution works.

manual.manpages.enable = false; # in home-manager

still looking for a fix so i can re-enable man

Ma27 commented 1 year ago

So... strictly speaking it is a hm/nix-darwin issue because these manpages don't quote their " correctly in option names (which is now necessary and the whole point of the PR in question).

I'll file a patch for rycee/nmd later that should ifx it for home-manager.

Ma27 commented 1 year ago

Fix for home-manager is out now: https://gitlab.com/rycee/nmd/-/merge_requests/6

Will do nix-darwin later.

CorbanR commented 1 year ago

So... strictly speaking it is a hm/nix-darwin issue because these manpages don't quote their " correctly in option names (which is now necessary and the whole point of the PR in question).

I'll file a patch for rycee/nmd later that should ifx it for home-manager.

ahh, sorry about that and thank you for fixing!!

Ma27 commented 1 year ago

Opened lnl7/nix-darwin#552.

roberth commented 1 year ago

Long term solution for both projects is to help them use nixosOptionsDoc, and make improvements to it if necessary. Also

Ma27 commented 1 year ago

OK, home-manager upstream seems fixed, I'd wait until the nix-darwin PR is merged and then I'd close this issue.

Ma27 commented 1 year ago

Fixes landed in both nix-darwin and home-manager. I guess there's nothing more actionable here, so I'll close this. If I forgot about something, please let me know!

cognivore commented 1 year ago

I've weirdly started hitting something like this on my WSL home-manager running 22-x state version. It mentions some darwin XMLs and it's all very confusing. How to disable building manual-combined entirely?

Read the code, found the keys. Adding this fixes to home.nix the issue:

  # Some weird bug
  manual.manpages.enable = false;
  manual.html.enable = false;
  manual.json.enable = false;
GuillaumeDesforges commented 1 year ago

Had the same issue on WSL 1.0.3.0 as well when updating home-manager from e7eba9cc46547ae86642ad3c6a9a4fb22c07bc26 to c43d4a3d6d9ef8ddbe2438362f5c775b4186000b

ncfavier commented 1 year ago

Could you provide the complete error log please? Also, what revision of nixpkgs?

nixos-discourse commented 1 year ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/segmentation-faults-when-building-with-flake-on-raspberry-pi-3b/27069/5

SohamG commented 1 year ago

I just downgraded from unstable to 22.11 and I have this issue when moving over the home-manager stuff. My system flake switch'd fine, and nix profile upgrade also worked fine.

I guess the fix is only for unstable?

roberth commented 1 year ago

22.11 will be EOL by the end of July iirc, so I don't think this is worth fixing. You could probably work around the issue by disabling the documentation build in your config. You'll be looking to set options like these to false.

SohamG commented 1 year ago

Thats understandable. I have the workaround for now. FWIW I am on x86 linux

ncfavier commented 1 year ago

Are you using corresponding branches of nixos and home-manager? We only fix things for this configuration.

hraban commented 1 year ago

FWIW I just upgraded, and I encountered this issue for the first time. I found this thread using Google and the workaround of disabling man pages in home-manager config works (thanks!).

My upgrade:

    'github:nix-community/home-manager/e0034971f9def16bbc32124147787bc0f09f0e59' (2023-06-14)
  → 'github:nix-community/home-manager/d2b6f2d154bf6b27a93ed895392f80c503df7cfa' (2023-06-23)

system:

 - system: `"aarch64-darwin"`
 - host os: `Darwin 22.5.0, macOS 13.4.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.15.1`
 - channels(user): `""`
 - channels(root): `""`
 - nixpkgs: `/nix/store/fqjg9y9pwh9cg2izs76kkv0wwwpsqp1v-source`
ncfavier commented 1 year ago

Yes, the new instance is being tracked in https://github.com/nix-community/home-manager/issues/4142