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

enable #include scanning for C++ dep inference #7223

Closed
3 tasks
cosmicexplorer opened this issue Feb 6, 2019 · 2 comments
Closed
3 tasks

enable #include scanning for C++ dep inference #7223

cosmicexplorer opened this issue Feb 6, 2019 · 2 comments

Comments

@cosmicexplorer
Copy link
Contributor

Apparently at google they have enabled scanning #include directives in C/C++ files in bazel to perform dependency inference, but this isn't expected to be open sourced anytime soon (source: a bazel dev crashed a twitter conference once). We would love to be able to perform dep inference in pants's more well-supported languages such as python and scala by scanning import statements, but C/C++ has the benefit (?) that preprocessor directives can be parsed with simple regular expressions, which means it can be done without resorting to a compiler.

Dependency inference in general can be used to avoid typing out deps in BUILD files, which improves correctness, but it also allows for extremely granular virtual targets to be synthesized (single-file, potentially), which means without any effort on the part of the developer we can achieve the minimum invalidation possible upon edits to C/C++ sources.

With #7136 addressed, and especially with almost-magical process execution caching via #7171, this means we can obviate a lot of the need for C++ compilers to be made fast by making use of a powerful build tool, which lets compiler hackers get back to hacking compilers.

  • port the native backend to v2 (port the native backend to v2 #7136)
  • determine an appropriate way to do dep inference in v2 (#???)
  • implement #include scanning and deprecate explicitly-declared dependencies
@stuhood
Copy link
Member

stuhood commented Feb 6, 2019

FTR: the "dep inference" ticket is #6449. It's blocked on #4535.

@Eric-Arellano
Copy link
Contributor

Closing because Pants does not currently support C++ to begin with. If/once we have a C++ backend in Pants 2.0, then this ticket would be relevant to re-open.

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

No branches or pull requests

3 participants