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

package select different url will in different versions. #5962

Open
TabNahida opened this issue Dec 13, 2024 · 15 comments
Open

package select different url will in different versions. #5962

TabNahida opened this issue Dec 13, 2024 · 15 comments

Comments

@TabNahida
Copy link

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

boost
ispc
These two packages have shown that we need a url selector to select url in different package versions and different package configs.
In ispc, I use on_load script to implement this. It will first try to download the normal version. Yet it will fail and then try download from the oneapi config version.
For boost, there are two lines of comments mentioned the same problem.

--xrepo does not support `package:config("cmake")` in on_source to set the download url, so if you want to build with cmake, we need to `add_urls` cmake archive url at first line.
-- Users can also download the cmake archive and put it in `xmake g --pkg_searchdirs=` to avoid xrepo using a non-cmake archive url.

Describe the solution you'd like

Maybe like this

add_urls("https://github.com/boostorg/boost/releases/download/boost-$(version)/boost-$(version)-cmake.tar.gz", {alias = "cmake"})
add_versions("cmake:1.86.0", "c62ce6e64d34414864fef946363db91cea89c1b90360eabed0515f0eda74c75c")

Describe alternatives you've considered

No response

Additional context

No response

@waruqi
Copy link
Member

waruqi commented Dec 13, 2024

add_urls("https://github.com/boostorg/boost/releases/download/boost-$(version)/boost-$(version)-cmake.tar.gz", {alias = "cmake"})
add_versions("cmake:1.86.0", "c62ce6e64d34414864fef946363db91cea89c1b90360eabed0515f0eda74c75c")

不知道你要说啥,这不是原本就支持的么

@Issues-translate-bot
Copy link

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


add_urls("https://github.com/boostorg/boost/releases/download/boost-$(version)/boost-$(version)-cmake.tar.gz", {alias = "cmake"})
add_versions("cmake:1.86.0", "c62ce6e64d34414864fef946363db91cea89c1b90360eabed0515f0eda74c75c")

I don’t know what you want to say. Isn’t this what I originally supported?

@TabNahida
Copy link
Author

add_urls("https://github.com/boostorg/boost/releases/download/boost-$(version)/boost-$(version)-cmake.tar.gz", {alias = "cmake"})
add_versions("cmake:1.86.0", "c62ce6e64d34414864fef946363db91cea89c1b90360eabed0515f0eda74c75c")

不知道你要说啥,这不是原本就支持的么

我的意思是可以根据config来选择url,现在这个只是设置镜像,但是不能在config里选择。这个实现我随便填的,我觉得如果真的要实现可以下面这样

add_configs("oneapi", {description = "Use the OneAPI version on Linux", default = false, type = "boolean", urls="https://github.com/ispc/ispc/releases/download/v$(version)/ispc-v$(version)-linux-oneapi.tar.gz"})

我对实现确实没有很多想法,主要就是缺一个根据config选择url的功能。

@waruqi
Copy link
Member

waruqi commented Dec 13, 2024

这个不太好支持,configs 初始化比较滞后,这个时候 url 已经没法再改了。

@Issues-translate-bot
Copy link

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


This is not easy to support. The initialization of configs is lagging behind. At this time, the url cannot be changed.

@TabNahida
Copy link
Author

这个不太好支持,configs 初始化比较滞后,这个时候 url 已经没法再改了。

可不可以在脚本里把某个已经添加的url给删除呢。我那个ispc的实现好像是可以正常安装的

@Issues-translate-bot
Copy link

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


This is not easy to support. The configs initialization is lagging behind. At this time, the url cannot be changed.

Is it possible to delete a certain URL that has been added in the script? My implementation of ispc seems to be able to be installed normally.

@waruqi
Copy link
Member

waruqi commented Dec 13, 2024

这个不太好支持,configs 初始化比较滞后,这个时候 url 已经没法再改了。

可不可以在脚本里把某个已经添加的url给删除呢。我那个ispc的实现好像是可以正常安装的

不太好弄,尽管你看上去没问题,那也仅仅只是一些特定包的表象,内部很多状态已经不一致了。遇到其他一些包,就可能会出各种问题。

前面对版本的选择,各种初始化,都已经读取早期的 urls 做了处理(比如决定是否走 git url 还是 tar url,版本选择都是不同的),后面突然改了 urls ,前面这些状态都会不一致。

@Issues-translate-bot
Copy link

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


This is not easy to support. The configs initialization is lagging behind. At this time, the url cannot be changed.

Can I delete a certain URL that has been added in the script? My implementation of ispc seems to be able to be installed normally.

It's not easy to do. Even if you seem to have no problem, it's just the appearance of some specific packages, and many internal states are already inconsistent. When encountering some other packages, various problems may occur.

@SirLynix
Copy link
Member

wouldn't it be possible to use on_download in that specific case?

@waruqi
Copy link
Member

waruqi commented Dec 13, 2024

on_download can be used

@TabNahida
Copy link
Author

这个不太好支持,configs 初始化比较滞后,这个时候 url 已经没法再改了。

可不可以在脚本里把某个已经添加的url给删除呢。我那个ispc的实现好像是可以正常安装的

不太好弄,尽管你看上去没问题,那也仅仅只是一些特定包的表象,内部很多状态已经不一致了。遇到其他一些包,就可能会出各种问题。

前面对版本的选择,各种初始化,都已经读取早期的 urls 做了处理(比如决定是否走 git url 还是 tar url,版本选择都是不同的),后面突然改了 urls ,前面这些状态都会不一致。

我现在这个感觉只要不是不同config的下载文件的sha256值就不会有问题应该

@Issues-translate-bot
Copy link

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


This is not easy to support. The configs initialization is lagging behind. At this time, the url cannot be changed.

Can I delete a certain URL that has been added in the script? My implementation of ispc seems to be able to be installed normally.

It’s not easy to do. Even if you seem to have no problem, it’s just the appearance of some specific packages, and many internal states are already inconsistent. When encountering some other packages, various problems may occur.

In the previous version selection and various initializations, the early urls have been read and processed (for example, deciding whether to use git url or tar url, the version selection is different), but then the urls were suddenly changed, and the previous states were All will be inconsistent.

I now feel that as long as the sha256 value of the downloaded file is not different config, there should be no problem.

@waruqi
Copy link
Member

waruqi commented Dec 14, 2024

这个不太好支持,configs 初始化比较滞后,这个时候 url 已经没法再改了。

可不可以在脚本里把某个已经添加的url给删除呢。我那个ispc的实现好像是可以正常安装的

不太好弄,尽管你看上去没问题,那也仅仅只是一些特定包的表象,内部很多状态已经不一致了。遇到其他一些包,就可能会出各种问题。
前面对版本的选择,各种初始化,都已经读取早期的 urls 做了处理(比如决定是否走 git url 还是 tar url,版本选择都是不同的),后面突然改了 urls ,前面这些状态都会不一致。

我现在这个感觉只要不是不同config的下载文件的sha256值就不会有问题应该

但内部不可能只为了一个特定包没问题 去放开这种支持,而且里面还有很多其他处理了

@Issues-translate-bot
Copy link

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


This is not easy to support. The configs initialization is lagging behind. At this time, the url cannot be changed.

Can I delete a certain URL that has been added in the script? My implementation of ispc seems to be able to be installed normally.

It's not easy to do. Even though you seem to have no problem, it's just the appearance of some specific packages, and many internal states are already inconsistent. When encountering some other packages, various problems may occur.
In the previous version selection and various initializations, the early urls have been read and processed (for example, when deciding whether to use git url or tar url, the version selection is different). Later, the urls were suddenly changed, and the previous URLs were changed. The status will be inconsistent.

I feel now that as long as the sha256 value of the downloaded file is not different config, there should be no problem.

But internally it is impossible to release this kind of support just for a specific package, and there are many other processes in it.

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

No branches or pull requests

4 participants