diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-06-16 18:16:18 +0200 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-06-16 18:16:18 +0200 |
| commit | bb52acc8b7ad073068c9a2dc656d4fecf935d710 (patch) | |
| tree | 4410ec49a91d41a137d998cb78df00a7a893800d /salis.py | |
| parent | 279ad369ddf6f493c525b52237eb20560c7d55ae (diff) | |
Adds final tweaks to data client/server
Diffstat (limited to 'salis.py')
| -rwxr-xr-x | salis.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -61,6 +61,7 @@ options = { (("C", "clones"), (new,), fmt_id): {"metavar": "N", "help": "number of ancestor clones on each core", "default": 1, "required": False, "type": nat}, (("c", "cores"), (new,), fmt_id): {"metavar": "N", "help": "number of simulator cores", "default": 2, "required": False, "type": nat}, (("d", "data-push-pow"), (new,), fmt_id): {"metavar": "POW", "help": "data aggregation interval exponent; interval = 2^{POW} >= {sync-pow}", "default": 28, "required": False, "type": nat}, + (("F", "font"), (client,), fmt_id): {"metavar": "FILE", "help": "font face to use", "default": "/usr/share/fonts/droid/DroidSansMono.ttf", "required": False}, (("f", "force"), (new,), fmt_id): {"action": "store_true", "help": "overwrite existing simulation of given name", "required": False}, (("F", "muta-flip"), (new,), fmt_id): {"action": "store_true", "help": "cosmic rays flip bits instead of randomizing whole bytes", "required": False}, (("g", "c-compiler"), (new, load, server, client), fmt_id): {"metavar": "CC", "help": "C compiler to use", "default": "gcc", "required": False, "type": str}, @@ -256,6 +257,10 @@ if args.command == "server": # Data client if args.command == "client": + # Check provided font file exists + if not os.path.isfile(args.font): + raise RuntimeError(f"Font file {args.font} does not exist; please provide a valid font") + # Pull basic information from the server # Required to build the client with correct flags args.name = request_from_server({"request": "name"})["name"] @@ -273,7 +278,7 @@ if args.command == "client": client_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("utf-8").strip() if server_hash != client_hash: - raise RuntimeError(f"Server hash '{server_hash}' and client hash '{client_hash}' don't match") + raise RuntimeError(f"Server hash '{server_hash}' and client hash '{client_hash}' do not match") log.info(f"Confirmed server and client are running against the same git hash: {server_hash}") @@ -417,6 +422,7 @@ if args.command == "client": if not args.no_vsync: ns.b.defines.add("-DVSYNC") + ns.b.defines.add(f"-DFONT_SOURCE=\"{args.font}\"") ns.b.defines.add(f"-DIP=\"{args.ip}\"") ns.b.links.add("-lGL") ns.b.links.add("-lglfw") |
