From 718074ce55ce107e88f8f734f9e9d3b52bfb6347 Mon Sep 17 00:00:00 2001 From: Emmett Gaines Date: Thu, 5 Mar 2020 11:54:04 -0500 Subject: [PATCH] Build SpacemanDMM from source (#49712) * Build SpacemanDMM from source * oops * Fix new unreachables/dumb code * ooops cache conflict * bugfix * oops * lint * ninjanomnom held me down and forced me to delete this --- .travis.yml | 7 ++++++- code/__DEFINES/spaceman_dmm.dm | 12 ++++++++++++ code/controllers/subsystem/mapping.dm | 1 + code/datums/diseases/gastrolisis.dm | 2 +- code/datums/http.dm | 2 +- code/game/atoms.dm | 3 +++ code/game/atoms_movable.dm | 1 + code/game/machinery/doors/firedoor.dm | 2 +- code/game/objects/effects/portals.dm | 1 - .../abductor/equipment/abduction_gear.dm | 2 +- code/modules/mapping/reader.dm | 1 + code/modules/mob/inventory.dm | 1 + .../carbon/human/species_types/snail.dm | 2 +- dependencies.sh | 3 +++ tools/travis/build_spaceman_dmm.sh | 19 +++++++++++++++++++ tools/travis/install_spaceman_dmm.sh | 8 -------- 16 files changed, 52 insertions(+), 15 deletions(-) create mode 100755 tools/travis/build_spaceman_dmm.sh delete mode 100755 tools/travis/install_spaceman_dmm.sh diff --git a/.travis.yml b/.travis.yml index 880562ca6598b..2d03fe999d547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,14 @@ matrix: - python3-pip - python3-setuptools - pcregrep + - rustc + - cargo + cache: + directories: + - $HOME/SpacemanDMM install: - tools/travis/install_build_tools.sh - - tools/travis/install_spaceman_dmm.sh dreamchecker + - tools/travis/build_spaceman_dmm.sh dreamchecker script: - tools/travis/check_filedirs.sh tgstation.dme - tools/travis/check_changelogs.sh diff --git a/code/__DEFINES/spaceman_dmm.dm b/code/__DEFINES/spaceman_dmm.dm index 4d9c0993fb11e..3d4207c5c973a 100644 --- a/code/__DEFINES/spaceman_dmm.dm +++ b/code/__DEFINES/spaceman_dmm.dm @@ -7,13 +7,25 @@ #define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X #define UNLINT(X) SpacemanDMM_unlint(X) #define SHOULD_NOT_OVERRIDE(X) set SpacemanDMM_should_not_override = X + #define SHOULD_NOT_SLEEP(X) set SpacemanDMM_should_not_sleep = X + #define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X + #define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X + #define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X #define VAR_FINAL var/SpacemanDMM_final + #define VAR_PRIVATE var/SpacemanDMM_private + #define VAR_PROTECTED var/SpacemanDMM_protected #else #define RETURN_TYPE(X) #define SHOULD_CALL_PARENT(X) #define UNLINT(X) X #define SHOULD_NOT_OVERRIDE(X) + #define SHOULD_NOT_SLEEP(X) + #define SHOULD_BE_PURE(X) + #define PRIVATE_PROC(X) + #define PROTECTED_PROC(X) #define VAR_FINAL var + #define VAR_PRIVATE var + #define VAR_PROTECTED var #endif /world/proc/enable_debugger() diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 271e9e5a20b63..2ab53766a6a19 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -523,6 +523,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) //DO NOT CALL THIS PROC DIRECTLY, CALL wipe_reservations(). /datum/controller/subsystem/mapping/proc/do_wipe_turf_reservations() + PRIVATE_PROC(TRUE) UNTIL(initialized) //This proc is for AFTER init, before init turf reservations won't even exist and using this will likely break things. for(var/i in turf_reservations) var/datum/turf_reservation/TR = i diff --git a/code/datums/diseases/gastrolisis.dm b/code/datums/diseases/gastrolisis.dm index 96efd38d5bc3c..119ccc0c60e07 100644 --- a/code/datums/diseases/gastrolisis.dm +++ b/code/datums/diseases/gastrolisis.dm @@ -82,5 +82,5 @@ var/obj/item/storage/backpack/bag = H.get_item_by_slot(ITEM_SLOT_BACK) if(istype(bag, /obj/item/storage/backpack/snail)) bag.emptyStorage() - H.doUnEquip(bag, TRUE, no_move = TRUE) + H.temporarilyRemoveItemFromInventory(bag, TRUE) qdel(bag) diff --git a/code/datums/http.dm b/code/datums/http.dm index 58eb815acbfcc..8cac03d2bd0d1 100644 --- a/code/datums/http.dm +++ b/code/datums/http.dm @@ -30,7 +30,7 @@ id = rustg_http_request_async(method, url, body, headers) if (isnull(text2num(id))) - CRASH("Proc error: [id]") + stack_trace("Proc error: [id]") _raw_response = "Proc error: [id]" else in_progress = TRUE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e6133408a7d6f..52b02101ee084 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -141,6 +141,7 @@ * * [/turf/open/space/Initialize] */ /atom/proc/Initialize(mapload, ...) + SHOULD_NOT_SLEEP(TRUE) SHOULD_CALL_PARENT(TRUE) if(flags_1 & INITIALIZED_1) stack_trace("Warning: [src]([type]) initialized multiple times!") @@ -223,6 +224,7 @@ ///Can the mover object pass this atom, while heading for the target turf /atom/proc/CanPass(atom/movable/mover, turf/target) SHOULD_CALL_PARENT(TRUE) + SHOULD_BE_PURE(TRUE) if(mover.movement_type & UNSTOPPABLE) return TRUE . = CanAllowThrough(mover, target) @@ -233,6 +235,7 @@ /// Returns true or false to allow the mover to move through src /atom/proc/CanAllowThrough(atom/movable/mover, turf/target) SHOULD_CALL_PARENT(TRUE) + SHOULD_BE_PURE(TRUE) return !density /** diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 264145022fdb7..2f217a3f26c31 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -702,6 +702,7 @@ /// Returns true or false to allow src to move through the blocker, mover has final say /atom/movable/proc/CanPassThrough(atom/blocker, turf/target, blocker_opinion) SHOULD_CALL_PARENT(TRUE) + SHOULD_BE_PURE(TRUE) return blocker_opinion /// called when this atom is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called. diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index addce4d0be187..4ec92526c42d6 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -466,7 +466,7 @@ constructionStep = CONSTRUCTION_GUTTED update_icon() return TRUE - else if(RCD_DECONSTRUCT) + if(RCD_DECONSTRUCT) to_chat(user, "You deconstruct [src].") qdel(src) return TRUE diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 03b78b3080f0d..c3b30d5eae9cb 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -229,7 +229,6 @@ var/obj/projectile/P = M P.ignore_source_check = TRUE return TRUE - return FALSE // try to search for a new one if something was var edited etc set_linked() . = ..() diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 7a0d5de097217..d48abe9c611ad 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -518,7 +518,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} toggle_on(user) if(iscyborg(target)) - if(BATON_STUN) + if(mode == BATON_STUN) ..() return FALSE diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm index e7d7fd4898d11..cecd61091bffc 100644 --- a/code/modules/mapping/reader.dm +++ b/code/modules/mapping/reader.dm @@ -138,6 +138,7 @@ // Do not call except via load() above. /datum/parsed_map/proc/_load_impl(x_offset = 1, y_offset = 1, z_offset = world.maxz + 1, cropMap = FALSE, no_changeturf = FALSE, x_lower = -INFINITY, x_upper = INFINITY, y_lower = -INFINITY, y_upper = INFINITY, placeOnTop = FALSE) + PRIVATE_PROC(TRUE) var/list/areaCache = list() var/list/modelCache = build_cache(no_changeturf) var/space_key = modelCache[SPACE_KEY] diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 96b80844205a8..84f2723165cea 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -294,6 +294,7 @@ /mob/proc/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE, silent = FALSE) //Force overrides TRAIT_NODROP for things like wizarditis and admin undress. //Use no_move if the item is just gonna be immediately moved afterward //Invdrop is used to prevent stuff in pockets dropping. only set to false if it's going to immediately be replaced + PROTECTED_PROC(TRUE) if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for TRAIT_NODROP. return TRUE diff --git a/code/modules/mob/living/carbon/human/species_types/snail.dm b/code/modules/mob/living/carbon/human/species_types/snail.dm index 9296e9ee58b95..375ba7be6dcf7 100644 --- a/code/modules/mob/living/carbon/human/species_types/snail.dm +++ b/code/modules/mob/living/carbon/human/species_types/snail.dm @@ -41,7 +41,7 @@ var/obj/item/storage/backpack/bag = C.get_item_by_slot(ITEM_SLOT_BACK) if(istype(bag, /obj/item/storage/backpack/snail)) bag.emptyStorage() - C.doUnEquip(bag, TRUE, no_move = TRUE) + C.temporarilyRemoveItemFromInventory(bag, TRUE) qdel(bag) /obj/item/storage/backpack/snail diff --git a/dependencies.sh b/dependencies.sh index be5a3204285b2..947120ac57169 100755 --- a/dependencies.sh +++ b/dependencies.sh @@ -24,3 +24,6 @@ export PHP_VERSION=5.6 # SpacemanDMM git tag export SPACEMAN_DMM_VERSION=suite-1.3 + +# SpacemanDMM commit hash +export SPACEMAN_DMM_COMMIT_HASH=3cd3c402af04e6deedc9149caf5c5b0dfd44ad3b diff --git a/tools/travis/build_spaceman_dmm.sh b/tools/travis/build_spaceman_dmm.sh new file mode 100755 index 0000000000000..d63aeac2cc850 --- /dev/null +++ b/tools/travis/build_spaceman_dmm.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -euo pipefail + +source dependencies.sh + +cd $HOME/SpacemanDMM + +if [ ! -d .git ] +then + git init + git remote add origin https://github.com/SpaceManiac/SpacemanDMM.git +fi + +git fetch origin --depth=1 $SPACEMAN_DMM_COMMIT_HASH +git reset --hard FETCH_HEAD + +cargo build --release --bin $1 +cp target/release/$1 ~ +~/$1 --version diff --git a/tools/travis/install_spaceman_dmm.sh b/tools/travis/install_spaceman_dmm.sh deleted file mode 100755 index 39464193f8894..0000000000000 --- a/tools/travis/install_spaceman_dmm.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -euo pipefail - -source dependencies.sh - -wget -O ~/$1 "https://github.com/SpaceManiac/SpacemanDMM/releases/download/$SPACEMAN_DMM_VERSION/$1" -chmod +x ~/$1 -~/$1 --version