Skip to content

Conversation

@sean7218
Copy link
Contributor

@sean7218 sean7218 commented Jul 16, 2025

Add Protobuf Definitions and BazelProtobufBindings for bazel aquery output proto format

  • Introduced analysis_v2.proto to define Protobuf messages for aquery data, including module information, rule definitions, and provider details.
  • Created a README.md file for the Action Parser, outlining setup instructions and usage for generating Swift bindings from Protobuf definitions.
  • Implemented unit tests in BazelProtobufBindingsTests.swift to validate the parsing of action graph data from Protobuf output, including tests for compiler arguments and action targets.
  • Added sample Protobuf data file actions.pb for testing purposes.

- Introduced `analysis_v2.proto` to define Protobuf messages for aquery data, including module information, rule definitions, and provider details.
- Created a README.md file for the Action Parser, outlining setup instructions and usage for generating Swift bindings from Protobuf definitions.
- Implemented unit tests in `ActionParserTests.swift` to validate the parsing of action graph data from Protobuf output, including tests for compiler arguments and action targets.
- Added sample Protobuf data file `actions.pb` for testing purposes.
@sean7218 sean7218 requested a review from a team as a code owner July 16, 2025 02:07
@rockbruno
Copy link
Member

Awesome stuff! I need to first finish the refactors we were doing, but at a quick glance it looks exactly what we need. Will be back to this soon

@rockbruno
Copy link
Member

@sean7218 Is it possible to filter this to only include the exact things we're interested in (like the compiler arguments section of swiftcompile/objccompile) or will we always have to ship the entire spec with the tool?

@sean7218
Copy link
Contributor Author

Regarding action parser with proto, the aquery output is filtered with SwiftCompile|ObjcCompile, the parsing will only be done for these actions, I don’t know if there is a way to filter down even more such that only the compiler flags remains

sean7218 added 3 commits July 17, 2025 07:48
  1. remove build.proto and build.pb.swift
  2. remove stardoc_output.proto and stardoc_output.pb.swift
  3. use Target defined in analysis_v2.proto instead of blaze_query.Target
@sean7218 sean7218 changed the title ActionParser for proto format BazelProtobufBindings for Parsing ActionGraph Jul 17, 2025
@rockbruno rockbruno merged commit 95915f2 into spotify:main Jul 17, 2025
1 check passed
josh-arnold-1 pushed a commit to josh-arnold-1/sourcekit-bazel-bsp that referenced this pull request Jul 17, 2025
* Add Protobuf Definitions and Action Parser Tests

- Introduced `analysis_v2.proto` to define Protobuf messages for aquery data, including module information, rule definitions, and provider details.
- Created a README.md file for the Action Parser, outlining setup instructions and usage for generating Swift bindings from Protobuf definitions.
- Implemented unit tests in `ActionParserTests.swift` to validate the parsing of action graph data from Protobuf output, including tests for compiler arguments and action targets.
- Added sample Protobuf data file `actions.pb` for testing purposes.

* Slim down the binding files generated

  1. remove build.proto and build.pb.swift
  2. remove stardoc_output.proto and stardoc_output.pb.swift
  3. use Target defined in analysis_v2.proto instead of blaze_query.Target

* updated NOTICE for swift-protobuf

* rename ActionParser to BazelProtobufBindings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants