xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.18k stars 785 forks source link

Duplicate header-only packages are installed #5807

Open star-hengxing opened 1 week ago

star-hengxing commented 1 week ago

Xmake Version

dev

Operating System Version and Architecture

all

Describe Bug

set_runtimes("MD")
add_requires("fast_io", "eigen")
$ xmake f -c
in xmake-repo:
  -> eigen 3.4.0 [runtimes:"MD"]
please input: y (y/n/m)

fast_io headeronly kind set in package description. eigen headeronly kind set in on_load.

Expected Behavior

Work.

Project Configuration

N/A

Additional Information and Error Logs

N/A

waruqi commented 1 week ago

没懂 什么问题。我这可以么

in xmake-repo:
  -> fast_io 2024.3.31
  -> eigen 3.4.0 [runtimes:"MD"]
Issues-translate-bot commented 1 week ago

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


I don't understand what the problem is. Is this okay with me?

in xmake-repo:
  -> fast_io 2024.3.31
  ->eigen 3.4.0 [runtimes:"MD"]
star-hengxing commented 1 week ago
  1. 把这两个包安装的版本全删了
  2. 第一次安装
$ xmake f -c
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> fast_io 2024.3.31
  -> eigen 3.4.0 [runtimes:"MT"]
please input: y (y/n/m)
y
  => download https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2 .. failed
  => clone https://gitee.com/qabeowjbtkwb/fast_io.git 2024.3.31 .. ok
  => install fast_io 2024.3.31 .. ok
  => install eigen 3.4.0 .. ok
  1. 添加 asan 后
$ xmake f -c
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> eigen 3.4.0 [runtimes:"MT", asan:y]
please input: y (y/n/m)

eigen 理论上不需要重新安装的。两个包区别就是一个在描述域设置的 headeronly kind,一个在 on_load

waruqi commented 1 week ago

大概知道原因,但是比较难搞。 is_headeronly 在 on_load 之前就被调用了,用于参与计算 buildhash,在 on_load 去动态改 headeronly kind,滞后了。

Issues-translate-bot commented 1 week ago

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


I probably know the reason, but it's more difficult to do. is_headeronly is called before on_load to participate in the calculation of buildhash. It is dynamically changed after on_load, which lags behind.