1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-04 09:43:08 +02:00

Remove conditional compilation for lz4.

0c32757f made lz4 required in the meson build but conditional compilation was left in to make reverting easy for packagers just in case.

Since a few releases have gone by without any complaints, remove conditional compilation for lz4.
This commit is contained in:
David Steele 2024-11-07 09:27:02 -05:00
parent 355e27d69c
commit c678543165
12 changed files with 2 additions and 45 deletions

View File

@ -170,11 +170,9 @@ endif
# Find required bz2 library
lib_bz2 = cc.find_library('bz2')
# Find optional lz4 library
# Find required lz4 library
lib_lz4 = dependency('liblz4')
configuration.set('HAVE_LIBLZ4', true, description: 'Is liblz4 present?')
# Find required openssl library
lib_openssl = dependency('openssl', version : '>=1.1.1')

View File

@ -798,7 +798,7 @@ option:
- none
- bz2
- gz
- lz4: HAVE_LIBLZ4
- lz4
- zst: HAVE_LIBZST
command: compress
command-role:

View File

@ -81,7 +81,6 @@ static const struct CompressHelperLocal
.typeId = STRID6("lz4", 0x2068c1),
.type = STRDEF(LZ4_EXT),
.ext = STRDEF("." LZ4_EXT),
#ifdef HAVE_LIBLZ4
.compressType = LZ4_COMPRESS_FILTER_TYPE,
.compressNew = lz4CompressNew,
.decompressType = LZ4_DECOMPRESS_FILTER_TYPE,
@ -89,7 +88,6 @@ static const struct CompressHelperLocal
.levelDefault = LZ4_COMPRESS_LEVEL_DEFAULT,
.levelMin = LZ4_COMPRESS_LEVEL_MIN,
.levelMax = LZ4_COMPRESS_LEVEL_MAX,
#endif
},
{
.typeId = STRID5("zst", 0x527a0),

View File

@ -3,8 +3,6 @@ LZ4 Common
***********************************************************************************************************************************/
#include "build.auto.h"
#ifdef HAVE_LIBLZ4
#include <lz4frame.h>
#include "common/compress/lz4/common.h"
@ -23,5 +21,3 @@ lz4Error(const LZ4F_errorCode_t error)
FUNCTION_TEST_RETURN_TYPE(LZ4F_errorCode_t, error);
}
#endif // HAVE_LIBLZ4

View File

@ -9,14 +9,10 @@ LZ4 extension
***********************************************************************************************************************************/
#define LZ4_EXT "lz4"
#ifdef HAVE_LIBLZ4
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
// Process lz4 errors
FN_EXTERN size_t lz4Error(size_t error);
#endif // HAVE_LIBLZ4
#endif

View File

@ -5,8 +5,6 @@ Developed against version r131 using the documentation in https://github.com/lz4
***********************************************************************************************************************************/
#include "build.auto.h"
#ifdef HAVE_LIBLZ4
#include <lz4frame.h>
#include <stdio.h>
#include <string.h>
@ -294,5 +292,3 @@ lz4CompressNew(const int level, const bool raw)
LZ4_COMPRESS_FILTER_TYPE, this, paramList, .done = lz4CompressDone, .inOut = lz4CompressProcess,
.inputSame = lz4CompressInputSame));
}
#endif // HAVE_LIBLZ4

View File

@ -3,8 +3,6 @@ LZ4 Compress
Compress IO to the lz4 format.
***********************************************************************************************************************************/
#ifdef HAVE_LIBLZ4
#ifndef COMMON_COMPRESS_LZ4_COMPRESS_H
#define COMMON_COMPRESS_LZ4_COMPRESS_H
@ -28,5 +26,3 @@ Constructors
FN_EXTERN IoFilter *lz4CompressNew(int level, bool raw);
#endif
#endif // HAVE_LIBLZ4

View File

@ -3,8 +3,6 @@ LZ4 Decompress
***********************************************************************************************************************************/
#include "build.auto.h"
#ifdef HAVE_LIBLZ4
#include <lz4frame.h>
#include <stdio.h>
@ -181,5 +179,3 @@ lz4DecompressNew(const bool raw)
LZ4_DECOMPRESS_FILTER_TYPE, this, NULL, .done = lz4DecompressDone, .inOut = lz4DecompressProcess,
.inputSame = lz4DecompressInputSame));
}
#endif // HAVE_LIBLZ4

View File

@ -3,8 +3,6 @@ LZ4 Decompress
Decompress IO from the lz4 format.
***********************************************************************************************************************************/
#ifdef HAVE_LIBLZ4
#ifndef COMMON_COMPRESS_LZ4_DECOMPRESS_H
#define COMMON_COMPRESS_LZ4_DECOMPRESS_H
@ -21,5 +19,3 @@ Constructors
FN_EXTERN IoFilter *lz4DecompressNew(bool raw);
#endif
#endif // HAVE_LIBLZ4

View File

@ -1880,9 +1880,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
PARSE_RULE_VAL_STRID(Bz2), // opt/compress-type
PARSE_RULE_VAL_STRID(Gz), // opt/compress-type
PARSE_RULE_VAL_STRID(Lz4), // opt/compress-type
#ifndef HAVE_LIBLZ4 // opt/compress-type
PARSE_RULE_BOOL_FALSE, // opt/compress-type
#endif // opt/compress-type
PARSE_RULE_VAL_STRID(Zst), // opt/compress-type
#ifndef HAVE_LIBZST // opt/compress-type
PARSE_RULE_BOOL_FALSE, // opt/compress-type

View File

@ -313,7 +313,6 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("lz4"))
{
#ifdef HAVE_LIBLZ4
// Run standard test suite
testSuite(compressTypeLz4, "lz4 -dc", 4);
@ -351,9 +350,6 @@ testRun(void)
TEST_RESULT_VOID(FUNCTION_LOG_OBJECT_FORMAT(decompress, lz4DecompressToLog, buffer, sizeof(buffer)), "lz4DecompressToLog");
TEST_RESULT_Z(buffer, "{inputSame: true, inputOffset: 999, frameDone false, done: true}", "check log");
#else
TEST_ERROR(compressTypePresent(compressTypeLz4), OptionInvalidValueError, "pgBackRest not built with lz4 support");
#endif // HAVE_LIBLZ4
}
// *****************************************************************************************************************************

View File

@ -272,10 +272,7 @@ testRun(void)
uint64_t sha1Total = 1;
uint64_t sha256Total = 1;
uint64_t gzip6Total = 1;
#ifdef HAVE_LIBLZ4
uint64_t lz41Total = 1;
#endif // HAVE_LIBLZ4
for (unsigned int idx = 0; idx < iteration; idx++)
{
@ -334,7 +331,6 @@ testRun(void)
MEM_CONTEXT_TEMP_END();
// -------------------------------------------------------------------------------------------------------------------------
#ifdef HAVE_LIBLZ4
TEST_LOG_FMT("lz4 -1 iteration %u", idx + 1);
MEM_CONTEXT_TEMP_BEGIN()
@ -344,7 +340,6 @@ testRun(void)
BENCHMARK_END(lz41Total);
}
MEM_CONTEXT_TEMP_END();
#endif // HAVE_LIBLZ4
}
// -------------------------------------------------------------------------------------------------------------------------
@ -360,10 +355,7 @@ testRun(void)
TEST_RESULT("sha1", sha1Total);
TEST_RESULT("sha256", sha256Total);
TEST_RESULT("gzip -6", gzip6Total);
#ifdef HAVE_LIBLZ4
TEST_RESULT("lz4 -1", lz41Total);
#endif // HAVE_LIBLZ4
}
FUNCTION_HARNESS_RETURN_VOID();