Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUILD] Fix compilation with Regex being disabled #3276

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

Merged
merged 3 commits into from
Feb 16, 2025
Merged

[BUILD] Fix compilation with Regex being disabled #3276

merged 3 commits into from
Feb 16, 2025

Conversation

kylepl
Copy link
Contributor

@kylepl kylepl commented Feb 15, 2025

Changes

Fix compilation with Regex disabled:

  • It was missing an include for std::any_of
  • Avoid declaring unused constants (at least my LLVM errors out)

Testing

I compiled it locally, and it works - but I assume either not-regex isn't covered by testing, our my use of LLVM 19 in my own code base means it was being more strict.

* It was missing an include for std::any_of
* Avoid declaring unused constants (at least my LLVM errors out)
@kylepl kylepl requested a review from a team as a code owner February 15, 2025 18:30
Copy link

netlify bot commented Feb 15, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit 6857fc7
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/67b16433203cef00089bdf37

Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.96%. Comparing base (2f58e95) to head (6857fc7).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3276   +/-   ##
=======================================
  Coverage   87.96%   87.96%           
=======================================
  Files         205      205           
  Lines        6407     6407           
=======================================
  Hits         5635     5635           
  Misses        772      772           
Files with missing lines Coverage Δ
sdk/src/metrics/instrument_metadata_validator.cc 100.00% <ø> (ø)

@@ -1,6 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#if OPENTELEMETRY_HAVE_WORKING_REGEX
Copy link
Member

Choose a reason for hiding this comment

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

The CI is failing for this - you need to include instrument_metadata_validator.h before using this macro. The changes look good otherwise.

@lalitb
Copy link
Member

lalitb commented Feb 16, 2025

but I assume either not-regex isn't covered by testing

Yes, this was previously tested with GCC 4.8, but it was removed from CI after C++11 support was dropped.

@kylepl
Copy link
Contributor Author

kylepl commented Feb 16, 2025

Thanks for the comment. I've moved where the check is, into the else of the existing part.

@kylepl
Copy link
Contributor Author

kylepl commented Feb 16, 2025

Yes, this was previously tested with GCC 4.8, but it was removed from CI after C++11 support was dropped.

Does this mean... we should just drop support for this? As in, is the condition it is disabled in ever hit? Perhaps just by people like me that disable it. Note that I do it just to save compilation time (a la #2431).

@owent
Copy link
Member

owent commented Feb 16, 2025

Yes, this was previously tested with GCC 4.8, but it was removed from CI after C++11 support was dropped.

Does this mean... we should just drop support for this? As in, is the condition it is disabled in ever hit? Perhaps just by people like me that disable it. Note that I do it just to save compilation time (a la #2431).

I prefer to keep the old implementation because we have some old toolchains in some peoduct environment.I can maintain this toolchain but don't want to have a large patch file.
I'm not sure but in my understanding, just a macro checking
won't significantly increase compile time,template expansion and new header files will cost more.

Copy link
Member

@owent owent left a comment

Choose a reason for hiding this comment

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

LGTM, and thanks.

@lalitb lalitb merged commit 2fdc022 into open-telemetry:main Feb 16, 2025
57 checks passed
@marcalff marcalff changed the title Fix compilation with Regex being disabled [BUILD] Fix compilation with Regex being disabled Mar 27, 2025
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