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

Fix win32 breakage 18 dec #9399

Merged
merged 7 commits into from
Dec 20, 2019
Merged

Fix win32 breakage 18 dec #9399

merged 7 commits into from
Dec 20, 2019

Conversation

wrowe
Copy link
Contributor

@wrowe wrowe commented Dec 18, 2019

Description:
This corrects the newest breakage on the Windows platform introduced in December.

Risk Level: Low
Testing: Local on Windows msvc and Linux gcc
Docs Changes: n/a
Release Notes: n/a

wrowe and others added 3 commits December 18, 2019 11:32
- gcc and clang may handle this but msvc does not
- see section 16.3/11 of the standard

Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]>
On MSVC we cannot derive from TypedMetadataFactory::TypedMetadataFactory
as it remains too abstract, and didn't have base class methods name or
parse.

Signed-off-by: Sunjay Bhatia <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]>
This restores master to passing the validation

Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]>
jmarantz
jmarantz previously approved these changes Dec 19, 2019
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

lgtm modulo minor comments, which can be addressed in your senior approver round.

@@ -60,7 +60,7 @@ class TypedMetadataTest : public testing::Test {

struct Bar : public TypedMetadata::Object {};

class FooFactory : public TypedMetadataFactory::TypedMetadataFactory {
class FooFactory : public Envoy::Config::TypedMetadataFactory {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? It seems lexically obvious we are in a namespace where TypedMetadataFactory should be usable without qualification. If this cannot work I wonder what other things will fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From this commit log;

TypedMetadataFactory::TypedMetadataFactory remains too abstract, and didn't have base class methods name or parse.

We are quite confused as well, this is the error output of the original source;

ERROR: C:/workspace/envoy/test/common/config/BUILD:261:1: C++ compilation of rule '//test/common/config:metadata_test_lib_internal_only' failed (Exit 2)
test/common/config/metadata_test.cc(63): error C2516: 'Envoy::Config::TypedMetadataFactory::{ctor}': is not a legal base class
test/common/config/metadata_test.cc(65): error C3668: 'Envoy::Config::`anonymous-namespace'::TypedMetadataTest::FooFactory::name': method with override specifier 'override' did not override any base class methods
test/common/config/metadata_test.cc(68): error C3668: 'Envoy::Config::`anonymous-namespace'::TypedMetadataTest::FooFactory::parse': method with override specifier 'override' did not override any base class methods
test/common/config/metadata_test.cc(54): error C2664: 'Envoy::Registry::InjectFactory<Envoy::Config::TypedMetadataFactory>::InjectFactory(const Envoy::Registry::InjectFactory<Envoy::Config::TypedMetadataFactory> &)': cannot convert argument 1 from 'Envoy::Config::`anonymous-namespace'::TypedMetadataTest::FooFactory' to 'Base &'
        with
        [
            Base=Envoy::Config::TypedMetadataFactory
        ]
.\test/test_common/registry.h(17): note: see declaration of 'Envoy::Registry::InjectFactory<Envoy::Config::TypedMetadataFactory>::InjectFactory'

Things that are confusing, why promote TypedMetadataFactory:: to Envoy::Config:: in these contexts? Why the anon namespace? Suggestions and observations welcome.

Copy link
Member

Choose a reason for hiding this comment

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

Does it work if you just extend TypedMetadataFactory instead of TypedMetadataFactory::TypedMetadataFactory? The latter seems to be nonsense, since there's no TypedMetadataFactory namespace in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zuercher agreed, that was the issue. Will push the fix first thing Friday.

test/common/common/mem_block_builder_test.cc Outdated Show resolved Hide resolved
@jmarantz
Copy link
Contributor

@zuercher for senior maintainer approval.

Signed-off-by: Sunjay Bhatia <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]>
@@ -112,7 +112,7 @@ class ApiBooster : public clang::ast_matchers::MatchFinder::MatchCallback,
return true;
}

// Visitor callback for end of a compiation unit.
// Visitor callback for end of a compilation unit.
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove "compiation" from the dictionary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not on our fork. Will have to merge to master first.

@@ -161,7 +161,7 @@ class ApiBooster : public clang::ast_matchers::MatchFinder::MatchCallback,
// Die hard if we don't have a useful proto type for something that looks
// like an API type(modulo a short whitelist).
std::cerr << "Unknown API type: " << proto_type_name << std::endl;
// TODO(htuch): mabye there is a nicer way to terminate AST traversal?
// TODO(htuch): maybe there is a nicer way to terminate AST traversal?
Copy link
Member

Choose a reason for hiding this comment

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

Likewise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd suggest you might be better off tracking the commit that added these, and work backwards to correct them (these are simply files that trip up verify on our roll-up of work, we didn't look for every misspelling.) These are only the few that we found, this was obviously pushed no-verify, and the spelling words added after the fact.

(see: [https://github.com//pull/9241] )

Add missing legit word hackery

Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]>
@wrowe
Copy link
Contributor Author

wrowe commented Dec 20, 2019

/retest

@repokitteh-read-only
Copy link

🤷‍♀️ nothing to rebuild.

🐱

Caused by: a #9399 (comment) was created by @wrowe.

see: more, trace.

@wrowe
Copy link
Contributor Author

wrowe commented Dec 20, 2019

The OS/X failure to grab bazelisk-darwin-amd64 is unrelated to this commit, can you re-review this PR please, @zuercher?

Copy link
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

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

Thanks!

@zuercher zuercher merged commit 411a953 into envoyproxy:master Dec 20, 2019
@wrowe wrowe deleted the fix-win32-breakage-18-dec branch December 20, 2019 20:04
@sunjayBhatia sunjayBhatia mentioned this pull request Dec 20, 2019
prakhag1 pushed a commit to prakhag1/envoy that referenced this pull request Jan 3, 2020
This corrects the newest breakage on the Windows platform introduced in December.

Risk Level: Low
Testing: Local on Windows msvc and Linux gcc
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]>
Signed-off-by: Prakhar <[email protected]>
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.

4 participants