Skip to content

Commit

Permalink
MINOR: [Dev][C++] Allow ubuntu-cpp-thread-sanitizer Docker build with…
Browse files Browse the repository at this point in the history
… Ubuntu 24.04 (#43619)

Install the clang-rt libraries that are necessary to link Thread Sanitizer-enabled binaries. Also fix use of deprecated `BufferReader` constructor in some tests, so that compilation with CLang 18 succeeds.

Note that the C++ test suite still fails on Flight tests, as tracked in GH-36552.

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
pitrou authored Aug 14, 2024
1 parent 712cfe6 commit 7c8909a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions ci/docker/ubuntu-24.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ RUN latest_system_llvm=18 && \
clang-${llvm} \
clang-format-${clang_tools} \
clang-tidy-${clang_tools} \
libclang-rt-${llvm}-dev \
llvm-${llvm}-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists*
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/dataset/dataset_writer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class DatasetWriterTestFixture : public testing::Test {

std::shared_ptr<RecordBatch> ReadAsBatch(std::string_view data, int* num_batches) {
std::shared_ptr<io::RandomAccessFile> in_stream =
std::make_shared<io::BufferReader>(data);
std::make_shared<io::BufferReader>(std::make_shared<Buffer>(data));
EXPECT_OK_AND_ASSIGN(std::shared_ptr<ipc::RecordBatchFileReader> reader,
ipc::RecordBatchFileReader::Open(in_stream));
RecordBatchVector batches;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/io/compressed_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ TEST_P(CompressedOutputStreamTest, RandomData) {
TEST(TestSnappyInputStream, NotImplemented) {
std::unique_ptr<Codec> codec;
ASSERT_OK_AND_ASSIGN(codec, Codec::Create(Compression::SNAPPY));
std::shared_ptr<InputStream> stream = std::make_shared<BufferReader>("");
std::shared_ptr<InputStream> stream = BufferReader::FromString("");
ASSERT_RAISES(NotImplemented, CompressedInputStream::Make(codec.get(), stream));
}

Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/io/memory_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ template <typename SlowStreamType>
void TestSlowInputStream() {
using clock = std::chrono::high_resolution_clock;

auto stream = std::make_shared<BufferReader>(std::string_view("abcdefghijkl"));
std::shared_ptr<RandomAccessFile> stream = BufferReader::FromString("abcdefghijkl");
const double latency = 0.6;
auto slow = std::make_shared<SlowStreamType>(stream, latency);

Expand Down Expand Up @@ -519,7 +519,7 @@ class TestTransformInputStream : public ::testing::Test {
TransformInputStream::TransformFunc transform() const { return T(); }

void TestEmptyStream() {
auto wrapped = std::make_shared<BufferReader>(std::string_view());
std::shared_ptr<InputStream> wrapped = BufferReader::FromString({});
auto stream = std::make_shared<TransformInputStream>(wrapped, transform());

ASSERT_OK_AND_EQ(0, stream->Tell());
Expand Down Expand Up @@ -797,7 +797,7 @@ TEST(RangeReadCache, Basics) {
TEST(RangeReadCache, Concurrency) {
std::string data = "abcdefghijklmnopqrstuvwxyz";

auto file = std::make_shared<BufferReader>(Buffer(data));
auto file = std::make_shared<BufferReader>(std::make_shared<Buffer>(data));
std::vector<ReadRange> ranges{{1, 2}, {3, 2}, {8, 2}, {20, 2},
{25, 0}, {10, 4}, {14, 0}, {15, 4}};

Expand Down

0 comments on commit 7c8909a

Please sign in to comment.