fix: Fix compilation on Arch Linux (#1233)
- Update protobuf to v23.4, to fix the cstdint error on Arch Linux, and make some related changes: - Silence additional compiler warnings for the new protobuf - Update absl to 20230125.3, to support the protobuf update, and make some related changes: - Silence additional compiler warnings for the new protobuf - Replace GOOGLE_CHECK_OK with ABSL_CHECK_OK - Replace GUARDED_BY with ABSL_GUARDED_BY - Update other instances of cstdint missing in our own code - Always pull the latest docker images, to avoid stale results when your workstation has pulled an older image at the same label
This commit is contained in:
parent
86bf6cf3cd
commit
8bf2d45424
|
@ -103,7 +103,7 @@ jobs:
|
||||||
# NOTE: cmake is already installed in GitHub Actions VMs, but not
|
# NOTE: cmake is already installed in GitHub Actions VMs, but not
|
||||||
# necessarily in a self-hosted runner.
|
# necessarily in a self-hosted runner.
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y \
|
sudo apt update && sudo apt install -y \
|
||||||
cmake \
|
cmake \
|
||||||
libc-ares-dev
|
libc-ares-dev
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@ if(MSVC)
|
||||||
add_compile_options(/wd4324)
|
add_compile_options(/wd4324)
|
||||||
# Silence a warning about STL types in exported classes.
|
# Silence a warning about STL types in exported classes.
|
||||||
add_compile_options(/wd4251)
|
add_compile_options(/wd4251)
|
||||||
|
# Silence a warning about constant conditional expressions.
|
||||||
|
add_compile_options(/wd4127)
|
||||||
|
|
||||||
# Packager's macro for Windows-specific code.
|
# Packager's macro for Windows-specific code.
|
||||||
add_definitions(-DOS_WIN)
|
add_definitions(-DOS_WIN)
|
||||||
|
|
|
@ -69,13 +69,13 @@ class IoCache {
|
||||||
|
|
||||||
const uint64_t cache_size_;
|
const uint64_t cache_size_;
|
||||||
absl::Mutex mutex_;
|
absl::Mutex mutex_;
|
||||||
absl::CondVar read_event_ GUARDED_BY(mutex_);
|
absl::CondVar read_event_ ABSL_GUARDED_BY(mutex_);
|
||||||
absl::CondVar write_event_ GUARDED_BY(mutex_);
|
absl::CondVar write_event_ ABSL_GUARDED_BY(mutex_);
|
||||||
std::vector<uint8_t> circular_buffer_ GUARDED_BY(mutex_);
|
std::vector<uint8_t> circular_buffer_ ABSL_GUARDED_BY(mutex_);
|
||||||
const uint8_t* end_ptr_ GUARDED_BY(mutex_);
|
const uint8_t* end_ptr_ ABSL_GUARDED_BY(mutex_);
|
||||||
uint8_t* r_ptr_ GUARDED_BY(mutex_);
|
uint8_t* r_ptr_ ABSL_GUARDED_BY(mutex_);
|
||||||
uint8_t* w_ptr_ GUARDED_BY(mutex_);
|
uint8_t* w_ptr_ ABSL_GUARDED_BY(mutex_);
|
||||||
bool closed_ GUARDED_BY(mutex_);
|
bool closed_ ABSL_GUARDED_BY(mutex_);
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(IoCache);
|
DISALLOW_COPY_AND_ASSIGN(IoCache);
|
||||||
};
|
};
|
||||||
|
|
|
@ -101,9 +101,9 @@ class FileSystem {
|
||||||
FileSystem() = default;
|
FileSystem() = default;
|
||||||
|
|
||||||
// Filename to file data map.
|
// Filename to file data map.
|
||||||
std::map<std::string, std::vector<uint8_t>> files_ GUARDED_BY(mutex_);
|
std::map<std::string, std::vector<uint8_t>> files_ ABSL_GUARDED_BY(mutex_);
|
||||||
// Filename to file open modes map.
|
// Filename to file open modes map.
|
||||||
std::map<std::string, std::string> open_files_ GUARDED_BY(mutex_);
|
std::map<std::string, std::string> open_files_ ABSL_GUARDED_BY(mutex_);
|
||||||
|
|
||||||
absl::Mutex mutex_;
|
absl::Mutex mutex_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -42,10 +42,10 @@ class ThreadPool {
|
||||||
void ThreadMain();
|
void ThreadMain();
|
||||||
|
|
||||||
absl::Mutex mutex_;
|
absl::Mutex mutex_;
|
||||||
absl::CondVar tasks_available_ GUARDED_BY(mutex_);
|
absl::CondVar tasks_available_ ABSL_GUARDED_BY(mutex_);
|
||||||
std::queue<Task> tasks_ GUARDED_BY(mutex_);
|
std::queue<Task> tasks_ ABSL_GUARDED_BY(mutex_);
|
||||||
size_t num_idle_threads_ GUARDED_BY(mutex_);
|
size_t num_idle_threads_ ABSL_GUARDED_BY(mutex_);
|
||||||
bool terminated_ GUARDED_BY(mutex_);
|
bool terminated_ ABSL_GUARDED_BY(mutex_);
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ThreadPool);
|
DISALLOW_COPY_AND_ASSIGN(ThreadPool);
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,11 +62,11 @@ class ThreadedIoFile : public File {
|
||||||
std::atomic<int64_t> internal_file_error_;
|
std::atomic<int64_t> internal_file_error_;
|
||||||
|
|
||||||
absl::Mutex flush_mutex_;
|
absl::Mutex flush_mutex_;
|
||||||
bool flushing_ GUARDED_BY(flush_mutex_);
|
bool flushing_ ABSL_GUARDED_BY(flush_mutex_);
|
||||||
bool flush_complete_ GUARDED_BY(flush_mutex_);
|
bool flush_complete_ ABSL_GUARDED_BY(flush_mutex_);
|
||||||
|
|
||||||
absl::Mutex task_exited_mutex_;
|
absl::Mutex task_exited_mutex_;
|
||||||
bool task_exited_ GUARDED_BY(task_exited_mutex_);
|
bool task_exited_ ABSL_GUARDED_BY(task_exited_mutex_);
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ThreadedIoFile);
|
DISALLOW_COPY_AND_ASSIGN(ThreadedIoFile);
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#ifndef PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
|
#ifndef PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
|
||||||
#define PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
|
#define PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "packager/macros.h"
|
#include "packager/macros.h"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#ifndef PACKAGER_MEDIA_BASE_FOURCCS_H_
|
#ifndef PACKAGER_MEDIA_BASE_FOURCCS_H_
|
||||||
#define PACKAGER_MEDIA_BASE_FOURCCS_H_
|
#define PACKAGER_MEDIA_BASE_FOURCCS_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace shaka {
|
namespace shaka {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#ifndef PACKAGER_MEDIA_BASE_ID3_TAG_H_
|
#ifndef PACKAGER_MEDIA_BASE_ID3_TAG_H_
|
||||||
#define PACKAGER_MEDIA_BASE_ID3_TAG_H_
|
#define PACKAGER_MEDIA_BASE_ID3_TAG_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -125,12 +125,14 @@ class ProducerConsumerQueue {
|
||||||
const size_t capacity_; // Maximum number of elements; zero means unlimited.
|
const size_t capacity_; // Maximum number of elements; zero means unlimited.
|
||||||
|
|
||||||
mutable absl::Mutex mutex_;
|
mutable absl::Mutex mutex_;
|
||||||
size_t head_pos_ GUARDED_BY(mutex_); // Head position.
|
size_t head_pos_ ABSL_GUARDED_BY(mutex_); // Head position.
|
||||||
std::deque<T> q_ GUARDED_BY(mutex_); // Internal queue holding the elements.
|
std::deque<T> q_
|
||||||
absl::CondVar not_empty_cv_ GUARDED_BY(mutex_);
|
ABSL_GUARDED_BY(mutex_); // Internal queue holding the elements.
|
||||||
absl::CondVar not_full_cv_ GUARDED_BY(mutex_);
|
absl::CondVar not_empty_cv_ ABSL_GUARDED_BY(mutex_);
|
||||||
absl::CondVar new_element_cv_ GUARDED_BY(mutex_);
|
absl::CondVar not_full_cv_ ABSL_GUARDED_BY(mutex_);
|
||||||
bool stop_requested_ GUARDED_BY(mutex_); // True after Stop has been called.
|
absl::CondVar new_element_cv_ ABSL_GUARDED_BY(mutex_);
|
||||||
|
bool stop_requested_
|
||||||
|
ABSL_GUARDED_BY(mutex_); // True after Stop has been called.
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProducerConsumerQueue);
|
DISALLOW_COPY_AND_ASSIGN(ProducerConsumerQueue);
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,7 @@ std::string MessageToJsonString(const google::protobuf::Message& message) {
|
||||||
json_print_options.preserve_proto_field_names = true;
|
json_print_options.preserve_proto_field_names = true;
|
||||||
|
|
||||||
std::string result;
|
std::string result;
|
||||||
GOOGLE_CHECK_OK(google::protobuf::util::MessageToJsonString(
|
ABSL_CHECK_OK(google::protobuf::util::MessageToJsonString(
|
||||||
message, &result, json_print_options));
|
message, &result, json_print_options));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ class SyncPointQueue {
|
||||||
std::shared_ptr<const CueEvent> PromoteAtNoLocking(double time_in_seconds);
|
std::shared_ptr<const CueEvent> PromoteAtNoLocking(double time_in_seconds);
|
||||||
|
|
||||||
absl::Mutex mutex_;
|
absl::Mutex mutex_;
|
||||||
absl::CondVar sync_condition_ GUARDED_BY(mutex_);
|
absl::CondVar sync_condition_ ABSL_GUARDED_BY(mutex_);
|
||||||
size_t thread_count_ = 0;
|
size_t thread_count_ = 0;
|
||||||
size_t waiting_thread_count_ = 0;
|
size_t waiting_thread_count_ = 0;
|
||||||
bool cancelled_ = false;
|
bool cancelled_ = false;
|
||||||
|
|
|
@ -37,10 +37,10 @@ class TestWebServer {
|
||||||
};
|
};
|
||||||
|
|
||||||
absl::Mutex mutex_;
|
absl::Mutex mutex_;
|
||||||
TestWebServerStatus status_ GUARDED_BY(mutex_);
|
TestWebServerStatus status_ ABSL_GUARDED_BY(mutex_);
|
||||||
absl::CondVar started_ GUARDED_BY(mutex_);
|
absl::CondVar started_ ABSL_GUARDED_BY(mutex_);
|
||||||
absl::CondVar stop_ GUARDED_BY(mutex_);
|
absl::CondVar stop_ ABSL_GUARDED_BY(mutex_);
|
||||||
bool stopped_ GUARDED_BY(mutex_);
|
bool stopped_ ABSL_GUARDED_BY(mutex_);
|
||||||
|
|
||||||
// Connections to be handled again later, mapped to the time at which we
|
// Connections to be handled again later, mapped to the time at which we
|
||||||
// should handle them again. We can't block the server thread directly to
|
// should handle them again. We can't block the server thread directly to
|
||||||
|
|
|
@ -83,7 +83,7 @@ for DOCKER_FILE in ${SCRIPT_DIR}/dockers/*; do
|
||||||
CONTAINER="$( echo "packager_test_${OS_NAME}" | tr A-Z a-z )"
|
CONTAINER="$( echo "packager_test_${OS_NAME}" | tr A-Z a-z )"
|
||||||
|
|
||||||
RAN_SOMETHING=1
|
RAN_SOMETHING=1
|
||||||
docker build -t ${CONTAINER} -f ${DOCKER_FILE} ${SCRIPT_DIR}/dockers/
|
docker build --pull -t ${CONTAINER} -f ${DOCKER_FILE} ${SCRIPT_DIR}/dockers/
|
||||||
mkdir -p "${TEMP_BUILD_DIR}"
|
mkdir -p "${TEMP_BUILD_DIR}"
|
||||||
docker_run cmake -S . -B build/ -DCMAKE_BUILD_TYPE=Debug
|
docker_run cmake -S . -B build/ -DCMAKE_BUILD_TYPE=Debug
|
||||||
docker_run cmake --build build/ --config Debug
|
docker_run cmake --build build/ --config Debug
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 273292d1cfc0a94a65082ee350509af1d113344d
|
Subproject commit c2435f8342c2d0ed8101cb43adfd605fdc52dca2
|
|
@ -34,6 +34,10 @@ if(MSVC)
|
||||||
/wd4141 # multiple inline keywords
|
/wd4141 # multiple inline keywords
|
||||||
# src/google/protobuf/util/message_differencer.h
|
# src/google/protobuf/util/message_differencer.h
|
||||||
/wd4100 # unreferenced formal parameter
|
/wd4100 # unreferenced formal parameter
|
||||||
|
# src/google/protobuf/text_format.cc
|
||||||
|
/wd4805 # unsafe mix of type bool and uint64_t in operation
|
||||||
|
# src/google/protobuf/compiler/cpp/field.cc via absl/log/internal/check_op.h
|
||||||
|
/wd4018 # signed/unsigned mismatch
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
|
@ -54,6 +58,12 @@ else()
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
# There are also redundant move calls.
|
# There are also redundant move calls.
|
||||||
-Wno-redundant-move
|
-Wno-redundant-move
|
||||||
|
# There are ignored qualifiers.
|
||||||
|
-Wno-ignored-qualifiers
|
||||||
|
# There are attributes that cannot be honored.
|
||||||
|
-Wno-attributes
|
||||||
|
# There are implicit fallthroughs.
|
||||||
|
-Wno-implicit-fallthrough
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit cc1f708d756c6739fdd59722963d324b865014cd
|
Subproject commit 2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a
|
|
@ -45,7 +45,7 @@ class Version {
|
||||||
Version& operator=(const Version&) = delete;
|
Version& operator=(const Version&) = delete;
|
||||||
|
|
||||||
absl::Mutex mutex_;
|
absl::Mutex mutex_;
|
||||||
std::string version_ GUARDED_BY(mutex_);
|
std::string version_ ABSL_GUARDED_BY(mutex_);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue