Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meson #7

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e23882c
rpc: colocate service code generator with rpc
dotnwat May 15, 2022
a79858a
kafka: protocol code gen should take output paths
dotnwat May 15, 2022
a982ae1
build: setup and project and dependencies
dotnwat May 13, 2022
5a9a995
build: add test utilities
dotnwat Jun 2, 2022
9810e13
build: add ssx
dotnwat May 27, 2022
072a93e
build: add bytes
dotnwat May 13, 2022
c456a8e
build: add hashing
dotnwat Jun 1, 2022
8b55b82
build: add serde
dotnwat Jun 1, 2022
96910f5
build: add failure injector
dotnwat May 13, 2022
e8be0c7
build: add random
dotnwat May 13, 2022
b404b7e
build: add compression
dotnwat May 14, 2022
f4097ca
build: add model
dotnwat May 14, 2022
2dac67c
build: add reflection
dotnwat May 27, 2022
3cc0ced
build: add json
dotnwat May 13, 2022
bb4c607
build: add utils
dotnwat May 14, 2022
99f5d0e
build: add security
dotnwat May 14, 2022
2b100d2
build: add config
dotnwat May 13, 2022
1456210
build: generate version tag from git
dotnwat May 14, 2022
670451b
build: add syschecks
dotnwat May 14, 2022
e69b3e2
build: add networking
dotnwat May 14, 2022
e89c66b
build: add http
dotnwat May 14, 2022
b243786
build: add s3
dotnwat May 15, 2022
543c36b
build: add storage
dotnwat May 15, 2022
06bd5da
build: add rpc
dotnwat May 15, 2022
b00f7be
build: add raft
dotnwat May 15, 2022
6bd771a
build: add v8 engine
dotnwat May 15, 2022
b1ece79
build: add cloud storage
dotnwat May 15, 2022
43762c7
build: add cluster
dotnwat May 15, 2022
7fc147d
build: add archival
dotnwat May 15, 2022
dc007cc
build: add kafka
dotnwat May 15, 2022
70d190c
build: add coproc
dotnwat May 15, 2022
8f96bcb
build: add pandaproxy
dotnwat May 15, 2022
ee265fb
build: add redpanda
dotnwat May 16, 2022
821d5d5
build: add tests with forward dependencies
dotnwat Jun 2, 2022
c27bb03
build: add outcome test
dotnwat Jun 2, 2022
0e019ac
build: add script for testing build in docker
dotnwat May 17, 2022
122fb7b
meson github action build
dotnwat Jun 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
29 changes: 29 additions & 0 deletions .github/workflows/redpanda-meson-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2022 Redpanda Data, Inc.
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.md
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0

name: build-meson
on: push

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -qq \
python3 python3-pip python3-setuptools python3-wheel ninja-build \
libboost1.74-all-dev libprotobuf-dev libprotoc-dev libcrypto++-dev \
pkg-config libfmt-dev liblz4-dev libgnutls28-dev libc-ares-dev \
libyaml-cpp-dev ragel clang libabsl-dev libsnappy-dev libxxhash-dev \
libzstd-dev git python3-jsonschema xfslibs-dev valgrind systemtap-sdt-dev \
libsctp-dev ccache python3-jinja2 libroaring-dev cmake lld
sudo pip3 install meson
- name: checkout
uses: actions/checkout@v3
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from ubuntu:jammy

run apt-get update

run DEBIAN_FRONTEND=noninteractive apt-get install -qq \
python3 python3-pip python3-setuptools python3-wheel ninja-build \
libboost1.74-all-dev libprotobuf-dev libprotoc-dev libcrypto++-dev \
pkg-config libfmt-dev liblz4-dev libgnutls28-dev libc-ares-dev \
libyaml-cpp-dev ragel clang libabsl-dev libsnappy-dev libxxhash-dev \
libzstd-dev git python3-jsonschema xfslibs-dev valgrind systemtap-sdt-dev \
libsctp-dev ccache python3-jinja2 libroaring-dev cmake lld

run pip3 install meson

workdir /src/redpanda
cmd ["bash", "-c", "meson builddir && cd builddir && meson compile"]
51 changes: 51 additions & 0 deletions build-meson.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
set -e
set -x

CCACHE_DIR=$HOME/redpanda-meson-ccache
CC="ccache clang"
CXX="ccache clang++"
CC_LD="lld"
CXX_LD="lld"
NAME=redpanda-meson

mkdir -p $CCACHE_DIR
docker build -t $NAME .

function run {
local args=$*
docker run -v $PWD:/src/redpanda \
-v $CCACHE_DIR:/mnt/ccache \
-e CCACHE_DIR=/mnt/ccache -e CC="$CC" \
-e CC_LD="$CC_LD" -e CXX_LD="$CXX_LD" \
-e CXX="$CXX" -u $(id -u):$(id -g) -it $NAME $args
}

function reset_build {
rm -rf builddir
run meson builddir
}

function purge_subprojects {
run meson subprojects purge --confirm
}

function build {
reset_build
run meson compile -C builddir
}

function build_targets_isolated {
reset_build
targets=$(run meson introspect builddir --targets | jq -r "reverse | .[] | select(.subproject == null).name")
for target in ${targets}; do
reset_build
run meson compile -C builddir $target
done
}

function run_tests {
run meson test -C builddir
}

build
2 changes: 1 addition & 1 deletion cmake/rpcgen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function(rpcgen)
set(multi_value_args INCLUDES LIBRARIES DEFINITIONS COMPILE_OPTIONS)
cmake_parse_arguments(args "" "${one_value_args}" "${multi_value_args}" ${ARGN})
get_filename_component(out_dir ${args_OUT_FILE} DIRECTORY)
set(generator "${PROJECT_SOURCE_DIR}/tools/rpcgen.py")
set(generator "${PROJECT_SOURCE_DIR}/src/v/rpc/rpc_compiler.py")
add_custom_command(
DEPENDS
${args_IN_FILE}
Expand Down
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
project('redpanda', 'cpp',
default_options : [
'cpp_std=c++20',
'default_library=static',
])

subdir('src/v')
13 changes: 13 additions & 0 deletions src/v/archival/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
libarchival = library('archival',
'archival_policy.cc',
'service.cc',
'ntp_archiver_service.cc',
'probe.cc',
'types.cc',
'upload_controller.cc',
implicit_include_directories: false,
dependencies: [common, s3, storage, cluster])

archival = declare_dependency(
dependencies: [common, s3, storage, cluster],
link_with: libarchival)
8 changes: 8 additions & 0 deletions src/v/archival/tests/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ARGS "-- -c 1"
t = executable('test_archival',
'service_fixture.cc',
'ntp_archiver_test.cc',
'service_test.cc',
dependencies: [seastar_testing_main, archival, storage_test_utils,
redpanda_app, model_test_utils])
test('archival', t)
17 changes: 17 additions & 0 deletions src/v/bytes/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
libbytes = library('bytes',
'bytes.cc',
'iobuf.cc',
dependencies: [common, seastar],
implicit_include_directories: false)

bytes = declare_dependency(
link_with: libbytes,
dependencies: [common, seastar, absl])

t = executable('test_bytes',
'tests/iobuf_tests.cc',
'tests/iobuf_utils_tests.cc',
'tests/bytes_tests.cc',
dependencies: [seastar_testing_main, bytes])

test('bytes test', t)
21 changes: 21 additions & 0 deletions src/v/cloud_storage/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
libcloud_storage = library('cloud_storage',
'cache_service.cc',
'cache_probe.cc',
'topic_manifest.cc',
'partition_manifest.cc',
'recursive_directory_walker.cc',
'remote.cc',
'offset_translation_layer.cc',
'probe.cc',
'partition_probe.cc',
'partition_recovery_manager.cc',
'types.cc',
'remote_segment.cc',
'remote_partition.cc',
'remote_segment_index.cc',
implicit_include_directories: false,
dependencies: [seastar, common, config, model, s3, storage])

cloud_storage = declare_dependency(
dependencies: [seastar, common, config, model, s3, storage],
link_with: libcloud_storage)
15 changes: 15 additions & 0 deletions src/v/cloud_storage/tests/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ARGS "-- -c 1"
t = executable('test_cloud_storage',
'directory_walker_test.cc',
'partition_manifest_test.cc',
'topic_manifest_test.cc',
's3_imposter.cc',
'remote_test.cc',
'cache_test.cc',
'offset_translation_layer_test.cc',
'remote_segment_test.cc',
'remote_partition_test.cc',
'remote_segment_index_test.cc',
dependencies: [seastar_testing_main, cloud_storage, storage_test_utils,
model_test_utils, cluster])
test('cloud storage', t)
88 changes: 88 additions & 0 deletions src/v/cluster/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
cluster_services = [
'controller',
'id_allocator',
'metadata_dissemination_rpc',
'tx_gateway',
]

cluster_services_h = []
foreach service : cluster_services
t = custom_target(
input: f'@[email protected]',
output: f'@service@_service.h',
command: [rpc_compiler, '--service_file', '@INPUT@',
'--output_file', '@OUTPUT@'])
cluster_services_h += [t]
endforeach

libcluster = library('cluster',
'archival_metadata_stm.cc',
'metadata_cache.cc',
'partition_manager.cc',
'scheduling/partition_allocator.cc',
'logger.cc',
'config_frontend.cc',
'config_manager.cc',
'cluster_utils.cc',
'id_allocator.cc',
'id_allocator_frontend.cc',
'rm_partition_frontend.cc',
'tx_gateway_frontend.cc',
'tx_gateway.cc',
'service.cc',
'metadata_dissemination_handler.cc',
'metadata_dissemination_service.cc',
'metadata_dissemination_utils.cc',
'types.cc',
'notification_latch.cc',
'topic_table.cc',
'topic_updates_dispatcher.cc',
'members_table.cc',
'members_manager.cc',
'partition_leaders_table.cc',
'topics_frontend.cc',
'controller_backend.cc',
'controller.cc',
'partition.cc',
'partition_probe.cc',
'id_allocator_stm.cc',
'persisted_stm.cc',
'tm_stm.cc',
'rm_stm.cc',
'tx_helpers.cc',
'security_manager.cc',
'security_frontend.cc',
'data_policy_manager.cc',
'data_policy_frontend.cc',
'controller_api.cc',
'members_frontend.cc',
'members_backend.cc',
'health_manager.cc',
'non_replicable_topics_frontend.cc',
'scheduling/allocation_node.cc',
'scheduling/types.cc',
'scheduling/allocation_state.cc',
'scheduling/allocation_strategy.cc',
'scheduling/constraints.cc',
'scheduling/leader_balancer.cc',
'scheduling/leader_balancer_probe.cc',
'health_monitor_types.cc',
'health_monitor_backend.cc',
'health_monitor_frontend.cc',
'metrics_reporter.cc',
'node/types.cc',
'node/local_monitor.cc',
'feature_backend.cc',
'feature_manager.cc',
'feature_barrier.cc',
'feature_table.cc',
'drain_manager.cc',
cluster_services_h,
version_h,
implicit_include_directories: false,
dependencies: [common, config, model, raft, http, v8_engine, cloud_storage])

cluster = declare_dependency(
sources: [cluster_services_h, version_h],
dependencies: [common, config, model, raft, http, v8_engine, cloud_storage],
link_with: libcluster)
62 changes: 62 additions & 0 deletions src/v/cluster/tests/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
t = executable('bench_partition_allocator',
'allocation_bench.cc',
dependencies: [cluster, seastar_perf_testing])
benchmark('partition allocator', t)

t = executable('test_metadata_dissemination_utils',
'metadata_dissemination_utils_test.cc',
dependencies: [cluster, boost])
test('metadata dissemination', t)

t = executable('test_cluster',
'partition_allocator_tests.cc',
'simple_batch_builder_test.cc',
'serialization_rt_test.cc',
'cluster_utils_tests.cc',
'cluster_tests.cc',
'metadata_dissemination_test.cc',
'notification_latch_test.cc',
'autocreate_test.cc',
'controller_state_test.cc',
'commands_serialization_test.cc',
'topic_table_test.cc',
'topic_updates_dispatcher_test.cc',
'controller_backend_test.cc',
'configuration_change_test.cc',
'idempotency_tests.cc',
'feature_barrier_test.cc',
'feature_table_test.cc',
'tm_stm_tests.cc',
'rm_stm_tests.cc',
'controller_api_tests.cc',
'decommissioning_tests.cc',
'replicas_rebalancing_tests.cc',
'create_partitions_test.cc',
'id_allocator_stm_test.cc',
'data_policy_controller_test.cc',
'health_monitor_test.cc',
'topic_configuration_compat_test.cc',
'local_monitor_test.cc',
dependencies: [cluster, seastar_testing_main, model_test_utils, redpanda_app])
test('cluster', t)

t = executable('test_partition_movement',
'partition_moving_test.cc',
dependencies: [common, cluster, seastar_testing_main, model_test_utils,
redpanda_app])
test('partition movement', t)

t = executable('test_leader_balancer',
'leader_balancer_test.cc',
dependencies: [boost, cluster])
test('leader balancer', t)

t = executable('bench_leader_balancer',
'leader_balancer_bench.cc',
dependencies: [seastar_perf_testing, cluster])
benchmark('leader balancer', t)

t = executable('test_metrics_reporter',
'metrics_reporter_test.cc',
dependencies: [boost, cluster])
test('metrics reporter', t)
25 changes: 25 additions & 0 deletions src/v/compression/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
libcompression = library('compression',
'compression.cc',
'stream_zstd.cc',
'logger.cc',
'snappy_standard_compressor.cc',
'internal/snappy_java_compressor.cc',
'internal/lz4_frame_compressor.cc',
'internal/gzip_compressor.cc',
cpp_args: ['-DZSTD_STATIC_LINKING_ONLY'],
implicit_include_directories: false,
dependencies: [common, bytes, zlib, zstd, snappy])

compression = declare_dependency(
dependencies: [common, bytes, zlib, zstd, snappy],
link_with: libcompression)

t = executable('bench_zstd_stream',
'tests/zstd_stream_bench.cc',
dependencies: [compression, seastar_perf_testing])
benchmark('zstd stream', t)

t = executable('test_zstd',
'tests/zstd_tests.cc',
dependencies: [compression, seastar_testing_main])
test('zstd testing', t)
23 changes: 23 additions & 0 deletions src/v/config/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
libconfig = library('config',
'configuration.cc',
'node_config.cc',
'base_property.cc',
'rjson_serialization.cc',
'validators.cc',
dependencies: [common, seastar, json, absl, model, security, yaml, boost])

config = declare_dependency(
dependencies: [common, seastar, json, absl, model, security, yaml, boost],
link_with: libconfig)

t = executable('test_configuration',
'tests/bounded_property_test.cc',
'tests/enum_property_test.cc',
'tests/retention_property_test.cc',
'tests/config_store_test.cc',
'tests/socket_address_convert_test.cc',
'tests/tls_config_convert_test.cc',
'tests/advertised_kafka_api_test.cc',
'tests/seed_server_property_test.cc',
dependencies: [config, seastar_testing_main])
test('config testing', t)
Loading