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

manpage building failed with asciidoc #86

Closed
DachiChang opened this issue Feb 4, 2013 · 21 comments
Closed

manpage building failed with asciidoc #86

DachiChang opened this issue Feb 4, 2013 · 21 comments

Comments

@DachiChang
Copy link

I use asciidoc-8.6.4 and asciidoc-8.6.6 in freebsd amd64 r9.1 to build compton. compiling is fine, but building manpage with asciidoc is failed when install target.

error message

a2x --format manpage compton.1.asciidoc
a2x: ERROR: xmllint --nonet --noout --valid /usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.xml returned non-zero exit status 4

I have already try use 8.6.4 and 8.6.6 the same result. but when i add argument "--no-xmllint" asciidoc goes fine. so is something wrong ?

@DachiChang
Copy link
Author

verbose output

a2x --format manpage --verbose compton.1.asciidoc
a2x: args: ['--format', 'manpage', '--verbose', 'compton.1.asciidoc']
a2x: executing: /usr/local/bin/asciidoc.py --backend docbook  --doctype manpage --verbose  --out-file /usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.xml /usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.asciidoc
asciidoc: reading: /usr/local/etc/asciidoc/asciidoc.conf
asciidoc: reading: /usr/local/etc/asciidoc/asciidoc.conf
asciidoc: reading: /usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.asciidoc
asciidoc: reading: /usr/local/etc/asciidoc/docbook45.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/code/code-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/music/music-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/graphviz/graphviz-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/latex/latex-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/source/source-highlight-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/lang-en.conf
asciidoc: writing: /usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.xml
a2x: executing: xmllint --nonet --noout --valid /usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.xml
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
/usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
                                                                               ^
/usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.xml:5: validity error : Validation failed: no DTD found !
<refentry lang="en">
                   ^
a2x: ERROR: xmllint --nonet --noout --valid /usr/home/dachichang/arkports/compton/chjj-compton-e8d854b/man/compton.1.xml returned non-zero exit status 4

So is this my network problem ?

@richardgv
Copy link
Collaborator

The DocBook DTD should be installed locally instead of being fetched from Internet. Installing textproc/docbook-xml-450 seemingly resolves the issue for me.

Another problem I discover is FreeBSD install does not support -D, which breaks compton's make install. Grab a copy from richardgv-dev branch and replace install -D with install works for me, and richardgv-dev branch will soon be merged into master unless we get some other tricky things.

@DachiChang
Copy link
Author

thanks all problem fixed ^^

I already test the richardgv-dev branch and works fine. the install not support -D argument problem I patch by freebsd ports mechanism. thanks richardgv compton is port to freebsd

https://github.com/DachiChang/arkports-9.1/tree/master/compton my test port, not complete, but it's works :)

@richardgv
Copy link
Collaborator

@DachiChang:

  1. Glad to see somebody packaging compton for FreeBSD! :-)
  2. As you may or may not know, NO_VSYNC_DRM=no actually disables DRM VSync support. As far as the variable is not empty, compton disables the feature during compilation, and all other variables follow the same rule. Oh well, I'm not completely sure whether DRM VSync works on FreeBSD, though.
  3. Stripping -D from install directly feels like a bad idea, because install will probably then fail if the parent directories of specified destination does not exist. I told you to do this to richardgv-dev branch, because I used install -d to create directories before those commands that actually install the files there, and this is NOT being done in master branch (e8d854b) yet.
  4. As what I've already said in release tags #71, you are recommended to export COMPTON_VERSION as a variable (make COMPTON_VERSION=git-${GITVERSION}-fbsd) instead of modifying Makefile with a patch.

@DachiChang
Copy link
Author

@richardgv

https://github.com/DachiChang/arkports-9.1/tree/master/compton is just test for me ( the category will be in x11-wm/compton not arkports/compton ), I know the issue which you point out 2, 3, 4. I will make all building options with menu that user can chose for them-self.

thank you for your advice, I will adjust compton port to adopt your recommend, but I need some time.

thanks again for your hard work that compton can run in freebsd :)

@DachiChang
Copy link
Author

I checkout to richardgv-dev branch and got compiling error.

In file included from src/c2.c:11:
src/c2.h:41: warning: declaration does not declare anything
src/c2.h:50: error: unknown field 'l' specified in initializer
src/c2.h:50: warning: excess elements in struct initializer
src/c2.h:50: warning: (near initialization for 'C2_PTR_NULL')
src/c2.h: In function 'c2_ptr_isempty':
src/c2.h:212: error: 'c2_ptr_t' has no member named 'b'
src/c2.h:212: error: 'c2_ptr_t' has no member named 'l'
src/c2.h: In function 'c2h_comb_tree':
src/c2.h:231: error: unknown field 'b' specified in initializer
src/c2.h:232: warning: excess elements in struct initializer
src/c2.h:232: warning: (near initialization for 'p')
src/c2.h:234: error: 'c2_ptr_t' has no member named 'b'
src/c2.h:235: error: 'c2_ptr_t' has no member named 'b'
src/c2.h:236: error: 'c2_ptr_t' has no member named 'b'
src/c2.c: In function 'c2_parse':
src/c2.c:22: error: unknown field 'l' specified in initializer
src/c2.c:22: warning: excess elements in struct initializer
src/c2.c:22: warning: (near initialization for 'result')
src/c2.c:37: error: unknown field 'l' specified in initializer
src/c2.c:37: warning: excess elements in struct initializer
src/c2.c:37: warning: (near initialization for 'lptr_def.ptr')
src/c2.c: In function 'c2_parse_grp':
src/c2.c:99: error: unknown field 'l' specified in initializer
src/c2.c:99: warning: excess elements in struct initializer
src/c2.c:99: warning: (near initialization for 'eles[0]')
src/c2.c:99: error: unknown field 'l' specified in initializer
src/c2.c:99: warning: excess elements in struct initializer
src/c2.c:99: warning: (near initialization for 'eles[1]')
src/c2.c:172: error: 'struct <anonymous>' has no member named 'b'
src/c2.c:196: error: 'c2_ptr_t' has no member named 'l'
src/c2.c:206: error: 'c2_ptr_t' has no member named 'b'
src/c2.c:206: error: 'c2_ptr_t' has no member named 'b'
src/c2.c:208: error: 'c2_ptr_t' has no member named 'l'
src/c2.c:208: error: 'c2_ptr_t' has no member named 'l'
src/c2.c: In function 'c2_parse_target':
src/c2.c:264: error: 'c2_ptr_t' has no member named 'l'
src/c2.c:265: error: 'c2_ptr_t' has no member named 'l'
src/c2.c:268: error: 'c2_ptr_t' has no member named 'l'
src/c2.c: In function 'c2_parse_op':
src/c2.c:453: error: 'c2_ptr_t' has no member named 'l'
src/c2.c: In function 'c2_parse_pattern':
src/c2.c:518: error: 'c2_ptr_t' has no member named 'l'
src/c2.c: In function 'c2_parse_legacy':
src/c2.c:665: error: 'c2_ptr_t' has no member named 'l'
src/c2.c: In function 'c2_free':
src/c2.c:826: error: 'c2_ptr_t' has no member named 'b'
src/c2.c:837: error: 'c2_ptr_t' has no member named 'l'
src/c2.c: In function 'c2_dump_raw':
src/c2.c:902: error: 'c2_ptr_t' has no member named 'b'
src/c2.c:925: error: 'c2_ptr_t' has no member named 'l'
src/c2.c: In function 'c2_match_once':
src/c2.c:1209: error: 'c2_ptr_t' has no member named 'b'
src/c2.c:1241: error: 'c2_ptr_t' has no member named 'l'
src/c2.c:1266: error: 'c2_ptr_t' has no member named 'b'
src/c2.c:1266: error: 'c2_ptr_t' has no member named 'l'
gmake: *** [c2.o] Error 1

my gcc version

Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]

use gcc46 fixed the issue above, but need dependency on gcc46 port for compiling, gcc46 port must building up for more than one hour. can compton support freebsd base compiler (gcc version 4.2.1) ?

@richardgv
Copy link
Collaborator

@DachiChang:

I checkout to richardgv-dev branch and got compiling error.

The issue is caused by a bug in <gcc-4.6 that unnamed union members cannot be used in initializer. (The funny thing is, although the first report came on 2003, it's only fixed in gcc-4.6.)

I use unnamed union in c2_ptr_t in src/c2.h for convenience. There are several possible fixes:

  1. Use /usr/bin/clang to compile. FreeBSD 9.1 base system comes with clang 3.1, and I heard FreeBSD plans to use it as default compiler.

  2. Patch src/c2.h to drop the anonymous union. This patch fixes known issues on FreeBSD, for richardgv-dev branch:

    diff --git a/.gitignore b/.gitignore
    index a11d54d..ee95b3c 100644
    --- a/.gitignore
    +++ b/.gitignore
    @@ -34,6 +34,7 @@ install_manifest.txt
    
     # Misc files
     core
    +*.core
     oprofile_data/
     compton.plist
     callgrind.out.*
    diff --git a/Makefile b/Makefile
    index 820ce2a..ea60805 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -100,12 +100,12 @@ docs: $(MANPAGES) $(MANPAGES_HTML)
    
     install: $(BINS) docs
        @install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)"
    -   @install -D -m755 $(BINS) "$(DESTDIR)$(BINDIR)"/ 
    -   @install -D -m644 $(MANPAGES) "$(DESTDIR)$(MANDIR)"/
    +   @install -m755 $(BINS) "$(DESTDIR)$(BINDIR)"/
    +   @install -m644 $(MANPAGES) "$(DESTDIR)$(MANDIR)"/
     ifneq "$(DOCDIR)" ""
        @install -d "$(DESTDIR)$(DOCDIR)"
    -   @install -D -m644 README.md compton.sample.conf "$(DESTDIR)$(DOCDIR)"/
    -   @install -D -m755 dbus-examples/cdbus-driver.sh "$(DESTDIR)$(DOCDIR)"/
    +   @install -m644 README.md compton.sample.conf "$(DESTDIR)$(DOCDIR)"/
    +   @install -m755 dbus-examples/cdbus-driver.sh "$(DESTDIR)$(DOCDIR)"/
     endif
    
     uninstall:
    diff --git a/src/c2.h b/src/c2.h
    index 000c684..6a2bdb8 100644
    --- a/src/c2.h
    +++ b/src/c2.h
    @@ -35,10 +35,8 @@ typedef struct _c2_l c2_l_t;
     /// Pointer to a condition tree.
     typedef struct {
       bool isbranch : 1;
    -  union {
    -    c2_b_t *b;
    -    c2_l_t *l;
    -  };
    +  c2_b_t *b;
    +  c2_l_t *l;
     } c2_ptr_t;
    
     /// Initializer for c2_ptr_t.
    

    Unfortunately, the patch does not come without cost: It doubles the memory consumption of all c2_ptr_t structures.

  3. Give the union a name. But, this requires a lot of changes in code, and not everybody use gcc-4.2. I don't think it worths the effort.

@DachiChang
Copy link
Author

patch from union to struct make compling fine. I know what difference between union and struct, use union can reduce more memory consumption.

In 3.

I know not everbody use gcc-4.2 and freebsd will use clang as default compiler. freebsd ports system is for all freebsd 7.2 ~ 9.1 so use clang to compiling compton is fine, but in out date version of freebsd is not support.
use gcc-4.6 is compile fine, but "it's need lot of time to building", because in freebsd ports tree system everything is build from source code. building gcc-4.6 spend more than one hour if computer is not very well. compton is tiny compositor but it's need depend on gcc-4.6 compiler, I think some people will install xcompmgr to replace it, because they don't need waiting lot of time for gcc-4.6 building.

richardgv added a commit that referenced this issue Feb 5, 2013
- Make Makefile compatible with BSD install, by dropping -D.

- Make CFG independent in Makefile, to allow people to specify CFLAGS
  as a parameter to make.

- Correct location of .clang_complete.
@MeisterLinux
Copy link

I'm also having the exact same error occur when trying to compile. I'm using a Pkgfile to build. I have the latest docbook-xml installed as well as asciidoc.

  • make PREFIX=/usr/ports/work/compton/pkg/usr MANDIR=/usr/ports/work/compton/pkg/usr/man/man1 install
    a2x --format manpage man/compton.1.asciidoc
    a2x: ERROR: "xmllint" --nonet --noout --valid "/usr/ports/work/compton/src/compton-build/man/compton.1.xml" returned non-zero exit status 4
    make: *** [man/compton.1] Error 1

My Pkgfile:
name=compton
version=git
release=1
source=()

build () {
_gitroot="git://github.com/chjj/compton.git"
_gitname="compton"

      echo -e "Connecting to GIT server..."

      if [ -d $_gitname ] ; then 
               cd $_gitname && git pull origin
               echo -e "The local files are updated."
      else
               git clone $_gitroot $_gitname
      fi

      echo -e "GIT checkout done or server timeout"

echo -e "Starting make..."

  rm -rf "$_gitname" "$_gitname-build"

  cd "$_gitname-build"
  make PREFIX=/usr

  make PREFIX=$PKG/usr MANDIR=$PKG/usr/man/man1 install
  install -D -m644 "compton.sample.conf" "$pkgdir/etc/xdg/compton.conf.example"

}

Any suggestions or help would be appreciated! I tried looking for textproc/docbook-xml-450 but it seems to be a bsd port.

@DachiChang
Copy link
Author

In ArchLinux may be install https://www.archlinux.org/packages/extra/any/docbook-xml/ will solve your problem. :)

@MeisterLinux
Copy link

I'm actually using Crux Linux, and have the latest docbook-xml installed already. Thanks for the suggestion though.

@richardgv
Copy link
Collaborator

@MeisterLinux:

I'm afraid I have no more disk space to install yet another system. I have 6 operating systems installed now, and many are installed solely because people reported bugs of compton on those systems.

Firstly, feel free to replace a2x with a2x --no-xmllint in Makefile, just like what DachiChang did. I don't personally know what sort of side effect it may have. You could even choose to disable man page generation.

In case you haven't, please run a2x --format manpage --verbose man/compton.1.asciidoc to check whether what you meet is exactly the same issue or a different one.

Asciidoc uses DocBook 4.5 docbookx.dtd DTD as far as I know, /usr/share/sgml/docbook/xml-dtd-4.5/docbookx.dtd on Gentoo, probably /usr/share/xml/docbook/xml-dtd-4.5/docbookx.dtd on Arch. If a2x --verbose is not giving you enough info, you may try playing with xmllint to investigate what's wrong.

And your pkgfile is probably misusing PREFIX: There's another variable DESTDIR that should be used for specifying the root path, and one shouldn't insert the root path into PREFIX.

@MeisterLinux
Copy link

Thanks for the reply, I ended up cloning the repository, making the --no-xmllint change to the Makefile, and tar'ing it. I also downgraded from DocBook 5.0, back to 4.5. With those changes, and removing the prefix made the package compile. I haven't noticed any weird things with adding that flag, so so far, so good. I wasn't able to get that other command in there, but since it was successful I'm sure it wasn't needed. Thanks for taking the time to respond to my issue, and the suggestion. I'm a huge fan of compton, and just couldn't bring myself to go back to xcompmgr. :)

@mckaygerhard
Copy link

i need a workaround for compiling in gcc 4.2 for mini distros, i not able to use gcc 4.6 due its not cheap .. i using a AMD K6-II and install gcc 4.6 will cause to update several times many packages..

please, the workaround for union/struc will work on linux also?

@mckaygerhard
Copy link

@MeisterLinux

i need a workaround for compiling in gcc 4.2 for mini distros, i not able to use gcc 4.6 due its not cheap .. i using a AMD K6-II and install gcc 4.6 will cause to update several times many packages..

please, the workaround for union/struc will work on linux also?

@mckaygerhard
Copy link

umm i'll try to made a macro for detecting gcc but dosent work... som help?

@mckaygerhard
Copy link

@MeisterLinux and @hun7err

i have made a macro detection of gcc and pulled the patch in #92 please analize and commit .. the pull #91 must be update due do not able to gcc 4.6+ to use th union performance

@DachiChang
Copy link
Author

Hi mckaygerhard,

You can try this patch https://github.com/DachiChang/compton/blob/master/files/patch-c2.h , it's will make compton compiled by gcc 4.2. try it :)

@mckaygerhard
Copy link

i solved , and made a pull request to able compile in any vesion of gcc,
please update and commit if helfully

On Wed, Feb 27, 2013 at 11:57 AM, Chi-Hung Chang
[email protected]:

Hi mckaygerhard,

You can try this patch
https://github.com/DachiChang/compton/blob/master/files/patch-c2.h , it's
will make compton compiled by gcc 4.2. try it :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/86#issuecomment-14183182
.

Lenz McKAY Gerardo (PICCORO)
http://qglochekone.blogspot.com

@mckaygerhard
Copy link

@DachiChang

my pull request are avble to detect gcc version

@richardgv
Copy link
Collaborator

@mckaygerhard:

Every time you "@" somebody, they probably will get a notification. When you "@" somebody that is unconcerned about a problem (MeisterLinux apparently is entirely unrelated to your issue), they will possibly get their mailbox spammed with useless notifications. Posting duplicate replies also has a similar effect on those subscribed to the issue / repo. The first page of my inbox is filled with notifications about your messages this morning. I would personally suggest you to be a little bit more cautious when you post things here, mckaygerhard.

By the way, my reply is on #92.

@DachiChang: Thanks for helping. :-)

fruchti pushed a commit to fruchti/compton that referenced this issue Feb 2, 2019
Make buffer age not glx specific
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants