mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.94k stars 716 forks source link

Build fails on macOS Sierra (a2x, xsltproc) #939

Closed elzii closed 7 years ago

elzii commented 7 years ago

Here is a full log from brew

Relevant bit (I think):

a2x --no-xmllint -f manpage ../doc/kak.1.txt
a2x --no-xmllint -f manpage ../doc/manpages/commands.asciidoc
a2x --no-xmllint -f manpage ../doc/manpages/execeval.asciidoc
a2x --no-xmllint -f manpage ../doc/manpages/expansions.asciidoc
a2x --no-xmllint -f manpage ../doc/manpages/faces.asciidoc
a2x --no-xmllint -f manpage ../doc/manpages/faq.asciidoc
a2x --no-xmllint -f manpage ../doc/manpages/highlighters.asciidoc
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161124-72283-jl9yhi/doc/manpages/faces.xml" returned non-zero exit status 5
make: *** [../doc/manpages/faces.gz] Error 1
make: *** Waiting for unfinished jobs....
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161124-72283-jl9yhi/doc/kak.1.xml" returned non-zero exit status 5
make: *** [../doc/kak.1.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161124-72283-jl9yhi/doc/manpages/execeval.xml" returned non-zero exit status 5
make: *** [../doc/manpages/execeval.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161124-72283-jl9yhi/doc/manpages/faq.xml" returned non-zero exit status 5
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161124-72283-jl9yhi/doc/manpages/expansions.xml" returned non-zero exit status 5
make: *** [../doc/manpages/faq.gz] Error 1
make: *** [../doc/manpages/expansions.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161124-72283-jl9yhi/doc/manpages/highlighters.xml" returned non-zero exit status 5
make: *** [../doc/manpages/highlighters.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161124-72283-jl9yhi/doc/manpages/commands.xml" returned non-zero exit status 5
make: *** [../doc/manpages/commands.gz] Error 1

As per #579 here are some of the outputs requested:

~ which a2x
/usr/local/bin/a2x
~ which a2x.py
/usr/local/bin/a2x.py
~ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
~ printf 'all:\n\techo $(shell which a2x)' | make -f -
echo /usr/local/bin/a2x
/usr/local/bin/a2x
~ printf 'all:\n\techo $(shell which a2x.py)' | make -f -
echo /usr/local/bin/a2x.py
/usr/local/bin/a2x.py
~ printf 'all:\n\techo $$PATH' | make -f -
/Users/elzi/.rvm/bin:
/Users/elzi/.rvm/gems/ruby-2.3.1/bin:
/Users/elzi/.rvm/gems/ruby-2.3.1@global/bin:
/Users/elzi/.rvm/rubies/ruby-2.3.1/bin:
/Users/elzi/.nvm/versions/node/v5.0.0/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/opt/X11/bin:
/usr/local/go/bin:
/usr/local/bin:
/usr/bin:
/usr/sbin:
/usr/local/sbin:
elzii commented 7 years ago

Update:

Compiling manually with

make install PREFIX=/usr/local

succeeded. I have no experience with asciidoc or a2x but the process took a long time when running them. Ex:

a2x --no-xmllint -f manpage ../doc/manpages/commands.asciidoc
sed -i -r -e "s,^\.TH .+,.TH KAKOUNE 1 \"\" \"\" \"commands\"," \
    -e "/^\.SH \"NAME\"/{N;d;}" ../doc/manpages/commands.1
gzip -f ../doc/manpages/commands.1
mv -f ../doc/manpages/commands.1.gz ../doc/manpages/commands.gz
a2x --no-xmllint -f manpage ../doc/manpages/execeval.asciidoc
sed -i -r -e "s,^\.TH .+,.TH KAKOUNE 1 \"\" \"\" \"execeval\"," \
    -e "/^\.SH \"NAME\"/{N;d;}" ../doc/manpages/execeval.1
gzip -f ../doc/manpages/execeval.1

Unsure how that might relate to a2x failing via brew install

lenormf commented 7 years ago

Could you try installing Kakoune using contrib/kakoune.rb, with the following patch applied:

diff --git a/contrib/kakoune.rb b/contrib/kakoune.rb
index 018774d..260b74f 100644
--- a/contrib/kakoune.rb
+++ b/contrib/kakoune.rb
@@ -6,6 +6,7 @@ class Kakoune < Formula

   depends_on 'boost'
   depends_on 'asciidoc' => :build
+  depends_on 'docbook-xsl' => :build

   def install
     cd 'src' do
casimir commented 7 years ago

Also the xml catalog path is not set by default, you have to export XML_CATALOG_FILES=/usr/local/etc/xml/catalog to build the doc without problem.

% brew info asciidoc
asciidoc: stable 8.6.9 (bottled), HEAD
Formatter/translator for text files to numerous formats. Includes a2x.
http://asciidoc.org/
/usr/local/Cellar/asciidoc/8.6.9_1 (217 files, 2.6M) *
  Built from source on 2016-09-26 at 13:24:19 with: --with-docbook-xsl
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/asciidoc.rb
==> Dependencies
Required: docbook ✔
Optional: docbook-xsl ✔
==> Options
--with-docbook-xsl
        Install DTDs to generate manpages
--HEAD
        Install HEAD version
==> Caveats
If you intend to process AsciiDoc files through an XML stage
(such as a2x for manpage generation) you need to add something
like:

  export XML_CATALOG_FILES=/usr/local/etc/xml/catalog

to your shell rc file so that xmllint can find AsciiDoc's
catalog files.

See `man 1 xmllint' for more.
lenormf commented 7 years ago

@casimir would something like the following work?

diff --git a/contrib/kakoune.rb b/contrib/kakoune.rb
index 018774d..260b74f 100644
--- a/contrib/kakoune.rb
+++ b/contrib/kakoune.rb
@@ -6,6 +6,7 @@ class Kakoune < Formula

   depends_on 'boost'
   depends_on 'asciidoc' => :build
+  depends_on 'docbook-xsl' => :build

   def install
     cd 'src' do
diff --git a/src/Makefile b/src/Makefile
index 966582d..87dfa4d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -37,6 +37,7 @@ mandir := $(DESTDIR)$(PREFIX)/share/man/man1
 os := $(shell uname)

 ifeq ($(os),Darwin)
+    XML_CATALOG_FILES=/usr/local/etc/xml/catalog
     LIBS += -lncurses -lboost_regex-mt
     CPPFLAGS += -I/usr/local/opt/ncurses/include
     LDFLAGS += -L/usr/local/opt/ncurses/lib
casimir commented 7 years ago

It will if you use the brew version of asciidoc (with --with-docbook-xsl) at least. This could be a sensible default.

The command I use to reinstall kakoune every day is this one:

XML_CATALOG_FILES=/usr/local/etc/xml/catalog \
PKG_CONFIG_PATH=/usr/local/opt/ncurses/lib/pkgconfig \
brew reinstall --HEAD https://raw.githubusercontent.com/mawww/kakoune/master/contrib/kakoune.rb
lenormf commented 7 years ago

User @jjthrash reportedly managed to install Kakoune using the following patch (the asciidoc might have to be removed beforehand):

diff --git a/contrib/kakoune.rb b/contrib/kakoune.rb
index 018774d..326b89d 100644
--- a/contrib/kakoune.rb
+++ b/contrib/kakoune.rb
@@ -5,7 +5,8 @@ class Kakoune < Formula
   head "https://github.com/mawww/kakoune.git"

   depends_on 'boost'
-  depends_on 'asciidoc' => :build
+  depends_on 'docbook-xsl' => :build
+  depends_on 'asciidoc' => [:build, 'with-docbook-xsl']

   def install
     cd 'src' do
nonphoto commented 7 years ago

I'm having issues on Sierra even after the patch:

==> make install PREFIX=/usr/local/Cellar/kakoune/HEAD-e441295
Last 15 lines from /Users/xxxxx/Library/Logs/Homebrew/kakoune/01.make:
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161212-53682-1wc7llx/doc/manpages/faq.xml" returned non-zero exit status 5
make: *** [../doc/manpages/faq.gz] Error 1
make: *** Waiting for unfinished jobs....
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161212-53682-1wc7llx/doc/manpages/highlighters.xml" returned non-zero exit status 5
make: *** [../doc/manpages/highlighters.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161212-53682-1wc7llx/doc/manpages/execeval.xml" returned non-zero exit status 5
make: *** [../doc/manpages/execeval.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161212-53682-1wc7llx/doc/manpages/commands.xml" returned non-zero exit status 5
make: *** [../doc/manpages/commands.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161212-53682-1wc7llx/doc/manpages/expansions.xml" returned non-zero exit status 5
make: *** [../doc/manpages/expansions.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161212-53682-1wc7llx/doc/kak.1.xml" returned non-zero exit status 5
make: *** [../doc/kak.1.gz] Error 1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/usr/local/Cellar/asciidoc/8.6.9_1/etc/asciidoc/docbook-xsl/manpage.xsl" "/private/tmp/kakoune-20161212-53682-1wc7llx/doc/manpages/faces.xml" returned non-zero exit status 5
make: *** [../doc/manpages/faces.gz] Error 1

Building manually from the repository does not succeed either:

In file included from color.cc:5:
./regex.hh:8:10: fatal error: 'boost/regex.hpp' file not found
#include <boost/regex.hpp>
         ^

Boost is installed with Homebrew:

boost: stable 1.62.0 (bottled), HEAD
Collection of portable C++ source libraries
https://www.boost.org/
/usr/local/Cellar/boost/1.62.0 (12,405 files, 396.4M) *
  Poured from bottle on 2016-12-12 at 19:49:33
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb
==> Dependencies
Optional: icu4c ✔
==> Requirements
Optional: mpi ✘
==> Options
--c++11
    Build using C++11 mode
--universal
    Build a universal binary
--with-icu4c
    Build regexp engine with icu support
--with-mpi
    Build with MPI support
--without-single
    Disable building single-threading variant
--without-static
    Disable building static library variant
--HEAD
    Install HEAD version
nemtsov commented 7 years ago

Similar issue:

In file included from color.cc:5:
./regex.hh:8:10: fatal error: 'boost/regex.hpp' file not found
#include <boost/regex.hpp>
         ^
1 warning and 1 error generated.
make: *** [.color.debug.o] Error 1
➜  brew info boost
boost: stable 1.62.0 (bottled), HEAD
Collection of portable C++ source libraries
https://www.boost.org/
/usr/local/Cellar/boost/1.62.0 (12,405 files, 396.4M) *
  Poured from bottle on 2016-12-13 at 09:14:16
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb
==> Dependencies
Optional: icu4c ✘
==> Requirements
Optional: mpi ✘
==> Options
--c++11
    Build using C++11 mode
--universal
    Build a universal binary
--with-icu4c
    Build regexp engine with icu support
--with-mpi
    Build with MPI support
--without-single
    Disable building single-threading variant
--without-static
    Disable building static library variant
--HEAD
    Install HEAD version
lenormf commented 7 years ago

Please forward your comments on #954, the newly created issue about this problem.

nonphoto commented 7 years ago

954 takes care of the issues when installing via Homebrew, but not when installing manually. Should I create a new issue for this?

lenormf commented 7 years ago

@nonphoto yes please, the environment variable needs to be exported into the Makefile as well.

nemtsov commented 7 years ago

@lenormf FYI, I just tested on the latest and #954 (and the #966 fix) did not fix the boost issue above.

lenormf commented 7 years ago

Unfortunately the fixes regarding those issues are not related, maybe we need to declare boost as a build dependency as well ?

diff --git a/kakoune.rb b/kakoune.rb
index 6c6860f..e4b5f44 100644
--- a/kakoune.rb
+++ b/kakoune.rb
@@ -4,7 +4,7 @@ class Kakoune < Formula
   homepage "https://github.com/mawww/kakoune"
   head "https://github.com/mawww/kakoune.git"

-  depends_on 'boost'
+  depends_on 'boost' => :build
   depends_on 'docbook-xsl' => :build
   depends_on 'asciidoc' => [:build, 'with-docbook-xsl']
nonphoto commented 7 years ago

I created #987 for the Boost-related errors.