Skip to content

Lint: Lint for std::for_each_n #15093

Merged
mattklein123 merged 2 commits intoenvoyproxy:mainfrom
KBaichoo:lint-for-each-n
Feb 23, 2021
Merged

Lint: Lint for std::for_each_n #15093
mattklein123 merged 2 commits intoenvoyproxy:mainfrom
KBaichoo:lint-for-each-n

Conversation

@KBaichoo
Copy link
Copy Markdown
Contributor

Signed-off-by: Kevin Baichoo [email protected]

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Commit Message: Lint: Lint for std::for_each_n
Additional Description: It's insufficiently supported in C++17. See #14923
Risk Level: low
Testing: unit test
Docs Changes: NA
Release Notes: NA
Platform Specific Features: NA

Signed-off-by: Kevin Baichoo <[email protected]>
Copy link
Copy Markdown
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the compile issues introduced by #14923

Change looks good if we decide to avoid std::for_each_n for the time being.

@antoniovicente
Copy link
Copy Markdown
Contributor

cc @jrajahalme

Signed-off-by: Kevin Baichoo <[email protected]>
@lizan
Copy link
Copy Markdown
Member

lizan commented Feb 18, 2021

I'm generally not in favor of this kind of limitation because of it is not well supported in older version of stdlib (libstdc++ <= 8). We can bump build requirement if it doesn't cause a lot of churn.

@jrajahalme
Copy link
Copy Markdown
Contributor

@lizan I agree that limiting use of a standardized C++17 feature is not ideal, but for_each_n is available only on the newest libc++. However, I'd like to retain compatibility with GCC on Ubuntu 18.04 for now. GCC due to working cross-compilation toolchain we have for arm64 (I have no idea how to do that on clang), and Ubuntu 18.04 for ability to run the same Envoy binary in Ubuntu 18.04 and 20.04 based images. Unfortunately for_each_n does not work on GCC 7 that is the system compiler for Ubuntu 18.04.

@jrajahalme
Copy link
Copy Markdown
Contributor

To clarify, bumping build requirements is a potential concern for projects building on Envoy, not just Envoy itself. There is already some churn due to Envoy CI apparently using only a bleeding edge clang setup :-)

rgs1 pushed a commit to rgs1/envoy that referenced this pull request Feb 23, 2021
This reverts commit 3f740bc.

Because it breaks builds on RHEL 8 and Ubuntu 18. See:

envoyproxy#15093

Signed-off-by: Raul Gutierrez Segales <[email protected]>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit a50b1c0 into envoyproxy:main Feb 23, 2021
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.

7 participants