-
Notifications
You must be signed in to change notification settings - Fork 6
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
satellite #220
Comments
First, browse available scripting tools and task runners.
Note that WSL does not offer sh as a reachable command from Command Prompt or PowerShell terminal sessions.
Lua(Rocks) is a reasonably flexible, lean, fast, C/C++ interoperable language suitable for use as a basis for implementing a task runner system for C/C++ projects. Lua(Rocks) has overall good support for a variety of platforms. However, Lua(Rocks) may not necessarily have solid, first party, first tier support for some of the fringe platforms, suchas AIX, HP/UX, MirOS, OS/2 Warp, FreeDOS, MS-DOS, Android, iOS, and so on. Some platforms may not have a full, stable, modern LuaRocks release available. Some platforms may not even have a C++ compiler, or a C99 compiler. A task runner designed for intentely cross-platform use when developing software in a sea of Windows and UNIX build hosts, would be better served with a task runner built in and for C89. In the interest of not reinventing the wheel, we could begin by evaluating Lua build systems, sometimes known as build tools, sometimes known as task runners, before embarking on a pure C/C++ task runner. Notably, Lua's platform support is comparable to cmake; If a platform can't build and run cmake, then it's already going to be difficult enough to manage C/C++ projects, nevermind the choice of task runner. LuaRocks added support for distinguishing between packages required at runtime ( lenv ( https://github.com/mah0x211/lenv ) or luaver ( https://github.com/DhavalKapil/luaver ) may be able to assist with setting up Lua(Rocks) versions. luaver was last updated in 2017, may break with newer Lua(Rocks) versions. Note that lenv uses binaries instead of shell scripts. This limits platform support. Windows and FreeBSD are not currently supported by the binary releases.
Any task runner whose tasks are written directly in C/C++ benefits from a reduced software stack, which can be more easily maintained and runs more efficiently compared to using secondary Python/Ruby/Lua/etc. languages. On the other hand, C/C++ are notorious for the sheer amount of boilerplate involved in getting anything done. We have many tradeoffs to make when deciding on a task runner for C/C++ projects. Note that (POSIX) libc and (C++17) stdlibc++ have limited support for portable file system API functionality. As a first pass, a pure by-and-for C task runner would suffice for C++ projects as well. We could generalize the design just enough to search for the root task in a C++ well known source file path, e.g. "tasks.cpp", and then fallback to "tasks.c". With the CXX and CC environment variables allowing for the user to flexibly work with Clang++, Clang, g++, gcc, and/or MSVC. No compiler toolchain vendor lock. And even mix and match with some projects that support multiple toolchains, like swiper. Note that cmake and vcvarsall.bat manage MSVC environment variable loading. Any flexible C/C++ task runner that offers integration with the MSVC toolchain, will need a way to have the same environment variables loaded. For Vagrant-automated builds, this is trivial. For more common, interactive manual builds on a Command Prompt or PowerShell terminal session, this is far more annoying. We could reverse engineer how cmake obtains these variables, once. But that is likely to break with future versions of MSVC. Maybe there is a way to configure PowerShell to automatically load vsvarsall.bat in every terminal session. Ideally this includes noninteractive terminal sessions as well. For interactive PowerShell sessions, there is. And it's gross. https://superuser.com/a/886960/5142 What MSVC really needs is a direnv equivalent that can integrate with that system, allowing developers to specify with a CWD text file which MSVC version to load, on a per-project basis. To the best of my knowledge,
cmake offers raw, uninterpreted shell commands (in many cases non-portable), and invoking shell scripts (fragile), and running plugins (cumbersome for writing many arbitrary tasks quickly). cmake can, however, build executables from ordinary C/C++ source files, which behave as the desired tasks. The overall workflow, for example, to solve the pain point of cmake's inability to easily remove all of its own junk files, would look like: $ cmake .
$ cmake build . --target build-tasks
$ cmake build . --target super-clean A bit cumbersome, but that would work. Oh, and unfortunately the cmake use there as a task runner, would not be portable for the significant portion of C/C++ projects that don't use cmake as their build tool. I've never liked how long cmake task commands are, by character count. Nor the divergent CLI syntax between cmake proper and ctest. Would prefer to wrap those. Without depending on (subjective, flaky, non-Windows, tty) shell aliases.
autotools on Windows requires a Cygwin-style environment, such as WSL, Cygwin, MinGW, MSYS(Git), Git Bash, or Strawberry Perl. autotools likely lacks support for MSVC toolchains. |
conan recently improved support for clang-cl. We can reevaluate that for swiper and tonixxx. Possibility of dropping MSVC support altogether, which would simplify any non-cmake-based task runner implementation. |
rez |
Orbit above the build tool and automate more auxilliary build tasks in a platform-independent way.
The text was updated successfully, but these errors were encountered: