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

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

Closed
krafczyk opened this issue Mar 21, 2015 · 21 comments
Closed
Assignees

Comments

@krafczyk
Copy link

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
Copy link
Member

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
Copy link
Author

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
Copy link

dkubb commented Aug 17, 2015

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
Copy link

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 <[email protected]>
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 [email protected]
+   $(trace-gen) $(xmllint) --xinclude $< -o [email protected]
    @mv [email protected] $@

 $(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
Copy link

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

@Hodapp87
Copy link

I just ran into this too on Arch.

@lambdafu
Copy link

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
Copy link

DavidEGrayson commented Jun 22, 2016

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
Copy link
Member

vcunat commented Jun 22, 2016

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
Copy link
Member

vcunat commented Jun 22, 2016

Why was this closed?

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

@robstewart57
Copy link

Am I right in thinking that the expected use of #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
Copy link
Contributor

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
Copy link
Contributor

nh2 commented Jul 1, 2019

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
Copy link
Member

edolstra commented Jul 1, 2019

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

@nh2
Copy link
Contributor

nh2 commented Jul 1, 2019

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:

  • We add to the instructions for building Nix from source that --disable-doc-gen is a workaround when building the manual fails due to outdated docbook versions (I suspect that's the reason for I/O error : Attempt to load network entity http://docbook.org/xml/5.0/rng/docbook.rng but am not super sure).
  • We further mention that if users just want to make contributions, nix-shell is the preferred workflow that's guaranteed to work.
  • We also add more bullet points to help users with other build errors, like ./configure complaining about missing EDITLINE on Ubuntu 16.04 (which has no libeditline .pc file; that was added only in a newer release of editline). There was a commit de59973 to help with that on Ubuntu and Debian, but it "got lost" because only the commit message describes how to use it, not the manual.
  • The general direction would be that for hacking, we recommend nix-shell, and for building-from-source, we provide workarounds for common problems (such as disabling docs generation).
  • When the above points are done and we've added workaround instructions for Debian, Ubuntu and Arch, we close this issue.

What do you think about this?

@nh2
Copy link
Contributor

nh2 commented Jul 3, 2019

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 added a commit to nh2/nix that referenced this issue Jul 3, 2019
Also give a helpful error message on what package the user likely
has to install to make it work.
nh2 added a commit to nh2/nix that referenced this issue Jul 3, 2019
This should finally allow us to address all cases of build errors due to
differences between release tarballs and building from git.

See also NixOS#506 (comment)
@nh2
Copy link
Contributor

nh2 commented Jul 3, 2019

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
Copy link
Contributor

nh2 commented Jul 3, 2019

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.

@edolstra edolstra closed this as completed Jul 3, 2019
@jamesray1
Copy link

jamesray1 commented Oct 23, 2019

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
Copy link

madobet commented Oct 28, 2019

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
Copy link

You're welcome!

zolodev pushed a commit to zolodev/nix that referenced this issue Jan 1, 2024
Add information about the behaviour of `import` if the given path is a directory.

Co-authored-by: Silvan Mosberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests