チケット #44181

Forbid singlepole setting requirements unless alltemperate is disabled

登録: 2022-03-25 22:54 最終更新: 2022-03-29 20:00

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
4

詳細

It is currently possible to have singlepole requirements without also checking that alltemperate is disabled. This is nonsensical, since when alltemperate is in fact enabled, singlepole should not make any difference.

I can see a number of ways to deal with this:

  • Mark singlepole requirements deprecated unless (a) there is also a negated alltemperate requirement or (b) alltemperate is locked FALSE by the ruleset
  • As above, but make it a hard ruleset loading failure
  • Mark all singlepole requirements deprecated
  • As above, but make it a hard ruleset loading failure

To make #44038 easier / possible at all, this needs to be resolved in S3_1.

チケットの履歴 (17 件中 3 件表示)

2022-03-25 22:54 更新者: alienvalkyrie
  • 新しいチケット "Forbid singlepole setting requirements unless alltemperate is disabled" が作成されました
2022-03-25 23:09 更新者: cazfi
コメント

Reply To alienvalkyrie

It is currently possible to have singlepole requirements without also checking that alltemperate is disabled. This is nonsensical, since when alltemperate is in fact enabled, singlepole should not make any difference. I can see a number of ways to deal with this: * Mark singlepole requirements deprecated unless (a) there is also a negated alltemperate requirement or (b) alltemperate is locked FALSE by the ruleset

I think we can simplify this be leaving (b) out, i.e., to require explicit !present alltemperate requirement even when the setting is locked to FALSE.

* As above, but make it a hard ruleset loading failure

We should do that for master (always), and for S3_1 outside compat mode. S3_1 compat mode, loading S3_0 ruleset, should make sensible conversion, and if we can't guarantee that the conversion is always correct, use compat->log_cb() to inform the user about the situation / instruct manual update.
2022-03-26 23:51 更新者: alienvalkyrie
コメント

Quickie note on disjunctive requirement lists (which is only building obsoletion requirements, afaict): singlepole requirements for those are only valid iff (a) there is a present alltemperate requirement, or (b) alltemperate is locked FALSE by the ruleset. Since in the latter case, a present alltemperate requirement would always be inactive, i.e. have no effect on disjunctive requirement lists, we can drop (b) here as well and demand (a) without loss of generality.

(Granted, having a building that is always obsolete given certain server settings is unlikely to be a thing anyway, but y'know, let's keep it general here.)

2022-03-27 02:50 更新者: alienvalkyrie
  • 担当者(未割り当て) から alienvalkyrie に更新されました
  • コンポーネントGeneral から Server に更新されました
コメント

Master patch is attached; S3_1 patch still to go.

Should we also do something for S3_0, e.g. mark those cases as deprecated, starting with 3.0.1? Get warning messages out to ruleset authors ASAP?

2022-03-27 03:04 更新者: alienvalkyrie
コメント

Reply To cazfi

S3_1 compat mode, loading S3_0 ruleset, should make sensible conversion

Since this is rscompat stuff for requirement vectors (which appear in multiple ruleset files), we might have to backport #43708 to S3_1. Alternatively, we could use the same solution/workaround as hrm #695469 originally used, i.e.

check all relevant versions and only apply when all of them are old

2022-03-27 03:12 更新者: cazfi
コメント

Reply To alienvalkyrie

Should we also do something for S3_0, e.g. mark those cases as deprecated

Yeah, deprecation warning would be the right thing to do, even if it seems that we still have work to do in educating ruleset authors to enable those warnings.

2022-03-27 03:14 更新者: cazfi
コメント

Reply To alienvalkyrie

we might have to backport #43708 to S3_1

I'm not against.

2022-03-27 05:59 更新者: alienvalkyrie
コメント

Reply To cazfi

Reply To alienvalkyrie

we might have to backport #43708 to S3_1

I'm not against.

Done #44203

2022-03-27 07:55 更新者: alienvalkyrie
コメント

Reply To cazfi

Reply To alienvalkyrie

Should we also do something for S3_0, e.g. mark those cases as deprecated

Yeah, deprecation warning would be the right thing to do, even if it seems that we still have work to do in educating ruleset authors to enable those warnings.

~> S3_0 patch attached

(I'm not retargetting this ticket to 3.0.1 or 3.0.2, since I feel it's more important that this is blocking S3_1 d3f)

2022-03-27 20:46 更新者: alienvalkyrie
コメント

S3_1 patch done. I'm not sure I'm happy with it – there is currently no place in the code with access to both rscompat info and whether a given requirement vector is conjunctive (both of which are relevant to this change). One option would've been to pass a bool conjunctive to lookup_req_list(), but that would've added a lot of small changes all over the place ~> higher chance for conflict with other current patches, and future S3_1 patches are less likely to also work for other branches. Given that this is all about (a) an unlikely edge case and (b) something where affected ruleset authors will have to check the result anyway, I used a heuristic instead – if the secfile key is "obsolete_by", we're disjunctive; otherwise, we're probably conjunctive. This matches current rscompat and ruleset load code.

If this heuristic ever fails (in a place where there is a singlepole requirement), it will make rscompat introduce an erroneous requirement and lead to ruleset load failure, which isn't great. The more advanced alternative would be to trust that any existing alltemperate requirement is the one we need (maybe print a warning if we think it should be flipped) and not change anything in those cases.

2022-03-27 20:56 更新者: cazfi
コメント

Well, luckily this code is only needed in 3.0 -> 3.1 conversion, and not in "future" where format might be different. We do know that in the 3.0 format buildings "obsolete_by" is the only disjunctive list.

2022-03-27 22:51 更新者: alienvalkyrie
  • 解決法なし から 受領 に更新されました
コメント

Did a bit of testing and everything seems to work swimmingly. The only issue was when there's already the wrong alltemperate requirement (i.e. something changes based on singlepole specifically when alltemperate is enabled), in which case the requirement added by rscompat causes a contradiction.

Since this is already a nonsensical situation, I don't think it's worth trying to figure out which way to solve it (flipping the alltemperate requirement or dropping the singlepole requirement) ~> explicitly tell the user to fix it manually.

2022-03-29 20:00 更新者: alienvalkyrie
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする