After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 356499 - Support for running commands in specific module paths
Support for running commands in specific module paths
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Iago Toral
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2006-09-18 09:23 UTC by Jose Dapena Paz
Modified: 2007-05-28 09:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add "pathrun" command to jhbuild (2.97 KB, patch)
2006-09-18 09:25 UTC, Jose Dapena Paz
none Details | Review
Patch update (2.14 KB, patch)
2007-03-01 16:19 UTC, Iago Toral
reviewed Details | Review
Same patch, but extending cmd_run command (1.63 KB, patch)
2007-05-14 07:49 UTC, Iago Toral
none Details | Review

Description Jose Dapena Paz 2006-09-18 09:23:37 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.
Comment 1 Jose Dapena Paz 2006-09-18 09:25:55 UTC
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.
Comment 2 Iago Toral 2007-03-01 16:19:26 UTC
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.
Comment 3 Frederic Peters 2007-03-01 17:01:49 UTC
Could this be changed to extend cmd_run, adding a --in-builddir=MODULE or similar
parameter ?
Comment 4 Iago Toral 2007-03-09 09:45:27 UTC
Will look at this and upload a new patch
Comment 5 Iago Toral 2007-05-14 07:49:19 UTC
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.
Comment 6 Frederic Peters 2007-05-28 09:07:19 UTC
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