mcandre / rez

C/C++ task runner
Other
3 stars 1 forks source link

refine rez into strictly a C++ task runner #52

Closed mcandre closed 2 years ago

mcandre commented 2 years ago

Since rez itself is written in C++ 17, there is an implicit assumption that the programmer has access to a modern C++ compiler.

While we could technically support pure C tasks (esp. tasks written outside of rez.{c,cpp} in separate .h, .c files), there is additional complexity involved in getting even rez.c to work in a portable fashion. And portability of the task runner definition is a primary goal for this project.

Perhaps we explicitly declare rez a by-and-for C++ project, and begin researching a pure C task runner. Obviously will involve a lot more code than with C++.

libuv can provide a reasonably portable replacement for most of the C++ filesystem library. Although its usage on the programmer's computer when building the task runner .c file will be more complicated, due to the need to integrate third party library include and linker flags.

Note that libuv appears to be missing a std::filesystem::remove_all equivalent.

https://github.com/libuv/libuv/discussions/3529

Relates to #31.

mcandre commented 2 years ago

For recursive deletion, POSIX can do most of the heavy lifting.

https://stackoverflow.com/a/5467788

Still need to test that on directory and non-directory file paths.

Obviously need to check what COMSPEC Windows would do.

mcandre commented 2 years ago

No need for this at the moment.

Managed to demonstrate a reasonably portable, pure C task definition.

The only reason to write a separate tool would be for the super niche users who won't run the precompiled rez binary on their system and won't use a C++ compiler to build rez itself. As for the rez.c task definition file, a C++ compiler is not required.