haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Building documentation fails with a Python import error

Open ozkutuk opened this issue 3 years ago • 1 comments

Build of the documentation fails with the message provided in the "Actual behaviour" section. It fails regardless of the method used for building the documentation (i.e. both with nix build .#docs and with cd docs; make html).

Your environment

Which OS do you use? NixOS

Steps to reproduce

nix build .#docs

Expected behaviour

Documentations should be building

Actual behaviour

error: builder for '/nix/store/8vfimsxaib5l3n77gap9vswgv6bhw0zx-hls-docs.drv' failed with exit code 2;
       last 10 log lines:
       > unpacking source archive /nix/store/2djd5r3qzm8ay4ygajk8rj0kf17hqmhz-source
       > source root is source
       > patching sources
       > configuring
       > no configure script, doing nothing
       > building
       > Running Sphinx v5.1.1
       >
       > Extension error:
       > Could not import extension myst_parser (exception: No module named 'myst_parser')
       For full logs, run 'nix log /nix/store/8vfimsxaib5l3n77gap9vswgv6bhw0zx-hls-docs.drv'.

Debug information

ozkutuk avatar Sep 22 '22 11:09 ozkutuk

The error thrown by Nix probably indicates a bug in our nix files.

Meanwhile, when not using Nix, you need to use pip install -r requirements.txt to install the dependencies first. You may use something like venv to prevent the python libraries from being installed globally.

Contributions welcome!

kokobd avatar Sep 22 '22 12:09 kokobd

Is there a particular reason for not using the myst-parser and sphinx_rtd_theme packaged on nixpkgs? It seems like there is an issue with packages provided through poetry2nix. I have replaced those two with their nixpkgs counterparts and documentation built successfully (well, it still failed but that's unrelated to the nix issue, caused by a sphinx warning promoted to an error).

ozkutuk avatar Sep 26 '22 20:09 ozkutuk

I have replaced those two with their nixpkgs counterparts and documentation built successfully

Looks good to me ;)

kokobd avatar Sep 26 '22 23:09 kokobd