Harden launcher config parsing and release packaging
Validate Env identifiers and accept UTF-8 BOMs and last-value INI keys. Resolve the OptiScaler GPL license before builds and support both system license locations. Match the bridge's KFD selection by SIMD count.
This commit is contained in:
1 parent
c4954dc3c4
commit
6876288761
3 files changed
+11
-6
No files matched your search
@@ -42,10 +42,10 @@ def config_path(argv):
|
||||
|
||||
def main(argv):
|
||||
path = config_path(argv)
|
||||
ini = configparser.ConfigParser(inline_comment_prefixes=(";", "#"), interpolation=None)
|
||||
ini = configparser.ConfigParser(inline_comment_prefixes=(";", "#"), interpolation=None, strict=False)
|
||||
ini.optionxform = str # keep [Env] variable names as written
|
||||
if path.exists():
|
||||
ini.read(path)
|
||||
ini.read(path, encoding="utf-8-sig")
|
||||
|
||||
def get(section, key):
|
||||
value = ini.get(section, key, fallback="").strip()
|
||||
@@ -193,6 +193,8 @@ def main(argv):
|
||||
|
||||
if ini.has_section("Env"):
|
||||
for key, value in ini.items("Env"):
|
||||
if not (key.isascii() and key.isidentifier()):
|
||||
fail(f"[Env] key {key!r} must be an ASCII identifier")
|
||||
env[key] = value.strip()
|
||||
|
||||
final = {key: value for key, value in env.items() if key not in os.environ}
|
||||
|
||||
Reference in new issue
Block a user