Dunging out
This is an Easy Hack. Potential mentors: @mmeeks
Detailed description and rationale
We have a lot of duplication in Makefile.am around the run: rules to take just two for example:
run: setup-wsd
./coolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
--o:security.capabilities="$(CAPABILITIES)" \
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
--o:ssl.ca_file_path="$(abs_top_srcdir)/etc/ca-chain.cert.pem" \
--o:admin_console.username=admin --o:admin_console.password=admin \
--o:logging.file[@enable]=${OUTPUT_TO_FILE} --o:logging.level=trace \
--o:trace_event[@enable]=true
if ENABLE_DEBUG
run-one: setup-wsd
./coolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
--o:security.capabilities="$(CAPABILITIES)" \
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
--o:ssl.ca_file_path="$(abs_top_srcdir)/etc/ca-chain.cert.pem" \
--o:admin_console.username=admin --o:admin_console.password=admin \
--o:logging.file[@enable]=true --o:logging.level=trace \
--singlekit
endif
All of the common parameters from these coolwsd invocations should be condensed into a single shared variable for all of these parameters to ease maintenance and simplify the script.
Thanks ! =)
WRT https://github.com/CollaboraOnline/online/blob/master/Makefile.am , I have also updated description with coolwsd instead of loolwsd and formatting
Hi @mmeeks, I'm interested in contributing to this issue, please assign me this. Thank you
Hello @h20220025 and sorry for the delayed response. Are you still interested in this?
Hello @mmeeks @pedropintosilva,
I have drafted PR #6482, which aims to condense the common parameters in the Makefile.am. However, I have some concerns about testing it manually. The code looks good, but I would like to ensure that I test it for edge cases.
In addition to the tests I've already performed by running make run and make run-one, everything seems to be fine. However, I want to make sure that the changes do not cause any unintended issues or break other functionalities. Therefore, Can you suggest me way to test it??
Hi Vivekkumar ! thanks for the nice patch; I think there is a lot more sharing with run-callgrind, run-valgring, run-gdb etc. that would be good to cleanup too. Also - I think the logging parameter you didn't share in th ecommon variable is a bug ;-) (the kind that comes from copy/paste) - we should use the substituted ${OUTPUT_TO_FILE} in each case I think =) - please do test with some paths with spaces in them to ensure we got escaping right; otherwise - golden !
@mmeeks Will do it. Thanks! :)