Bug 236213 - databases/rocksdb: fails to build with clang 8
Summary: databases/rocksdb: fails to build with clang 8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sunpoet Po-Chuan Hsieh
URL:
Keywords: needs-patch
Depends on:
Blocks: 236062
  Show dependency treegraph
 
Reported: 2019-03-04 13:17 UTC by Jan Beich
Modified: 2019-12-08 16:28 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)
jbeich: maintainer-feedback? (lx)
jbeich: maintainer-feedback? (freebsd)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2019-03-04 13:17:55 UTC
$ poudriere jail -cj clang8 -v projects/clang800-import -m svn+https
$ poudriere testport -j clang8 databases/rocksdb
[...]
In file included from db/builder.cc:19:
./db/internal_stats.h:111:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    WAL_FILE_BYTES,
    ^
./include/rocksdb/statistics.h:190:3: note: previous declaration is here
  WAL_FILE_BYTES,   // Number of bytes written to WAL
  ^
In file included from db/builder.cc:19:
./db/internal_stats.h:112:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    WAL_FILE_SYNCED,
    ^
./include/rocksdb/statistics.h:189:3: note: previous declaration is here
  WAL_FILE_SYNCED,  // Number of times WAL sync is done
  ^
In file included from db/builder.cc:19:
./db/internal_stats.h:113:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    BYTES_WRITTEN,
    ^
./include/rocksdb/statistics.h:126:3: note: previous declaration is here
  BYTES_WRITTEN,
  ^
In file included from db/builder.cc:19:
./db/internal_stats.h:114:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    NUMBER_KEYS_WRITTEN,
    ^
./include/rocksdb/statistics.h:119:3: note: previous declaration is here
  NUMBER_KEYS_WRITTEN,
  ^
In file included from db/builder.cc:19:
./db/internal_stats.h:115:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    WRITE_DONE_BY_OTHER,
    ^
./include/rocksdb/statistics.h:195:3: note: previous declaration is here
  WRITE_DONE_BY_OTHER,  // Equivalent to writes done for others
  ^
In file included from db/builder.cc:19:
./db/internal_stats.h:116:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    WRITE_DONE_BY_SELF,
    ^
./include/rocksdb/statistics.h:194:3: note: previous declaration is here
  WRITE_DONE_BY_SELF,
  ^
In file included from db/builder.cc:19:
./db/internal_stats.h:117:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    WRITE_WITH_WAL,
    ^
./include/rocksdb/statistics.h:197:3: note: previous declaration is here
  WRITE_WITH_WAL,       // Number of Write calls that request WAL
  ^
7 errors generated.

http://package18.nyi.freebsd.org/data/headamd64PR236062-default/2019-03-01_06h42m53s/logs/errors/rocksdb-5.17.2_1.log
http://package18.nyi.freebsd.org/data/headamd64PR236062-default/2019-03-01_06h42m53s/logs/errors/rocksdb-lite-5.17.2_1.log
Comment 1 Jan Beich freebsd_committer 2019-03-04 13:43:28 UTC
Also in cockroachdb due to bundling.

$ poudriere jail -cj clang8 -v projects/clang800-import -m svn+https
$ poudriere testport -j clang8 databases/cockroach
[...]
In file included from src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc:7:
In file included from src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h:8:
In file included from src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h:24:
In file included from src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h:24:
src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h:107:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
    WAL_FILE_BYTES,
    ^

http://package18.nyi.freebsd.org/data/headamd64PR236062-default/2019-03-01_06h42m53s/logs/errors/cockroach-2.0.6.log
Comment 2 Jan Beich freebsd_committer 2019-03-04 23:31:13 UTC
Reminder: Clang 8 was merged to 13.0-CURRENT in base r344779. Maintainers, expect pkg-fallout@ mail soon.
Comment 3 Pedro F. Giffuni freebsd_committer 2019-06-07 21:21:51 UTC
(In reply to Jan Beich from comment #1)
FWIW, I noticed while trying to update cockroachdb (which is about to change license) as well.

Reported upstream:
https://github.com/facebook/rocksdb/issues/5429
Comment 4 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-06-07 23:13:11 UTC
(In reply to Pedro F. Giffuni from comment #3)

There was some discussion about this (Clang 8) on https://github.com/facebook/rocksdb/issues/4946.
Comment 5 commit-hook freebsd_committer 2019-09-28 20:02:49 UTC
A commit references this bug:

Author: sunpoet
Date: Sat Sep 28 20:02:33 UTC 2019
New revision: 513148
URL: https://svnweb.freebsd.org/changeset/ports/513148

Log:
  Allow build with Clang 8

  Clang 8 detects shadow enums and stops the build. This workaround adds -Wno-error=shadow to bypass it.

  In file included from db/builder.cc:19:
  ./db/internal_stats.h:112:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
      WAL_FILE_BYTES,
      ^
  ./include/rocksdb/statistics.h:196:3: note: previous declaration is here
    WAL_FILE_BYTES,   // Number of bytes written to WAL
    ^
  In file included from db/builder.cc:19:
  ./db/internal_stats.h:113:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
      WAL_FILE_SYNCED,
      ^
  ./include/rocksdb/statistics.h:195:3: note: previous declaration is here
    WAL_FILE_SYNCED,  // Number of times WAL sync is done
    ^
  In file included from db/builder.cc:19:
  ./db/internal_stats.h:114:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
      BYTES_WRITTEN,
      ^
  ./include/rocksdb/statistics.h:131:3: note: previous declaration is here
    BYTES_WRITTEN,
    ^
  In file included from db/builder.cc:19:
  ./db/internal_stats.h:115:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
      NUMBER_KEYS_WRITTEN,
      ^
  ./include/rocksdb/statistics.h:124:3: note: previous declaration is here
    NUMBER_KEYS_WRITTEN,
    ^
  In file included from db/builder.cc:19:
  ./db/internal_stats.h:116:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
      WRITE_DONE_BY_OTHER,
      ^
  ./include/rocksdb/statistics.h:201:3: note: previous declaration is here
    WRITE_DONE_BY_OTHER,  // Equivalent to writes done for others
    ^
  In file included from db/builder.cc:19:
  ./db/internal_stats.h:117:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
      WRITE_DONE_BY_SELF,
      ^
  ./include/rocksdb/statistics.h:200:3: note: previous declaration is here
    WRITE_DONE_BY_SELF,
    ^
  In file included from db/builder.cc:19:
  ./db/internal_stats.h:118:5: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
      WRITE_WITH_WAL,
      ^
  ./include/rocksdb/statistics.h:203:3: note: previous declaration is here
    WRITE_WITH_WAL,       // Number of Write calls that request WAL
    ^
  7 errors generated.
  gmake[1]: *** [Makefile:683: shared-objects/db/builder.o] Error 1
  gmake[1]: Leaving directory '/wrkdirs/usr/ports/databases/rocksdb/work/rocksdb-6.2.2'
  *** Error code 1

  Stop.
  make: stopped in /usr/ports/databases/rocksdb

  PR:		236213
  Reported by:	jbeich
  Reference:	https://github.com/facebook/rocksdb/issues/4946

Changes:
  head/databases/rocksdb/Makefile