Merge pull request #294800 from trofi/rocksdb-drop-redundant-pin-to-gcc12-if-gcc13

rocksdb: drop redundant `pin-to-gcc12-if-gcc13`
This commit is contained in:
Mario Rodas 2024-03-16 07:43:16 -05:00 committed by GitHub
commit 66b0e32ac3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 16 deletions

View File

@ -39,20 +39,9 @@ stdenv.mkDerivation (finalAttrs: {
"tools"
];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
"-Wno-error=deprecated-copy"
"-Wno-error=pessimizing-move"
# Needed with GCC 12
"-Wno-error=format-truncation"
"-Wno-error=maybe-uninitialized"
] ++ lib.optionals stdenv.cc.isClang [
"-Wno-error=unused-private-field"
"-faligned-allocation"
] ++ lib.optionals (lib.versionOlder finalAttrs.version "8") [
"-Wno-error=unused-but-set-variable"
] ++ lib.optionals (lib.versionOlder finalAttrs.version "7") [
"-Wno-error=deprecated-copy"
]);
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
"-faligned-allocation"
]);
cmakeFlags = [
"-DPORTABLE=1"
@ -71,12 +60,25 @@ stdenv.mkDerivation (finalAttrs: {
"-DUSE_RTTI=1"
"-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere
(lib.optional sse42Support "-DFORCE_SSE42=1")
"-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}"
"-DFAIL_ON_WARNINGS=NO"
] ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0";
# otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format";
postPatch = lib.optionalString (lib.versionOlder finalAttrs.version "8") ''
# Fix gcc-13 build failures due to missing <cstdint> and
# <system_error> includes, fixed upstyream sice 8.x
sed -e '1i #include <cstdint>' -i db/compaction/compaction_iteration_stats.h
sed -e '1i #include <cstdint>' -i table/block_based/data_block_hash_index.h
sed -e '1i #include <cstdint>' -i util/string_util.h
sed -e '1i #include <cstdint>' -i include/rocksdb/utilities/checkpoint.h
'' + lib.optionalString (lib.versionOlder finalAttrs.version "7") ''
# Fix gcc-13 build failures due to missing <cstdint> and
# <system_error> includes, fixed upstyream sice 7.x
sed -e '1i #include <system_error>' -i third-party/folly/folly/synchronization/detail/ProxyLockable-inl.h
'';
preInstall = ''
mkdir -p $tools/bin
cp tools/{ldb,sst_dump}${stdenv.hostPlatform.extensions.executable} $tools/bin/

View File

@ -24463,7 +24463,7 @@ with pkgs;
rlottie = callPackage ../development/libraries/rlottie { };
rocksdb = pin-to-gcc12-if-gcc13 (callPackage ../development/libraries/rocksdb { });
rocksdb = callPackage ../development/libraries/rocksdb { };
rocksdb_7_10 = rocksdb.overrideAttrs rec {
pname = "rocksdb";