Files
Citadel-Station-13-RP/tools/linux_build.py
silicons 5823fb93e7 migrates to github actions + sync tgui to main's, removes a bunch of dead maps and code and reworks how submap loading is done (#2917)
* move phoronlock define

* t

* force rename

* nuke unneeded things

* don't do that

* tgui sync?

* changes

* unit testing module

* backend

* tools update

* aaah

* go and stay go

* path replace

* move everything

* toss out more stuff

* remove

* fine those can stay

* dependencies.sh

* ruin datum move + rename

* level assets why did you guys put the turfs in my atmosphers folder grr

* more moving

* basemap, force stuff

* fix that desync meme

* move more stuff

* move those too

* repath

* get rid of useless initializers

* hacky patchy

* reservations

* alright

* tgui

* changelog example

* checksum

* md5

* errors

* more

* turf empty

* stop

* fix

* bad kwarg

* let's get those in again

* alright

* rid of that

* huh

* newlines

* newlines

* folder

* mood

* woops

* readme

* might as well trim now

* let's go

* fuck it tether isn't being used anyways lol

* ok

* empty files go

* tether is demoted

* sorry but this goes too

* okay

* make that work too

* ok

* wow.

* whew

* Fix

* fixes

* ok

* sigh

* fix

* fix

* aah.

* rust_g logging

* update rust g file

* fix

* funny

* Fix

* map issues

* fix

* initialize hints

* solves some problems

* those too

* ok

* pills

* let's do that.

* hit that too

* runtime

* add that too

* alright

* fix

* fix

* fix

* Fix

* add

* fix

* wildwest, what have they done to you...

* do that too'
git push

* fixes

* fixes

* fixes

* pack this tightly

* let's not have empty files

* sigh

* fix

* FUCK OFF

* fix icon

* rip old mapmerge

* zz

* woo yeah woo yeah

* logging

* fix

* better logs

* GRRRRRR

* last commit??

* awful
2021-04-01 16:07:03 -05:00

96 lines
2.6 KiB
Python

#!/usr/bin/env python
import subprocess
import os
import sys
import argparse
import time
from subprocess import PIPE, STDOUT
null = open("/dev/null", "wb")
def wait(p):
rc = p.wait()
if rc != 0:
p = play("sound/misc/compiler-failure.ogg")
p.wait()
assert p.returncode == 0
sys.exit(rc)
def play(soundfile):
p = subprocess.Popen(["play", soundfile], stdout=null, stderr=null)
assert p.wait() == 0
return p
def stage1():
p = subprocess.Popen("(cd tgui; /bin/bash ./build.sh)", shell=True)
wait(p)
play("sound/misc/compiler-stage1.ogg")
def stage2(map):
if map:
txt = "-M{}".format(map)
else:
txt = ''
args = "bash tools/travis/dm.sh {} vorestation.dme".format(txt)
print(args)
p = subprocess.Popen(args, shell=True)
wait(p)
def stage3(profile_mode=False):
start_time = time.time()
play("sound/misc/compiler-stage2.ogg")
logfile = open('server.log~','w')
p = subprocess.Popen(
"DreamDaemon vorestation.dmb 25001 -trusted",
shell=True, stdout=PIPE, stderr=STDOUT)
try:
while p.returncode is None:
stdout = p.stdout.readline()
if "Initializations complete" in stdout:
play("sound/misc/server-ready.ogg")
time_taken = time.time() - start_time
print("{} seconds taken to fully start".format(time_taken))
if "Map is ready." in stdout:
time_taken = time.time() - start_time
print("{} seconds for initial map loading".format(time_taken))
if profile_mode:
return time_taken
sys.stdout.write(stdout)
sys.stdout.flush()
logfile.write(stdout)
finally:
logfile.flush()
os.fsync(logfile.fileno())
logfile.close()
p.kill()
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-s','---stage',default=1,type=int)
parser.add_argument('--only',action='store_true')
parser.add_argument('-m','--map',type=str)
parser.add_argument('--profile-mode',action='store_true')
args = parser.parse_args()
stage = args.stage
assert stage in (1,2,3)
if stage == 1:
stage1()
if not args.only:
stage = 2
if stage == 2:
stage2(args.map)
if not args.only:
stage = 3
if stage == 3:
value = stage3(profile_mode=args.profile_mode)
with open('profile~', 'a') as f:
f.write("{}\n".format(value))
if __name__=='__main__':
try:
main()
except KeyboardInterrupt:
pass