xmake-io / xmake-repo

📦 An official xmake package repository
https://xrepo.xmake.io
Apache License 2.0
669 stars 393 forks source link

Unable to install boost with bzip2 on linux #4986

Closed REMqb closed 4 weeks ago

REMqb commented 1 month ago

Xmake Version

v2.9.4+HEAD.e85b001

Operating System Version and Architecture

Debian 11.10

Describe Bug

I'm unable to install boost with config bzip2 = true.

Boost's xmake.lua function https://github.com/xmake-io/xmake-repo/blob/2fdd344046b86e86ee4f6fa11828c1032962bcfd/packages/b/boost/xmake.lua#L280-L291 crashes on line 286 because includedirs is not present in the table returned by dep:fetch() for libbz2-dev installed by apt.

(the header is installed in /usr/include/bzlib.h)

Expected Behavior

The script shouldn't crash

Project Configuration

add_rules("mode.debug", "mode.release")

add_requires("boost", {configs = {bzip2 = true}})

target("bug")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("boost")

Additional Information and Error Logs

checking for apt::libbz2-dev ... libbz2-dev 
error: ...xmake/repositories/xmake-repo/packages/b/boost/xmake.lua:286: attempt to index a nil value (field 'includedirs')
stack traceback:
    [...xmake/repositories/xmake-repo/packages/b/boost/xmake.lua:286]: in function 'config_deppath'
    [...xmake/repositories/xmake-repo/packages/b/boost/xmake.lua:305]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:404]:

  => install boost 1.86.0 .. failed
star-hengxing commented 4 weeks ago

Fixed https://github.com/xmake-io/xmake-repo/commit/c34c4200773beb2908857e865d2d2bb9c8d874bf, Try it again xrepo update-repo

REMqb commented 4 weeks ago

It still fails because the table info doesn't have the key includedirs so it's doing nil[1], and it doesn't contains sysincludedirs either.

Here is the content of info:

{ 
  links = { 
    "bz2" 
  },
  linkdirs = { 
    "/usr/lib/x86_64-linux-gnu" 
  },
  libfiles = { 
    "/usr/lib/x86_64-linux-gnu/libbz2.a",
    "/usr/lib/x86_64-linux-gnu/libbz2.so" 
  } 
}
star-hengxing commented 4 weeks ago

Thanks your info, Try it again.

waruqi commented 4 weeks ago

https://github.com/xmake-io/xmake-repo/pull/5000

REMqb commented 4 weeks ago

It works now. Thanks :+1:

Issues-translate-bot commented 4 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


It works now. Thanks :+1: