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

[build] Fix Gradle build on macOS 11.0 Big Sur #2656

Merged
merged 1 commit into from
Aug 30, 2020

Conversation

prateekma
Copy link
Member

The beta of macOS 11.0 Big Sur comes with AppleClang 12.0, which catches some more warnings with C++ code when building. Because -Werror is turned on, this inevitably leads to build failures. There were three main build failures that I've categorized below:

  • wpiutil - tautological-overlap-compare

  • opencv - c11-extensions

    • The build log for this type of error can be found here: https://gradle.com/s/4bndkaxghnipk
    • The fix was to compile with Wno-error=c11-extensions on macOS. I had to add this everywhere that OpenCV headers were included.
  • wpilibOldCommands - range-loop-analysis

    • The error was as follows (fixed by replacing const auto& with const auto:
wpi::SmallPtrSetImpl<frc::Subsystem *>' does not return a reference [-Werror,-Wrange-loop-analysis]
    for (const auto& requirement : requirements) {
                     ^
/Users/prateekma/Documents/Dev/allwpilib/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp:235:10: note: use non-reference type 'frc::Subsystem *'
    for (const auto& requirement : requirements) {
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

This was the build log after everything was fixed: https://gradle.com/s/hl3d6oryvnzzq

@ThadHouse
Copy link
Member

That OpenCV error is actually a problem. Fixing it here won't fix user code. Can you check if Osx Catalina allows that warning disable? If so, we'll need to add that to native-utils, here won't fix it.

@prateekma
Copy link
Member Author

prateekma commented Aug 25, 2020

@ThadHouse Opened a PR to nativeutils here: wpilibsuite/native-utils#51
Once that is merged and a new version is released, I can bump the nativeutils version in this PR and revert the changes related to that warning.

@prateekma prateekma force-pushed the apple-clang-12 branch 2 times, most recently from 36baa0e to 89f901a Compare August 27, 2020 18:37
@prateekma
Copy link
Member Author

@PeterJohnson I just used uint64_t and int64_t since the function that's calling these new templated methods is also on templated on NumberType being either uint64_t or int64_t and I couldn't find a definition for number_unsigned_t and number_integer_t anywhere.

@prateekma
Copy link
Member Author

@ThadHouse Updated this PR to use latest nativeutils and everything is building fine on macOS 11

@ThadHouse
Copy link
Member

We're going to need to merge #2592 first, as its got some other changes needed for new native utils.

@PeterJohnson PeterJohnson merged commit 4162880 into wpilibsuite:master Aug 30, 2020
@prateekma prateekma deleted the apple-clang-12 branch August 30, 2020 03:36
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