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

add_requires太慢,又不知道cache目录 #852

Closed
playgithub opened this issue Jun 18, 2020 · 12 comments
Closed

add_requires太慢,又不知道cache目录 #852

playgithub opened this issue Jun 18, 2020 · 12 comments

Comments

@playgithub
Copy link

  1. xmake下载boost太慢
λ xmake f -cvD
checking for the architecture ... x64
checking for the vswhere.exe ... C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
checking for the cl.exe ... ok
checking for the Microsoft Visual Studio (x64) version ... 2019
checking for the unzip ... ok
checking for the git ... ok
checking for the gzip ... ok
checking for the tar ... ok
checking for the ping ... ok
pinging for the host(gitee.com) ... 25 ms
pinging for the host(gitlab.com) ... 92 ms
checking for the nmap ... no
pinging for the host(github.com) ... 65535 ms
finding boost from xmake ..
checking for the xmake::boost ... no
finding boost from vcpkg ..
checking for the vcpkg directory ... no
finding boost from conan ..
finding boost from pkg_config ..
checking for the pkg-config ... no
finding boost from system ..
checking for the boost ... no
finding wxWidgets from xmake ..
checking for the xmake::wxWidgets ... no
finding wxWidgets from vcpkg ..
finding wxWidgets from conan ..
finding wxWidgets from pkg_config ..
finding wxWidgets from system ..
checking for the wxWidgets ... no
finding postgresql from xmake ..
checking for the xmake::postgresql ... no
finding postgresql from vcpkg ..
finding postgresql from conan ..
finding postgresql from pkg_config ..
finding postgresql from system ..
checking for the postgresql ... no
finding curl from xmake ..
checking for the xmake::curl ... no
finding curl from vcpkg ..
finding curl from conan ..
finding curl from pkg_config ..
finding curl from system ..
checking for the curl ... no
finding rapidjson from xmake ..
checking for the xmake::rapidjson ... no
finding rapidjson from vcpkg ..
finding rapidjson from conan ..
finding rapidjson from pkg_config ..
finding rapidjson from system ..
checking for the rapidjson ... no
finding xlsxio from xmake ..
checking for the xmake::xlsxio ... no
finding xlsxio from vcpkg ..
finding xlsxio from conan ..
finding xlsxio from pkg_config ..
finding xlsxio from system ..
checking for the xlsxio ... no
note: try installing these packages (pass -y to skip confirm)?
in xmake-repo:
  -> boost 1.73.0
please input: y (y/n)

pinging for the host(dl.bintray.com) ... 65535 ms
checking for the curl ... ok
curl -SL -A "Xmake/2.3.4+202006071445 (Windows;) curl/7.55.1" https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.bz2 -o boost-1.73.0.tar.bz2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0^C
  1. 找不到库对应cache目录
λ xmake require --info -vD boost
error: @programdir\core\main.lua:284: @programdir\core\sandbox\modules\import\core\base\task.lua:65: stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:799]: in function 'raise'
    [@programdir\core\project\project.lua:890]: in function 'targets'
    [@programdir\actions\config\main.lua:119]: in function '_check_target'
    [@programdir\actions\config\main.lua:267]:
    [C]: in function 'load'
    [@programdir\core\base\task.lua:520]: in function 'run'
    [@programdir\core\sandbox\modules\import\core\base\task.lua:63]: in function 'run'
    [@programdir\actions\require\main.lua:62]: in function '_load_project'
    [@programdir\actions\require\main.lua:72]:
    [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:788: 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>
  1. 怎么办?
@waruqi
Copy link
Member

waruqi commented Jun 18, 2020

下载慢问题没办法,你自己开个curl代理,或者手动下载好放到cache目录,要想完全解决只能走国内镜像,没米,所以凑活着自己下载放进去好了。

错误问题,我目前复现不了,这边ok,你可以尝试先删下 .xmake目录试试,不行就直接到 %localappdata%/.xmake/cache下一层层找下去,找到 b/boost目录

@waruqi
Copy link
Member

waruqi commented Jun 21, 2020

代理问题到:#854 跟进

toolchain分支,我改进了下,如果下载失败,会有提示用户,手动下载包到 当前项目指定的 build/boost-1.73.0.tar.bz2

下次重新执行xmake安装,会优先从 build 下 用户放入的本地包来直接解压安装,不用去找cache目录在哪。。

toolchain分支我做了许多其他的重构,明天我会merge到dev分支,所以想测试cache这个的话 直接从toolchain上下载安装

xmake update github:xmake-io/xmake#toolchain

或者等我merge到dev后在测试也行。

xmake require --info -vD boost

这个问题出错,你可以尝试 手动删下 当前项目的 .xmake 目录后,在执行下试试

@playgithub
Copy link
Author

playgithub commented Jun 21, 2020

toolchain分支,我改进了下,如果下载失败,会有提示用户,手动下载包到 当前项目指定的 build/boost-1.73.0.tar.bz2

这样太委屈xmake

这样怎么样?
add_requires("boost", {additional_search_path= {"folder_path_1", "folder_path_2"}})
cache目录作为默认search_path,如果每个search_path都找不到,cache目录也作为下载目录
build目录只保存build产生的文件

@waruqi
Copy link
Member

waruqi commented Jun 21, 2020

这种就算了,xmake.lua是要分发给其他用户用的,本地有这种需求,没必要放置到xmake.lua

@playgithub
Copy link
Author

playgithub commented Jun 21, 2020

是的,写到xmake.lua显得冗余,xmake f设置查找目录可以吗?

@waruqi
Copy link
Member

waruqi commented Jun 21, 2020

xmake f 已经配置项太多了 没必要没了这种小需求再去单独加配置项了 直接放build用用就行了

@playgithub
Copy link
Author

playgithub commented Jun 21, 2020

xmake g感觉合适

build只放build产生的文件,这样比较简单

@waruqi
Copy link
Member

waruqi commented Jun 22, 2020

原本就是临时的放置用于过掉安装,安装完 删了tar都可以。。这块就先这样吧,暂时我不想动了。

@waruqi waruqi closed this as completed Jun 22, 2020
@playgithub
Copy link
Author

通过xmake全局配置很合适啊,有空考虑一下吧。
比如换个系统什么的,xmake g --remtoe-pkg-search-path="folder_path_1;folder_path_2"一句就行了。
放build目录,build目录就复杂了,不符合UNIX的原则吧。

@waruqi
Copy link
Member

waruqi commented Jun 22, 2020

可以到 #861 这个上跟进

@waruqi
Copy link
Member

waruqi commented Jun 22, 2020

我已经支持上了,具体用法 见 #861

@playgithub
Copy link
Author

playgithub commented Jun 23, 2020

我订阅 #861

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