I generally want my tup :-rules to be run in bash with `set -o pipefail` 
enabled. I could add this to every single rule but that's verbose and error 
prone. Someone on stackoverflow recommended I try doing this with shared 
library interposition, which seemed like it might work. My hypothesis at 
the time was that the commands were executed using glibc's `system` call. 
That seems to be false, but spending some time perusing the codebase, I 
couldn't actually find where the commands were executed. It doesn't help 
that I'm not very familiar with fuse or pthread. This leaves me with a few 
questions:

   - Is shared library interposition a viable root to accomplish this? If 
   the commands are executed almost directly by a call to some shared library 
   this seems like it could work, wouldn't be too hard, and wouldn't be 
   mandatory, or require me (or anyone else) to patch and recompile tup source.
   - If it is viable can someone point me to the appropriate place to look 
   for where to do the intercept? In addition to reading relevant pieces of 
   the code (or so I thought), I also tried tracing command execution with 
   ltrace, but it seemed to interfere with fuse, and I couldn't manage to get 
   fuse running with ltrace active.
   - If it's not viable, is there a better method to accomplish this that 
   is relatively trivial (on the order of writing a simple interposer)?
   - If none of these, is there a potentially better way to improve tup to 
   allow this? I'm open to contributing a pull request if there's a relevant 
   piece to write. It seems like maybe with the lua api you could have a 
   function that arbitrarily modifies every command before it's executed, but 
   then you'd have to fetch back to the lua api from main tup which seems like 
   a pain and potentially slow. There could be a specific flag to do 
   specifically this (e.g. wrap every command in "bash -c '<command with 
   escaped apostrophes>'") but that seems a little hard coded and less 
   portable. I'm open to other suggestions.

Thanks,
Erik

-- 
-- 
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.

Reply via email to