Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

NDEBUG not defined for Release builds #6887

Closed

Description

@jfirebaugh

The stack trace from #6883 indicates that the MBGL_CHECK_ERROR macro was compiled to the error-checking variant in a release build. Most likely, this means that release builds are neglecting to define NDEBUG, and therefore including code intended only for debug builds. This includes GL error checking, debug level logging, and asserts.

@kkaefer, is this something that may have regressed in the switch to cmake?

Activity

  1. added this to the ios-v3.4.0 milestone on Nov 3, 2016
  2. kkaefer commented on Nov 3, 2016

    @kkaefer
    Member

    Nope, Release builds are still built with NDEBUG. However, it seems like f41546e changed the default BUILDTYPE for make ipackage to Debug. Apparently this was in response to 9732f02 defaulting to Debug in the rest of the code as well.

    @friedbunny @incanus @1ec5 did you accidentally build iOS packages without BUILDTYPE=Release?

  3. kkaefer commented on Nov 3, 2016

    @kkaefer
    Member

    We could add something like this:

    diff --git a/src/mbgl/gl/debugging.hpp b/src/mbgl/gl/debugging.hpp
    index 42c31cc..1f1cf09 100644
    --- a/src/mbgl/gl/debugging.hpp
    +++ b/src/mbgl/gl/debugging.hpp
    @@ -2,6 +2,8 @@
    
     #ifndef NDEBUG
    
    +#pragma message "WARNING: Building with BUILDTYPE=Debug"
    +
     #include <string>
    
     namespace mbgl {
  4. mikemorris commented on Nov 3, 2016

    @mikemorris
    Contributor

    We have a hard fail when trying to publish a Node.js package with BUIILDTYPE=Debug on Travis or Bitrise - would something like this be helpful?

  5. boundsj commented on Nov 3, 2016

    @boundsj
    Contributor

    @friedbunny @incanus @1ec5 did you accidentally build iOS packages without BUILDTYPE=Release?

    @kkaefer we don't use the default when we publish a build. We use a script and it sets the build type to release. See https://github.com/mapbox/mapbox-gl-native/blob/release-ios-v3.4.0/platform/ios/scripts/deploy-packages.sh#L53

  6. 1ec5 commented on Nov 4, 2016

    @1ec5
    Contributor

    One theory is that we’re building the SDK itself in Release, but it’s linking to an mbgl static library built in Debug.

  7. boundsj commented on Nov 4, 2016

    @boundsj
    Contributor

    When I build locally with SYMBOLS=YES BUILDTYPE=Release make iframework and SYMBOLS=YES make iframework things work as expected in the repro app where there is a zero rect framed map view (as expected means log spew in release and crash in debug). So it does seem like something unexpected happened when I published beta 2. We don't intend to make it possible to publish a debug build using the publish script so I don't think I "ran the script incorrectly" so I will keep digging to figure out what happened.

  8. boundsj commented on Nov 8, 2016

    @boundsj
    Contributor

    When I built beta.2 I used Xcode 7.3.1 because #6842 (comment). I'm not exactly sure why, but something about xcode-selecting that toolchain (I was on Xcode 8 just before that) seems to have caused this Debug output even though the scripts should always result in Release output.

    I spent a bunch of time on this before deciding to turn my computer off and turn it back on it again. This appears to have "fixed" the problem. I'm going to close this and will keep an eye on future releases. I think the solution for this already ticketed: #2844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions