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

How to build the lib with system dependency #342

Open
topazus opened this issue Aug 30, 2024 · 1 comment
Open

How to build the lib with system dependency #342

topazus opened this issue Aug 30, 2024 · 1 comment

Comments

@topazus
Copy link

topazus commented Aug 30, 2024

Is your feature request related to a problem? Please describe.

I have changed system=false to system=true in add_requires() and disabled tests in xmake.lua file, so that it can use system dependency as much as possible even without network.

> xmake config -vD --enable_tests=false
checking for platform ... linux
checking for architecture ... x86_64
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
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checking for enable_tests ... no
checking for g++ ... /usr/bin/g++
checking for the c++ compiler (cxx) ... g++
checking for /usr/bin/g++ ... ok
checking for flags (-fPIC) ... ok
> g++ "-fPIC" "-m64"
> /usr/bin/g++ -c -m64 -o /tmp/.xmake1000/240830/_08FD9396A9934C1082567C3E7FD14240.o /tmp/.xmake1000/240830/_CC4FF776CE1140F5806577A9E0688D22.cpp
> checking for c++ includes(mutex)
> checking for c++ types(std::mutex)
checking for posix_thread ... ok
checking for unzip ... /usr/bin/unzip
checkinfo: cannot runv(git --version), No such file or directory
checking for git ... no
checkinfo: @programdir/core/sandbox/modules/os.lua:264: cannot runv(ping -c 1 -W 1 127.0.0.1), No such file or directory
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [@programdir/core/sandbox/modules/os.lua:264]: in function 'run'
    [@programdir/modules/detect/tools/find_ping.lua:41]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/sandbox/modules/import/lib/detect/find_program.lua:65]: in function '_do_check'
    [@programdir/core/sandbox/modules/import/lib/detect/find_program.lua:88]: in function '_check'
    [@programdir/core/sandbox/modules/import/lib/detect/find_program.lua:242]: in function '_find'
    [@programdir/core/sandbox/modules/import/lib/detect/find_program.lua:328]:
    [@programdir/modules/lib/detect/find_tool.lua:31]: in function '_find_from_modules'
    [@programdir/modules/lib/detect/find_tool.lua:42]: in function '_find_tool'
    [@programdir/modules/lib/detect/find_tool.lua:88]:
    [@programdir/modules/net/ping.lua:60]:
    [@programdir/modules/net/fasturl.lua:48]: in function 'sort'
    [@programdir/core/sandbox/modules/import/core/package/repository.lua:129]: in function 'repositories'
    [@programdir/modules/private/action/require/impl/repository.lua:119]: in function 'repositories'
    [@programdir/modules/private/action/require/impl/repository.lua:186]: in function 'packagedir'
    [@programdir/modules/private/action/require/impl/package.lua:232]: in function '_load_package_from_repository'
    [@programdir/modules/private/action/require/impl/package.lua:895]: in function '_load_package'
    [@programdir/modules/private/action/require/impl/package.lua:1039]: in function '_load_packages'
    [@programdir/modules/private/action/require/impl/package.lua:1343]: in function 'load_packages'
    [@programdir/modules/private/action/require/impl/install_packages.lua:672]:
    [@programdir/modules/private/action/require/impl/environment.lua:47]: in function 'enter'
    [@programdir/modules/private/action/require/install.lua:71]:
    [@programdir/actions/config/main.lua:391]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/base/task.lua:491]: in function 'run'
    [@programdir/core/main.lua:327]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

checking for ping ... no
checking for git ... no
checkinfo: cannot runv(git --version), No such file or directory
checking for git ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in builtin-repo:
  -> git latest 
please input: y (y/n/m)
error: @programdir/core/main.lua:329: @programdir/modules/private/action/require/impl/install_packages.lua:772: packages(git): must be installed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [@programdir/modules/private/action/require/impl/install_packages.lua:772]:
    [@programdir/modules/private/action/require/impl/environment.lua:47]: in function 'enter'
    [@programdir/modules/private/action/require/install.lua:71]:
    [@programdir/actions/config/main.lua:391]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/base/task.lua:491]: in function 'run'
    [@programdir/core/main.lua:327]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

stack traceback:
	[C]: in function 'error'
	@programdir/core/base/os.lua:973: in function 'os.raiselevel'
	(...tail calls...)
	@programdir/core/main.lua:329: in upvalue 'cotask'
	@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>

Describe the solution you'd like

I want to build the library with system dependency.

Describe alternatives you've considered

No response

Additional context

No response

@da-liii
Copy link
Contributor

da-liii commented Sep 12, 2024

system=true is the right way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants