xmake icon indicating copy to clipboard operation
xmake copied to clipboard

Impossibility to install via apt

Open hanako-eo opened this issue 1 year ago • 1 comments

Xmake Version

2.8.3

Operating System Version and Architecture

Linux 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux

Describe Bug

I wrote this line add_requires("apt::llvm-17", { alias = "llvm" }) and now when I try to compile my project, xmake stop and say "checking for apt::llvm-17 ... no" after execution of the apt command

Expected Behavior

the checking pass

Project Configuration

set_policy("build.warning", true)
add_rules("mode.debug", "mode.release")
add_requires("criterion")
add_requires("apt::llvm-17", { alias = "llvm" })
set_toolchains("clang")

if is_mode("debug") then
    add_defines("DEBUG")
end

set_warnings("all")
add_cflags("-Werror=incompatible-pointer-types")

add_includedirs("includes")

target("croc")
    set_kind("binary")
    add_packages("llvm")
    add_files("src/**.c")

target("test")
    set_kind("binary")
    add_packages("criterion")
    add_packages("llvm")
    add_files("src/**.c")
    add_files("tests/*.c")
    remove_files("src/main.c")

includes("scripts/*.lua")

Additional Information and Error Logs

checking for gcc ... /usr/bin/gcc
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
finding libffi from xmake ..
checking for xmake::libffi ... no
finding libffi-dev from apt ..
checking for dpkg ... /usr/bin/dpkg
checking for pkg-config ... /usr/bin/pkg-config
checking for apt::libffi-dev ... libffi-dev 3.4.4
finding zlib from xmake ..
checking for xmake::zlib ... no
finding zlib from pacman ..
checkinfo: cannot runv(pacman --version), No such file or directory
checking for pacman ... no
checking for pacman::zlib ... no
finding zlib1g-dev from apt ..
checking for apt::zlib1g-dev ... zlib1g-dev 1.2.13
finding openssl from xmake ..
checking for xmake::openssl ... openssl 1.1.1-t
finding ca-certificates from xmake ..
checking for xmake::ca-certificates ... ca-certificates 20230306
checking for python ... no
checking for python3 ... no
checking for python ... no
checking for python2 ... no
checking for python ... no
checking for meson ... no
checking for ninja ... no
finding criterion from xmake ..
checking for xmake::criterion ... criterion v2.4.1
finding llvm-17 from apt ..
checking for apt::llvm-17 ... no
installing llvm-17 from apt ..
checking for apt ... /usr/bin/apt
checking for sudo ... /usr/bin/sudo
/usr/bin/sudo env PATH=/home/hana/.local/bin:/home/hana/local/bin:/home/hana/.opam/default/bin:/home/hana/local/google-cloud-sdk/bin:/home/hana/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/hana/.dotnet/tools XMAKE_STATS= COLORTERM=truecolor /usr/bin/apt install -y llvm-17
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
llvm-17 is already the newest version (1:17.0.4~++20231027013056+e9dcc15f514a-1~exp1~20231027133203.60).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
finding llvm-17 from apt ..
checking for apt::llvm-17 ... no

error: .../modules/private/action/require/impl/actions/install.lua:393: fetch apt::llvm-17-latest failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:923]: in function 'raiselevel'
    [@programdir/core/sandbox/modules/utils.lua:149]: in function 'assert'
    [.../modules/private/action/require/impl/actions/install.lua:393]:

  => install apt::llvm-17 latest .. failed

.../modules/private/action/require/impl/actions/install.lua:393: fetch apt::llvm-17-latest failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:923]: in function 'raiselevel'
    [@programdir/core/sandbox/modules/utils.lua:149]: in function 'assert'
    [.../modules/private/action/require/impl/actions/install.lua:393]:
if you want to get more verbose errors, please see:
  -> /home/hana/Lab/croc-test-ci/build/.packages/a/apt_llvm-17/latest/cache/installdir.failed/logs/install.txt
error: @programdir/modules/async/runjobs.lua:256: .../modules/private/action/require/impl/actions/install.lua:469: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:923]:
    [.../modules/private/action/require/impl/actions/install.lua:469]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:328]:
    [...modules/private/action/require/impl/install_packages.lua:479]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:232]:

stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:923: in function 'base/os.raiselevel'
        (...tail calls...)
        @programdir/modules/async/runjobs.lua:256: in field 'catch'
        @programdir/core/sandbox/modules/try.lua:123: in global 'try'
        @programdir/modules/async/runjobs.lua:218: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:404: in function <@programdir/core/base/scheduler.lua:397>

hanako-eo avatar Oct 29 '23 10:10 hanako-eo

xmake will call dpkg and pkgconfig to find it, but it's not always completely reliable, and you can try to improve it by debugging https://github.com/xmake-io/xmake/blob/master/xmake/modules/package/manager/apt/find_package.lua

Or you can submit pr to xmake-repo to update the llvm package to 17 and then use add_requires("llvm") to reference it.

waruqi avatar Oct 30 '23 01:10 waruqi