Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First check-in of configuration overhead measurement tool #11511

Closed
wants to merge 16 commits into from

Conversation

gregestren
Copy link
Contributor

i.e. first check-in of Measuring Configuration Overhead.

This just establishes supporting structure. The tool is not yet functional.

Specifically:

  • types.py: defines data structures for "configuration" and "configured target"
  • bazel_api.py: API to translate bazel cquery and bazel config calls into the above data structures
  • bazel_api_test.py: tests
  • ctexplain.py: stump of an entry point

The tests utilize an existing Python test framework for invoking Bazel (//src/test/py/bazel:test_base).

Work towards #10613

tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/bazel_api.py Show resolved Hide resolved
tools/ctexplain/bazel_api.py Show resolved Hide resolved
tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/types.py Outdated Show resolved Hide resolved
tools/ctexplain/types.py Outdated Show resolved Hide resolved
tools/ctexplain/types.py Outdated Show resolved Hide resolved
tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/bazel_api.py Show resolved Hide resolved
tools/ctexplain/bazel_api.py Outdated Show resolved Hide resolved
tools/ctexplain/types.py Outdated Show resolved Hide resolved
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

gregestren added a commit to gregestren/bazel that referenced this pull request Jul 14, 2020
i.e. first check-in of [Measuring Configuration Overhead](https://docs.google.com/document/d/10ZxO2wZdKJATnYBqAm22xT1k5r4Vp6QX96TkqSUIhs0/edit).

This just establishes supporting structure. The tool is not yet functional.

Specifically:
- `types.py`: defines data structures for "configuration" and "configured target"
- `bazel_api.py`: API to translate `bazel cquery` and `bazel config` calls into the above data structures
- `bazel_api_test.py`: tests
- `ctexplain.py`: stump of an entry point

The tests utilize an existing Python test framework for invoking Bazel (`//src/test/py/bazel:test_base`).

Work towards bazelbuild#10613

Closes bazelbuild#11511.

PiperOrigin-RevId: 315479921
Change-Id: I00898a4579e20483c8c4c3f5250afc22ee1e1695
PiperOrigin-RevId: 315479921
Change-Id: I00898a4579e20483c8c4c3f5250afc22ee1e1695
@bazel-io bazel-io closed this in 2323dfe Jul 15, 2020
@gregestren gregestren deleted the ctexplain branch July 15, 2020 19:05
bazel-io pushed a commit that referenced this pull request Aug 25, 2020
#11511 set up basic project structure.  This PR adds minimum working functionality.

Specifically, you can run it with a build command and it reports basic stats on the build's graph.

Example:

```
$ bazel-bin/tools/ctexplain/ctexplain -b "//testapp:foo"
Collecting configured targets for //testapp:foo... done in 0.62 s.

Configurations: 3
Targets: 79
Configured targets: 92 (+16.5% vs. targets)
Targets with multiple configs: 13
```

Notes:
* Changed import structure to prefer module imports over function, class imports (style guide recommendation)
* Set up structure for injecting arbitrary analyses. Each analysis consumes the build's set of configured targets and can output whatever it wants.
* Implemented one basic analysis
* Structured code to make it easy to fork output formatters (e.g. for machine-readable output). But tried not to add speculative inheritance / boilerplate too soon

Context: [Measuring Configuration Overhead](https://docs.google.com/document/d/10ZxO2wZdKJATnYBqAm22xT1k5r4Vp6QX96TkqSUIhs0/edit).
Work towards #10613

Closes #11829.

PiperOrigin-RevId: 328325094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants