genotrance / nimarchive

libarchive wrapper for Nim
MIT License
17 stars 3 forks source link

`nimble install choosenim` fails: libarchive/archive_read_support_filter_bzip2.c:44:19: fatal error: bzlib.h: No such file or directory #185 #9

Closed timotheecour closed 4 years ago

timotheecour commented 4 years ago

(transferred over from https://github.com/dom96/choosenim/issues/185)

/cc @genotrance I'm getting a different error than I had in https://github.com/dom96/choosenim/issues/177 now (on ubuntu) nimble install nimterop # works

nimble install choosenim # fails

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial

nimble -v
nimble v0.11.0 compiled at 2020-03-11 08:37:36
git hash: 4007b2a778429a978e12307bf13a038029b4c4d9

nim -v
Nim Compiler Version 1.1.1 [Linux: i386]
Compiled at 2020-03-11
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: f5f9243cc05cae998e4380a347da8e93ac547dd4
active boot switches: -d:release
nimble install choosenim

 Verifying dependencies for osinfo@0.3.2
 Installing choosenim@#head
   Building choosenim/choosenim using c backend
       Tip: 61 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: choosenim
        ... Details:
        ... Execution failed with exit code 1
        ... Command: "/home/timothee/git_clone/Nim/bin/nim" c --noNimblePath -d:NimblePkgVersion=0.6.0 -d:release --path:"/home/timothee/.nimble/pkgs/nimble-#5bb795a"  --path:"/home/timothee/.nimble
/pkgs/nimarchive-0.3.5"  --path:"/home/timothee/.nimble/pkgs/nimterop-0.4.4"  --path:"/home/timothee/.nimble/pkgs/regex-0.13.0"  --path:"/home/timothee/.nimble/pkgs/unicodedb-0.7.2"  --path:"/home/t
imothee/.nimble/pkgs/unicodeplus-0.5.1"  --path:"/home/timothee/.nimble/pkgs/unicodedb-0.7.2"  --path:"/home/timothee/.nimble/pkgs/cligen-0.9.42"  --path:"/home/timothee/.nimble/pkgs/libcurl-1.0.0" 
 --path:"/home/timothee/.nimble/pkgs/analytics-0.2.0"  --path:"/home/timothee/.nimble/pkgs/uuids-0.1.10"  --path:"/home/timothee/.nimble/pkgs/isaac-0.1.3"  --path:"/home/timothee/.nimble/pkgs/osinfo
-0.3.2"  --path:"/home/timothee/.nimble/pkgs/osinfo-0.3.2"  -o:"/tmp/nimble_20702/githubcom_dom96choosenim_#head/bin/choosenim" "/tmp/nimble_20702/githubcom_dom96choosenim_#head/src/choosenim.nim"
        ... Output: Hint: used config file '/home/timothee/git_clone/Nim/config/nim.cfg' [Conf]
        ... Hint: used config file '/home/timothee/git_clone/Nim/config/config.nims' [Conf]
        ... Hint: system [Processing]
        ... Hint: widestrs [Processing]
        ... Hint: io [Processing]
        ... Hint: choosenim [Processing]

...
     ... Hint: time_t [Processing]
        ... Hint: bzlib [Processing]
        ... # Including library /home/timothee/.cache/nim/nimterop/nimarchive/bzip2/libbz2.a
        ... Hint: lzma [Processing]
        ... # Including library /home/timothee/.cache/nim/nimterop/nimarchive/liblzma/src/liblzma/.libs/liblzma.a
        ... Hint: zlib [Processing]
        ... # Including library /home/timothee/.cache/nim/nimterop/nimarchive/zlib/libz.a
        ... # Running make -j 2 
        ... #   Path: /home/timothee/.cache/nim/nimterop/nimarchive/libarchive
        ... stack trace: (most recent call last)
        ... build.nim(1032, 23)
        ... build.nim(802, 9)        buildLibrary
        ... build.nim(619, 18)       make
        ... build.nim(105, 11)       execAction
        ... assertions.nim(29, 26)   failedAssertImpl
        ... assertions.nim(22, 11)   raiseAssert
        ... fatal.nim(55, 5)         sysFatal
        ... /home/timothee/.nimble/pkgs/nimarchive-0.3.5/nimarchive/archive.nim(83, 10) template/generic instantiation of `getHeader` from here
        ... /home/timothee/git_clone/Nim/lib/system/fatal.nim(55, 5) Error: unhandled exception: build.nim(105, 16) `false` Command failed: 2
        ... cmd: cd /home/timothee/.cache/nim/nimterop/nimarchive/libarchive && make -j 2 
        ... result:
        ... make  all-am
        ... make[1]: Entering directory '/home/timothee/.cache/nim/nimterop/nimarchive/libarchive'
        ...   CC       libarchive/archive_read_support_filter_bzip2.lo
        ...   CC       libarchive/archive_read_support_filter_xz.lo
        ... libarchive/archive_read_support_filter_bzip2.c:44:19: fatal error: bzlib.h: No such file or directory
        ... compilation terminated.
        ... Makefile:6561: recipe for target 'libarchive/archive_read_support_filter_bzip2.lo' failed
        ... make[1]: *** [libarchive/archive_read_support_filter_bzip2.lo] Error 1
        ... make[1]: *** Waiting for unfinished jobs....
        ... make[1]: Leaving directory '/home/timothee/.cache/nim/nimterop/nimarchive/libarchive'
        ... Makefile:3773: recipe for target 'all' failed
        ... make: *** [all] Error 2 [AssertionError]
genotrance commented 4 years ago

Do you have cmake? If not, libarchive is being built with configure and I think I'm missing the bzlib include dir in the prebuild.

https://github.com/genotrance/nimarchive/blob/c325b78c20b8822f724f68f62a638bb368b46f16/nimarchive/archive.nim#L61

genotrance commented 4 years ago

Please try the issue9 branch to see if it fixes this issue.

genotrance commented 4 years ago

PTAL @timotheecour

timotheecour commented 4 years ago

after git clone https://github.com/genotrance/nimarchive cd nimarchive git checkout issue9 nimble develop nimble install -y choosenim

i still get error, see below. you can reproduce by trying to do this on a fresh ubuntu VM (eg, free tier on AWS)

        ... Hint: paths [Processing]
        ... Hint: types [Processing]
        ... Hint: time_t [Processing]
        ... Hint: bzlib [Processing]
        ... # Resetting /home/timothee/.cache/nim/nimterop/nimarchive/bzip2
        ... # Including library /home/timothee/.cache/nim/nimterop/nimarchive/bzip2/libbz2.a
        ... Hint: lzma [Processing]
        ... # Including library /home/timothee/.cache/nim/nimterop/nimarchive/liblzma/src/liblzma/.libs/liblzma.a
        ... Hint: zlib [Processing]
        ... # Including library /home/timothee/.cache/nim/nimterop/nimarchive/zlib/libz.a
        ... # Running make -j 2 
        ... #   Path: /home/timothee/.cache/nim/nimterop/nimarchive/libarchive
        ... stack trace: (most recent call last)
        ... build.nim(1032, 23)
        ... build.nim(802, 9)        buildLibrary
        ... build.nim(619, 18)       make
        ... build.nim(105, 11)       execAction
        ... assertions.nim(29, 26)   failedAssertImpl
        ... assertions.nim(22, 11)   raiseAssert
        ... fatal.nim(55, 5)         sysFatal
        ... /home/timothee/git_clone/nimarchive/nimarchive/archive.nim(84, 10) template/generic instantiation of `getHeader` from here
        ... /home/timothee/git_clone/Nim/lib/system/fatal.nim(55, 5) Error: unhandled exception: build.nim(105, 16) `false` Command failed: 2
        ... cmd: cd /home/timothee/.cache/nim/nimterop/nimarchive/libarchive && make -j 2 
        ... result:
        ... make  all-am
        ... make[1]: Entering directory '/home/timothee/.cache/nim/nimterop/nimarchive/libarchive'
        ...   CC       libarchive/archive_read_support_filter_bzip2.lo
        ...   CC       libarchive/archive_read_support_format_7zip.lo
        ... libarchive/archive_read_support_format_7zip.c:36:19: fatal error: bzlib.h: No such file or directory
        ... compilation terminated.
        ... Makefile:6561: recipe for target 'libarchive/archive_read_support_format_7zip.lo' failed
        ... make[1]: *** [libarchive/archive_read_support_format_7zip.lo] Error 1
        ... make[1]: *** Waiting for unfinished jobs....
        ... libarchive/archive_read_support_filter_bzip2.c:44:19: fatal error: bzlib.h: No such file or directory
        ... compilation terminated.
        ... Makefile:6561: recipe for target 'libarchive/archive_read_support_filter_bzip2.lo' failed
        ... make[1]: *** [libarchive/archive_read_support_filter_bzip2.lo] Error 1
        ... make[1]: Leaving directory '/home/timothee/.cache/nim/nimterop/nimarchive/libarchive'
        ... Makefile:3773: recipe for target 'all' failed
        ... make: *** [all] Error 2 [AssertionError]