Skip to content

Conversation

@eminence
Copy link
Member

@eminence eminence commented Dec 3, 2025

std::shared_ptr::unique() is deprecated in C++17 and removed in C++20.

The CI builds on macos fail because of this

https://en.cppreference.com/w/cpp/memory/shared_ptr/use_count.html

@eminence
Copy link
Member Author

eminence commented Dec 3, 2025

The change fixed one error, but then exposed another one. I don't have a macos machine, so I'm not sure how much dev I'm going to do on this

std::shared_ptr::unique() is deprecated in C++17 and removed in C++20.

The CI builds on macos fail because of this
On macos, protobuf depends on abseil, which doesn't build cleanly
with the -Werror and -pedantic options we use in CI.  However this
is a 3rd party library, so these errors aren't useful for us. This
is a bit of a hack, but it changes the protobuf include paths to
be "system" paths (with -isystem), which tells the compiler to
ignore them for the purposes of pedantic warning checking.
@eminence eminence changed the title Fix build on macos Fix CI build Dec 6, 2025
@eminence
Copy link
Member Author

eminence commented Dec 6, 2025

I took a different approach for the macos builds: While there was one code change in our code base, the vast majority of the build errors was in the 3rd-party abseil library (a dependency of protobuf). While it supports C++17, it doesn't build cleanly with our -pedantic -Wall -Werror settings. So I did a little hack to replace -I/opt/homebrew/... with -isystem /opt/homebrew/... which tells the compiler that these are system libraries and that it shouldn't apply the pedantic error checks to them.

On the linux side, I dropped ubuntu 20.04 from CI (which is 5 years old and no longer supported by github actions) and added ubuntu 24.04 (the latest LTS version at the time of this writing)

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.

1 participant