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

Issues building libxlswriter on Gentoo Linux with system minizip #116

Closed
petricf opened this issue Aug 10, 2017 · 18 comments
Closed

Issues building libxlswriter on Gentoo Linux with system minizip #116

petricf opened this issue Aug 10, 2017 · 18 comments

Comments

@petricf
Copy link

petricf commented Aug 10, 2017

On Gentoo Linux minizip is usually installed system wide. This conflicts with the packaged minizip.

The following patches remove the dependency in CMakeLists.txt and adjust the include in packager.h
They are based on the 0.7.2 release.

My suggestion is to add an option for cmake to use the system minizip instead of the built in one.
Sorry - i don't know much on cmake, so maybe an other one will step in.

patches.zip

@jmcnamara jmcnamara self-assigned this Aug 10, 2017
@jmcnamara
Copy link
Owner

Hi @petricf,

Thanks for the report.

  1. Could you add some instruction on how to replicate the issues on Gentoo?
  2. Does the issue happen if you use the Makefile based build system?

John

@petricf
Copy link
Author

petricf commented Aug 10, 2017 via email

@petricf
Copy link
Author

petricf commented Aug 10, 2017

Missed attachment - renamed to build.txt
build.txt

@jmcnamara
Copy link
Owner

What is the output of the following on your system:

git clone https://github.com/jmcnamara/libxlsxwriter.git
cd libxlsxwriter
make V=1

P.S. Could you post the output via the GitHub website (rather than email) and place it between verbatim commands ``` (3 backticks at the start and end).

@petricf
Copy link
Author

petricf commented Aug 10, 2017

Find attached the screen output (test.txt) as requested.

test.txt

@petricf
Copy link
Author

petricf commented Aug 11, 2017

Compiler info:

petric@main ~/test/libxlsxwriter $ LANG=en_US.UTF-8 gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/5.4.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/gcc-5.4.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 5.4.0-r3 p1.3, pie-0.6.5' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --without-isl --enable-libsanitizer
Thread model: posix
gcc version 5.4.0 (Gentoo 5.4.0-r3 p1.3, pie-0.6.5) 

Default include search paths are:

petric@main ~/test/libxlsxwriter $ echo | LANG=en_US.UTF-8 gcc -Wp,-v -x c - -fsyntax-only
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include-fixed
 /usr/include
End of search list.

@jmcnamara jmcnamara changed the title Patches for Gentoo Linux Issues building libxlswriter on Gentoo Linux with system minizip Aug 11, 2017
@jmcnamara
Copy link
Owner

I'm finding it very hard to reproduce this on other Linux systems even after installing minizip into the system. From a bit of googling it looks like it only occurs on Gentoo.

A couple of questions:

  1. Is zconf.h installed on your system and if so where? For me it is in /usr/local/include/zconf.h.
  2. What version of Gentoo are you using?
  3. If I wanted to replicate a system to reproduce this in a VM what version of Gentoo would I have to install?

John

@petricf
Copy link
Author

petricf commented Aug 11, 2017

  1. zconf.h is in /usr/include
  2. amd64 13.0 (base) + kde plasma desktop
  3. Usually follow https://gentoo.org/get-started/
    This will get you to a non-gui installation. The latest stable version should be ok.

Gentoo is a distribution where you compile (nearly) everything from source. It uses a ports like system (inspired from BSD ?) to manage the installed packages.

Which VM system you intend to use (VMware, Proxmox (linux kvm), VirtualBox, ...) ?

@jmcnamara
Copy link
Owner

Which VM system you intend to use (VMware, Proxmox (linux kvm), VirtualBox, ...) ?

Virtualbox

@petricf
Copy link
Author

petricf commented Aug 11, 2017

Should be installable w/o a problem. I use proxmox (http://pve.proxmox.com) for my test installations - so i can't provide a VM directly.
But this may help: http://www.osboxes.org/gentoo/

jmcnamara added a commit that referenced this issue Aug 12, 2017
@jmcnamara
Copy link
Owner

jmcnamara commented Aug 12, 2017

Hi,

I got a Gentoo VM built and I was able to replicate the issue. It is in the category best described as "interesting".

It turns out that it is caused by Gentoo redefining a macro in libs zconf.h. Because why not fix a "bad" macro name and let some poor schmucks downstream tear their hair out for a day or two.

Anyway, I've pushed a fix to master and tested it on Gentoo with the standard (non cmake) make system.

Let me know if you have any issues and if you want it packaged into a release.

The cmake solution will have to be patched separately and probably not in the short term.

John

@petricf
Copy link
Author

petricf commented Aug 12, 2017

Thanks for your efforts.

I can confirm that your fix works for the Makefile based build.

The patches i posted on top of this issue also works for me. I can live with that.
You do not have to make a release only driven by the change above.

Could you consider adding a cmake option to use a system wide installed minizip instead of the packaged one ?

@jmcnamara
Copy link
Owner

You do not have to make a release only driven by the change above.

Ok. I thought that maybe your were going to submit a port/ebuild for libxlsxwriter to Gentoo. If not I'll just let the change trickle into the next release.

Could you consider adding a cmake option to use a system wide installed minizip instead of the packaged one

To be clear: the issues isn't that there is a system wide minizip since that isn't an issue on Ubuntu, Fedora or other systems. The issue is that the Gentoo maintainers patch the standard zlib/zconf headers to redefine a macro name that they don't like. This causes programs that use those macros to not compile.

I'll look into a fix in the CMake files. In the meantime you can build with CMake as follows:

cd libxlsxwriter
cd cmake # or wherever
cmake -D CMAKE_C_FLAGS='-DOF=_Z_OF' ..
make 

jmcnamara added a commit that referenced this issue Aug 12, 2017
@jmcnamara
Copy link
Owner

Could you consider adding a cmake option to use a system wide installed minizip instead of the packaged one ?

This issue is now fixed on master for cmake and make.

@Alexhuszagh Can you have a quick look at CMake fix: f256dc2 to see if everything looks okay. No rush.

@petricf
Copy link
Author

petricf commented Aug 12, 2017

I've added the ebuild for 0.7.2 to gentoo bugtracker: https://bugs.gentoo.org/show_bug.cgi?id=627452

This ebuild-version includes the two patches i created for using the system minizip. They will be applied during the build process.

As soon as 0.7.3 (or whatever version the fixed release gets) is out (and i get knowledge of it) i will update the ebuild for gentoo and remove the patches.

@jmcnamara
Copy link
Owner

Version 0.7.3 is available now. Thanks for submitting the ebuild file.

@petricf
Copy link
Author

petricf commented Aug 13, 2017

Confirmed - patches are no more required for Gentoo.

I've posted an updated ebuild to https://bugs.gentoo.org/show_bug.cgi?id=627452.

@jmcnamara
Copy link
Owner

Thanks for that. Let me know if it gets added.

P.S. There is a feature request to use system minizip when possible, that you might be interested in. See: #119.

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

2 participants