chore: Upgrade absl and protobuf (#1337)
protobuf depends on absl, so both needed an update. Updating absl fixes issues on Alpine 3.19 (see PR #1327), and also removes the need for hacks around vlog flags.
This commit is contained in:
parent
9b384828c6
commit
15b27549a8
|
@ -170,8 +170,6 @@ add_executable(packager
|
||||||
app/stream_descriptor.h
|
app/stream_descriptor.h
|
||||||
app/validate_flag.cc
|
app/validate_flag.cc
|
||||||
app/validate_flag.h
|
app/validate_flag.h
|
||||||
app/vlog_flags.cc
|
|
||||||
app/vlog_flags.h
|
|
||||||
app/widevine_encryption_flags.cc
|
app/widevine_encryption_flags.cc
|
||||||
app/widevine_encryption_flags.h
|
app/widevine_encryption_flags.h
|
||||||
)
|
)
|
||||||
|
@ -190,8 +188,6 @@ target_link_libraries(packager
|
||||||
add_executable(mpd_generator
|
add_executable(mpd_generator
|
||||||
app/mpd_generator.cc
|
app/mpd_generator.cc
|
||||||
app/mpd_generator_flags.h
|
app/mpd_generator_flags.h
|
||||||
app/vlog_flags.cc
|
|
||||||
app/vlog_flags.h
|
|
||||||
)
|
)
|
||||||
target_link_libraries(mpd_generator
|
target_link_libraries(mpd_generator
|
||||||
absl::flags
|
absl::flags
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include <absl/strings/str_split.h>
|
#include <absl/strings/str_split.h>
|
||||||
|
|
||||||
#include <packager/app/mpd_generator_flags.h>
|
#include <packager/app/mpd_generator_flags.h>
|
||||||
#include <packager/app/vlog_flags.h>
|
|
||||||
#include <packager/mpd/util/mpd_writer.h>
|
#include <packager/mpd/util/mpd_writer.h>
|
||||||
#include <packager/tools/license_notice.h>
|
#include <packager/tools/license_notice.h>
|
||||||
#include <packager/version/version.h>
|
#include <packager/version/version.h>
|
||||||
|
@ -124,8 +123,6 @@ int MpdMain(int argc, char** argv) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_vlog_flags();
|
|
||||||
|
|
||||||
absl::InitializeLog();
|
absl::InitializeLog();
|
||||||
|
|
||||||
if (!absl::GetFlag(FLAGS_test_packager_version).empty())
|
if (!absl::GetFlag(FLAGS_test_packager_version).empty())
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
#include <packager/app/raw_key_encryption_flags.h>
|
#include <packager/app/raw_key_encryption_flags.h>
|
||||||
#include <packager/app/retired_flags.h>
|
#include <packager/app/retired_flags.h>
|
||||||
#include <packager/app/stream_descriptor.h>
|
#include <packager/app/stream_descriptor.h>
|
||||||
#include <packager/app/vlog_flags.h>
|
|
||||||
#include <packager/app/widevine_encryption_flags.h>
|
#include <packager/app/widevine_encryption_flags.h>
|
||||||
#include <packager/file.h>
|
#include <packager/file.h>
|
||||||
#include <packager/kv_pairs/kv_pairs.h>
|
#include <packager/kv_pairs/kv_pairs.h>
|
||||||
|
@ -564,8 +563,6 @@ int PackagerMain(int argc, char** argv) {
|
||||||
absl::SetMinLogLevel(absl::LogSeverityAtLeast::kWarning);
|
absl::SetMinLogLevel(absl::LogSeverityAtLeast::kWarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_vlog_flags();
|
|
||||||
|
|
||||||
absl::InitializeLog();
|
absl::InitializeLog();
|
||||||
|
|
||||||
if (!ValidateWidevineCryptoFlags() || !ValidateRawKeyCryptoFlags() ||
|
if (!ValidateWidevineCryptoFlags() || !ValidateRawKeyCryptoFlags() ||
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
// Copyright 2015 Google LLC. All rights reserved.
|
|
||||||
//
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file or at
|
|
||||||
// https://developers.google.com/open-source/licenses/bsd
|
|
||||||
//
|
|
||||||
// Defines verbose logging flags.
|
|
||||||
|
|
||||||
#include <packager/app/vlog_flags.h>
|
|
||||||
|
|
||||||
#include <absl/log/globals.h>
|
|
||||||
#include <absl/log/log.h>
|
|
||||||
#include <absl/strings/numbers.h>
|
|
||||||
|
|
||||||
#include <packager/kv_pairs/kv_pairs.h>
|
|
||||||
#include <packager/macros/logging.h>
|
|
||||||
|
|
||||||
ABSL_FLAG(int,
|
|
||||||
v,
|
|
||||||
0,
|
|
||||||
"Show all VLOG(m) or DVLOG(m) messages for m <= this. "
|
|
||||||
"Overridable by --vmodule.");
|
|
||||||
|
|
||||||
ABSL_FLAG(
|
|
||||||
std::string,
|
|
||||||
vmodule,
|
|
||||||
"",
|
|
||||||
"Per-module verbose level. THIS FLAG IS DEPRECATED. "
|
|
||||||
"Argument is a comma-separated list of <module name>=<log level>. "
|
|
||||||
"The logging system no longer supports different levels for different "
|
|
||||||
"modules, so the verbosity level will be set to the maximum specified for "
|
|
||||||
"any module or given by --v.");
|
|
||||||
|
|
||||||
ABSL_DECLARE_FLAG(int, minloglevel);
|
|
||||||
|
|
||||||
namespace shaka {
|
|
||||||
|
|
||||||
void handle_vlog_flags() {
|
|
||||||
// Reference the log level flag to keep the absl::log flags from getting
|
|
||||||
// stripped from the executable.
|
|
||||||
int log_level = absl::GetFlag(FLAGS_minloglevel);
|
|
||||||
(void)log_level;
|
|
||||||
|
|
||||||
int vlog_level = absl::GetFlag(FLAGS_v);
|
|
||||||
std::string vmodule_patterns = absl::GetFlag(FLAGS_vmodule);
|
|
||||||
|
|
||||||
if (!vmodule_patterns.empty()) {
|
|
||||||
std::vector<KVPair> patterns =
|
|
||||||
SplitStringIntoKeyValuePairs(vmodule_patterns, '=', ',');
|
|
||||||
int pattern_vlevel;
|
|
||||||
bool warning_shown = false;
|
|
||||||
|
|
||||||
for (const auto& pattern : patterns) {
|
|
||||||
if (!warning_shown) {
|
|
||||||
LOG(WARNING) << "--vmodule ignored, combined with --v!";
|
|
||||||
warning_shown = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!::absl::SimpleAtoi(pattern.second, &pattern_vlevel)) {
|
|
||||||
LOG(ERROR) << "Error parsing log level for '" << pattern.first
|
|
||||||
<< "' from '" << pattern.second << "'";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vlog_level != 0) {
|
|
||||||
absl::SetMinLogLevel(static_cast<absl::LogSeverityAtLeast>(-vlog_level));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace shaka
|
|
|
@ -1,17 +0,0 @@
|
||||||
// Copyright 2015 Google LLC. All rights reserved.
|
|
||||||
//
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file or at
|
|
||||||
// https://developers.google.com/open-source/licenses/bsd
|
|
||||||
|
|
||||||
#ifndef APP_VLOG_FLAGS_H_
|
|
||||||
#define APP_VLOG_FLAGS_H_
|
|
||||||
|
|
||||||
#include <absl/flags/declare.h>
|
|
||||||
#include <absl/flags/flag.h>
|
|
||||||
|
|
||||||
namespace shaka {
|
|
||||||
void handle_vlog_flags();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // APP_VLOG_FLAGS_H_
|
|
|
@ -14,20 +14,4 @@
|
||||||
/// You can use the insertion operator to add specific logs to this.
|
/// You can use the insertion operator to add specific logs to this.
|
||||||
#define NOTIMPLEMENTED() LOG(ERROR) << "NOTIMPLEMENTED: "
|
#define NOTIMPLEMENTED() LOG(ERROR) << "NOTIMPLEMENTED: "
|
||||||
|
|
||||||
#define VLOG(verboselevel) \
|
|
||||||
LOG(LEVEL(static_cast<absl::LogSeverity>(-verboselevel)))
|
|
||||||
|
|
||||||
#define VLOG_IS_ON(verboselevel) \
|
|
||||||
(static_cast<int>(absl::MinLogLevel()) <= -verboselevel)
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
#define DVLOG(verboselevel) VLOG(verboselevel)
|
|
||||||
#else
|
|
||||||
// We need this expression to work with << after it, so this is a simple way to
|
|
||||||
// turn DVLOG into a no-op in release builds.
|
|
||||||
#define DVLOG(verboselevel) \
|
|
||||||
if (false) \
|
|
||||||
VLOG(verboselevel)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // PACKAGER_MACROS_LOGGING_H_
|
#endif // PACKAGER_MACROS_LOGGING_H_
|
||||||
|
|
|
@ -13,5 +13,8 @@ set(ABSL_PROPAGATE_CXX_STD ON)
|
||||||
# for one in the system.
|
# for one in the system.
|
||||||
set(ABSL_USE_EXTERNAL_GOOGLETEST ON)
|
set(ABSL_USE_EXTERNAL_GOOGLETEST ON)
|
||||||
|
|
||||||
|
# Disable internal debugging features.
|
||||||
|
add_definitions(-DNDEBUG)
|
||||||
|
|
||||||
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
||||||
add_subdirectory(source)
|
add_subdirectory(source)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit c2435f8342c2d0ed8101cb43adfd605fdc52dca2
|
Subproject commit 4a2c63365eff8823a5221db86ef490e828306f9d
|
|
@ -25,8 +25,7 @@ set(ABSL_ROOT_DIR get_filename_component(ABSOLUTE_PATH ../abseil-cpp/source ABSO
|
||||||
# Make sure protoc links against the same MSVC runtime as internal libs.
|
# Make sure protoc links against the same MSVC runtime as internal libs.
|
||||||
set(protobuf_MSVC_STATIC_RUNTIME OFF)
|
set(protobuf_MSVC_STATIC_RUNTIME OFF)
|
||||||
|
|
||||||
# Disable internal debugging features, which end up triggering further compiler
|
# Disable internal debugging features.
|
||||||
# errors.
|
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
|
|
||||||
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
# With these set in scope of this folder, load the library's own CMakeLists.txt.
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a
|
Subproject commit a9b006bddd52e289029f16aa77b77e8e0033d9ee
|
Loading…
Reference in New Issue