diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2872dc2bff..8bdd7871c65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: jobs: run_linters: name: Run Linters - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Setup Cache @@ -47,7 +47,7 @@ jobs: odlint: name: Lint with OpenDream - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Setup OD @@ -59,7 +59,7 @@ jobs: compile_all_maps: name: Compile All Maps - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Setup Cache @@ -76,7 +76,7 @@ jobs: unit_tests_and_sql: name: Unit Tests + SQL Validation - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false # Let all map tests run to completion matrix: @@ -106,8 +106,9 @@ jobs: run: | sudo dpkg --add-architecture i386 sudo apt update || true - sudo apt install libssl1.1:i386 - ldd librust_g.so + sudo apt install lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl gcc libdbus-1-dev + sudo apt install gcc:i386 + tools/ci/install_rustg.sh - name: Compile & Run Unit Tests run: | tools/ci/install_byond.sh '${{ matrix.byondtype }}' diff --git a/.gitignore b/.gitignore index 89bc37e9421..052fe69acad 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,9 @@ __pycache__/ dmm-tools.exe OpenDream paradise.json + +# Misc windows shenanigans $RECYCLE.BIN + +# Linux libs +/*.so diff --git a/.tgs.yml b/.tgs.yml new file mode 100644 index 00000000000..6970078ff70 --- /dev/null +++ b/.tgs.yml @@ -0,0 +1,21 @@ +# This file is used by TGS (https://github.com/tgstation/tgstation-server) clients to quickly initialize a server instance for the codebase +# The format isn't documented anywhere but hopefully we never have to change it. If there are questions, contact the TGS maintainer Cyberboss/@Dominion#0444 +version: 1 +# The BYOND version to use +# Must be interpreted as a string, keep quoted +byond: "515.1620" +# Folders to create in "/Configuration/GameStaticFiles/" +static_files: + # Config directory should be static + - name: config + # This implies the folder should be pre-populated with contents from the repo + populate: true + # Data directory must be static + - name: data +# Scripts linux needs +linux_scripts: + PreCompile.sh: tools/tgs_scripts/PreCompile.sh + WatchdogLaunch.sh: tools/tgs_scripts/WatchdogLaunch.sh + InstallDeps.sh: tools/tgs_scripts/InstallDeps.sh +# The security level the game should be run at +security: Trusted diff --git a/_build_dependencies.sh b/_build_dependencies.sh index 8cded2a078a..d146ad1c518 100644 --- a/_build_dependencies.sh +++ b/_build_dependencies.sh @@ -6,10 +6,12 @@ export NODE_VERSION=18 # Stable Byond Major export STABLE_BYOND_MAJOR=515 # Stable Byond Minor -export STABLE_BYOND_MINOR=1619 +export STABLE_BYOND_MINOR=1620 # Beta Byond Major export BETA_BYOND_MAJOR=515 # Beta Byond Minor -export BETA_BYOND_MINOR=1619 +export BETA_BYOND_MINOR=1620 # Python version for mapmerge and other tools export PYTHON_VERSION=3.11.6 +# RUSTG version +export RUSTG_VERSION=v3.0.0-P diff --git a/code/game/world.dm b/code/game/world.dm index 3eb34e067be..2b03f0ad2d1 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -12,7 +12,7 @@ GLOBAL_DATUM(test_runner, /datum/test_runner) SSmetrics.world_init_time = REALTIMEOFDAY // Do sanity checks to ensure RUST actually exists - if(!fexists(RUST_G)) + if((!fexists(RUST_G)) && world.system_type == MS_WINDOWS) DIRECT_OUTPUT(world.log, "ERROR: RUSTG was not found and is required for the game to function. Server will now exit.") del(world) diff --git a/librust_g.so b/librust_g.so deleted file mode 100644 index d4bb0d3adc5..00000000000 Binary files a/librust_g.so and /dev/null differ diff --git a/tools/ci/install_rustg.sh b/tools/ci/install_rustg.sh index 7c67513e64a..c7e1cfc606c 100755 --- a/tools/ci/install_rustg.sh +++ b/tools/ci/install_rustg.sh @@ -1,11 +1,9 @@ #!/usr/bin/env bash set -euo pipefail -# This script is not actually used by CI, but kept as a reference incase we refactor CI again - source _build_dependencies.sh mkdir -p ~/.byond/bin -wget -O ~/.byond/bin/librust_g.so "https://github.com/ParadiseSS13/rust-g/releases/download/$RUSTG_VERSION/librust_g.so" +wget -O ~/.byond/bin/librust_g.so "https://github.com/ParadiseSS13/rust-g/releases/download/$RUSTG_VERSION/librust_g-ci.so" chmod +x ~/.byond/bin/librust_g.so ldd ~/.byond/bin/librust_g.so diff --git a/tools/tgs_scripts/InstallDeps.sh b/tools/tgs_scripts/InstallDeps.sh new file mode 100755 index 00000000000..8fbc7a59bac --- /dev/null +++ b/tools/tgs_scripts/InstallDeps.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#find out what we have (+e is important for this) +set +e +has_git="$(command -v git)" +has_curl="$(command -v curl)" +has_cargo="$(command -v ~/.cargo/bin/cargo)" +has_sudo="$(command -v sudo)" +set -e +set -x + +# apt packages, libssl needed by rust-g but not included in TGS barebones install +# These basically only work on ubuntu+debian +if ! ( [ -x "$has_git" ] && [ -x "$has_curl" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then + echo "Installing apt dependencies..." + if ! [ -x "$has_sudo" ]; then + dpkg --add-architecture i386 + apt-get update + apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl gcc libdbus-1-dev + apt-get install -y gcc:i386 + else + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl gcc libdbus-1-dev + sudo apt-get install -y gcc:i386 + fi +fi + +# install cargo if needed +if ! [ -x "$has_cargo" ]; then + echo "Installing rust..." + curl https://sh.rustup.rs -sSf | sh -s -- -y + . ~/.profile +fi diff --git a/tools/tgs_scripts/PreCompile.sh b/tools/tgs_scripts/PreCompile.sh new file mode 100755 index 00000000000..26af2b44ea4 --- /dev/null +++ b/tools/tgs_scripts/PreCompile.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +./InstallDeps.sh + +set -e +set -x + +#load dep exports +#need to switch to game dir for Dockerfile weirdness +original_dir=$PWD +cd "$1" +. dependencies.sh +cd "$original_dir" + + +# update rust-g +if [ ! -d "rust-g" ]; then + echo "Cloning rust-g..." + git clone https://github.com/tgstation/rust-g + cd rust-g + ~/.cargo/bin/rustup target add i686-unknown-linux-gnu +else + echo "Fetching rust-g..." + cd rust-g + git fetch + ~/.cargo/bin/rustup target add i686-unknown-linux-gnu +fi + +echo "Deploying rust-g..." +git checkout "$RUST_G_VERSION" +env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --features all --target=i686-unknown-linux-gnu +mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so" +cd .. diff --git a/tools/tgs_scripts/WatchdogLaunch.sh b/tools/tgs_scripts/WatchdogLaunch.sh new file mode 100755 index 00000000000..cd400cbb969 --- /dev/null +++ b/tools/tgs_scripts/WatchdogLaunch.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Special file to ensure all dependencies still exist between server launches. +# Mainly for use by people who abuse docker by modifying the container's system. + +./InstallDeps.sh