xmake-io / xrepo

🗂️ A cross-platform C/C++ package manager based on Xmake
https://xrepo.xmake.io
Apache License 2.0
354 stars 18 forks source link

Installation of packages in wrong order #4

Closed SeanRamey closed 3 years ago

SeanRamey commented 3 years ago

Describe the bug

Xrepo will attempt to install freetype before installing brotli, therefore causing freetype to fail installation. This is the relevant line from the xmake.lua: add_requires("libsdl","libpng", "glib", "freetype", "brotli", {system = false}) -- brotli needed for freetype, but may have issues using the system library, so explicitly install from xmake

Expected behavior

Xrepo should install package dependencies first.

Error output

[sean@sean-pc-arch 86Box]$ xmake
checking for platform ... linux
checking for architecture ... x86_64
note: try installing these packages (pass -y to skip confirm)?
in xmake-repo:
  -> libsdl 2.0.14 
  -> libpng v1.6.37 
  -> glib 2.60.2 
  -> freetype 2.10.4 
  -> brotli#1 1.0.9 
please input: y (y/n)
y
  => install freetype 2.10.4 .. failed
if you want to get verbose errors, please see:
  -> /home/sean/.xmake/cache/packages/2103/f/freetype/2.10.4/installdir.failed/logs/install.txt
error: install failed!

Related Environment

waruqi commented 3 years ago

please run xmake f -c -vD and let me see the verbose errors

SeanRamey commented 3 years ago

xmakeout.txt

waruqi commented 3 years ago

wee need not add add_requires("brotli", {system = false}) , there is brolti dep in freetype.

we need only add add_requires("freetype", {system = true})

see https://github.com/xmake-io/xmake-repo/blob/d5d7d0e83c2e38124070eae097220776ff78797b/packages/f/freetype/xmake.lua#L25

waruqi commented 3 years ago

Your two questions about xrepo/xmake are actually caused by the same problem. Because brolti is a dependent library of freetype, although using xrepo install freetype or add_requires("freetype", {system=false}) will force to install them and ignore the system library.

But its dependent library brolti will still be used first as a system library.

I think there are two solutions

  1. I will improve the search for these two system libraries and add the missing .a library, but it will take some time.

  2. You can also use add_requireconfs("freetype.broli", {system = false}) to rewrite the dependency configuration first, force to install brolti, and ignore the brolti system library

waruqi commented 3 years ago

I have improved to find freetype/brotli system library in xmake-repo

see https://github.com/xmake-io/xmake-repo/pull/318

you can update repo and try it

xmake repo -u
xmake f -c -vD
xmake