Skip to content

ARROW-4336: [C++] Change default build type to RELEASE - #3464

Closed
fsaintjacques wants to merge 8 commits into
apache:masterfrom
fsaintjacques:ARROW-4336-cmake-warning-default
Closed

fsaintjacques wants to merge 8 commits into
apache:masterfrom
fsaintjacques:ARROW-4336-cmake-warning-default

Conversation

@fsaintjacques

@fsaintjacques fsaintjacques commented Jan 23, 2019 •

Copy link
Copy Markdown
Contributor

The first goal of this change is two fold, to provide a fast default of users with the least amount of compiler warnings. The second goal of this change is to default the BUILD_WARNING_LEVEL to CHECKIN, if the release type is not RELEASE, minimizing the back-and-forth with CI from the developer perspective.

@wesm

wesm commented Jan 23, 2019

Copy link
Copy Markdown
Member

I'm kind of -0.5 on this. Having this on by default is going to mean more broken builds out of the box

@wesm

wesm commented Jan 23, 2019

Copy link
Copy Markdown
Member

@fsaintjacques can you split the code changes that fix EVERYTHING warnings into a separate patch? I think it makes most sense to decouple those changes from the discussion about what should be the default arguments

In general we have been changing the defaults steadily away from contributor-optimized defaults (like ARROW_BUILD_TESTS used to be "on" by default) toward user-optimized defaults. This reflects that many more people are using the project as a library instead of contributing to it.

@xhochy

xhochy commented Jan 24, 2019

Copy link
Copy Markdown
Member

Having this as a default will annoy a lot of packagers, thus I'm also -0.5. We should have this CMake option in the developer docs as part of the default cmake calls.

@fsaintjacques

Copy link
Copy Markdown
Contributor Author

I'll separate the warning fixes into another patch.

Counter-proposal that could satisfy everyone. Make CMAKE_BUILD_TYPE=RELEASE the default? This will make it user-optimized by default while preserving the warning level to minimum (and no -werror). As soon as someone switches to DEBUG, it'll also go into CHECKIN unless specified otherwise.

@xhochy

xhochy commented Jan 24, 2019

Copy link
Copy Markdown
Member

Make CMAKE_BUILD_TYPE=RELEASE the default?

Yes, this is the right direction to make it user-friendly.

@wesm

wesm commented Jan 24, 2019

Copy link
Copy Markdown
Member

Some of the warnings with CHECKIN mode are a bit pedantic, so even if there is no -Werror there is risk that developer-users will think that "something is wrong". I'm in favor of changing default build type to release in any case

@fsaintjacques
fsaintjacques force-pushed the ARROW-4336-cmake-warning-default branch from 35da786 to 1d727d8 Compare January 24, 2019 18:56
@fsaintjacques fsaintjacques changed the title ARROW-4336: Change the default BUILD_WARNING_LEVEL to CHECKIN ARROW-4336: [C++] Change default build type to RELEASE Jan 24, 2019
@fsaintjacques

Copy link
Copy Markdown
Contributor Author

@wesm I think you misunderstood. In this last revision:

  • CMAKE_BUILD_TYPE defaults to RELEASE
  • BUILD_WARNING_LEVEL default is PRODUCTION if in release, otherwise defaults to CHECKIN.

I can also remove all of this since I've separated the CHECKIN warning in a different PR.

@wesm

wesm commented Jan 24, 2019

Copy link
Copy Markdown
Member

Oh I see. So the default warning level is dependent on the build type. That's fine by me

@wesm wesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@fsaintjacques
fsaintjacques force-pushed the ARROW-4336-cmake-warning-default branch from 1d727d8 to a5bf0a8 Compare January 25, 2019 19:12

@xhochy xhochy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, this looks good but sadly it catches some warnings on Windows so that the build fails again.

@fsaintjacques

Copy link
Copy Markdown
Contributor Author

AppVeyor was atrociously slow yesterday, I saw the failure only in the evening :(

@wesm

wesm commented Jan 27, 2019

Copy link
Copy Markdown
Member

@kou are there any instructions about setting up a local development environment for mingw 32- and 64-bit? I can help with debugging and fixing such issues if I can set myself up properly

@wesm

wesm commented Jan 27, 2019

Copy link
Copy Markdown
Member

@fsaintjacques If you enable Appveyor on your fork you can get more timely builds when you're debugging something

@kou

kou commented Jan 28, 2019

Copy link
Copy Markdown
Member

@wesm #3505 isn't completed yet but it will help you.
You can't use -DCMAKE_BUILD_TYPE=debug for now. We need to use -DCMAKE_BUILD_TYPE=release. See
#3503 for details.

@kou

kou commented Jan 28, 2019

Copy link
Copy Markdown
Member

I use PowerShell terminal not MSYS2 terminal on local. Because it's similar environment to AppVeyor environment.

Comment thread python/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change doesn't affect MinGW build. Because it's C++ build not Python build.

@fsaintjacques fsaintjacques Jan 29, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bad change that went in while trying to figure out the issue. Removed.

The goal of this change is to minimize the time waiting at CI for
any warning errors. The default was PRODUCTION.

This also does a minor cleanup of some C++ files such that compilation
succeeds in EVERYTHING compile mode.
@fsaintjacques
fsaintjacques force-pushed the ARROW-4336-cmake-warning-default branch from 0ac1da8 to 6741f8e Compare January 29, 2019 01:34

@wesm wesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The build documentation in many places is made out of date as the result of this patch. I'll triage cpp/README.md and merge this. I volunteered to migrate the README to sphinx so I can review the build type options further when I do that

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