GNOME Bugzilla – Bug 356499
Support for running commands in specific module paths
Last modified: 2007-05-28 09:07:19 UTC
It would be interesting that JHbuild would help in running commands in specific compilation trees. For example, if you compile gtk+, it would be interesting to add a way to run "make check" or coverage reporting tools inside the tree. As far as I know, there's no way to get the path to the place where a module has been compiled from the command line interface (it's usually the module name, but it does not happen always). A draft of the command would be: jhbuild pathrun <module> <command> <parameters...> And this would go to the directory where the module has been compiled and run the specified command.
Created attachment 72967 [details] [review] Patch to add "pathrun" command to jhbuild This patch adds support for "pathrun" command. It gets the build directory and runs the specified command and parameters in it. I've tested it to run unit tests (make check or similar), generate coverage information of the unit tests, etc.
Created attachment 83651 [details] [review] Patch update We are using this patch in the build brigade be able to run scripts in a jhbuild shell environment when using buildbot. It would be great if we can get it merged upstream. This patch makes the other one obsolete.
Could this be changed to extend cmd_run, adding a --in-builddir=MODULE or similar parameter ?
Will look at this and upload a new patch
Created attachment 88143 [details] [review] Same patch, but extending cmd_run command The same patch, but this time it extends the "run" command, as suggested by Frederic. I'm not an experienced python developer, so maybe this patch is not very elegant... please let me know how I can improve it if that's the case. Btw, I did not use Python's OptionParser for this because the program options can conflict with jhbuild run --in-builddir option, for example: jhbuid run --in-builddir libxml2 ls --color would complain about unrecognized option "--color". If you prefer to use the OptionParser and know a way to make it work in this scenario, let me know.
Ok; I rewrote it to use the option parser; you just have to pass '--' so it knows remaining args are not to be treated; example: $ jhbuild run --in-builddir atk -- ls -l