Skip to content

Commit 429488a

Browse files
committed
upd min required clang version
1 parent 54bf61a commit 429488a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

mytonctrl/mytonctrl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
from mytoninstaller.utils import get_ton_storage_port
5151

5252

53+
CLANG_VERSION_REQUIRED = 21
54+
55+
5356
def Init(local, ton, console, argv):
5457
# Load translate table
5558
with get_package_resource_path('mytonctrl', 'resources/translate.json') as translate_path:
@@ -370,8 +373,8 @@ def Upgrade(local, ton, args: list):
370373
ton.SetSettings("validatorConsole", validatorConsole)
371374

372375
clang_version = get_clang_major_version()
373-
if clang_version is None or clang_version < 16:
374-
text = f"{{red}}WARNING: THIS UPGRADE WILL MOST PROBABLY FAIL DUE TO A WRONG CLANG VERSION: {clang_version}, REQUIRED VERSION IS 16. RECOMMENDED TO EXIT NOW AND UPGRADE CLANG AS PER INSTRUCTIONS: https://gist.github.com/neodix42/e4b1b68d2d5dd3dec75b5221657f05d7{{endc}}\n"
376+
if clang_version is None or clang_version < CLANG_VERSION_REQUIRED:
377+
text = f"{{red}}WARNING: THIS UPGRADE WILL MOST PROBABLY FAIL DUE TO A WRONG CLANG VERSION: {clang_version}, REQUIRED VERSION IS {CLANG_VERSION_REQUIRED}. RECOMMENDED TO EXIT NOW AND UPGRADE CLANG AS PER INSTRUCTIONS: https://gist.github.com/neodix42/24d6a401e928f7e895fcc8e7b7c5c24a{{endc}}\n"
375378
color_print(text)
376379
if input("Continue with upgrade anyway? [Y/n]\n").strip().lower() not in ('y', ''):
377380
print('aborted.')

tests/integration/test_basic_commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def fake_run_as_root(run_args):
7272
return 0
7373

7474
monkeypatch.setattr(mytonctrl_module, "run_as_root", fake_run_as_root)
75-
monkeypatch.setattr(mytonctrl_module, "get_clang_major_version", lambda: 16)
75+
monkeypatch.setattr(mytonctrl_module, "get_clang_major_version", lambda: 21)
7676
monkeypatch.setattr(MyTonCore, "using_validator", lambda self: False)
7777
with get_package_resource_path('mytonctrl', 'scripts/upgrade.sh') as upg_path:
7878
assert upg_path.is_file()
@@ -98,15 +98,15 @@ def fake_SetSettings(self, name, value):
9898
assert captured_settings["liteClient"]["liteServer"]["pubkeyPath"] == "/var/ton-work/keys/liteserver.pub"
9999
assert calls["run_args"] == ["bash", upg_path, "-a", "author", "-r", "repo", "-b", "branch"]
100100

101-
# clang version is < 16, abort
101+
# clang version is < 21, abort
102102
calls = {}
103103
monkeypatch.setattr(mytonctrl_module, "get_clang_major_version", lambda: 14)
104104
monkeypatch.setattr('builtins.input', lambda _: "n")
105105
output = cli.execute("upgrade")
106106
assert "aborted." in output
107107
assert not calls
108108

109-
# clang version is < 16, proceed
109+
# clang version is < 21, proceed
110110
monkeypatch.setattr(mytonctrl_module, "get_clang_major_version", lambda: 14)
111111
monkeypatch.setattr('builtins.input', lambda _: "y")
112112
output = cli.execute("upgrade")
@@ -115,7 +115,7 @@ def fake_SetSettings(self, name, value):
115115
assert calls["run_args"] == ["bash", upg_path, "-a", "author", "-r", "repo", "-b", "branch"]
116116

117117
# call upgrade_btc_teleport if using validator
118-
monkeypatch.setattr(mytonctrl_module, "get_clang_major_version", lambda: 16)
118+
monkeypatch.setattr(mytonctrl_module, "get_clang_major_version", lambda: 21)
119119
calls = {}
120120
monkeypatch.setattr(MyTonCore, "using_validator", lambda self: True)
121121
teleport_calls = {}

0 commit comments

Comments
 (0)