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

target:add_configfiles 需要一个重新生成的缓存策略 #4747

Closed
zheming-lyu opened this issue Feb 19, 2024 · 5 comments
Closed

target:add_configfiles 需要一个重新生成的缓存策略 #4747

zheming-lyu opened this issue Feb 19, 2024 · 5 comments

Comments

@zheming-lyu
Copy link

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

使用 add_configfiles 功能

例如有 config.h.in 文件,内有使用 ${GIT_BRANCH} ${GIT_COMMIT} 等内置变量,构建时可以正常替换为 config.h

在经历 git 提交后,branch和 commit 发生了改变,但是直接执行 xmake build 命令,并没有重新生成 config.h

描述可能的解决方案

期望在每次 git version branch commit 改变后,能够自动检测到,并触发 configfiles 的自动重新生成

描述你认为的候选方案

提供类似 set_policy("build.ccache", false) 的接口
例如:
add_configfiles("config.h.in", {cache = false})

其他信息

No response

@Issues-translate-bot
Copy link

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


Title: target:add_configfiles requires a regenerated cache policy

In what scenario do you need this feature?

Using the add_configfiles function

For example, there is a config.h.in file, which contains built-in variables such as ${GIT_BRANCH} ${GIT_COMMIT}. It can be replaced with config.h normally during construction.

After git submission, branch and commit have changed, but the xmake build command is executed directly and config.h is not regenerated.

Describe possible solutions

It is expected that every time git version branch commit changes, it can be automatically detected and trigger the automatic regeneration of configfiles.

Describe your alternatives

Provide an interface similar to set_policy("build.ccache", false)
For example:
add_configfiles("config.h.in", {cache = false})

other information

No response

@waruqi
Copy link
Member

waruqi commented Feb 19, 2024

试下 build.always_update_configfiles policy, xmake update -s dev

@waruqi waruqi added this to the v2.8.7 milestone Feb 19, 2024
@waruqi waruqi closed this as completed Feb 20, 2024
@zheming-lyu
Copy link
Author

感谢提示!

另外,我注意到目前文档中 https://xmake.io/#/guide/build_policies
If you want to get a list and description of all the policy configurations supported by the current xmake, you can execute the following command:
这一段是执行结果,并不是command

@waruqi
Copy link
Member

waruqi commented Feb 20, 2024

更新了

@Issues-translate-bot
Copy link

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


updated

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

3 participants