Bug 82448 - [GTK] generate-gtk-doc doesn't cope with custom build directory
Summary: [GTK] generate-gtk-doc doesn't cope with custom build directory
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-28 04:16 PDT by Philippe Normand
Modified: 2012-03-28 09:33 PDT (History)
1 user (show)

See Also:


Attachments
Patch (7.72 KB, patch)
2012-03-28 04:20 PDT, Philippe Normand
mrobinson: review-
Details | Formatted Diff | Diff
Patch (4.21 KB, patch)
2012-03-28 08:12 PDT, Philippe Normand
mrobinson: review+
mrobinson: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2012-03-28 04:16:58 PDT
I have one product directory per branch. So generate-gtk-doc should use WebKitBuild/brancName/Release or Debug instead of trying almost random directories in WebKitBuild :)
Comment 1 Philippe Normand 2012-03-28 04:20:49 PDT
Created attachment 134263 [details]
Patch
Comment 2 Philippe Normand 2012-03-28 04:21:30 PDT
Carlos can you please test this patch in the distcheck scenario?
Comment 3 Martin Robinson 2012-03-28 07:56:59 PDT
Comment on attachment 134263 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134263&action=review

> Tools/gtk/generate-gtkdoc:-123
> +    build_directory = sys.argv[-1]
>      options = get_common_options().copy()
>      options.update({
>          'module_name' : 'webkitgtk',
>          'doc_dir' : src_path('docs'),
> -        'output_dir' : common.build_path('Documentation', 'webkitgtk'),

This looks like it will pass something crazy (like the command name) if you don't pass an argument for build directory. I think I'd like to keep the logic for understanding the command-line arguments in common.build_path instead of forcing all the code here to pass the build_directory down. 

in common.get_build_path() you could do this:

def get_build_path():
    if len(sys.argv) > 1 and os.path.exists(sys.argv[-1]):
        # Try to use this path as a build directory.

With that change you could avoid all the modifications to this file.
Comment 4 Philippe Normand 2012-03-28 08:12:38 PDT
Created attachment 134299 [details]
Patch
Comment 5 Martin Robinson 2012-03-28 09:03:49 PDT
Comment on attachment 134299 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134299&action=review

> Tools/gtk/common.py:-40
> -    global build_dir
> -    if build_dir:
> -        return build_dir

Why do you no longer cache the build directory here?
Comment 6 Martin Robinson 2012-03-28 09:07:00 PDT
Comment on attachment 134299 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134299&action=review

>> Tools/gtk/common.py:-40
>> -        return build_dir
> 
> Why do you no longer cache the build directory here?

I cannot see a reason why it isn't. The patch looks great, but I think caching the build directory was a nice feature in that it avoided touching the file system every time you needed the build directory. Perhaps you could restore that before landing?
Comment 7 Philippe Normand 2012-03-28 09:13:59 PDT
(In reply to comment #5)
> (From update of attachment 134299 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=134299&action=review
> 
> > Tools/gtk/common.py:-40
> > -    global build_dir
> > -    if build_dir:
> > -        return build_dir
> 
> Why do you no longer cache the build directory here?

Right, I'll restore this part and land, thanks for the review :)
Comment 8 Philippe Normand 2012-03-28 09:33:32 PDT
Committed r112408: <http://trac.webkit.org/changeset/112408>