[Webkit-unassigned] [Bug 235686] Generate compile_commands.json on macOS Builds

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 21 09:45:37 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=235686

--- Comment #35 from Elliott Williams <emw at apple.com> ---
Comment on attachment 452685
  --> https://bugs.webkit.org/attachment.cgi?id=452685
patch

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

Looks great! r=me after this scripting change:

> Tools/Scripts/generate-compile-commands:48
> +# Check compile_commands folder exists
> +compile_commands_dir = sys.argv[1] + "/compile_commands/"
> +
> +if not os.path.exists(compile_commands_dir):
> +    print("Please specify the build directory with compile_commands.")
> +    print("Example: generate-compile-commands WebKitBuild/Release")
> +    exit(1)

This will crash if the user doesn't pass argv[1]. Since this is a python script now, can we use ArgumentParser? This will also give us `-h|--help` flags for free :)

Xcode calls this directory BUILT_PRODUCTS_DIR. Can we name it the same here for consistency?

```python
import argparse
parser = argparse.ArgumentParser()
parser.add('built_products_dir', help='path to directory containing generated compile commands (ex: WebKitBuild/Release)')
opts = parser.parse()

# use it:
compile_commands_dir = opts.built_products_dir + '/compile_commands/'
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220221/9431df67/attachment-0001.htm>


More information about the webkit-unassigned mailing list