Git Product home page Git Product logo

xrepo's Introduction

xrepo

A cross-platform C/C++ package manager based on Xmake

Supporting the project

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. 🙏 [Become a sponsor]

Introduction (中文)

xrepo is a cross-platform C/C++ package manager based on Xmake.

It is based on the runtime provided by xmake, but it is a complete and independent package management program. Compared with package managers such as vcpkg/homebrew, xrepo can provide C/C++ packages for more platforms and architectures at the same time.

And it also supports multi-version semantic selection. In addition, it is also a decentralized distributed repository. It not only provides the official xmake-repo repository, It also supports users to build multiple private repositorys.

At the same time, xrepo also supports installing packages from third-party package managers such as vcpkg/homebrew/conan, and provides unified and consistent library link information to facilitate integration and docking with third-party projects.

If you want to know more, please refer to: Documents, Github and Gitee

Installation

We only need install xmake to use the xrepo command. About the installation of xmake, we can see: Xmake Installation Document.

Supported platforms

  • Windows (x86, x64)
  • macOS (i386, x86_64, arm64)
  • Linux (i386, x86_64, cross-toolchains ..)
  • *BSD (i386, x86_64)
  • Android (x86, x86_64, armeabi, armeabi-v7a, arm64-v8a)
  • iOS (armv7, armv7s, arm64, i386, x86_64)
  • MSYS (i386, x86_64)
  • MinGW (i386, x86_64, arm, arm64)
  • Cross Toolchains

Supported package repositories

  • Official package repository xmake-repo (tbox >1.6.1)
  • User-built repositories
  • Conan (conan::openssl/1.1.1g)
  • Vcpkg (vcpkg:ffmpeg)
  • Homebrew/Linuxbrew (brew::pcre2/libpcre2-8)
  • Pacman on archlinux/msys2 (pacman::libcurl)
  • Clib (clib::clibs/[email protected])
  • Dub (dub::log 0.4.3)

Suppory distributed repository

In addition to directly retrieving the installation package from the official repository: xmake-repo.

We can also add any number of self-built repositories, and even completely isolate the external network, and only maintain the installation and integration of private packages on the company's internal network.

Just use the following command to add your own repository address:

$ xrepo add-repo myrepo https://github.com/mygroup/myrepo

Seamless integration with xmake project

add_requires("tbox >1.6.1", "libuv master", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8")
add_requires("conan::openssl/1.1.1g", {alias = "openssl", optional = true, debug = true})
target("test")
     set_kind("binary")
     add_files("src/*.c")
     add_packages("tbox", "libuv", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8", "openssl")

The following is the overall architecture and compilation process integrated with xmake.

Get started

Installation package

Basic usage

$ xrepo install zlib tbox

Install the specified version package

$ xrepo install "zlib 1.2.x"
$ xrepo install "zlib >=1.2.0"

Install the specified platform package

$ xrepo install -p iphoneos -a arm64 zlib
$ xrepo install -p android [--ndk=/xxx] zlib
$ xrepo install -p mingw [--mingw=/xxx] zlib
$ xrepo install -p cross --sdk=/xxx/arm-linux-musleabi-cross zlib

Install the debug package

$ xrepo install -m debug zlib

Install the package with dynamic library

$ xrepo install -k shared zlib

Install the specified configuration package

$ xrepo install -f "vs_runtime='MD'" zlib
$ xrepo install -f "regex=true,thread=true" boost

Install packages from third-party package manager

$ xrepo install brew::zlib
$ xrepo install vcpkg::zlib
$ xrepo install conan::zlib/1.2.11
$ xrepo install pacman:libpng
$ xrepo install dub:log

Find the library information of the package

$ xrepo fetch pcre2
{
  {
    linkdirs = {
      "/usr/local/Cellar/pcre2/10.33/lib"
    },
    links = {
      "pcre2-8"
    },
    defines = {
      "PCRE2_CODE_UNIT_WIDTH=8"
    },
    includedirs = "/usr/local/Cellar/pcre2/10.33/include"
  }
}
$ xrepo fetch --ldflags openssl
-L/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/lib -lcrypto -lssl
$ xrepo fetch --cflags openssl
-I/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/include
$ xrepo fetch -p [iphoneos|android] --cflags "zlib 1.2.x"
-I/Users/ruki/.xmake/packages/z/zlib/1.2.11/df72d410e7e14391b1a4375d868a240c/include
$ xrepo fetch --cflags --ldflags conan::zlib/1.2.11
-I/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/include -L/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/lib -lz

Import and export packages

xrepo can quickly export the installed packages, including the corresponding library files, header files, and so on.

$ xrepo export -o /tmp/output zlib

You can also import the previously exported installation package on other machines to implement package migration.

$ xrepo import -i /xxx/packagedir zlib

Search supported packages

$ xrepo search zlib "pcr*"
    zlib:
      -> zlib: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (in xmake-repo)
    pcr*:
      -> pcre2: A Perl Compatible Regular Expressions Library (in xmake-repo)
      -> pcre: A Perl Compatible Regular Expressions Library (in xmake-repo)

In addition, you can now search for their packages from third-party package managers such as vcpkg, conan, conda, and apt. You only need to add the corresponding package namespace, for example:

$ xrepo search vcpkg::pcre
The package names:
     vcpkg::pcre:
       -> vcpkg::pcre-8.44#8: Perl Compatible Regular Expressions
       -> vcpkg::pcre2-10.35#2: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library
$ xrepo search conan::openssl
The package names:
     conan::openssl:
       -> conan::openssl/1.1.1g:
       -> conan::openssl/1.1.1h:

Show package environment information

$ xrepo env --show luajit
{
   OLDPWD = "/mnt/tbox",
   HOME = "/home/ruki",
   PATH = "/home/ruki/.xmake/packages/l/luajit/2.1.0-beta3/fbac76d823b844f0b91abf3df0a3bc61/bin:/tmp:/tmp/arm-linux-musleabi-cross/bin:~/.local/bin: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
   TERM = "xterm",
   PWD = "/mnt/xmake",
   XMAKE_PROGRAM_DIR = "/mnt/xmake/xmake",
   HOSTNAME = "e6edd61ff1ab",
   LD_LIBRARY_PATH = "/home/ruki/.xmake/packages/l/luajit/2.1.0-beta3/fbac76d823b844f0b91abf3df0a3bc61/lib",
   SHLVL = "1",
   _ = "/mnt/xmake/scripts/xrepo.sh"
}

Load package environment and run commands

$ xrepo env luajit
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
>
$ xrepo env -b "luajit 2.x" luajit
$ xrepo env -p iphoneos -b "zlib,libpng,luajit 2.x" cmake ..

Package virtual environment

Enter the virtual environment

We can customize some package configurations by adding the xmake.lua file in the current directory, and then enter the specific package virtual environment.

add_requires("zlib 1.2.11")
add_requires("python 3.x", "luajit")
$ xrepo env shell
> python --version
> luajit --version

We can also configure and load the corresponding toolchain environment in xmake.lua, for example, load the VS compilation environment.

set_toolchains("msvc")

Manage virtual environments

We can use the following command to register the specified virtual environment configuration globally to the system for quick switching.

$ xrepo env --add /tmp/base.lua

At this time, we have saved a global virtual environment called base, and we can view it through the list command.

$ xrepo env --list
/Users/ruki/.xmake/envs:
  -base
envs(1) found!

We can also delete it.

$ xrepo env --remove base

Switch global virtual environment

If we register multiple virtual environments, we can also switch them quickly.

$ xrepo env -b base shell
> python --version

Or directly load the specified virtual environment to run specific commands

$ xrepo env -b base python --version

xrepo env -b/--bind is to bind the specified virtual environment. For more details, see: #1762

Show the given package information

$ xrepo info zlib
The package info of project:
    require(zlib):
      -> description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library
      -> version: 1.2.11
      -> urls:
         -> http://zlib.net/zlib-1.2.11.tar.gz
            -> c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
         -> https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
            -> c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
      -> repo: xmake-repo https://gitee.com/tboox/xmake-repo.git master
      -> cachedir: /Users/ruki/.xmake/cache/packages/2010/z/zlib/1.2.11
      -> installdir: /Users/ruki/.xmake/packages/z/zlib/1.2.11/d639b7d6e3244216b403b39df5101abf
      -> searchdirs:
      -> searchnames: zlib-1.2.11.tar.gz
      -> fetchinfo: 1.2.11, system
          -> version: 1.2.11
          -> links: z
          -> linkdirs: /usr/local/Cellar/zlib/1.2.11/lib
          -> includedirs: /usr/local/Cellar/zlib/1.2.11/include
      -> platforms: iphoneos, mingw@windows, macosx, mingw@linux,macosx, android@linux,macosx, windows, linux
      -> requires:
         -> plat: macosx
         -> arch: x86_64
         -> configs:
            -> debug: false
            -> vs_runtime: MT
            -> shared: false
      -> configs:
      -> configs (builtin):
         -> debug: Enable debug symbols. (default: false)
         -> shared: Enable shared library. (default: false)
         -> cflags: Set the C compiler flags.
         -> cxflags: Set the C/C++ compiler flags.
         -> cxxflags: Set the C++ compiler flags.
         -> asflags: Set the assembler flags.
         -> vs_runtime: Set vs compiler runtime. (default: MT)
            -> values: {"MT","MD"}

Uninstall all packages

We can use the following command to batch uninstall and delete the installed packages, supporting pattern matching:

$ xrepo remove --all
$ xrepo remove --all zlib pcr*

Contacts

xrepo's People

Contributors

rinkaa avatar waruqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

xrepo's Issues

添加清理时只清理缓存的功能

你在什么场景下需要该功能?

xrepo clean 清理是没有使用的包和缓存一起清理,还要自己选择是否清理某些包。
有时候只需清理包的构建缓存和下载缓存,不需要清理包。

描述可能的解决方案

添加只清理缓存的选项

描述你认为的候选方案

No response

其他信息

No response

xrepo search 找不到boost

描述问题

Windows10上执行

xrepo search boost

发现输出只有1行:
image

裸连和挂梯子都没用

期待的结果

输出boost包的信息

错误信息

PS D:\Projects\xiaoxun_cpp_backend> xrepo search -vD boost
xmake f -c -v -D
checking for platform ... windows
checking for architecture ... x64
checking for vswhere.exe ... C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
checking for cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2019
checkinfo: cannot runv(dmd.exe --version), No such file or directory
checking for dmd ... no
checkinfo: cannot runv(ldc2.exe --version), No such file or directory
checking for ldc2 ... no
checkinfo: cannot runv(gdc.exe --version), No such file or directory
checking for gdc ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checking for link.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
configure
{
    host = windows
    ndk_stdcxx = true
    arch = x64
    buildir = build
    clean = true
    ccache = true
    plat = windows
    mode = release
    vs = 2019
    kind = static
}
xmake require --search -v -D boost
configure
{
    ndk_stdcxx = true
    buildir = build
    host = windows
    clean = true
    mode = release
    vs = 2019
    plat = windows
    kind = static
    ccache = true
    arch = x64
}
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Program Files\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
The package names:
PS D:\Projects\xiaoxun_cpp_backend>
The package names:

相关环境

请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:

  • xmake版本:xRepo 2.5.6+202107260800
  • xmake运行平台:windows 10
  • xmake目标平台:windows 10

add-repo 命令找不到 unzip 和 7z

Xmake 版本

2.9.3

操作系统版本和架构

Rocky-Linux-9

描述问题

执行 xrepo add-repo oxc xxx 时报错
image
image

期待的结果

命令执行成功

工程配置

附加信息和错误日志

[root@10-16-153-4 ~]# xrepo add-repo -vD oxc xxx
/root/.local/bin/xmake repo --add --global -v -D oxc xxx
error: @programdir/core/main.lua:329: ...mdir/modules/private/action/require/impl/environment.lua:37: failed to find unzip or 7zip! please install one of them first
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:973]:
[...mdir/modules/private/action/require/impl/environment.lua:37]: in function 'enter'
[@programdir/plugins/repo/main.lua:50]: in function '_add'
[@programdir/plugins/repo/main.lua:231]:
[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>
error: ./.local/share/xmake/core/main.lua:329: ./.local/share/xmake/core/sandbox/modules/os.lua:378: execv(/root/.local/bin/xmake repo --add --global -v -D oxc xxx) failed(255)
stack traceback:
[C]: in function 'error'
[./.local/share/xmake/core/base/os.lua:973]:
[./.local/share/xmake/core/sandbox/modules/os.lua:378]:
[...al/share/xmake/modules/private/xrepo/action/add-repo.lua:80]: in function '_add_repository'
[...al/share/xmake/modules/private/xrepo/action/add-repo.lua:88]:
[./.local/share/xmake/modules/private/xrepo/main.lua:196]:
[./.local/share/xmake/plugins/lua/main.lua:124]:
[C]: in function 'xpcall'
[./.local/share/xmake/core/base/utils.lua:275]:
[./.local/share/xmake/core/base/task.lua:491]: in function 'run'
[./.local/share/xmake/core/main.lua:327]: in function 'cotask'
[./.local/share/xmake/core/base/scheduler.lua:406]:

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

`xrepo env --show`结果和`env`一样

xrepo env --show 输出大概看了一下,没有xmake相关内容
除去大括号和最后的空行,行数和env输出一样

$ xrepo env --show | wc -l
74
$ env | wc -l
71

更新
仔细看过了,内容一样,一个json格式,一个shell格式


这个例子是不是有问题,因为xrepo env没有引入任何xrepo的内容
https://github.com/xmake-io/xrepo#enter-the-package-shell-environment

add_requires("zlib 1.2.11")
add_requires("python 3.x", "luajit")
$ xrepo env shell
> python --version
> luajit --version

Installation of packages in wrong order

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

  • xmake version: 2.5.2
  • os: arch-linux
  • target platform: x86_64

mac 使用C++包fmt失败

描述问题

C++项目依赖fmt后,安装fmt失败。

期待的结果

安装成功。

错误信息

ote: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
-> protobuf-cpp 3.17.3
-> fmt 8.0.1
please input: y (y/n/m)

=> install fmt 8.0.1 .. failed

clang: error: invalid version number in '-mmacosx-version-min=11.4'
if you want to get more verbose errors, please see:

相关环境

请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:

  • xmake版本:v2.5.9
  • xmake运行平台:mac
  • xmake目标平台:mac

其他信息

How to specify both the package version and branch

你在什么场景下需要该功能?

xrepo install "xx 1.1"
xrepo install "xx dev"
包名xx后面只能跟版本号或者分支

描述可能的解决方案

怎么同时指定版本号和分支

描述你认为的候选方案

No response

其他信息

No response

xrepo:60: no such file or directory: /Users/zz/.local/bin/xmake

Xmake 版本

v2.9.2+20240523

操作系统版本和架构

Apple M1

描述问题

第一次安装 xmake 的方式忘记了, 应该不是 brew 安装的。

执行了 xmake update 前, xrepo 命令印象中能使用。
执行 xmake update 后, 输入 xrepo 提示

~ xrepo
xrepo:60: no such file or directory: /Users/zz/.local/bin/xmake

检查了 xmake 和 xrepo 各自是什么:

➜  ~ which xmake
/opt/homebrew/bin/xmake
➜  ~ which xrepo
xrepo () {
	if [ $# -ge 2 ] && [ "$1" = "env" ]
	then
		local cmd="${2-x}"
		case "$cmd" in
			(shell) if test "${XMAKE_PROMPT_BACKUP}"
				then
					PS1="${XMAKE_PROMPT_BACKUP}"
					source "${XMAKE_ENV_BACKUP}" || return 1
					unset XMAKE_PROMPT_BACKUP
					unset XMAKE_ENV_BACKUP
				fi
				"$XMAKE_EXE" lua private.xrepo.action.env.info config || return 1
				local prompt="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info prompt)"  || return 1
				if [ -z "${prompt+x}" ]
				then
					return 1
				fi
				local activateCommand="$("$XMAKE_EXE" lua private.xrepo.action.env.info script.bash)"  || return 1
				export XMAKE_ENV_BACKUP="$("$XMAKE_EXE" lua private.xrepo.action.env.info envfile)"
				export XMAKE_PROMPT_BACKUP="${PS1}"
				"$XMAKE_EXE" lua private.xrepo.action.env.info backup.bash > "$XMAKE_ENV_BACKUP"
				eval "$activateCommand"
				PS1="${prompt} $PS1"  ;;
			(quit) if test "${XMAKE_PROMPT_BACKUP}"
				then
					PS1="${XMAKE_PROMPT_BACKUP}"
					source "${XMAKE_ENV_BACKUP}" || return 1
					unset XMAKE_PROMPT_BACKUP
					unset XMAKE_ENV_BACKUP
				fi ;;
			(-b | --bind) if [ "$4" = "shell" ]
				then
					local bnd="${3-x}"
					if test "${XMAKE_PROMPT_BACKUP}"
					then
						PS1="${XMAKE_PROMPT_BACKUP}"
						source "${XMAKE_ENV_BACKUP}" || return 1
						unset XMAKE_PROMPT_BACKUP
						unset XMAKE_ENV_BACKUP
					fi
					"$XMAKE_EXE" lua private.xrepo.action.env.info config $bnd || return 1
					local prompt="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info prompt $bnd)"  || return 1
					if [ -z "${prompt+x}" ]
					then
						return 1
					fi
					local activateCommand="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info script.bash $bnd)"  || return 1
					export XMAKE_ENV_BACKUP="$("$XMAKE_EXE" lua private.xrepo.action.env.info envfile $bnd)"
					export XMAKE_PROMPT_BACKUP="${PS1}"
					"$XMAKE_EXE" lua --quiet private.xrepo.action.env.info backup.bash $bnd > "$XMAKE_ENV_BACKUP"
					eval "$activateCommand"
					PS1="${prompt} $PS1"
				else
					"$XMAKE_EXE" lua private.xrepo "$@"
				fi ;;
			(*) "$XMAKE_EXE" lua private.xrepo "$@" ;;
		esac
	else
		"$XMAKE_EXE" lua private.xrepo "$@"
	fi
}

期待的结果

希望 xrepo 命令不要报错,要提示 help 的内容。

工程配置

没有 xmake.lua

附加信息和错误日志

➜  ~ xmake -vD
checking for xrepo ... /opt/homebrew/bin/xrepo
checking for ping ... /sbin/ping
pinging the host(gitee.com) ... 40 ms
pinging the host(gitlab.com) ... 199 ms
pinging the host(github.com) ... 293 ms
note: xmake.lua not found, try generating it (pass -y or --confirm=y/n/d to skip confirm)?
please input: n (y/n)

search for package description

你在什么场景下需要该功能?

希望可以增加选项,在搜索时不仅搜索package name,还搜索description

例如搜索xml的库,写

xrepo search *xml*

就搜不到xerces-c、expat等xml库

描述可能的解决方案

xrepo search -a *xml*

搜索时同时也匹配description

在使用add_requires("libcurl")时安装失败

Xmake 版本

v2.8.5+20231220

操作系统版本和架构

Linux DESKTOP-79IFIOU 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

描述问题

程序使用add_requires("libcurl"),在编译库时出现安装失败的 问题
加-vD后,最后定位到是链接时缺少-ldl参数,能修改下相关程序吗?

期待的结果

成功安装libcurl

工程配置

lua脚本:
add_requires("libcurl",{system = false})

GCC版本 gcc (Ubuntu 11.4.0-2ubuntu1~18.04) 11.4.0

附加信息和错误日志

cd /home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/build_0a140039/src && /usr/bin/cc -DBUILDING_CURL -DCURL_STATICLIB -DHAVE_CONFIG_H -I/home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/include -I/home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/lib -I/home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/build_0a140039/lib -I/home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/build_0a140039/include -I/home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/src -isystem /home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/include -W -Wall -pedantic -Wbad-function-cast -Wconversion -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wno-multichar -Wpointer-arith -Wshadow -Wsign-compare -Wundef -Wunused -Wwrite-strings -Waddress -Wattributes -Wcast-align -Wdeclaration-after-statement -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-security -Wignored-qualifiers -Wmissing-field-initializers -Wmissing-noreturn -Wno-format-nonliteral -Wno-sign-conversion -Wno-system-headers -Wredundant-decls -Wold-style-definition -Wstrict-prototypes -Wtype-limits -Wunreachable-code -Wunused-parameter -Wvla -Wclobbered -Wmissing-parameter-type -Wold-style-declaration -Wstrict-aliasing=3 -Wformat=2 -Warray-bounds=2 -ftree-vrp -Wduplicated-cond -Wnull-dereference -fdelete-null-pointer-checks -Wshift-negative-value -Wshift-overflow=2 -Walloc-zero -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wrestrict -Warith-conversion -Wdouble-promotion -Wenum-conversion -Wpragmas -Wunused-const-variable -O3 -DNDEBUG -fPIE -MD -MT src/CMakeFiles/curl.dir//lib/dynbuf.c.o -MF CMakeFiles/curl.dir//lib/dynbuf.c.o.d -o CMakeFiles/curl.dir/__/lib/dynbuf.c.o -c /home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/lib/dynbuf.c
[100%] Linking C executable curl
cd /home/camel/.xmake/cache/packages/2401/l/libcurl/8.5.0/source/build_0a140039/src && /home/camel/.xmake/packages/c/cmake/3.28.1/130fb2d927cc4c0cabd31f0f6b3ef621/bin/cmake -E cmake_link_script CMakeFiles/curl.dir/link.txt --verbose=1

/usr/bin/cc -W -Wall -pedantic -Wbad-function-cast -Wconversion -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wno-multichar -Wpointer-arith -Wshadow -Wsign-compare -Wundef -Wunused -Wwrite-strings -Waddress -Wattributes -Wcast-align -Wdeclaration-after-statement -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-security -Wignored-qualifiers -Wmissing-field-initializers -Wmissing-noreturn -Wno-format-nonliteral -Wno-sign-conversion -Wno-system-headers -Wredundant-decls -Wold-style-definition -Wstrict-prototypes -Wtype-limits -Wunreachable-code -Wunused-parameter -Wvla -Wclobbered -Wmissing-parameter-type -Wold-style-declaration -Wstrict-aliasing=3 -Wformat=2 -Warray-bounds=2 -ftree-vrp -Wduplicated-cond -Wnull-dereference -fdelete-null-pointer-checks -Wshift-negative-value -Wshift-overflow=2 -Walloc-zero -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wrestrict -Warith-conversion -Wdouble-promotion -Wenum-conversion -Wpragmas -Wunused-const-variable -O3 -DNDEBUG CMakeFiles/curl.dir/slist_wc.c.o CMakeFiles/curl.dir/tool_binmode.c.o CMakeFiles/curl.dir/tool_bname.c.o CMakeFiles/curl.dir/tool_cb_dbg.c.o CMakeFiles/curl.dir/tool_cb_hdr.c.o CMakeFiles/curl.dir/tool_cb_prg.c.o CMakeFiles/curl.dir/tool_cb_rea.c.o CMakeFiles/curl.dir/tool_cb_see.c.o CMakeFiles/curl.dir/tool_cb_wrt.c.o CMakeFiles/curl.dir/tool_cfgable.c.o CMakeFiles/curl.dir/tool_dirhie.c.o CMakeFiles/curl.dir/tool_doswin.c.o CMakeFiles/curl.dir/tool_easysrc.c.o CMakeFiles/curl.dir/tool_filetime.c.o CMakeFiles/curl.dir/tool_findfile.c.o CMakeFiles/curl.dir/tool_formparse.c.o CMakeFiles/curl.dir/tool_getparam.c.o CMakeFiles/curl.dir/tool_getpass.c.o CMakeFiles/curl.dir/tool_help.c.o CMakeFiles/curl.dir/tool_helpers.c.o CMakeFiles/curl.dir/tool_hugehelp.c.o CMakeFiles/curl.dir/tool_ipfs.c.o CMakeFiles/curl.dir/tool_libinfo.c.o CMakeFiles/curl.dir/tool_listhelp.c.o CMakeFiles/curl.dir/tool_main.c.o CMakeFiles/curl.dir/tool_msgs.c.o CMakeFiles/curl.dir/tool_operate.c.o CMakeFiles/curl.dir/tool_operhlp.c.o CMakeFiles/curl.dir/tool_paramhlp.c.o CMakeFiles/curl.dir/tool_parsecfg.c.o CMakeFiles/curl.dir/tool_progress.c.o CMakeFiles/curl.dir/tool_setopt.c.o CMakeFiles/curl.dir/tool_sleep.c.o CMakeFiles/curl.dir/tool_stderr.c.o CMakeFiles/curl.dir/tool_strdup.c.o CMakeFiles/curl.dir/tool_urlglob.c.o CMakeFiles/curl.dir/tool_util.c.o CMakeFiles/curl.dir/tool_vms.c.o CMakeFiles/curl.dir/tool_writeout.c.o CMakeFiles/curl.dir/tool_writeout_json.c.o CMakeFiles/curl.dir/tool_xattr.c.o CMakeFiles/curl.dir/var.c.o CMakeFiles/curl.dir//lib/base64.c.o CMakeFiles/curl.dir//lib/dynbuf.c.o -o curl ../lib/libcurl.a -lpthread /home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib/libssl.a /home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib/libcrypto.a -lpthread //这里缺少-ldl

/home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib/libcrypto.a(dso_dlfcn.o): In function dlfcn_load': dso_dlfcn.c:(.text+0x114): undefined reference to dlopen'
dso_dlfcn.c:(.text+0x148): undefined reference to dlerror' dso_dlfcn.c:(.text+0x206): undefined reference to dlclose'
/home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib/libcrypto.a(dso_dlfcn.o): In function dlfcn_unload': dso_dlfcn.c:(.text+0x2d2): undefined reference to dlclose'
/home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib/libcrypto.a(dso_dlfcn.o): In function dlfcn_bind_func': dso_dlfcn.c:(.text+0x3d8): undefined reference to dlsym'
dso_dlfcn.c:(.text+0x40e): undefined reference to dlerror' /home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib/libcrypto.a(dso_dlfcn.o): In function dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x7de): undefined reference to dladdr' dso_dlfcn.c:(.text+0x849): undefined reference to dlerror'
/home/camel/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib/libcrypto.a(dso_dlfcn.o): In function dlfcn_globallookup': dso_dlfcn.c:(.text+0x8a3): undefined reference to dlopen'
dso_dlfcn.c:(.text+0x8c1): undefined reference to dlsym' dso_dlfcn.c:(.text+0x8d1): undefined reference to dlclose'
collect2: error: ld returned 1 exit status
make[2]: *** [src/curl] Error 1

Freetype not installing

Xrepo will not install freetype. On discord, we determined that it was because xrepo can't find the BrotliDecoderDecompress symbol on my system's brotli library. The issue is that my system's brotli install seperates the library into 3 files: libbrotlicommon-static.a, libbrotlienc-static.a, and libbrotlidec-static.a. The file libbrotlidec-static.a is where the BrotliDecoderDecompress symbol is defined.

Expected behavior

Should install without issue.

Error output

[sean@sean-pc-arch ~]$ xrepo install freetype note: try installing these packages (pass -y to skip confirm)? in xmake-repo: -> freetype 2.10.4 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! error: execv(xmake require -j 9 --extra={system=false} freetype) failed(255)

If it is a xmake related compilation problem, please add the -v -D parameter and give the detailed compilation output information.

Related Environment

  • xmake version: 2.5.2
  • os: arch-linux
  • target platform: x86-64

xrepo search vcpkg::flashlight-cuda gives no results

Note: If you use the fuzzy expressions such as 'can't use/no effect/problem/error', but don't give any relevant auxiliary information according to the template below, this issue will be not replied.

Describe the bug

A clear and concise description of what the bug is.

xrepo search vcpkg::flashlight-cuda doesn't return a result for the flashlight-cuda package on vcpkg.

Expected behavior

A clear and concise description of what you expected to happen.

It should return some result, as the package actually exists on vcpkg.

Error output

If applicable, please add verbose the errors output to help us analyze your problem.

If it is a xmake related compilation problem, please add the -v -D parameter and give the detailed compilation output information.

Related Environment

Please provide compiling and running environment information:

  • xmake version: xmake v2.5.3+202104301933,
  • os: ArchLinux
  • target platform: Linux

Additional context

Add any other context about the problem here.

xrepo导出的包如何在另外机器上安装或导入

描述讨论详情

我使用了xrepo安装了一个包,比如是zlib,我将它导出

> xrepo export -o /path/to/pkg zlib

发现导出包的目录结构与原始位置的目录结构不一致。
原目录结构为:z/zlib/1.2.11/a593fa3f71e64cf790ec96898b34de8a,导出包的目录结构直接为zlib_1.2.11_a593fa3f71e64cf790ec96898b34de8a
那么如果我要在另外一台机器上,能否将这个包导入或安装呢?

之所提这个问题,是因为需要在网络受限环境中使用依赖包。如果可以在开放的网络上下载安装需要的包,再将这个包导出,能导出的包复制或安装到受限环境中使用就好了。

还是说只能将依赖包源码下载到受限环境中,添加包仓库,像说明中指出的一样:

$ xrepo add-repo myrepo https://github.com/mygroup/myrepo

或者手动修改目录使之与xrepo管理目录适配呢?
或者能否在add_requires中设置包目录呢?

install mysql 5.7.29 .. failed

Xmake 版本

2.7.4

操作系统版本和架构

centos 7.8

描述问题

xrepo install mysql

期待的结果

install mysql failed

工程配置

No response

附加信息和错误日志

[xmk@VM-4-3-centos ~]$ xrepo install mysql

note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> mysql 5.7.29 
please input: y (y/n/m)
  => install mysql 5.7.29 .. failed 

-- Running cmake version 3.26.0-rc2
-- Found Git: /usr/local/git/bin/git (found version "2.39.1") 
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib64/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_GENERATOR: Unix Makefiles
-- Looking for SHM_HUGETLB
if you want to get more verbose errors, please see:
  -> /home/xmk/.xmake/cache/packages/2302/m/mysql/5.7.29/installdir.failed/logs/install.txt
error: install failed!
error: execv(xmake require -j 3 --extra={system=false} mysql) failed(255)

大佬,OPENSSL的交叉编译不了,快来救救孩子吧

Describe the problem details

我的安装命令如下
xrepo install -p cross --sdk=/home/sss/ssd210/gcc/ openssl
在安装openssl包中,获取到如下的信息

if you want to get verbose errors, please see:
  -> /home/sss/.xmake/cache/packages/2106/o/openssl/1.1.1k/installdir.failed/logs/install.txt
❗ error: install failed!
❗ error: execv(xmake require -j 12 --extra={system=false} openssl) failed(255)

但是我不知道这个错误是编译的时候遇到啥问题了。

Odd characters in output from xrepo

Describe the bug

Small typo looking issue in the xrepo output. Only happens when add_requires() is a certain order.
This produces the bug:

add_requires("libsdl","libpng", "glib", "freetype", "brotli", {system = false})

Here's the output:

xmake
checking for platform ... linux
checking for architecture ... x86_64
note: try installing these packages (pass -y to skip confirm)?
in xmake-repo:
  -> freetype 2.10.4 
  -> brotli#1 1.0.9  <----  See here, the extra '#1' after 'brotli'
please input: y (y/n)

This does not:

add_requires("brotli", {system = false})
add_requires("libsdl","libpng", "glib", "freetype", {system = false})

Here's the output:

xmake
checking for platform ... linux
checking for architecture ... x86_64
note: try installing these packages (pass -y to skip confirm)?
in xmake-repo:
  -> brotli 1.0.9 
please input: y (y/n)

Expected behavior

Shouldn't have extra characters.

Related Environment

  • xmake version: 2.5 2
  • os: arch-linux
  • target platform: x86_64

hiredis 包 mingw 平台库无法自动检测

Xmake 版本

2.7.2

操作系统版本和架构

操作系统:ubuntu16.04 架构:mingw

描述问题

加载方式:通过add_requires("hiredis")和add_packages("hiredis") 加载

linux:加载正常
{ static = true, license = "BSD-3-Clause", version = "v1.0.2", libfiles = { "/home/rocky/.xmake/packages/h/hiredis/v1.0.2/944c61d7a4e443f89f1bfbce4436adaf/lib/libhiredis.a" }, linkdirs = { "/home/rocky/.xmake/packages/h/hiredis/v1.0.2/944c61d7a4e443f89f1bfbce4436adaf/lib" }, sysincludedirs = { "/home/rocky/.xmake/packages/h/hiredis/v1.0.2/944c61d7a4e443f89f1bfbce4436adaf/include" }, links = { "hiredis" } }

mingw:只能检测到头文件,不能检测到库。
{ license = "BSD-3-Clause", shared = true, version = "v1.0.2", sysincludedirs = { "/home/rocky/.xmake/packages/h/hiredis/v1.0.2/69688960df35471daf9e3809068a0433/include" } }

mingw需要xrepo info hiredis查询到安装路径,通过add_linkdirs后才能检测到库。
add_linkdirs("/home/rocky/.xmake/packages/h/hiredis/v1.0.2/69688960df35471daf9e3809068a0433/lib")

可能是库名字特殊导致:
/home/rocky/.xmake/packages/h/hiredis/v1.0.2/69688960df35471daf9e3809068a0433/lib/libhiredis.dll.a

期待的结果

希望能跟linux一样,自动检测库。

工程配置

No response

附加信息和错误日志

No response

xrepo errors

Xmake 版本

2.6.4

操作系统版本和架构

windows 10 20h2

描述问题

xrepo install zlib
updating repositories .. error: fatal: not a git repository (or any of the parent directories): .git
error: execv(xmake require -j 12 --extra={system=false} zlib) failed(-1)

xmake require -j 12 --extra={system=false} zlib
updating repositories .. error: fatal: not a git repository (or any of the parent directories): .git

期待的结果

no

工程配置

default

附加信息和错误日志

No response

`xrepo env zlib` failed

$ xrepo install zlib installed zlib successfully

$ xrepo env zlib
error: cannot execv(zlib), No such file or directory

希望更好的支持到包的开发或调试

你在什么场景下需要该功能?

在嵌入式系统中,往往以交叉编译的方式进行,然后通过xrepo的模式来构建整个rootfs(用户态根文件系统)。这个时候不可避免的需要对一些包进行调整或调试,而不完全以一个个应用程序的方式组织开发。

当前的xrepo方式,当对代码进行修改时,它既不会对更改后的代码进行增量编译,甚至它还会重新展开原始的压缩包,把修改覆盖掉来进行编译。所以目前的xrepo方式并不面向开发,更多的是构建出对应的二进制程序。

描述可能的解决方案

希望的模式有些类似:

  • 可以非常方便的加入一个软件包;
  • 可以灵活的对这个软件包进行开发;
    • 支持修改软件包里的代码;
    • 在进行编译时,可以直接进行增量编译 & 安装;
    • 在做distclean时,也可以展开原始压缩包的模式去编译构建。

描述你认为的候选方案

No response

其他信息

No response

下载g2o报错

Xmake 版本

xmake v2.8.9+20240415

操作系统版本和架构

x86_64 ubuntu22

描述问题

无法直接下载g2o

期待的结果

无法直接下载g2o

工程配置

xrepo install g2o

附加信息和错误日志

/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(sparse_optimizer.cpp.o): in function g2o::SparseOptimizer::optimize(int, bool)': sparse_optimizer.cpp:(.text+0x1afb): undefined reference to g2o::get_monotonic_time()'
/usr/bin/ld: sparse_optimizer.cpp:(.text+0x1bea): undefined reference to g2o::get_monotonic_time()' /usr/bin/ld: sparse_optimizer.cpp:(.text+0x1c11): undefined reference to g2o::get_monotonic_time()'
/usr/bin/ld: sparse_optimizer.cpp:(.text+0x1c39): undefined reference to g2o::get_monotonic_time()' /usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(optimization_algorithm.cpp.o): in function g2o::OptimizationAlgorithm::~OptimizationAlgorithm()':
optimization_algorithm.cpp:(.text+0x58): undefined reference to g2o::PropertyMap::~PropertyMap()' /usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(optimization_algorithm.cpp.o): in function g2o::OptimizationAlgorithm::updatePropertiesFromString(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
optimization_algorithm.cpp:(.text+0x2f9): undefined reference to g2o::PropertyMap::updateMapFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: /home/.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(optimizable_graph.cpp.o): in function g2o::OptimizableGraph::setRenamedTypesFromString(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
optimizable_graph.cpp:(.text+0x42a4): undefined reference to g2o::strSplit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: optimizable_graph.cpp:(.text+0x431b): undefined reference to g2o::strSplit(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: optimizable_graph.cpp:(.text+0x45a9): undefined reference to g2o::trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: optimizable_graph.cpp:(.text+0x45bd): undefined reference to g2o::trim(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(optimizable_graph.cpp.o): in function g2o::OptimizableGraph::load(std::istream&)': optimizable_graph.cpp:(.text+0x6f89): undefined reference to g2o::readLine(std::istream&, std::__cxx11::basic_stringstream<char, std::char_traits, std::allocator >&)'
/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(parameter_container.cpp.o): in function g2o::ParameterContainer::read(std::istream&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const*)': parameter_container.cpp:(.text+0x87f): undefined reference to g2o::readLine(std::istream&, std::__cxx11::basic_stringstream<char, std::char_traits, std::allocator >&)'
/usr/bin/ld: parameter_container.cpp:(.text+0x9ef): undefined reference to g2o::readLine(std::istream&, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&)' /usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(hyper_graph_action.cpp.o): in function g2o::DrawAction::refreshPropertyPtrs(g2o::HyperGraphElementAction::Parameters*)':
hyper_graph_action.cpp:(.text+0x6e0): undefined reference to g2o::BaseProperty::BaseProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: hyper_graph_action.cpp:(.text+0x702): undefined reference to g2o::PropertyMap::addProperty(g2o::BaseProperty*)'
/usr/bin/ld: hyper_graph_action.cpp:(.text+0x89a): undefined reference to g2o::BaseProperty::BaseProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: hyper_graph_action.cpp:(.text+0x8ba): undefined reference to g2o::PropertyMap::addProperty(g2o::BaseProperty*)'
/usr/bin/ld: hyper_graph_action.cpp:(.text+0x960): undefined reference to typeinfo for g2o::BaseProperty' /usr/bin/ld: hyper_graph_action.cpp:(.text+0x997): undefined reference to typeinfo for g2o::BaseProperty'
/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(hyper_graph_action.cpp.o): in function g2o::DrawAction::Parameters::~Parameters()': hyper_graph_action.cpp:(.text._ZN3g2o10DrawAction10ParametersD2Ev[_ZN3g2o10DrawAction10ParametersD5Ev]+0x1c): undefined reference to g2o::PropertyMap::~PropertyMap()'
/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(hyper_graph_action.cpp.o): in function g2o::DrawAction::Parameters::~Parameters()': hyper_graph_action.cpp:(.text._ZN3g2o10DrawAction10ParametersD0Ev[_ZN3g2o10DrawAction10ParametersD5Ev]+0x1c): undefined reference to g2o::PropertyMap::~PropertyMap()'
/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(hyper_graph_action.cpp.o): in function g2o::Property<bool>::~Property()': hyper_graph_action.cpp:(.text._ZN3g2o8PropertyIbED2Ev[_ZN3g2o8PropertyIbED5Ev]+0x13): undefined reference to g2o::BaseProperty::~BaseProperty()'
/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(hyper_graph_action.cpp.o): in function g2o::Property<bool>::~Property()': hyper_graph_action.cpp:(.text._ZN3g2o8PropertyIbED0Ev[_ZN3g2o8PropertyIbED5Ev]+0x17): undefined reference to g2o::BaseProperty::~BaseProperty()'
/usr/bin/ld: /home//.xmake/packages/g/g2o/2020.12.23/9b8103c400e143d99e420d91049fc78f/lib/libg2o_core.a(hyper_graph_action.cpp.o):(.data.rel.ro._ZTIN3g2o8PropertyIbEE[_ZTIN3g2o8PropertyIbEE]+0x10): undefined reference to `typeinfo for g2o::BaseProperty'
collect2: error: ld returned 1 exit status

error: fatal: couldn't find remote ref main

Xmake 版本

v2.7.3+master.b312e3b6a

操作系统版本和架构

windows 10 21H2

描述问题

image
全新下载的压缩包xmake,使用xrepo搜索gest找不到分支,试了xrepo env可以使用。
另一台同样系统版本的电脑可以找到gtest无报错。

期待的结果

找到gtest包

工程配置

附加信息和错误日志

"xrepo search lib" 报错

使用 "xrepo search lib" 搜索时报错,报错信息如下:

The package names:
error: ...ke\repositories\xmake-repo\packages\l\libtorch\xmake.lua:24: attempt to call global 'set_policy' (a nil value)
stack traceback:
    [...ke\repositories\xmake-repo\packages\l\libtorch\xmake.lua:24]: in main chunk

error: execv(xmake require --search lib) failed(-1)

xrepo info error : invalid value (boolean) at index 1 in table for 'concat'

描述问题

cmd:
xrepo info -vD lua

lua 已经安装了 且 安装为 static 的时候 报错 invalid value (boolean) at index 1 in table for 'concat'

错误信息

~$ xrepo info -vD lua
xmake f -c -v -D
checking for architecture ... x86_64
checking for gcc ... /usr/bin/gcc
checking for dmd ... no
checking for ldc2 ... no
checking for gdc ... no
configure
{
ndk = /usr/local/android-ndk-r21b/
ndk_stdcxx = true
mode = release
clean = true
arch = x86_64
buildir = build
ccache = true
theme = default
kind = static
plat = linux
host = linux
network = public
proxy_pac = pac.lua
}
xmake require --info -v -D lua
configure
{
clean = true
theme = default
ndk = /usr/local/android-ndk-r21b/
ccache = true
kind = static
plat = linux
network = public
mode = release
buildir = build
arch = x86_64
proxy_pac = pac.lua
host = linux
ndk_stdcxx = true
}
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
checking for ping ... /usr/bin/ping
pinging for the host(github.com) ... 293 ms
pinging for the host(gitlab.com) ... 202 ms
pinging for the host(gitee.com) ... 44 ms
The package info of project:
require(lua):
-> description: A powerful, efficient, lightweight, embeddable scripting language.
-> version: 5.4.1
-> urls:
-> https://www.lua.org/ftp/lua-5.4.1.tar.gz
-> 4ba786c3705eb9db6567af29c91a01b81f1c0ac3124fdbf6cd94bdd9e53cca7d
-> https://github.com/lua/lua.git
-> 4ba786c3705eb9db6567af29c91a01b81f1c0ac3124fdbf6cd94bdd9e53cca7d
-> repo: xmake-repo https://gitee.com/tboox/xmake-repo.git master
-> cachedir: /home/yecate/.xmake/cache/packages/2011/l/lua/5.4.1
-> installdir: /home/yecate/.xmake/packages/l/lua/5.4.1/531f88cff3a64da0aa3fb05ee281ab7d
-> searchdirs:
-> searchnames: lua.git, lua-5.4.1.tar.gz
finding lua from xmake ..
checking for xmake::lua ... lua 5.4.1
-> fetchinfo: 5.4.1
-> sysincludedirs: /home/yecate/.xmake/packages/l/lua/5.4.1/531f88cff3a64da0aa3fb05ee281ab7d/include/lua
error: @programdir/core/main.lua:284: @programdir/actions/require/info.lua:163: invalid value (boolean) at index 1 in table for 'concat'
stack traceback:
[C]: in function 'concat'
[@programdir/actions/require/info.lua:163]: in function 'info'
[@programdir/actions/require/main.lua:98]:
[C]: in function 'load'
[@programdir/core/base/task.lua:520]: in function 'run'
[@programdir/core/main.lua:282]: in function 'cotask'
[@programdir/core/base/scheduler.lua:317]:
stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:789: in function 'raise'
@programdir/core/main.lua:284: in function 'cotask'
@programdir/core/base/scheduler.lua:317: in function <@programdir/core/base/scheduler.lua:315>
error: ./.local/share/xmake/core/main.lua:284: ./.local/share/xmake/core/sandbox/modules/os.lua:387: execv(xmake require --info -v -D lua) failed(255)
stack traceback:
[C]: in function 'error'
[./.local/share/xmake/core/base/os.lua:789]: in function 'raise'
[./.local/share/xmake/core/sandbox/modules/os.lua:387]: in function 'vexecv'
[./.local/share/xmake/modules/private/xrepo/action/info.lua:86]: in function '_info_packages'
[./.local/share/xmake/modules/private/xrepo/action/info.lua:93]: in function 'action'
[./.local/share/xmake/modules/private/xrepo/main.lua:196]: in function 'func'
[./.local/share/xmake/plugins/lua/main.lua:123]:
[C]: in function 'load'
[./.local/share/xmake/core/base/task.lua:520]: in function 'run'
[./.local/share/xmake/core/main.lua:282]: in function 'cotask'
[./.local/share/xmake/core/base/scheduler.lua:317]:
stack traceback:
[C]: in function 'error'
./.local/share/xmake/core/base/os.lua:789: in function 'raise'
./.local/share/xmake/core/main.lua:284: in function 'cotask'
./.local/share/xmake/core/base/scheduler.lua:317: in function <./.local/share/xmake/core/base/scheduler.lua:315>

相关环境

请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:

  • xmake版本:2.3.8 dev
  • xmake运行平台:linux
  • xmake目标平台:linux

其他信息

报错的lua 文件 actions/require/info.lua:163
https://github.com/xmake-io/xmake/blob/dev/xmake/actions/require/info.lua#L160-L165

dump fetchinfo

{
sysincludedirs = {
"/home/yecate/.xmake/packages/l/lua/5.4.1/531f88cff3a64da0aa3fb05ee281ab7d/include/lua"
},
static = true,
linkdirs = {
"/home/yecate/.xmake/packages/l/lua/5.4.1/531f88cff3a64da0aa3fb05ee281ab7d/lib"
},
links = {
"lua"
},
version = "5.4.1",
syslinks = {
"dl",
"m"
},
libfiles = {
"/home/yecate/.xmake/packages/l/lua/5.4.1/531f88cff3a64da0aa3fb05ee281ab7d/lib/liblua.a"
}
}

出错原因 fetchinfo.static = true

xrepo install brew::llvm fails on Linux

Xmake Version

2.8.2

Operating System Version and Architecture

Ubuntu 22.04.3 LTS

Describe Bug

Invoking xrepo install brew::llvm on Linux fails.

However, the same command did work when I tested it on my macOS machine.

Expected Behavior

The command should succeed (on all platforms where Homebrew is supported).

Project Configuration

No project configuration.

Additional Information and Error Logs

The logs just show the following:

fetch brew::llvm-latest failed!

增加gitee的支持

国内访问GitHub网站速度太差,希望能够增加对gitee的支持。我这边执行了xrepo add-repo myrepo https://gitee.com/tboox/xrepo但是发现仍然使用的是GitHub的源。`xrepo install "opencv 3.4"输出如下:

note: try installing these packages (pass -y to skip confirm)?
in xmake-repo:
  -> libffi 3.3 [linux, x86_64, from:opencv,python]
  -> zlib 1.2.11 [linux, x86_64, from:opencv,python]
  -> zlib#1 1.2.11 [from:opencv]
  -> opencv 3.4.9 
please input: y (y/n)
y
  => download https://github.com/madler/zlib/archive/v1.2.11.tar.gz .. failed

we can also download these packages manually:
  - https://github.com/madler/zlib/archive/v1.2.11.tar.gz
to the local search directories: 
  - v1.2.11.tar.gz
and we can run `xmake g --pkg_searchdirs=/xxx` to set the search directories.
error: download failed!
error: execv(xmake require -j 6 --extra={system=false} "opencv 3.4") failed(255)

Question: `xrepo install -f "name=val"` vs `xrepo install -f "name='val'"`

Describe the bug

-f "someconfig" makes no effect for xrepo install;
In the following commands, the config -f "glfw_include=es3" is ignored and makes no effect.

> xrepo install -f "glfw_include=es3" glfw
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo-dev:
  -> glfw 3.3.4 
please input: y (y/n/m)
y
  => install glfw 3.3.4 .. ok
> xrepo scan glfw
scanning packages ..
glfw-3.3.4:
  -> 58b838c9240946ef80fade0f66a356e9: linux, x86_64
    -> {debug=false,shared=false,glfw_include="none",pic=true}

Expected behavior

Package with the given configs should be installed, eg. providing {glfw_include="es3"}

Related Environment

  • xrepo version: xRepo 2.5.7+202109240246
  • os: Linux Mint 20.2 Cinnamon

Using Xmake-repo by default

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

When I first started using xrepo I couldn't figure out why I can't install packages, but later on I figured it's because there's no repository attached even though xmake list-repo shows me that xmake-repo is used.
but it was fixed when I added it xrepo add-repo xmake-repo https://github.com/xmake-io/xmake-repo

Describe the solution you'd like

I think xrepo by default should fall back the xmake-repo whenever an error is found.

Describe alternatives you've considered

No response

Additional context

No response

Fail to install assimp 5.2.4 at (vs_runtime="MTd" and debug=true)

Xmake 版本

v2.8.5+dev.1ccbc20e7

操作系统版本和架构

Windows11 22H2 22621.2861

描述问题

Using VS2022 as toolchain and below statement in xmake
add_requires("assimp >= 5.2.4", {configs = {debug = true, vs_runtime = "MTd"}} )

Fail to install it, the detailed output log shows there's something wrong with the "/EHsc" flags and all these warnings are considered as errors.

期待的结果

Should install successfully.

工程配置

add_requires("assimp >= 5.2.4", {configs = {debug = true, vs_runtime = "MTd"}} )

附加信息和错误日志

install.txt

`xrepo search` 相同参数不同结果

$ xrepo search pcr*
The package names:
    pcr*: 
      -> pcre2-10.23: A Perl Compatible Regular Expressions Library (in xmake-repo)
      -> pcre-8.44: A Perl Compatible Regular Expressions Library (in xmake-repo)
$ xrepo search "pcr*"
The package names:
    pcr*: 
      -> pcre2-10.30: A Perl Compatible Regular Expressions Library (in xmake-repo)
      -> pcre-8.45: A Perl Compatible Regular Expressions Library (in xmake-repo)

Cannot `xrepo remove package`. package(pkg) not found.

Xmake Version

2.7.1+HEAD.0162040

Operating System Version and Architecture

macOS Monterey 12.5.1

Describe Bug

image

image

Expected Behavior

Successfully removed the selected package.

Project Configuration

No response

Additional Information and Error Logs

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.