[MIRROR] Bumps compile to 515 [MDB IGNORE] (#25257)

* Bumps compile to 515 (#79134)

## About The Pull Request

LSP supports it, let's GOOOOOO
I've removed the 515 tests since they're stable, alongside the libcall
wrapper. left the rustgcall wrapper cause yaknow memes
Just removed all the 515 and 514 particular define wrappers. gaming

## Changelog
🆑
server: Minimum compile version has been bumped to 515. clients still
support 514 but we're gonna start using 515 restricted features for
serverside now.
/🆑

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>

* Bumps compile to 515

* Fixes a TGS regression in its API

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
This commit is contained in:
SkyratBot
2023-12-02 21:48:21 -05:00
committed by GitHub
co-authored by John Willard LemonInTheDark GoldenAlpharex
parent e1d47fc8e4
commit e06ec3e714
21 changed files with 46 additions and 170 deletions
-2
View File
@@ -5,5 +5,3 @@
# Format is version: map
# Example:
# 500.1337: runtimestation
515.1603: runtimestation
+1 -1
View File
@@ -3,7 +3,7 @@
version: 1
# The BYOND version to use (kept in sync with dependencies.sh by the "TGS Test Suite" CI job)
# Must be interpreted as a string, keep quoted
byond: "514.1588"
byond: "515.1620"
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
static_files:
# Config directory should be static
-9
View File
@@ -25,17 +25,8 @@
} \
sleep(time);
#ifdef EXPERIMENT_515_DONT_CACHE_REF
/// Takes a datum as input, returns its ref string
#define text_ref(datum) ref(datum)
#else
/// Takes a datum as input, returns its ref string, or a cached version of it
/// This allows us to cache \ref creation, which ensures it'll only ever happen once per datum, saving string tree time
/// It is slightly less optimal then a []'d datum, but the cost is massively outweighed by the potential savings
/// It will only work for datums mind, for datum reasons
/// : because of the embedded typecheck
#define text_ref(datum) (isdatum(datum) ? (datum:cached_ref ||= "\ref[datum]") : ("\ref[datum]"))
#endif
// Refs contain a type id within their string that can be used to identify byond types.
// Custom types that we define don't get a unique id, but this is useful for identifying
+3 -3
View File
@@ -10,7 +10,7 @@ GLOBAL_PROTECT(auxtools_initialized)
}\
if (GLOB.auxtools_initialized[LIB] != AUXTOOLS_FULL_INIT) {\
if (fexists(LIB)) {\
var/string = LIBCALL(LIB,"auxtools_init")();\
var/string = call_ext(LIB,"auxtools_init")();\
if(findtext(string, "SUCCESS")) {\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_FULL_INIT;\
} else {\
@@ -23,13 +23,13 @@ GLOBAL_PROTECT(auxtools_initialized)
#define AUXTOOLS_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] == AUXTOOLS_FULL_INIT && fexists(LIB)){\
LIBCALL(LIB,"auxtools_shutdown")();\
call_ext(LIB,"auxtools_shutdown")();\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_PARTIAL_INIT;\
}\
#define AUXTOOLS_FULL_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] && fexists(LIB)){\
LIBCALL(LIB,"auxtools_full_shutdown")();\
call_ext(LIB,"auxtools_full_shutdown")();\
GLOB.auxtools_initialized[LIB] = FALSE;\
}
-4
View File
@@ -8,8 +8,4 @@
/**
* NAMEOF that actually works in static definitions because src::type requires src to be defined
*/
#if DM_VERSION >= 515
#define NAMEOF_STATIC(datum, X) (nameof(type::##X))
#else
#define NAMEOF_STATIC(datum, X) (#X || ##datum.##X)
#endif
+6 -42
View File
@@ -1,52 +1,21 @@
// This file contains defines allowing targeting byond versions newer than the supported
//Update this whenever you need to take advantage of more recent byond features
#define MIN_COMPILER_VERSION 514
#define MIN_COMPILER_BUILD 1556
#define MIN_COMPILER_VERSION 515
#define MIN_COMPILER_BUILD 1609
#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM)
//Don't forget to update this part
#error Your version of BYOND is too out-of-date to compile this project. Go to https://secure.byond.com/download and update.
#error You need version 514.1556 or higher
#endif
#if (DM_VERSION == 514 && DM_BUILD > 1575 && DM_BUILD <= 1577)
#error Your version of BYOND currently has a crashing issue that will prevent you from running Dream Daemon test servers.
#error We require developers to test their content, so an inability to test means we cannot allow the compile.
#error Please consider downgrading to 514.1575 or lower.
#error You need version 515.1609 or higher
#endif
// Keep savefile compatibilty at minimum supported level
#if DM_VERSION >= 515
/savefile/byond_version = MIN_COMPILER_VERSION
#endif
// 515 split call for external libraries into call_ext
#if DM_VERSION < 515
#define LIBCALL call
#else
#define LIBCALL call_ext
#endif
// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof()
// So we want to have compile time guarantees these methods exist on local type
// We use wrappers for this in case some part of the api ever changes, and to make their function more clear
// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global.
#if DM_VERSION < 515
/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (.proc/##X)
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (.verb/##X)
/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X)
/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)
#else
/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (nameof(.proc/##X))
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
@@ -60,16 +29,11 @@
/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)
#endif
#if (DM_VERSION == 515)
/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows
/// var case matches documentation for fcopy.
/world/proc/__fcopy(Src, Dst)
if (istext(Src) && !fexists(Src))
return 0
return fcopy(Src, Dst)
#define fcopy(Src, Dst) world.__fcopy(Src, Dst)
#endif
#define fcopy(Src, Dst) world.__fcopy(Src, Dst)
+9 -21
View File
@@ -3,32 +3,20 @@
// Any flag you see here can be flipped with the `-D` CLI argument.
// For example, if you want to enable EXPERIMENT_MY_COOL_FEATURE, compile with -DEXPERIMENT_MY_COOL_FEATURE
// EXPERIMENT_515_QDEL_HARD_REFERENCE
// - Hold a hard reference for qdeleted items, and check ref_count, rather than using refs. Requires 515+.
// EXPERIMENT_515_DONT_CACHE_REF
// - Avoids `text_ref` caching, aided by improvements to ref() speed in 515.
// EXPERIMENT_MY_COOL_FEATURE
// - Does something really cool, just so neat, absolutely banging, gaming and chill
#if DM_VERSION < 515
// You can't X-macro custom names :(
#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
#warn EXPERIMENT_515_QDEL_HARD_REFERENCE is only available on 515+
#undef EXPERIMENT_515_QDEL_HARD_REFERENCE
#endif
#ifdef EXPERIMENT_515_DONT_CACHE_REF
#warn EXPERIMENT_515_DONT_CACHE_REF is only available on 515+
#undef EXPERIMENT_515_DONT_CACHE_REF
#endif
// You can't X-macro custom names :(
#ifdef EXPERIMENT_MY_COOL_FEATURE
#warn EXPERIMENT_MY_COOL_FEATURE is only available on 515+
#undef EXPERIMENT_MY_COOL_FEATURE
#endif
#elif defined(UNIT_TESTS)
#define EXPERIMENT_515_QDEL_HARD_REFERENCE
#define EXPERIMENT_515_DONT_CACHE_REF
#define EXPERIMENT_MY_COOL_FEATURE
#endif
#if DM_VERSION >= 516
#error "Remove all 515 experiments"
#error "Remove all 515 experiments"
#endif
+8 -1
View File
@@ -14,7 +14,14 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
GLOB = src
var/datum/controller/exclude_these = new
gvars_datum_in_built_vars = exclude_these.vars + list(NAMEOF(src, gvars_datum_protected_varlist), NAMEOF(src, gvars_datum_in_built_vars), NAMEOF(src, gvars_datum_init_order))
// I know this is dumb but the nested vars list hangs a ref to the datum. This fixes that
var/list/controller_vars = exclude_these.vars.Copy()
controller_vars["vars"] = null
gvars_datum_in_built_vars = controller_vars + list(NAMEOF(src, gvars_datum_protected_varlist), NAMEOF(src, gvars_datum_in_built_vars), NAMEOF(src, gvars_datum_init_order))
#if DM_VERSION >= 515 && DM_BUILD > 1620
#warn datum.vars hanging a ref should now be fixed, there should be no reason to remove the vars list from our controller's vars list anymore
#endif
QDEL_IN(exclude_these, 0) //signal logging isn't ready
Initialize()
+6 -31
View File
@@ -145,12 +145,6 @@ SUBSYSTEM_DEF(garbage)
pass_counts[i] = 0
fail_counts[i] = 0
#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
// 1 from the hard reference in the queue, and 1 from the variable used before this
#define IS_DELETED(datum, _) (refcount(##datum) == 2)
#else
#define IS_DELETED(datum, gcd_at_time) (isnull(##datum) || ##datum.gc_destroyed != gcd_at_time)
#endif
/datum/controller/subsystem/garbage/proc/HandleQueue(level = GC_QUEUE_FILTER)
if (level == GC_QUEUE_FILTER)
@@ -168,7 +162,7 @@ SUBSYSTEM_DEF(garbage)
lastlevel = level
//We do this rather then for(var/refID in queue) because that sort of for loop copies the whole list.
//We do this rather then for(var/list/ref_info in queue) because that sort of for loop copies the whole list.
//Normally this isn't expensive, but the gc queue can grow to 40k items, and that gets costly/causes overrun.
for (var/i in 1 to length(queue))
var/list/L = queue[i]
@@ -183,17 +177,11 @@ SUBSYSTEM_DEF(garbage)
break // Everything else is newer, skip them
count++
#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
var/datum/D = L[GC_QUEUE_ITEM_REF]
#else
var/GCd_at_time = L[GC_QUEUE_ITEM_GCD_DESTROYED]
var/refID = L[GC_QUEUE_ITEM_REF]
var/datum/D
D = locate(refID)
#endif
if (IS_DELETED(D, GCd_at_time)) // So if something else coincidently gets the same ref, it's not deleted by mistake
// 1 from the hard reference in the queue, and 1 from the variable used before this
// If that's all we've got, send er off
if (refcount(D) == 2)
++gcedlasttick
++totalgcs
pass_counts[level]++
@@ -228,10 +216,9 @@ SUBSYSTEM_DEF(garbage)
var/datum/qdel_item/I = items[type]
var/message = "## TESTING: GC: -- [text_ref(D)] | [type] was unable to be GC'd --"
#if DM_VERSION >= 515
message = "[message] (ref count of [refcount(D)])"
#endif
log_world(message)
var/detail = D.dump_harddel_info()
if(detail)
LAZYADD(I.extra_details, detail)
@@ -270,8 +257,6 @@ SUBSYSTEM_DEF(garbage)
queue.Cut(1,count+1)
count = 0
#undef IS_DELETED
/datum/controller/subsystem/garbage/proc/Queue(datum/D, level = GC_QUEUE_FILTER)
if (isnull(D))
return
@@ -280,21 +265,11 @@ SUBSYSTEM_DEF(garbage)
return
var/queue_time = world.time
#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
var/refid = D
if (D.gc_destroyed <= 0)
D.gc_destroyed = queue_time
#else
var/refid = text_ref(D)
var/static/uid = 0
if (D.gc_destroyed <= 0)
uid = WRAP(uid+1, 1, SHORT_REAL_LIMIT - 1)
D.gc_destroyed = uid
#endif
var/list/queue = queues[level]
queue[++queue.len] = list(queue_time, refid, D.gc_destroyed) // not += for byond reasons
queue[++queue.len] = list(queue_time, D, D.gc_destroyed) // not += for byond reasons
//this is mainly to separate things profile wise.
/datum/controller/subsystem/garbage/proc/HardDelete(datum/D)
-12
View File
@@ -104,12 +104,6 @@
if (!object)
return
#if DM_VERSION <= 514
if(istext(object) && object != GLOBAL_PROC)
to_chat(usr, "[object] may be an external library. Calling external libraries is disallowed.", confidential = TRUE)
return
#endif
var/list/calling_arguments = arguments
if (length(args))
if (length(arguments))
@@ -147,12 +141,6 @@
if (!object)
return
#if DM_VERSION <= 514
if(istext(object) && object != GLOBAL_PROC)
to_chat(usr, "[object] may be an external library. Calling external libraries is disallowed.", confidential = TRUE)
return
#endif
var/list/calling_arguments = arguments
if (length(args))
if (length(arguments))
-7
View File
@@ -44,13 +44,6 @@
/// Datum level flags
var/datum_flags = NONE
#ifndef EXPERIMENT_515_DONT_CACHE_REF
/// A cached version of our \ref
/// The brunt of \ref costs are in creating entries in the string tree (a tree of immutable strings)
/// This avoids doing that more then once per datum by ensuring ref strings always have a reference to them after they're first pulled
var/cached_ref
#endif
/// A weak reference to another datum
var/datum/weakref/weak_reference
-6
View File
@@ -98,15 +98,9 @@ GENERAL_PROTECT_DATUM(/datum/json_savefile)
var/file_name = "[account_name ? "[account_name]_" : ""]preferences_[time2text(world.timeofday, "MMM_DD_YYYY_hh-mm-ss")].json"
var/temporary_file_storage = "data/preferences_export_working_directory/[file_name]"
#if DM_VERSION >= 515
if(!text2file(json_encode(tree, JSON_PRETTY_PRINT), temporary_file_storage))
tgui_alert(requester, "Failed to export preferences to JSON! You might need to try again later.", "Export Preferences JSON")
return
#else
if(!text2file(json_encode(tree), temporary_file_storage))
tgui_alert(requester, "Failed to export preferences to JSON! You might need to try again later.", "Export Preferences JSON")
return
#endif
var/exportable_json = file(temporary_file_storage)
+2
View File
@@ -193,6 +193,8 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag)
return
/mob/proc/set_machine(obj/O)
if(QDELETED(src) || QDELETED(O))
return
if(machine)
unset_machine()
machine = O
+3 -3
View File
@@ -342,7 +342,7 @@ GLOBAL_VAR(restart_counter)
AUXTOOLS_FULL_SHUTDOWN(AUXLUA)
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
if (debug_server)
LIBCALL(debug_server, "auxtools_shutdown")()
call_ext(debug_server, "auxtools_shutdown")()
/world/Del()
auxcleanup()
@@ -470,14 +470,14 @@ GLOBAL_VAR(restart_counter)
else
CRASH("Unsupported platform: [system_type]")
var/init_result = LIBCALL(library, "init")("block")
var/init_result = call_ext(library, "init")("block")
if (init_result != "0")
CRASH("Error initializing byond-tracy: [init_result]")
/world/proc/init_debugger()
var/dll = GetConfig("env", "AUXTOOLS_DEBUG_DLL")
if (dll)
LIBCALL(dll, "auxtools_init")()
call_ext(dll, "auxtools_init")()
enable_debugging()
/world/Profile(command, type, format)
@@ -26,9 +26,7 @@
var/starting_time = world.time
#if DM_VERSION >= 515
log_reftracker("Refcount for [type]: [refcount(src)]")
#endif
//Time to search the whole game for our ref
DoSearchVar(GLOB, "GLOB", search_time = starting_time) //globals
@@ -48,9 +48,6 @@
//Temporary/Internal stuff, do not copy these.
var/static/list/ignored_vars = list(
NAMEOF(item, animate_movement),
#ifndef EXPERIMENT_515_DONT_CACHE_REF
NAMEOF(item, cached_ref),
#endif
NAMEOF(item, datum_flags),
NAMEOF(item, fingerprintslast),
NAMEOF(item, layer),
-4
View File
@@ -74,11 +74,7 @@ GENERAL_PROTECT_DATUM(/datum/log_entry)
output += "[uppertext(category)]: [message]"
if(flags & ENTRY_USE_DATA_W_READABLE)
#if DM_VERSION >= 515
output += json_encode(data, JSON_PRETTY_PRINT)
#else
output += json_encode(data)
#endif
return output
#define MANUAL_JSON_ENTRY(list, key, value) list.Add("\"[key]\":[(!isnull(value)) ? json_encode(value) : "null"]")
+1
View File
@@ -30,6 +30,7 @@
else if(ckey)
stack_trace("Mob without client but with associated ckey, [ckey], has been deleted.")
unset_machine()
remove_from_mob_list()
remove_from_dead_mob_list()
remove_from_alive_mob_list()
@@ -11,11 +11,9 @@
nukie_cutout.push_over()
test_screenshot("nukie_cutout_pushed", getFlatIcon(nukie_cutout))
#if DM_VERSION >= 515
// This is the only reason we're testing xenomorphs.
// Making a custom subtype with direct_icon is hacky.
ASSERT(!isnull(/datum/cardboard_cutout/xenomorph_maid::direct_icon))
#endif
var/obj/item/cardboard_cutout/xenomorph/xenomorph_cutout = new
test_screenshot("xenomorph_cutout", getFlatIcon(xenomorph_cutout))
@@ -27,11 +27,10 @@
SSgarbage.should_save_refs = TRUE
//Sanity check
#if DM_VERSION >= 515
var/refcount = refcount(victim)
TEST_ASSERT_EQUAL(refcount, 3, "Should be: test references: 0 + baseline references: 3 (victim var,loc,allocated list)")
#endif
victim.DoSearchVar(testbed, "Sanity Check", search_time = 1) //We increment search time to get around an optimization
TEST_ASSERT(!victim.found_refs.len, "The ref-tracking tool found a ref where none existed")
SSgarbage.should_save_refs = FALSE
@@ -45,10 +44,8 @@
testbed.test_list += victim
testbed.test_assoc_list["baseline"] = victim
#if DM_VERSION >= 515
var/refcount = refcount(victim)
TEST_ASSERT_EQUAL(refcount, 6, "Should be: test references: 3 + baseline references: 3 (victim var,loc,allocated list)")
#endif
victim.DoSearchVar(testbed, "First Run", search_time = 2)
TEST_ASSERT(victim.found_refs["test"], "The ref-tracking tool failed to find a regular value")
@@ -66,10 +63,8 @@
testbed.vis_contents += victim
testbed.test_assoc_list[victim] = TRUE
#if DM_VERSION >= 515
var/refcount = refcount(victim)
TEST_ASSERT_EQUAL(refcount, 6, "Should be: test references: 3 + baseline references: 3 (victim var,loc,allocated list)")
#endif
victim.DoSearchVar(testbed, "Second Run", search_time = 3)
//This is another sanity check
@@ -90,12 +85,11 @@
var/list/to_find_assoc = list(victim)
testbed.test_assoc_list["Nesting"] = to_find_assoc
#if DM_VERSION >= 515
var/refcount = refcount(victim)
TEST_ASSERT_EQUAL(refcount, 6, "Should be: test references: 3 + baseline references: 3 (victim var,loc,allocated list)")
#endif
victim.DoSearchVar(victim, "Third Run Self", search_time = 4)
victim.DoSearchVar(testbed, "Third Run Testbed", search_time = 4)
TEST_ASSERT(victim.found_refs["self_ref"], "The ref-tracking tool failed to find a self reference")
TEST_ASSERT(victim.found_refs[to_find], "The ref-tracking tool failed to find a nested list entry")
TEST_ASSERT(victim.found_refs[to_find_assoc], "The ref-tracking tool failed to find a nested assoc list entry")
@@ -108,11 +102,10 @@
//Calm before the storm
testbed.test_assoc_list = list(null = victim)
#if DM_VERSION >= 515
var/refcount = refcount(victim)
TEST_ASSERT_EQUAL(refcount, 4, "Should be: test references: 1 + baseline references: 3 (victim var,loc,allocated list)")
#endif
victim.DoSearchVar(testbed, "Fourth Run", search_time = 5)
TEST_ASSERT(testbed.test_assoc_list, "The ref-tracking tool failed to find a null key'd assoc list entry")
/datum/unit_test/find_reference_assoc_investigation/Run()
@@ -126,11 +119,10 @@
var/list/to_find_null_assoc_nested = list(victim)
testbed.test_assoc_list[null] = to_find_null_assoc_nested
#if DM_VERSION >= 515
var/refcount = refcount(victim)
TEST_ASSERT_EQUAL(refcount, 5, "Should be: test references: 2 + baseline references: 3 (victim var,loc,allocated list)")
#endif
victim.DoSearchVar(testbed, "Fifth Run", search_time = 6)
TEST_ASSERT(victim.found_refs[to_find_in_key], "The ref-tracking tool failed to find a nested assoc list key")
TEST_ASSERT(victim.found_refs[to_find_null_assoc_nested], "The ref-tracking tool failed to find a null key'd nested assoc list entry")
SSgarbage.should_save_refs = FALSE
@@ -150,10 +142,8 @@
for(var/key in global.vars)
global_vars[key] = global.vars[key]
#if DM_VERSION >= 515
var/refcount = refcount(victim)
TEST_ASSERT_EQUAL(refcount, 5, "Should be: test references: 2 + baseline references: 3 (victim var,loc,allocated list)")
#endif
victim.DoSearchVar(global_vars, "Sixth Run", search_time = 7)
TEST_ASSERT(victim.found_refs[global_vars], "The ref-tracking tool failed to find a natively global variable")
+3 -3
View File
@@ -4,8 +4,8 @@
#Final authority on what's required to fully build the project
# byond version
export BYOND_MAJOR=514
export BYOND_MINOR=1588
export BYOND_MAJOR=515
export BYOND_MINOR=1620
#rust_g git tag
export RUST_G_VERSION=3.0.0
@@ -15,7 +15,7 @@ export NODE_VERSION=14
export NODE_VERSION_PRECISE=14.16.1
# SpacemanDMM git tag
export SPACEMAN_DMM_VERSION=suite-1.7.3
export SPACEMAN_DMM_VERSION=suite-1.8
# Python version for mapmerge and other tools
export PYTHON_VERSION=3.9.0