Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the config system once again this time for good #53

Open
ChillerDragon opened this issue Oct 6, 2022 · 2 comments
Open

Refactor the config system once again this time for good #53

ChillerDragon opened this issue Oct 6, 2022 · 2 comments

Comments

@ChillerDragon
Copy link
Member

the server.cnf is basically a dotfile and thus native bash ... duh

do not reimplement that in bash. Just source it. Then the config vars in the code also match the config vars in the file that would be cool too for fast lookup. And it allows for things like:

unix_user=teeworlds
git_root=/home/$unix_user/git

^ which would help a lot with maintenance!

It should still keep the value checks tho. No invalid cfg assignments and no invalid values.

@ChillerDragon
Copy link
Member Author

ChillerDragon commented Oct 7, 2022

custom build flags and environments are currently broken.

gotta do the array magic here

local pointer_cmake_flags="$5" # has to be name of an array variable
local pointer_cmake_flags_arr="$5[@]"
local arg_cmake_flags=("${!pointer_cmake_flags_arr}") # parameter expansion

and also somehow custom environemnts like those break the build:

# env_build=CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer"
# env_runtime=UBSAN_OPTIONS=log_path=./logs/SAN:print_stacktrace=1:halt_on_errors=0 ASAN_OPTIONS=log_path=./logs/SAN:print_stacktrace=1:check_initialization_order=1:detect_leaks=1:halt_on_errors=0
env_build=CXXFLAGS=-pg CFLAGS=-pg LDFLAGS=-rdynamic

@ChillerDragon
Copy link
Member Author

I would also love to see array options

conf_var=(value1 value2 value3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant