Open merlinran opened 2 years ago
Make has always seemed pretty hard to follow for me. Are there any alternatives you can think of?
Is it just executing some commands? I am curious if we could achieve much the same results with a python script?
could call it acorn-run.py and mark the execute bit, so instead of calling make simulation we could call acorn-run.py simulation
we could alias it to the command "arun" so we just type:
arun simulatiuon
Or is make really needed? Let me know your thoughts. Thank you!
Some sort of build automation seems useful to, for example, rebuild the docker image automatically before running simulation if any of the requirements.txt
gets changed, or some other guy updating to the latest code would find it fail to run because of missing Python packages, and spend some minutes to figure out why and do the docker build by themselves. We could do the check of timestamp and rebuilding in Unix shell, but that's less structural than a tool dedicated to this, and IMHO shell is messier and harder to debug than Makefile (the errors you encountered when running make
in the other PR are due to differences among shell flavours). If we use Python, there would be tons of os.system
/subprocess.popen
to run the commands and get the output, which seems even more suboptimal.
I chose make
because of its ubiquity - and many developers are more or less familiar with it. An alternative would be https://www.scons.org which is Python-like, but that is yet another domain specific language for most of the people to learn. Same for https://github.com/bazelbuild/bazel and others.
From my experience, Makefile
seldom changes once gets established, and though the syntax has many dark corners I myself would frustrate too, the basic rules are simple. Actually the majority of the Makefile
are plain shell scripts. I'll comment on the Makefile
features. Lmk if they make sense to you and if not, we can discuss on the alternatives.
It is based off https://github.com/Twisted-Fields/acorn-precision-farming-rover/pull/12 and the change specific to this PR is in a single commit https://github.com/Twisted-Fields/acorn-precision-farming-rover/commit/541629ae9eacfe52568334ede8a3e94a2fd3200d