xparq / Out_of_Nothing

Versatile entity-based simulation & visualization/gamification framework PROTOTYPE
0 stars 0 forks source link

FIX: Forgot to use `busybox` from the start... #17

Closed xparq closed 1 year ago

xparq commented 1 year ago

...so now I've been hitting the idiotic quirks of the ancient CMD commands (like DEL still not supporting forward slashes properly).

...so now I'll have to rewrite everything for busybox. (Well, OK, not everything, but at least the Makefile1; apart from doing anything new with BB now, of course.)

(BusyBox is magic. We should be using it just for the joy alone, even without any specific use case at all. ;) )


1 OK, also the build script...

xparq commented 1 year ago

Just a motivational excerpt from an interim version of build.cmd, right before I got fed up, and opened this issue (and started migrating to busybox sh):

rem !! CMD is so fkn broken, that I couldn't even set a value with escaped quotes: the
rem !! first ^" was resolved as ^, unlike all the others ^"s, which just disappeared...
rem set "nmake_cmd=nmake /nologo %* ^"prjdir=%sz_prjdir%" ^"src_dir=%sz_src_dir%^" ^"out_dir=%sz_out_dir%^" ^"appname=%sz_appname%^"
rem !! "" is fucked up too, the double ""s still got removed.
rem https://stackoverflow.com/questions/7760545/escape-double-quotes-in-parameter did not help either...

This worked, tho:

rem Oh please... FFS!...:
set "nmake_cmd=nmake /nologo %* """prjdir=%sz_prjdir%""" """src_dir=%sz_src_dir%""" """out_dir=%sz_out_dir%""" """appname=%sz_appname%""""

set "make_cmd_script=%sz_out_dir%/make.cmd"
call :save_nmake_env "%nmake_cmd_script%"

But the command itself didn't! :)

rem OK then, this again fails:
rem %nmake_cmd%
rem ...but not the exact same thing, when called from a batch file:
rem call %nmake_cmd_script%

But the final nail in the coffin was when -- despite all the meticulous quoting chores -- this test to write the make cmd into a file with spaces in its path failed blatantly, in a way as if I did exactly nothing at all to prevent it...:

set "make_cmd_script=%sz_out_dir%/make env.cmd"
call :save_nmake_env "%nmake_cmd_script%"