-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
Provide a way to export only modified configs #5767
Comments
就是因为依赖联动很难搞,所以我一直没支持 config update,因为支持了,联动不了,反而会引入各种暗坑,导致用户各种报障,还很难复现和调试 |
Just because it is difficult to rely on linkage, I have never supported config update, because if it is supported, linkage cannot be done, but it will introduce various hidden pits, causing users to report various problems, and it is difficult to reproduce and debug. |
所以才需要学vscode的存modified的方式,vscode的模式还能支持合并多个设备不同的setting,也是很成熟的解决方案了;而且也不一定非要提供config update,提供一个modified config就行了 |
That’s why you need to learn the modified method of vscode. The vscode mode can also support merging different settings of multiple devices, which is also a very mature solution; and it is not necessary to provide a config update, just provide a modified config. |
不懂,如果三个 option 都存在依赖关系, 我仅仅修改存储 c 的状态 那 a 和 b 的状态怎么同步?我改完 c 直接 build 不就报错了么?
那不是还得用户手动分析关系后,手动再去改 a/b? 要是没去改呢 不也会出错么 |
I don’t understand, if all three options have a dependency relationship, I only modify the state of storage c How to synchronize the status of a and b? After I change c, won’t it report an error if I build directly?
Doesn’t the user have to manually analyze the relationship and then manually change a/b? If he didn’t change it, wouldn’t there be an error? |
如果是这样互相关联的情况,b c都应该设成 |
If this is the case, b and c should be set to |
不一定,联动有可能只是默认值联动,不是强制联动的。比如 如果 比如现在支持了增量更新。 首次用户配置, 这时候的 arch 到底应该是之前用户指定的 x86_64 还是iphoneos 默认的 arm64 呢? 目前的全量配置,也支持联动,但是仅仅只需要支持默认值联动,也就是 arch 会自动切到 arm64,其实反而是最合理的。 如果是增量更新,如果还是用之前用户指定的 x86_64 其实不对的,但是要支持联动,就不仅仅是默认值的联动关系了,这块实现上,目前的机制处理起来就更复杂了,目前不太好实现。但要是不处理,那么状态就不一致冲突了。各种配置多了,用户自己都记不清哪些 option 当前是哪些状态了,然后编译报错了,就各种提 issues 。 |
Not necessarily, the linkage may only be the default value linkage, not forced linkage. For example, If For example, incremental updates are now supported. First user configuration, Should the arch at this time be the x86_64 specified by the previous user or the default arm64 of iPhoneos? The current full configuration also supports linkage, but it only needs to support linkage with the default value, that is, arch will automatically switch to arm64, which is actually the most reasonable. If it is an incremental update, it is actually wrong to use the x86_64 specified by the previous user. However, to support linkage, it is not just the linkage relationship of the default value. In terms of implementation, the current mechanism is more complicated to handle. Currently Not easy to implement. But if it is not handled, the status will be inconsistent and conflicting. There are so many configurations that users can no longer remember which options are currently in which status. Then when compilation errors are reported, various issues are raised. |
可以不改默认行为,提供一个增量更新的接口或者导出更改过的options的接口就好了。上面的行为如果在增量更新里面等价于
出错误是应该的,这种情况就应该用全量更新清除之前设置。 (p.s. 实际上这种同时需要产出两种target的情况直接切config会覆盖之前的detect cache等,来回切换并不太方便,一般我会直接开两个子文件夹build_linux和build_ios然后分别在里面跑 |
You can leave the default behavior unchanged and provide an interface for incremental updates or an interface for exporting changed options. The above behavior in incremental updates is equivalent to
An error is expected. In this case, a full update should be used to clear the previous settings. (p.s. In fact, when two targets need to be generated at the same time, switching config directly will overwrite the previous detect cache, etc., and switching back and forth is not very convenient. Generally, I will directly open two sub-folders, build_linux and build_ios, and run them in them respectively. |
现在各种 cache 原本就是根据 plat/arch 独立存储的,为啥会冲突,我来回各种切,也没见啥问题
现在的问题就是,支持了增量更新,遇到这种错误的频率就变的更多了,有需要用户手动全量,然后对于大部分用户,并不了解这些机制和原理,就会各种趟坑后过来开 issues 问,很容易被劝退,而全量更新,至少目前 cmake/autoconf 目前也都是,至少行为上一致,熟悉这种方式。
为了个配置,额外再去加个 后面,增量可以考虑做,但前提是,需要先完全解决依赖联动的问题。就比如这里提到的 menuconf option 的状态联动。#4878 只有把这个问题彻底解了,那就没必要分 关于如何联动,目前我暂时没时间想好怎么弄,可能会考虑 option 里面加个 on_changed/on_updated 来实现用户修改状态的快速更新。 |
Now various caches are originally stored independently according to plat/arch. Why do they conflict? I have switched back and forth and there is no problem.
The problem now is that as incremental updates are supported, the frequency of encountering this kind of error becomes more frequent. Users are required to manually complete the update. However, most users do not understand these mechanisms and principles and will encounter various errors. It is easy to be persuaded to leave if you come to open issues after the pit, and full updates, at least for now, cmake/autoconf, at least the behavior is consistent, and you are familiar with this method.
For the sake of configuration, adding an additional Later, increments can be considered, but the premise is that the problem of dependence on linkage needs to be completely resolved first. For example, the status linkage of menuconf option mentioned here. #4878 Only if this problem is completely solved, there will be no need to separate As for how to link it, I don’t have time to figure out how to do it at the moment. I may consider adding on_changed/on_updated to the option to quickly update the user’s modified status. |
这个其实不准确,cmake/autoconf机制上是不支持更新的,要新的config就必须开新的文件夹,不然直接报错。所以微软才搞了个CMakePresets.json来实现增量更新,VS里Modified内容放到CMakePresets.json里,VS调用cmake的时候从CMakePresets.json生成设置。在同一个文件夹config多次的功能只有xmake才有,谈不上方式已经熟悉,其实我这边“理所当然”觉得多次config应该增量的新用户更多,只是来提issue问的比较少。
这个说法赞同,而且确实支持联动之后不再需要config-update了。目前可以不用官方提供config-update,只修改一下config --export的行为作为权益之计也足够了,需要增量更新的可以自己用modified export实现。上面微软搞得那套实际上也就是modified export。xmake-vscode插件里内部也可以用增量更新,目前vscode里点击build自动先运行xmake f --plat=windows --arch=x64,把之前设置的config都清除了,导致gui基本没法用,有增量更新的实现方式也可以参考VS支持CMake的方式,先把gui用起来 |
This is actually not accurate. The cmake/autoconf mechanism does not support updates. If you want a new config, you must open a new folder, otherwise an error will be reported directly. That's why Microsoft created a CMakePresets.json to implement incremental updates. The Modified content in VS is placed in CMakePresets.json. When VS calls cmake, it generates settings from CMakePresets.json. The function of configuring the same folder multiple times is only available in xmake. I am not familiar with the method. In fact, I "naturally" think that more new users should increment multiple configs, but there are relatively few people who come to ask questions. .
I agree with this statement, and it does support that config-update is no longer needed after linkage. At present, there is no need to officially provide config-update. Just modifying the behavior of config --export is enough as a benefit measure. If you need incremental updates, you can use modified export to implement it yourself. What Microsoft did above is actually modified export. Incremental updates can also be used internally in the xmake-vscode plug-in. Currently, clicking build in vscode automatically runs xmake f --plat=windows --arch=x64, which clears all the previously set configs, making the gui basically unusable. For implementation methods of incremental updates, you can also refer to the way VS supports CMake. First use the gui. |
你在什么场景下需要该功能?
#2401
有时需要在一个config模板上增加新的config,目前xmake中不提供config-update功能,只能通过
来实现。但这种做法存在一些问题,例如项目中存在a,b,c三个option,其中b的值依赖a而变动。(例如a=off时b设为on)这时运行
就会出现问题,template.txt中b为off,最后的效果相当于
xmake f --a=off --b=off
,产生conflict。#2401 中提到的config-update插件似乎也不能处理这种情况。描述可能的解决方案
类似VSCode的做法,只记录modified configs,而非记录全部configs:
template.txt
对非手动设置的默认config留给项目自己决定,不记录/导出。这样就避免了之前提到的conflict。
可以先提供
xmake f --export-modified
选项并保留之前的做法,3.0投票确认是否要更改为默认行为描述你认为的候选方案
用 export-modified 和 import 实现一个官方的 config-update ,原有export行为保留;config-update运行的时候输出一行实际的config命令
这样可以很清晰地看到是否有config conflict,和直接输入
xmake config --c=on --a=off
是一样的。其他信息
Related issues/comments:
A way to change config without having to respecify all config, maybe separate some configs such as mode from other configs. It's quite painful to work with a lot of config because of that.
Originally posted by @SirLynix in #5527 (comment)
#5041
#2401
#823
The text was updated successfully, but these errors were encountered: