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

tools: api_booster tool for upgrading Envoy APIs (tool only) #9329

Merged
merged 9 commits into from
Dec 13, 2019

Conversation

htuch
Copy link
Member

@htuch htuch commented Dec 12, 2019

(Tool only split from #9258, to simplify review)

This is a beachhead PR for a Clang Libtooling based workflow that automagically updates Envoy's
source tree to the latest API version for every referenced package. So far, ths tool is only capable
of inferring types and performing header fixups, later PRs will expand this.

Risk level: Low
Testing: Manual cleanup of all headers in source/ test/ and include/, all tests pass.

Part of #8082

This is a beachhead PR for a Clang Libtooling based workflow that automagically updates Envoy's
source tree to the latest API version for every referenced package. So far, ths tool is only capable
of inferring types and performing header fixups, later PRs will expand this.

Risk level: Low
Testing: Manual cleanup of all headers in source/ test/ and include/, all tests pass.

Part of envoyproxy#8082

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
tools/clang_tools/api_booster/main.cc Outdated Show resolved Hide resolved
tools/clang_tools/api_booster/main.cc Outdated Show resolved Hide resolved
tools/api_boost/api_boost.py Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
tools/gen_api_type_database.sh Outdated Show resolved Hide resolved
tools/type_whisperer/BUILD Outdated Show resolved Hide resolved
Signed-off-by: Harvey Tuch <htuch@google.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #9329 was synchronize by htuch.

see: more, trace.

@@ -12,6 +12,10 @@ namespace Config {
namespace {

TEST(ApiTypeOracleTest, All) {
// For proto descriptors only
static_cast<void>(envoy::config::filter::http::ip_tagging::v2::IPTagging::RequestType());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change and the BUILD fixes are not strictly part of the tooling, but they are nop changes to the rest of the tree that are needed to test the tool; they fix missing deps and linking requirements.

Signed-off-by: Harvey Tuch <htuch@google.com>
tools/type_whisperer/api_type_db_test.cc Outdated Show resolved Hide resolved
tools/gen_api_type_database.sh Outdated Show resolved Hide resolved
tools/api_boost/api_boost.py Outdated Show resolved Hide resolved
Signed-off-by: Harvey Tuch <htuch@google.com>
# Figure out where the LLVM include path is. We need to provide this
# explicitly as the api_booster is built inside the Bazel cache and doesn't
# know about this path.
# TODO(htuch): this is fragile and depends on Clang version, should figure out
Copy link
Member

@lizan lizan Dec 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the previous PR, what do we actually include from versioned include?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy+pasting:

If I don't declare this as -isystem, I see:

...clang-9.0/lib/clang/9.0.0/include/mmintrin.h:50:12: error: use of old-style cast [-Werror,-Wold-style-cast]
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);    

since it doesn't recognize these libraries as system libs (and hence subject to relaxation of the warning).

@htuch
Copy link
Member Author

htuch commented Dec 13, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@htuch htuch merged commit b54d1c3 into envoyproxy:master Dec 13, 2019
@htuch htuch deleted the api-booster-tool-only branch December 13, 2019 19:07
htuch added a commit to htuch/envoy that referenced this pull request Dec 13, 2019
This applies the API booster in envoyproxy#9329 to the Envoy tree. So far it just
figures out the correct include headers based on encountered API protos,
more to follow.

Risk level: Low
Testing: bazel test //test/....

Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added a commit that referenced this pull request Dec 15, 2019
This applies the API booster in #9329 to the Envoy tree. So far it just
figures out the correct include headers based on encountered API protos,
more to follow.

Risk level: Low
Testing: bazel test //test/....

Signed-off-by: Harvey Tuch <htuch@google.com>
prakhag1 pushed a commit to prakhag1/envoy that referenced this pull request Jan 3, 2020
…oxy#9329)

This is a beachhead PR for a Clang Libtooling based workflow that automagically updates Envoy's
source tree to the latest API version for every referenced package. So far, ths tool is only capable
of inferring types and performing header fixups, later PRs will expand this.

Risk level: Low
Testing: Manual cleanup of all headers in source/ test/ and include/, all tests pass.

Part of envoyproxy#8082

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Prakhar <prakhar_au@yahoo.com>
prakhag1 pushed a commit to prakhag1/envoy that referenced this pull request Jan 3, 2020
This applies the API booster in envoyproxy#9329 to the Envoy tree. So far it just
figures out the correct include headers based on encountered API protos,
more to follow.

Risk level: Low
Testing: bazel test //test/....

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Prakhar <prakhar_au@yahoo.com>
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.

3 participants