> > Some of my limited knowledge: > > tup executes :-rules with execle (see pat's reference). The obvious thing > to me would be to wrap "string" commands in '"/bin/sh", "-e", "-c", "cmd"' > (what's executed now) and store the array structure in the tup db instead. > I'm not sure how easy that would be, e.g. storing arrays in sqlite3, >
SQLite doesn't support arrays natively, but it offers blobs [the FAQ <https://www.sqlite.org/faq.html#q2>]. Tup could store the arrays of arguments with some sort of serialization (e.g. 16 bits for the number of arguments; and, then, 16 bits for each argument's size). > but it would allow an arbitrary array of strings to be called instead. > This would give up the benefit of all sh functionality > A shell could still be invoked explicitly ("bash -c …"). This is what I do, in fact, because I don't want to unadvertedly rely on non-guaranteed shell features. > […] path lookup also comes to mind [upon further look it looks like execle > doesn't do path lookup, execlp does, but there's no execlpe except on > nonstandard linux implementations]) > Why would this give up path lookup? If commands were stored as arrays, Tup could still make use of the execle wrappers or the shell to do path lookup on its behalf. Well, if it used the shell it would have to join the array elements and quote if necessary (which would require either that Tup knew of the shell's quoting rules, which is undesirable, or that it assumed a set of characters to be escaped and that double quotes work everywhere, which isn't desirable either). > but it would allow an api for lua with an array of arguments. It would > also allow for a future backwards incompatible change that would have tup > parse and tokenize tupfile commands instead of just passing the strings to > sh, which could provide extra platform independence. > As I said, making Tup tokenize commands itself doesn't seem an easy task, even if promising. > I was unaware of the different windows call, but it's unsurprising. I'm > not sure how this potential change would affect the windows call. I > generally side with Pat that it seems like you should be able to write the > lua platform independently if you need to, and that should probably be > enough. > For better, that's for sure! I have to use Windows and cmd.exe is a PITA, but one must take it into account in the current situation. I would much rather tokenize myself with Lua (in fact, I already work with argument tables; I have to join the strings to pass them to Tup). -- -- tup-users mailing list email: [email protected] unsubscribe: [email protected] options: http://groups.google.com/group/tup-users?hl=en --- You received this message because you are subscribed to the Google Groups "tup-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
