Fix desktop tests for bugfix and stable (#395)

* fix build and lint problems

* fix coveralls workflow by setting a working toolchain
This commit is contained in:
kaczmarczyck
2021-11-01 13:14:01 +01:00
parent c847e7060a
commit e4d82087a8
7 changed files with 39 additions and 27 deletions

View File

@@ -302,7 +302,16 @@ class OpenSKInstaller:
def update_rustc_if_needed(self):
target_toolchain_fullstring = "stable"
with open("rust-toolchain", "r", encoding="utf-8") as f:
target_toolchain_fullstring = f.readline().strip()
content = f.readlines()
if len(content) == 1:
# Old format, only the build is stored
target_toolchain_fullstring = content[0].strip()
else:
# New format
for line in content:
if line.startswith("channel"):
channel = line.strip().split("=", maxsplit=1)[1].strip()
target_toolchain_fullstring = channel.strip('"')
target_toolchain = target_toolchain_fullstring.split("-", maxsplit=1)
if len(target_toolchain) == 1:
# If we target the stable version of rust, we won't have a date