NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.83k stars 1.52k forks source link

Building nix fails on ubuntu 14.10 because xsltproc is passed --nonet #506

Closed krafczyk closed 5 years ago

krafczyk commented 9 years ago

When building the target doc/manual/manual.is-valid,

xsltproc is passed the option --nonet. Since the document which is fetched for this target is http://docbook.org/xml/5.0/rng/docbook.rng,

xsltproc fails with the following output:

GEN Makefile.config GEN doc/manual/manual.xmli GEN doc/manual/manual.is-valid I/O error : Attempt to load network entity http://docbook.org/xml/5.0/rng/docbook.rng warning: failed to load external entity "http://docbook.org/xml/5.0/rng/docbook.rng" Relax-NG parser error : xmlRelaxNGParse: could not load http://docbook.org/xml/5.0/rng/docbook.rng Relax-NG schema http://docbook.org/xml/5.0/rng/docbook.rng failed to compile -:1: parser error : Document is empty

^ -:1: parser error : Start tag expected, '<' not found

^ doc/manual/local.mk:29: recipe for target 'doc/manual/manual.is-valid' failed make: *\ [doc/manual/manual.is-valid] Error 1

Removing --nonet from the xsltproc lines fixes this error.

edolstra commented 9 years ago

Try building from a tarball (http://nixos.org/releases/nix/nix-1.8/nix-1.8.tar.xz). It already contains the generated docs. If you do build from GitHub, you need to ensure that the Docbook schemas / stylesheets are installed in the appropriate locations. The configure script doesn't check for this because it's not a requirement when building from the tarball.

krafczyk commented 9 years ago

I have failed to find where to look to ensure that the docbook schemas are installed. Can you point me to the right location?

dkubb commented 9 years ago

The configure script doesn't check for this because it's not a requirement when building from the tarball.

@edolstra I am building from the 1.9 tarball and am seeing the same error. I'm testing the build process on Alpine Linux, which has very few ootb dependencies.

Is it possible that you aren't seeing this error because you're building the tarball on a more capable system (NixOS?) that already has the dependencies preinstalled?

RomanHargrave commented 9 years ago

Can confirm. I am encountering this error on Debian 8.1. I was able to resolve it by (indiscriminately) removing --nonet from the make scripts.

Fix:

From 2d618e3f26870aa523f0fc6b090090c8cf65a652 Mon Sep 17 00:00:00 2001
From: Roman Hargrave <roman@hargrave.info>
Date: Wed, 19 Aug 2015 22:37:13 -0500
Subject: [PATCH] Remove --nonet from xmllint parameters

---
 doc/manual/local.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/manual/local.mk b/doc/manual/local.mk
index 3d7e7fe..67f3fbb 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
@@ -1,4 +1,4 @@
-XSLTPROC = $(xsltproc) --nonet $(xmlflags) \
+XSLTPROC = $(xsltproc) $(xmlflags) \
   --param section.autolabel 1 \
   --param section.label.includes.component.label 1 \
   --param html.stylesheet \'style.css\' \
@@ -18,7 +18,7 @@ MANUAL_SRCS := $(call rwildcard, $(d), *.xml)

 # Do XInclude processing / RelaxNG validation
 $(d)/manual.xmli: $(d)/manual.xml $(MANUAL_SRCS) $(d)/version.txt
-   $(trace-gen) $(xmllint) --nonet --xinclude $< -o $@.tmp
+   $(trace-gen) $(xmllint) --xinclude $< -o $@.tmp
    @mv $@.tmp $@

 $(d)/version.txt:
@@ -28,7 +28,7 @@ $(d)/version.txt:
 $(d)/manual.is-valid: $(d)/manual.xmli
    $(trace-gen) $(XSLTPROC) --novalid --stringparam profile.condition manual \
      $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \
-     $(xmllint) --nonet --noout --relaxng $(docbookrng) -
+     $(xmllint) --noout --relaxng $(docbookrng) -
    @touch $@

 clean-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid
-- 
2.5.0-rc2
hasufell commented 9 years ago

Building from the git repository should just work without manual fiddling.

Hodapp87 commented 8 years ago

I just ran into this too on Arch.

lambdafu commented 8 years ago

Installing docbook5-schemas and docbook5-style-xsl fixed this for me on Fedora 23. I think that's better than removing --nonet, but configure should check for it (at least with a warning).

DavidEGrayson commented 8 years ago

Why was this closed? The instructions for building Nix from source do not currently seem to work if you are building from the git repository. I had to remove all instances of --nonet from doc/manual/local.mk to get the build working on Arch Linux.

Building Nix from an official tarball is not an option for me because I am making a pull request to the documentation and I wish to see the generated documentation before submitting my pull request.

@edolstra How can I "ensure that the Docbook schemas / stylesheets are installed in the appropriate locations"?

vcunat commented 8 years ago

I'd personally first obtain the nix-* binaries, e.g. by building without the docs, and then I'd use the ./dev-shell. That way you get all dependencies from nixpkgs and not some random set from your host OS.

vcunat commented 8 years ago

Why was this closed?

It doesn't appear this issue has ever been closed.

robstewart57 commented 6 years ago

Am I right in thinking that the expected use of https://github.com/NixOS/nix/pull/1066 is:

./configure --disable-doc-gen

If not, what is the expected use of this flag? If it is, should this be added to documentation for building from source for the affected distros?

armijnhemel commented 6 years ago

I would like to stress that it would be good to add this to the docs. It bit me as well and it wasn't obvious to me.

nh2 commented 5 years ago

Can we get this fixed?

I'm on Ubuntu 16.04, and I really want to add some things to the manual, but nix and its docs not compiling properly means I can't really contribute here.

edolstra commented 5 years ago

The best way to hack on Nix is to use a Nix shell. It should provide the dependencies necessary for building the manual.

nh2 commented 5 years ago

In nix-shell it works; that is, running nix-shell and doing

./bootstrap
./configure
make doc/manual/manual.html

builds the manual.

The instructions for building Nix from source do not currently seem to work if you are building from the git repository.

@edolstra I think the nix-shell workflow addresses the "hacking on / contributing to nix" use case. But it seems that building from source as per the linked manual section should work or at least have workarounds mentioned for when it doesn't.

What's your preferred plan to deal with this?

A proposal:

What do you think about this?

nh2 commented 5 years ago

I/O error : Attempt to load network entity http://docbook.org/xml/5.0/rng/docbook.rng

Installing docbook5-schemas and docbook5-style-xsl fixed this for me on Fedora 23

I think I've found the solution to that one for Ubuntu/Debian:

sudo apt-get install docbook-xsl-ns

@krafczyk @RomanHargrave @Hodapp87 can you try that for your respective distros?

I found it via strace in nix-shell, where it's opening:

open("/nix/store/pzlp4c112srip3i95w7xn70vkm3icpyj-docbook-xsl-ns-1.79.1/share/xml/docbook-xsl-ns/profiling/profile.xsl", O_RDONLY)

So if you install the corresponding package from your distro, that should work even with --nonet.

nh2 commented 5 years ago

PR to fix it all: #2979

@krafczyk @RomanHargrave @Hodapp87 can you try this PR for your respective distros and report whether this gives better instructions of what's needed / what to do?

nh2 commented 5 years ago

My PR was merged, ./configure will now complain if --nonet doesn't work due to missing deps pre-downloaded deps, and instruct what package to install.

We can probably close this.

jamesray1 commented 5 years ago

Moved to #3162 and edited there:

I got a similar error when running make on Manjaro Archlinux, as detailed in #3154.

After installing docbook-xsl-ns, I got a lot of cannot stat ** No such file or directory messages.

➜  nix git:(fix-link) yay docbook-xsl-ns
1 aur/docbook-xsl-ns 1.79.2-1 (+1 0.00%) 
    The recommended namespaced XML stylesheets for Docbook5 transformations
==> Packages to install (eg: 1 2 3, 1-3 or ^4)
==> 1
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur: 1]  docbook-xsl-ns-1.79.2-1

:: Downloaded PKGBUILD (1/1): docbook-xsl-ns
  1 docbook-xsl-ns                           (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: Parsing SRCINFO (1/1): docbook-xsl-ns
==> Making package: docbook-xsl-ns 1.79.2-1 (Wed 23 Oct 2019 11:29:55 AEDT)
==> Retrieving sources...
  -> Downloading docbook-xsl-1.79.2.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   615    0   615    0     0   1830      0 --:--:-- --:--:-- --:--:--  1830
100 23.8M  100 23.8M    0     0   519k      0  0:00:47  0:00:47 --:--:--  579k
==> Validating source files with md5sums...
    docbook-xsl-1.79.2.tar.gz ... Passed
==> Validating source files with sha256sums...
    docbook-xsl-1.79.2.tar.gz ... Passed
==> Cleaning up...
==> Making package: docbook-xsl-ns 1.79.2-1 (Wed 23 Oct 2019 11:30:43 AEDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found docbook-xsl-1.79.2.tar.gz
==> Validating source files with md5sums...
    docbook-xsl-1.79.2.tar.gz ... Passed
==> Validating source files with sha256sums...
    docbook-xsl-1.79.2.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting docbook-xsl-1.79.2.tar.gz with bsdtar
==> Sources are ready.
==> Making package: docbook-xsl-ns 1.79.2-1 (Wed 23 Oct 2019 11:30:45 AEDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
assembly
---Info Ende ---
install: cannot stat 'assembly/*.xml': No such file or directory
install: cannot stat 'assembly/*.dtd': No such file or directory
install: cannot stat 'assembly/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
common
---Info Ende ---
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
eclipse
---Info Ende ---
install: cannot stat 'eclipse/*.dtd': No such file or directory
install: cannot stat 'eclipse/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
epub
---Info Ende ---
install: cannot stat 'epub/*.xml': No such file or directory
install: cannot stat 'epub/*.dtd': No such file or directory
install: cannot stat 'epub/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
epub3
---Info Ende ---
install: cannot stat 'epub3/*.dtd': No such file or directory
install: cannot stat 'epub3/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
fo
---Info Ende ---
install: cannot stat 'fo/*.dtd': No such file or directory
install: cannot stat 'fo/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
highlighting
---Info Ende ---
install: cannot stat 'highlighting/*.dtd': No such file or directory
install: cannot stat 'highlighting/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
html
---Info Ende ---
install: cannot stat 'html/*.dtd': No such file or directory
install: cannot stat 'html/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
htmlhelp
---Info Ende ---
install: cannot stat 'htmlhelp/*.dtd': No such file or directory
install: cannot stat 'htmlhelp/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
javahelp
---Info Ende ---
install: cannot stat 'javahelp/*.dtd': No such file or directory
install: cannot stat 'javahelp/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
lib
---Info Ende ---
install: cannot stat 'lib/*.dtd': No such file or directory
install: cannot stat 'lib/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
manpages
---Info Ende ---
install: cannot stat 'manpages/*.dtd': No such file or directory
install: cannot stat 'manpages/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
params
---Info Ende ---
install: cannot stat 'params/*.xsl': No such file or directory
install: cannot stat 'params/*.dtd': No such file or directory
install: cannot stat 'params/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
profiling
---Info Ende ---
install: cannot stat 'profiling/*.xml': No such file or directory
install: cannot stat 'profiling/*.dtd': No such file or directory
install: cannot stat 'profiling/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
roundtrip
---Info Ende ---
install: cannot stat 'roundtrip/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
template
---Info Ende ---
install: cannot stat 'template/*.dtd': No such file or directory
install: cannot stat 'template/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
website
---Info Ende ---
install: cannot stat 'website/*.dtd': No such file or directory
install: cannot stat 'website/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
xhtml
---Info Ende ---
install: cannot stat 'xhtml/*.dtd': No such file or directory
install: cannot stat 'xhtml/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
xhtml-1_1
---Info Ende ---
install: cannot stat 'xhtml-1_1/*.dtd': No such file or directory
install: cannot stat 'xhtml-1_1/*.ent': No such file or directory
----- Info -----
/home/jr/.cache/yay/docbook-xsl-ns/pkg/docbook-xsl-ns/usr/share/xml/docbook/xsl-ns-stylesheets-1.79.2
xhtml5
---Info Ende ---
install: cannot stat 'xhtml5/*.dtd': No such file or directory
install: cannot stat 'xhtml5/*.ent': No such file or directory
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "docbook-xsl-ns"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: docbook-xsl-ns 1.79.2-1 (Wed 23 Oct 2019 11:31:02 AEDT)
==> Cleaning up...
[sudo] password for jr: 
Sorry, try again.
[sudo] password for jr: 
Sorry, try again.
[sudo] password for jr: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) docbook-xsl-ns-1.79.2-1

Total Installed Size:  13.35 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                          [##################################################] 100%
(1/1) checking package integrity                                                        [##################################################] 100%
(1/1) loading package files                                                             [##################################################] 100%
(1/1) checking for file conflicts                                                       [##################################################] 100%
(1/1) checking available disk space                                                     [##################################################] 100%
:: Processing package changes...
(1/1) installing docbook-xsl-ns                                                         [##################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate..

I then re-ran make and got the same error. I reran ./bootstrap.sh and ./configure, and I didn't get any warning or errors about nonet missing.

madobet commented 5 years ago

Installing docbook5-schemas and docbook5-style-xsl fixed this for me on Fedora 23. I think that's better than removing --nonet, but configure should check for it (at least with a warning).

I just ran into this too on Arch.

installing docbook5-xml fixed for me on Arch, thanks for the inspiration

jamesray1 commented 5 years ago

You're welcome!