diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b6424ef67731..abd310c9f7d62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,8 @@ env: BYOND_MAJOR: "514" BYOND_MINOR: "1589" SPACEMAN_DMM_VERSION: suite-1.7.3 + RUST_G_REPO: "ss220-space/rust-g-tg" + RUST_G_VERSION: "2.0.0-ss220" jobs: PreFlight: @@ -94,6 +96,16 @@ jobs: with: path: ~/BYOND-${{ env.BYOND_MAJOR }}.${{ env.BYOND_MINOR }} key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} + - name: Install rust_g dependencies + run: ./scripts/install-rust_g-dependencies.sh + - name: Setup rust_g cache + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + with: + path: ~/.byond/bin/librust_g.so + key: "rust_g-${{ env.RUST_G_REPO }}-${{ env.RUST_G_VERSION }}" + - name: Install rust_g + if: steps.Setup-rust_g-cache.outputs.cache-hit != 'true' + run: ./scripts/install-rust_g.sh - name: Run Tests env: TEST: MAP @@ -123,6 +135,16 @@ jobs: with: path: ~/BYOND-${{ env.BYOND_MAJOR }}.${{ env.BYOND_MINOR }} key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} + - name: Install rust_g dependencies + run: ./scripts/install-rust_g-dependencies.sh + - name: Setup rust_g cache + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + with: + path: ~/.byond/bin/librust_g.so + key: "rust_g-${{ env.RUST_G_REPO }}-${{ env.RUST_G_VERSION }}" + - name: Install rust_g + if: steps.Setup-rust_g-cache.outputs.cache-hit != 'true' + run: ./scripts/install-rust_g.sh - name: Run Tests env: TEST: MAP @@ -152,6 +174,16 @@ jobs: with: path: ~/BYOND-${{ env.BYOND_MAJOR }}.${{ env.BYOND_MINOR }} key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} + - name: Install rust_g dependencies + run: ./scripts/install-rust_g-dependencies.sh + - name: Setup rust_g cache + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + with: + path: ~/.byond/bin/librust_g.so + key: "rust_g-${{ env.RUST_G_REPO }}-${{ env.RUST_G_VERSION }}" + - name: Install rust_g + if: steps.Setup-rust_g-cache.outputs.cache-hit != 'true' + run: ./scripts/install-rust_g.sh - name: Run Tests env: TEST: MAP diff --git a/baystation12.dme b/baystation12.dme index 55312e287ec75..6e6fe3af63739 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -88,6 +88,7 @@ #include "code\__defines\xenoarcheaology.dm" #include "code\__defines\ZAS.dm" #include "code\__defines\zmimic.dm" +#include "code\__defines\~mods\rust_g.dm" #include "code\__defines\~mods\expanded_culture_descriptor.dm" #include "code\__defines\~mods\~master_defines.dm" #include "code\_global_vars\edible.dm" diff --git a/code/__defines/~mods/rust_g.dm b/code/__defines/~mods/rust_g.dm new file mode 100644 index 0000000000000..595590143dbd0 --- /dev/null +++ b/code/__defines/~mods/rust_g.dm @@ -0,0 +1,195 @@ +// rust_g.dm - DM API for rust_g extension library +// +// To configure, create a `rust_g.config.dm` and set what you care about from +// the following options: +// +// #define RUST_G "path/to/rust_g" +// Override the .dll/.so detection logic with a fixed path or with detection +// logic of your own. + +// Enable replacement rust-g functions for certain builtins. Off by default. +#define RUSTG_OVERRIDE_BUILTINS + +#ifndef RUST_G +// Default automatic RUST_G detection. +// On Windows, looks in the standard places for `rust_g.dll`. +// On Linux, looks in `.`, `$LD_LIBRARY_PATH`, and `~/.byond/bin` for either of +// `librust_g.so` (preferred) or `rust_g` (old). + +/* This comment bypasses grep checks */ /var/__rust_g + +/proc/__detect_rust_g() + if (world.system_type == UNIX) + if (fexists("./librust_g.so")) + // No need for LD_LIBRARY_PATH badness. + return __rust_g = "./librust_g.so" + else if (fexists("./rust_g")) + // Old dumb filename. + return __rust_g = "./rust_g" + else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/rust_g")) + // Old dumb filename in `~/.byond/bin`. + return __rust_g = "rust_g" + else + // It's not in the current directory, so try others + return __rust_g = "librust_g.so" + else + return __rust_g = "rust_g" + +#define RUST_G (__rust_g || __detect_rust_g()) +#endif + +// Handle 515 call() -> call_ext() changes +#if DM_VERSION >= 515 +#define RUSTG_CALL call_ext +#else +#define RUSTG_CALL call +#endif + + +/** + * Sets up the Aho-Corasick automaton with its default options. + * + * The search patterns list and the replacements must be of the same length when replace is run, but an empty replacements list is allowed if replacements are supplied with the replace call + * Arguments: + * * key - The key for the automaton, to be used with subsequent rustg_acreplace/rustg_acreplace_with_replacements calls + * * patterns - A non-associative list of strings to search for + * * replacements - Default replacements for this automaton, used with rustg_acreplace + */ +#define rustg_setup_acreplace(key, patterns, replacements) RUSTG_CALL(RUST_G, "setup_acreplace")(key, json_encode(patterns), json_encode(replacements)) + +/** + * Sets up the Aho-Corasick automaton using supplied options. + * + * The search patterns list and the replacements must be of the same length when replace is run, but an empty replacements list is allowed if replacements are supplied with the replace call + * Arguments: + * * key - The key for the automaton, to be used with subsequent rustg_acreplace/rustg_acreplace_with_replacements calls + * * options - An associative list like list("anchored" = 0, "ascii_case_insensitive" = 0, "match_kind" = "Standard"). The values shown on the example are the defaults, and default values may be omitted. See the identically named methods at https://docs.rs/aho-corasick/latest/aho_corasick/struct.AhoCorasickBuilder.html to see what the options do. + * * patterns - A non-associative list of strings to search for + * * replacements - Default replacements for this automaton, used with rustg_acreplace + */ +#define rustg_setup_acreplace_with_options(key, options, patterns, replacements) RUSTG_CALL(RUST_G, "setup_acreplace")(key, json_encode(options), json_encode(patterns), json_encode(replacements)) + +/** + * Run the specified replacement engine with the provided haystack text to replace, returning replaced text. + * + * Arguments: + * * key - The key for the automaton + * * text - Text to run replacements on + */ +#define rustg_acreplace(key, text) RUSTG_CALL(RUST_G, "acreplace")(key, text) + +/** + * Run the specified replacement engine with the provided haystack text to replace, returning replaced text. + * + * Arguments: + * * key - The key for the automaton + * * text - Text to run replacements on + * * replacements - Replacements for this call. Must be the same length as the set-up patterns + */ +#define rustg_acreplace_with_replacements(key, text, replacements) RUSTG_CALL(RUST_G, "acreplace_with_replacements")(key, text, json_encode(replacements)) + +/** + * This proc generates a cellular automata noise grid which can be used in procedural generation methods. + * + * Returns a single string that goes row by row, with values of 1 representing an alive cell, and a value of 0 representing a dead cell. + * + * Arguments: + * * percentage: The chance of a turf starting closed + * * smoothing_iterations: The amount of iterations the cellular automata simulates before returning the results + * * birth_limit: If the number of neighboring cells is higher than this amount, a cell is born + * * death_limit: If the number of neighboring cells is lower than this amount, a cell dies + * * width: The width of the grid. + * * height: The height of the grid. + */ +#define rustg_cnoise_generate(percentage, smoothing_iterations, birth_limit, death_limit, width, height) \ + RUSTG_CALL(RUST_G, "cnoise_generate")(percentage, smoothing_iterations, birth_limit, death_limit, width, height) + +#define rustg_dmi_strip_metadata(fname) RUSTG_CALL(RUST_G, "dmi_strip_metadata")(fname) +#define rustg_dmi_create_png(path, width, height, data) RUSTG_CALL(RUST_G, "dmi_create_png")(path, width, height, data) +#define rustg_dmi_resize_png(path, width, height, resizetype) RUSTG_CALL(RUST_G, "dmi_resize_png")(path, width, height, resizetype) +/** + * input: must be a path, not an /icon; you have to do your own handling if it is one, as icon objects can't be directly passed to rustg. + * + * output: json_encode'd list. json_decode to get a flat list with icon states in the order they're in inside the .dmi + */ +#define rustg_dmi_icon_states(fname) RUSTG_CALL(RUST_G, "dmi_icon_states")(fname) + +#define rustg_file_read(fname) RUSTG_CALL(RUST_G, "file_read")(fname) +#define rustg_file_exists(fname) RUSTG_CALL(RUST_G, "file_exists")(fname) +#define rustg_file_write(text, fname) RUSTG_CALL(RUST_G, "file_write")(text, fname) +#define rustg_file_append(text, fname) RUSTG_CALL(RUST_G, "file_append")(text, fname) +#define rustg_file_get_line_count(fname) text2num(RUSTG_CALL(RUST_G, "file_get_line_count")(fname)) +#define rustg_file_seek_line(fname, line) RUSTG_CALL(RUST_G, "file_seek_line")(fname, "[line]") + +#ifdef RUSTG_OVERRIDE_BUILTINS + #define file2text(fname) rustg_file_read("[fname]") + #define text2file(text, fname) rustg_file_append(text, "[fname]") +#endif + +#define rustg_git_revparse(rev) RUSTG_CALL(RUST_G, "rg_git_revparse")(rev) +#define rustg_git_commit_date(rev) RUSTG_CALL(RUST_G, "rg_git_commit_date")(rev) + +#define RUSTG_HTTP_METHOD_GET "get" +#define RUSTG_HTTP_METHOD_PUT "put" +#define RUSTG_HTTP_METHOD_DELETE "delete" +#define RUSTG_HTTP_METHOD_PATCH "patch" +#define RUSTG_HTTP_METHOD_HEAD "head" +#define RUSTG_HTTP_METHOD_POST "post" +#define rustg_http_request_blocking(method, url, body, headers, options) RUSTG_CALL(RUST_G, "http_request_blocking")(method, url, body, headers, options) +#define rustg_http_request_async(method, url, body, headers, options) RUSTG_CALL(RUST_G, "http_request_async")(method, url, body, headers, options) +#define rustg_http_check_request(req_id) RUSTG_CALL(RUST_G, "http_check_request")(req_id) + +#define RUSTG_JOB_NO_RESULTS_YET "NO RESULTS YET" +#define RUSTG_JOB_NO_SUCH_JOB "NO SUCH JOB" +#define RUSTG_JOB_ERROR "JOB PANICKED" + +#define rustg_json_is_valid(text) (RUSTG_CALL(RUST_G, "json_is_valid")(text) == "true") + +#define rustg_log_write(fname, text, format) RUSTG_CALL(RUST_G, "log_write")(fname, text, format) +/proc/rustg_log_close_all() return RUSTG_CALL(RUST_G, "log_close_all")() + +#define rustg_log_write_formatted(log, text) rustg_log_write(log, text, "true") +#define rustg_log_write_no_format(log, text) rustg_log_write(log, text, "false") + +#define rustg_noise_get_at_coordinates(seed, x, y) RUSTG_CALL(RUST_G, "noise_get_at_coordinates")(seed, x, y) + +#define rustg_sql_connect_pool(options) RUSTG_CALL(RUST_G, "sql_connect_pool")(options) +#define rustg_sql_query_async(handle, query, params) RUSTG_CALL(RUST_G, "sql_query_async")(handle, query, params) +#define rustg_sql_query_blocking(handle, query, params) RUSTG_CALL(RUST_G, "sql_query_blocking")(handle, query, params) +#define rustg_sql_connected(handle) RUSTG_CALL(RUST_G, "sql_connected")(handle) +#define rustg_sql_disconnect_pool(handle) RUSTG_CALL(RUST_G, "sql_disconnect_pool")(handle) +#define rustg_sql_check_query(job_id) RUSTG_CALL(RUST_G, "sql_check_query")("[job_id]") + +#define rustg_time_microseconds(id) text2num(RUSTG_CALL(RUST_G, "time_microseconds")(id)) +#define rustg_time_milliseconds(id) text2num(RUSTG_CALL(RUST_G, "time_milliseconds")(id)) +#define rustg_time_reset(id) RUSTG_CALL(RUST_G, "time_reset")(id) + +/// Returns the timestamp as a string +/proc/rustg_unix_timestamp() + return RUSTG_CALL(RUST_G, "unix_timestamp")() + +#define rustg_raw_read_toml_file(path) json_decode(RUSTG_CALL(RUST_G, "toml_file_to_json")(path) || "null") + +/proc/rustg_read_toml_file(path) + var/list/output = rustg_raw_read_toml_file(path) + if (output["success"]) + return json_decode(output["content"]) + else + CRASH(output["content"]) + +#define rustg_raw_toml_encode(value) json_decode(RUSTG_CALL(RUST_G, "toml_encode")(json_encode(value))) + +/proc/rustg_toml_encode(value) + var/list/output = rustg_raw_toml_encode(value) + if (output["success"]) + return output["content"] + else + CRASH(output["content"]) + +#define rustg_url_encode(text) RUSTG_CALL(RUST_G, "url_encode")("[text]") +#define rustg_url_decode(text) RUSTG_CALL(RUST_G, "url_decode")(text) + +#ifdef RUSTG_OVERRIDE_BUILTINS + #define url_encode(text) rustg_url_encode(text) + #define url_decode(text) rustg_url_decode(text) +#endif diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm index 3e7d1fd10b2de..946a56ed365b3 100644 --- a/code/_helpers/logging.dm +++ b/code/_helpers/logging.dm @@ -30,7 +30,10 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : "" to_world_log("## TESTING: [msg][log_end]") /proc/game_log(category, text) - to_file(global.diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]") + // [SIERRA-EDIT] - RUST_G + // to_file(global.diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]") // SIERRA-EDIT - ORIGINAL + rustg_log_write_formatted("[GLOB.log_directory]/game.log", "[category]: [text]") + // [/SIERRA-EDIT] /proc/log_admin(text) GLOB.admin_log.Add(text) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 095f3e0c0c7dc..023d5398c2139 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -66,8 +66,12 @@ var/global/datum/controller/master/Master = new /datum/controller/master/New() Uptime() //Uptime as close to boot as possible to set its statics + // [SIERRA-REMOVE] - RUST_G + /* if (!global.diary) global.diary = file("data/logs/[time2text(world.timeofday, "YYYY/MM/DD", -world.timezone)].log") + */ + // [/SIERRA-REMOVE] if (!config) config = new total_run_times = list() diff --git a/code/controllers/subsystems/garbage.dm b/code/controllers/subsystems/garbage.dm index 9cae056c008fa..818f48c7e81d2 100644 --- a/code/controllers/subsystems/garbage.dm +++ b/code/controllers/subsystems/garbage.dm @@ -65,8 +65,11 @@ SUBSYSTEM_DEF(garbage) qdel_log += "\tSleeps: [details.slept_destroy]" if (details.no_hint) qdel_log += "\tNo hint: [details.no_hint] times" - var/log_file = file("[GLOB.log_directory]/qdel.log") - to_file(log_file, jointext(qdel_log, "\n")) + // [SIERRA-EDIT] - RUST_G + // var/log_file = file("[GLOB.log_directory]/qdel.log") // SIERRA-EDIT - ORIGINAL + // to_file(log_file, jointext(qdel_log, "\n")) // SIERRA-EDIT - ORIGINAL + rustg_log_write_formatted("[GLOB.log_directory]/qdel.log", jointext(qdel_log, "\n")) + // [/SIERRA-EDIT] /datum/controller/subsystem/garbage/Initialize(start_uptime) diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 49c11cc498065..104462f52e65e 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -11,6 +11,8 @@ var/global/datum/getrev/revdata = new() if(length(head_branch)) branch = copytext(head_branch[1], 17) + // [SIERRA-REMOVE] - RUST_G + /* var/list/head_log = file2list(".git/logs/HEAD", "\n") for(var/line=length(head_log), line>=1, line--) if(head_log[line]) @@ -23,6 +25,12 @@ var/global/datum/getrev/revdata = new() if(unix_time) date = unix2date(unix_time) break + */ + // [/SIERRA-REMOVE] + // [SIERRA-ADD] - RUST_G + revision = rustg_git_revparse("HEAD") + date = rustg_git_commit_date("HEAD") + // [/SIERRA-ADD] to_world_log("Running revision:") to_world_log(branch) diff --git a/code/game/world.dm b/code/game/world.dm index 97abf5ef9109b..07324605db821 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -81,7 +81,11 @@ GLOBAL_VAR(href_logfile) SetupLogs() var/date_string = time2text(world.realtime, "YYYY/MM/DD") - to_file(global.diary, "[log_end]\n[log_end]\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]") + // [SIERRA-EDIT] - RUST_G + // to_file(global.diary, "[log_end]\n[log_end]\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]") // SIERRA-EDIT - ORIGINAL + rustg_log_write_formatted("[GLOB.log_directory]/game.log", "Starting up. (ID: [game_id])\n---------------------------") + // [/SIERRA-EDIT] + if (config) if (config.server_name) @@ -119,7 +123,12 @@ GLOBAL_VAR_INIT(world_topic_last, world.timeofday) /world/Topic(T, addr, master, key) - to_file(global.diary, "TOPIC: \"[T]\", from:[addr], master:[master], key:[key][log_end]") + // [SIERRA-EDIT] - RUST_G + // to_file(global.diary, "TOPIC: \"[T]\", from:[addr], master:[master], key:[key][log_end]") // SIERRA-EDIT - ORIGINAL + + // Currently we have no need in topic log + // game_log("TOPIC","url:\"[T]\", from:[addr], master:[master], key:[key][log_end]" ) + // [/SIERRA-EDIT] if (GLOB.world_topic_last > world.timeofday) GLOB.world_topic_throttle = list() //probably passed midnight @@ -515,6 +524,9 @@ GLOBAL_VAR_INIT(world_topic_last, world.timeofday) for(var/client/C in GLOB.clients) send_link(C, "byond://[config.server]") + // [SIERRA-ADD] - RUST_G - Past this point, no logging procs can be used, at risk of data loss. + rustg_log_close_all() + //[/SIERRA-ADD] if(config.wait_for_sigusr1_reboot && reason != 3) text2file("foo", "reboot_called") to_world(SPAN_DANGER("World reboot waiting for external scripts. Please be patient.")) diff --git a/mods/rust_g/README.md b/mods/rust_g/README.md new file mode 100644 index 0000000000000..190da0bc90612 --- /dev/null +++ b/mods/rust_g/README.md @@ -0,0 +1,135 @@ + +#### Список PRов: + +- https://github.com/SierraBay/SierraBay12/pull/1467 + + + +## RustG + +ID мода: RUST_G + + +### Описание мода + +Мод добавляет поддержку растижки - написанной на языке RUST библиотеки, которая +позволяет заменить более быстрыми те функции BYOND'а, которые он делает медленно. + + +### Изменения *кор кода* + +- `code/_helpers/logging.dm`: `/proc/game_log()` +- `code/controllers/master.dm`: `/datum/controller/master/New()` +- `code/controllers/subsystems/garbage.dm`: `/datum/controller/subsystem/garbage/Shutdown()` +- `code/datums/helper_datums/getrev.dm`: `/datum/getrev/New()` +- `code/game/world.dm`: + - `/world/New()` + - `/world/Topic()` + - `/world/Reboot()` + + +### Оверрайды + +- Отсутствуют + + +### Дефайны + +- `code/__defines/~mods/rust_g.dm`: + - `RUST_G` + - `RUSTG_OVERRIDE_BUILTINS` + - `RUSTG_CALL` + - `rustg_setup_acreplace` + - `rustg_setup_acreplace_with_options` + - `rustg_acreplace` + - `rustg_acreplace_with_replacements` + - `rustg_cnoise_generate` + - `rustg_dmi_strip_metadata` + - `rustg_dmi_create_png` + - `rustg_dmi_resize_png` + - `rustg_dmi_icon_states` + - `rustg_file_read` + - `rustg_file_exists` + - `rustg_file_write` + - `rustg_file_append` + - `rustg_file_get_line_count` + - `rustg_file_seek_line` + - `rustg_git_revparse` + - `rustg_git_commit_date` + - `RUSTG_HTTP_METHOD_GET` + - `RUSTG_HTTP_METHOD_PUT` + - `RUSTG_HTTP_METHOD_DELETE` + - `RUSTG_HTTP_METHOD_PATCH` + - `RUSTG_HTTP_METHOD_HEAD` + - `RUSTG_HTTP_METHOD_POST` + - `rustg_http_request_blocking` + - `rustg_http_request_async` + - `rustg_http_check_request` + - `RUSTG_JOB_NO_RESULTS_YET` + - `RUSTG_JOB_NO_SUCH_JOB` + - `RUSTG_JOB_ERROR` + - `rustg_json_is_valid` + - `rustg_log_write` + - `rustg_log_write_formatted` + - `rustg_log_write_no_format` + - `rustg_noise_get_at_coordinates` + - `rustg_sql_connect_pool` + - `rustg_sql_query_async` + - `rustg_sql_query_blocking` + - `rustg_sql_connected` + - `rustg_sql_disconnect_pool` + - `rustg_sql_check_query` + - `rustg_time_microseconds` + - `rustg_time_milliseconds` + - `rustg_time_reset` + - `rustg_raw_read_toml_file` + - `rustg_raw_toml_encode` + - `rustg_url_encode` + - `rustg_url_decode` + + +### Используемые файлы, не содержащиеся в модпаке + +- `scripts/install-rust_g.sh` + + +### Авторы: + +SuhEugene + diff --git a/mods/rust_g/_rust_g.dm b/mods/rust_g/_rust_g.dm new file mode 100644 index 0000000000000..7058c4c93da21 --- /dev/null +++ b/mods/rust_g/_rust_g.dm @@ -0,0 +1,4 @@ +/singleton/modpack/rust_g + name = "RustG" + desc = "Мод добавляет поддержку растижки - написанной на языке RUST библиотеки, которая позволяет заменить более быстрыми те функции BYOND'а, которые он делает медленно." + author = "SuhEugene" diff --git a/mods/rust_g/_rust_g.dme b/mods/rust_g/_rust_g.dme new file mode 100644 index 0000000000000..c539b19b7d5b9 --- /dev/null +++ b/mods/rust_g/_rust_g.dme @@ -0,0 +1,6 @@ +#ifndef MODPACK_RUST_G +#define MODPACK_RUST_G + +#include "_rust_g.dm" + +#endif diff --git a/rust_g.dll b/rust_g.dll new file mode 100644 index 0000000000000..f5e81c45b3560 Binary files /dev/null and b/rust_g.dll differ diff --git a/scripts/install-rust_g-dependencies.sh b/scripts/install-rust_g-dependencies.sh new file mode 100755 index 0000000000000..bc783431a635f --- /dev/null +++ b/scripts/install-rust_g-dependencies.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail + +sudo dpkg --add-architecture i386 +sudo apt update || true +sudo apt remove -y libssl1.1:amd64 || true +sudo apt install libgcc-s1:i386 +sudo apt install -o APT::Immediate-Configure=false libc6:i386 +wget http://ftp.de.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u6_i386.deb +sudo dpkg -i libssl1.1_1.1.1n-0+deb10u6_i386.deb diff --git a/scripts/install-rust_g.sh b/scripts/install-rust_g.sh new file mode 100755 index 0000000000000..8d1de1d15bf3e --- /dev/null +++ b/scripts/install-rust_g.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ -f ~/.byond/bin/librust_g.so ]; then + echo "Using cached ~/.byond/bin/librust_g.so." +else + echo "~/.byond/bin/librust_g.so doesn't exist! Downloading..." + mkdir -p ~/.byond/bin + wget -O ~/.byond/bin/librust_g.so "https://github.com/${RUST_G_REPO}/releases/download/${RUST_G_VERSION}/librust_g.so" +fi + +chmod +x ~/.byond/bin/librust_g.so + +echo "LDD ~/.byond/bin/librust_g.so:" +ldd ~/.byond/bin/librust_g.so