mbtileserver icon indicating copy to clipboard operation
mbtileserver copied to clipboard

Build Error with GCC11

Open leearmstrong opened this issue 3 years ago • 2 comments

I cannot build this due to warnings with SQLite building.

Looks like this may be fixed though and wonder if dependencies could be updated and a new version published?

leearmstrong avatar May 04 '22 12:05 leearmstrong

We're currently using crawshaw.io/sqlite via the brendan-ward/mbtiles-go package, not mattn/go-sqlite. It looks like crawshaw.io/sqlite is only up to SQLite 3.36.0. We'll have to wait for updates to land there.

If I understand the issue you linked, those are warnings not errors, right? Is the reason that you cannot build with those because you are treating all warnings as errors, or some other local configuration? I don't have easy access to GCC11 at the moment, so please forgive my ignorance there.

brendan-ward avatar May 04 '22 16:05 brendan-ward

Yeah this is just a brand new Ubuntu 22.04 install with GCC 11 with no changed settings and then running go install github.com/consbio/mbtileserver@latest

The build actually stops with the following.

# crawshaw.io/sqlite
In file included from /usr/include/string.h:535,
                 from /root/go/pkg/mod/crawshaw.io/[email protected]/./c/sqlite3.c:14113,
                 from /root/go/pkg/mod/crawshaw.io/[email protected]/static.go:19:
In function ‘memcpy’,
    inlined from ‘sqlite3Fts5IndexQuery’ at /root/go/pkg/mod/crawshaw.io/[email protected]/./c/sqlite3.c:220863:18:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: warning: ‘__builtin_memcpy’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~

So yeah, I suspect you are right that by default it is treating warnings as errors and failing to build

leearmstrong avatar May 04 '22 16:05 leearmstrong

Any workaround for this by chance?

Also on Ubuntu 22.04 and facing this exact build failure (as well as on a Pi via Raspberry Pi OS/Debian).

briannafair avatar Mar 10 '23 20:03 briannafair

Looks like 3.38 is now available in crawshaw.io/sqlite. Will try to get that updated here soon and see if it fixes this.

brendan-ward avatar Mar 10 '23 21:03 brendan-ward

@briannafair @leearmstrong this should now be fixed on main as of #166; tests on Ubuntu 22.04 are passing (except for arm64, for other reasons). I'm not ready to release a new version yet, but since you are building from source this is hopefully not an issue.

If your builds still fail, please reopen this issue.

brendan-ward avatar Mar 11 '23 01:03 brendan-ward