This change is a modernization of Seastar's build system to maximize its
ability to integrate easily into applications and into the C++
ecosystem.
These changes reflect the C++'s community's evolving and solidifying
understanding of how to work with CMake and structure libraries and also
my own evolving experience and understanding in the same.
With this structure and integration support, Seastar and Seastar-based
applications will be easier to package, deploy, and develop, and in a
variety of environments.
There are many internal changes, but none of these changes should impact
existing consumers of Seastar.
Changes
--------------------
Change: Bundled Seastar dependencies (`dpdk`, `fmt`, `c-ares`) are now
independent of the build.
Motivation: Dependencies like `fmt` and `dpdk` are "public"
dependencies, in that they must be present on a system where
Seastar (or one of its applications) is installed. Bundling
the dependencies means that the Seastar build and
installation is not relocatable to arbitrary systems because
these dependencies may be supplied in a different fashion.
For example, in the future a `fmt` package may be available
and a client may wish to satisfy that dependency that way
instead of with the bundled sources. The build will now
succeed as long as all dependencies are satisfied. It will
be trivial, with this decoupling, to add optional support
for the Conan package manager as an option for these
dependencies as well.
Change: Git submodules are removed, with the exception of DPDK.
Motivation: With the exception of DPDK, in which ScyllaDB has committed
code which has not reached upstream, all dependencies can be
satisfied directly from their origin. Since the build is
independent of the location of the dependencies, users can
indicate their location to CMake when Seastar's build is
configured (or use `cmake-cooking`, described below).
Change: All dependencies are now precisely and explicitly specified with
modern CMake "find module" scripts. As long as all requirements
are satisfied in some way, the build will succeed.
Motivation: Users may wish to satisfy dependencies by installing a
package with `dnf` or `apt-get`, or they may wish to
download, compile, and install sources themselves. They may
wish to use a package manager like Conan or Nix to supply
dependencies, or use `cmake-cooking` for development
environments. They may wish to employ a combination of these
depending on their particular needs, and this flexibility
allows for this easily.
Change: A `cmake-cooking` recipe is available in `recipe/dev.cmake`.
Motivation: Since dependencies are now decoupled from the build, we need
to maintain a clear "snapshot" of the versions of all
dependencies that is repeatable and isolated from changes in
Linux distributions (which are moving targets). Also, Some
dependencies are not widely available. Users can still
supply dependencies externally if they wish (see use cases
below), but they also have the option of seamlessly building
a development environment with the exact versions as their
peers and colleagues. This specification is managed in
revision control so updates are propagated easily.
Change: Consumers can run `ninja install` and the installed files are
relocatable and allow for easy consumption from CMake and with
pkg-config (though pkg-config files are not relocatable since
some dependencies do not have support).
Motivation: This makes packaging a breeze, whether its for Linux
distributions and package managers like Conan, enterprise
customers/users, and developers experimenting on their
personal machine. Seastar can still be "embedded" as a
nested target with `add_subdirectory` but this work-flow is
discouraged.
Change: All public headers go in `include` and all private
headers and source files go in `src`.
Motivation: It is important to be clear on the private and public
interfaces of the library and transitive dependencies of
each. Not only is this convention widely adopted in the C++
community, but the clear separation in the file-system makes
the logical separation abundantly clear to humans. It also
makes the "install" target easy to write (just use all the
stuff in `include`.
Change: All public header files are in the `seastar` directory. i.e.,
you would include `<seastar/core/future.hh>` instead of
`<core/future>`.
Motivation: Seastar does not exist in a vacuum. Prefixing the file
header paths makes it obvious to readers of code that the
file belongs to Seastar.
Change: Increment the version of Seastar to 18.05 in preparation for the
next release.
Motivation: Not all consumers of Seastar will want to track it at the
Git commit level. Preparing now for well-defined versioning
and release process (whatever that may be) is an important
step. We can no longer use the same `1.0.01 version.
Change: All public header files of Seastar are included with full
paths (even in the same directory) relative to `include` and
with <>-brackets (everywhere in the project).
Motivation: The full paths allow header files to be relocatable. The
<>-brackets reinforce the important information that the
header in question is public and prevent ambiguity. This
will help to prevent over-including.
Change: All private header files are included with full paths relative
to `src` (even in the same directory) and with
""-brackets (everywhere in the project).
Motivation: The full paths allow header files to be relocatable. The
""-brackets emphasize that the header is private.
Change: Tests are now divided into unit tests, demos, performance tests,
and application tests.
Motivation: Grouping tests based on their functionality means that they
can more easily be used for that purpose. All tests in
`test/unit` should gate a release if they fail. Programs in
`demo` are interactive or non-gating.
Change: All targets for applications, tests, and demos have uniform
naming conventions.
Motivation: Consistency is nice and work-flows are faster when mental
energy does not have to spent on learning how to do
something different every time.
Change: A new "dist" test verifies that installing Seastar includes
everything necessary to consume it (from both pkg-config and
CMake).
Motivation: Happy consumers and productive developers.
Change: A new `HACKING.md` file with instructions for developers.
Motivation: A helping hand is always appreciated. The document will
evolve based on commonly-identified issues and make it
easier to contribute to Seastar.
Use
--------------------
Most existing users of Seastar will continue to supply most dependencies
of Seastar with system packages via `install-dependencies.sh`.
However, `c-ares` and `fmt` are not commonly packaged. Since the build
is now independent of the source of these dependencies, users can fetch
and install dependencies and point CMake to them at configure time.
Alternatively (and optionally), the `cooking.sh` script is an easy way
to set-up a repeatable and isolated development environment with all or
some of Seastar's dependencies.
Instead of configuring with `cmake`, you can fetch include all
dependencies in the `dev` "recipe" with
./cooking.sh -r dev
and then build inside the new `build` directory:
ninja -C build
If you'd like to use system packages for all dependencies except for
`c-ares` and `fmt`, then use the `-i` ("include") flag:
./cooking.sh -r dev -i c-ares -i fmt
If you'd like to flip the other way and use `cmake-cooking` for all
dependencies except for Boost (which you supply from the system), then
use the `-e` ("exclude") flag:
./cooking.sh -r dev -e Boost
See `HACKING.md` for more information.
Known issues
--------------------
The following tests fail, but this appears to be not an issue with the
build system:
- `test/unit/alloc`
- `test/unit/allocator`
- `test/unit/dns`
- `test/unit/slab`
- `app/memcached/test/ascii`
Other notes
--------------------
This build removes some "cruft" from the old system which is
likely unnecessary today.
In the interest of maintaining a clean and clear build which is easy to
change, I've removed some of that "cruft" optimistically. It is my
intention to add it back, possibly in an improved form, based on
demonstrated need as it arises (with the old build as a reference).
Signed-off-by: Jesse Haber-Kucharsky <
jhab...@scylladb.com>
---
.gitignore | 1 +
.gitmodules | 12 +-
CMakeLists.txt | 1381 ++++++++------------
HACKING.md | 138 ++
LICENSE => LICENSE.md | 0
NOTICE => NOTICE.md | 0
README.md | 19 +-
{apps => app}/CMakeLists.txt | 30 +-
{apps/io_tester => app/httpd}/CMakeLists.txt | 16 +-
{apps => app}/httpd/demo.json | 0
{apps => app}/httpd/main.cc | 12 +-
{apps/iotune => app/io_tester}/CMakeLists.txt | 8 +-
{apps => app}/io_tester/conf.yaml | 0
{apps => app}/io_tester/io_tester.cc | 20 +-
{apps/memcached => app/iotune}/CMakeLists.txt | 9 +-
{apps => app}/iotune/iotune.cc | 22 +-
{tests => app}/memcached/CMakeLists.txt | 36 +-
{apps => app}/memcached/ascii.rl | 4 +-
{apps => app}/memcached/memcache.cc | 30 +-
{apps => app}/memcached/memcached.hh | 2 +-
app/memcached/test/CMakeLists.txt | 56 +
{tests/memcached => app/memcached/test}/test.py | 0
.../memcached/test}/test_ascii_parser.cc | 10 +-
.../memcached/test}/test_memcached.py | 0
{apps => app}/seawreck/CMakeLists.txt | 3 +-
{apps => app}/seawreck/seawreck.cc | 16 +-
c-ares | 1 -
cmake-tests/asan_fiber.cc | 32 -
cmake-tests/have_membarrier.cc | 28 -
cmake-tests/sanitize_vptr.cc | 32 -
cmake-tests/visibility_flags.cc | 45 -
cmake-tools/dpdk_adjust_variables.py | 76 --
cmake-tools/dpdk_query_cflags.py | 58 -
cmake/FindCryptopp.cmake | 60 -
cmake/{FindLz4.cmake => FindGnuTLS.cmake} | 54 +-
.../FindLinuxMembarrier.cmake | 22 +-
cmake/FindSanitizers.cmake | 79 ++
cmake/FindStdFilesystem.cmake | 65 +
cmake/{FindLz4.cmake => Findc-ares.cmake} | 50 +-
cmake/{FindLz4.cmake => Findcryptopp.cmake} | 52 +-
cmake/{FindLz4.cmake => Finddl.cmake} | 55 +-
cmake/Finddpdk.cmake | 373 ++++++
cmake/{FindHWLoc.cmake => Findhwloc.cmake} | 50 +-
cmake/{FindLz4.cmake => Findlksctp-tools.cmake} | 51 +-
cmake/{FindLz4.cmake => Findlz4.cmake} | 56 +-
.../Findragel.cmake | 30 +-
cmake/Findrt.cmake | 59 +
cmake/{FindYaml-cpp.cmake => Findyaml-cpp.cmake} | 50 +-
cmake/
SeastarConfig.cmake.in | 60 +
cmake/code_test/LinuxMembarrier_test.cc | 8 +
cmake/code_test/Sanitizers_fiber_test.cc | 11 +
cmake/code_test/StdFilesystem_test.cc | 6 +
cmake/code_test/dl_test.cc | 7 +
cmake/code_test/rt_test.cc | 10 +
configure.py | 1078 ---------------
cooking.sh | 552 ++++++++
demo/CMakeLists.txt | 101 ++
.../block_discard_demo.cc | 8 +-
tests/echotest.cc => demo/echo_demo.cc | 8 +-
tests/ip_test.cc => demo/ip_demo.cc | 10 +-
tests/l3_test.cc => demo/l3_demo.cc | 6 +-
tests/linecount.cc => demo/line_count_demo.cc | 8 +-
tests/rpc.cc => demo/rpc_demo.cc | 10 +-
{tests => demo}/scheduling_group_demo.cc | 12 +-
tests/tcp_test.cc => demo/tcp_demo.cc | 6 +-
.../tcp_sctp_client_demo.cc | 6 +-
.../tcp_sctp_server_demo.cc | 8 +-
{tests => demo}/tls_echo_server.hh | 16 +-
.../tls_echo_server_demo.cc | 8 +-
.../tls_simple_client_demo.cc | 10 +-
tests/udp_client.cc => demo/udp_client_demo.cc | 8 +-
tests/udp_server.cc => demo/udp_server_demo.cc | 6 +-
.../udp_zero_copy.cc => demo/udp_zero_copy_demo.cc | 12 +-
doc/CMakeLists.txt | 80 ++
Doxyfile => doc/Doxyfile.cmake | 8 +-
DoxygenLayout.xml => doc/DoxygenLayout.xml | 0
doc/building-arch.md | 4 +-
doc/building-centos.md | 5 +-
doc/building-fedora.md | 7 +-
doc/building-ubuntu.md | 4 +-
doc/htmlsplit.py | 2 +-
dpdk => extern/dpdk | 0
fmt | 1 -
{http => gen/http}/request_parser.rl | 4 +-
.../http/response_parser.rl | 2 +-
{json => gen}/json2code.py | 5 +-
{proto => gen/proto}/metrics2.proto | 0
http/CMakeLists.txt | 5 -
{core => include/seastar/core}/abort_source.hh | 6 +-
{core => include/seastar/core}/alien.hh | 8 +-
{core => include/seastar/core}/align.hh | 0
{core => include/seastar/core}/aligned_buffer.hh | 2 +-
{core => include/seastar/core}/app-template.hh | 4 +-
{core => include/seastar/core}/apply.hh | 0
{core => include/seastar/core}/array_map.hh | 0
{core => include/seastar/core}/bitops.hh | 0
{core => include/seastar/core}/bitset-iter.hh | 0
{core => include/seastar/core}/byteorder.hh | 2 +-
{core => include/seastar/core}/cacheline.hh | 0
{core => include/seastar/core}/checked_ptr.hh | 2 +-
{core => include/seastar/core}/chunked_fifo.hh | 0
{core => include/seastar/core}/circular_buffer.hh | 4 +-
.../core}/circular_buffer_fixed_capacity.hh | 0
.../seastar/core}/condition-variable.hh | 4 +-
{core => include/seastar/core}/deleter.hh | 0
{core => include/seastar/core}/distributed.hh | 2 +-
{core => include/seastar/core}/do_with.hh | 4 +-
{core => include/seastar/core}/dpdk_rte.hh | 0
{core => include/seastar/core}/enum.hh | 0
{core => include/seastar/core}/exception_hacks.hh | 0
{core => include/seastar/core}/execution_stage.hh | 24 +-
{core => include/seastar/core}/expiring_fifo.hh | 10 +-
{core => include/seastar/core}/fair_queue.hh | 12 +-
{core => include/seastar/core}/file.hh | 12 +-
{core => include/seastar/core}/fsqual.hh | 2 +-
{core => include/seastar/core}/fstream.hh | 6 +-
{core => include/seastar/core}/function_traits.hh | 0
{core => include/seastar/core}/future-util.hh | 16 +-
{core => include/seastar/core}/future.hh | 14 +-
{core => include/seastar/core}/gate.hh | 2 +-
{core => include/seastar/core}/iostream-impl.hh | 8 +-
{core => include/seastar/core}/iostream.hh | 6 +-
{core => include/seastar/core}/linux-aio.hh | 0
{core => include/seastar/core}/lowres_clock.hh | 4 +-
{core => include/seastar/core}/manual_clock.hh | 0
{core => include/seastar/core}/memory.hh | 4 +-
{core => include/seastar/core}/metrics.hh | 8 +-
{core => include/seastar/core}/metrics_api.hh | 4 +-
.../seastar/core}/metrics_registration.hh | 0
{core => include/seastar/core}/metrics_types.hh | 0
{core => include/seastar/core}/pipe.hh | 4 +-
{core => include/seastar/core}/posix.hh | 4 +-
{core => include/seastar/core}/preempt.hh | 0
{core => include/seastar/core}/prefetch.hh | 4 +-
{core => include/seastar/core}/print.hh | 2 +-
{core => include/seastar/core}/prometheus.hh | 2 +-
{core => include/seastar/core}/queue.hh | 4 +-
{core => include/seastar/core}/ragel.hh | 8 +-
{core => include/seastar/core}/reactor.hh | 56 +-
{core => include/seastar/core}/report_exception.hh | 0
{core => include/seastar/core}/resource.hh | 0
{core => include/seastar/core}/rwlock.hh | 2 +-
.../seastar/core}/scattered_message.hh | 8 +-
{core => include/seastar/core}/scheduling.hh | 2 +-
{core => include/seastar/core}/scollectd.hh | 16 +-
{core => include/seastar/core}/scollectd_api.hh | 4 +-
{core => include/seastar/core}/seastar.hh | 4 +-
{core => include/seastar/core}/semaphore.hh | 8 +-
{core => include/seastar/core}/sharded.hh | 8 +-
{core => include/seastar/core}/shared_future.hh | 4 +-
{core => include/seastar/core}/shared_mutex.hh | 4 +-
{core => include/seastar/core}/shared_ptr.hh | 6 +-
.../seastar/core}/shared_ptr_debug_helper.hh | 0
.../seastar/core}/shared_ptr_incomplete.hh | 2 +-
{core => include/seastar/core}/simple-stream.hh | 2 +-
{core => include/seastar/core}/slab.hh | 6 +-
{core => include/seastar/core}/sleep.hh | 12 +-
{core => include/seastar/core}/sstring.hh | 2 +-
{core => include/seastar/core}/stall_sampler.hh | 4 +-
{core => include/seastar/core}/stream.hh | 2 +-
.../seastar/core}/systemwide_memory_barrier.hh | 0
{core => include/seastar/core}/task.hh | 2 +-
{core => include/seastar/core}/temporary_buffer.hh | 4 +-
{core => include/seastar/core}/thread.hh | 14 +-
.../seastar/core}/thread_cputime_clock.hh | 0
{core => include/seastar/core}/thread_impl.hh | 2 +-
{core => include/seastar/core}/timer-set.hh | 2 +-
{core => include/seastar/core}/timer.hh | 4 +-
{core => include/seastar/core}/transfer.hh | 0
{core => include/seastar/core}/unaligned.hh | 0
{core => include/seastar/core}/units.hh | 0
{core => include/seastar/core}/vector-data-sink.hh | 2 +-
{core => include/seastar/core}/vla.hh | 2 +-
{core => include/seastar/core}/weak_ptr.hh | 0
{http => include/seastar/http}/api_docs.hh | 10 +-
{http => include/seastar/http}/common.hh | 2 +-
{http => include/seastar/http}/exception.hh | 4 +-
{http => include/seastar/http}/file_handler.hh | 4 +-
.../seastar/http}/function_handlers.hh | 4 +-
{http => include/seastar/http}/handlers.hh | 8 +-
{http => include/seastar/http}/httpd.hh | 22 +-
{http => include/seastar/http}/json_path.hh | 8 +-
{http => include/seastar/http}/matcher.hh | 4 +-
{http => include/seastar/http}/matchrules.hh | 8 +-
{http => include/seastar/http}/mime_types.hh | 2 +-
{http => include/seastar/http}/reply.hh | 10 +-
{http => include/seastar/http}/request.hh | 4 +-
{http => include/seastar/http}/routes.hh | 10 +-
{http => include/seastar/http}/transformers.hh | 4 +-
{json => include/seastar/json}/formatter.hh | 4 +-
{json => include/seastar/json}/json_elements.hh | 6 +-
{net => include/seastar/net}/api.hh | 14 +-
{net => include/seastar/net}/arp.hh | 10 +-
{net => include/seastar/net}/byteorder.hh | 2 +-
{net => include/seastar/net}/config.hh | 0
{net => include/seastar/net}/const.hh | 0
{net => include/seastar/net}/dhcp.hh | 4 +-
{net => include/seastar/net}/dns.hh | 8 +-
{net => include/seastar/net}/dpdk.hh | 6 +-
{net => include/seastar/net}/ethernet.hh | 4 +-
{net => include/seastar/net}/inet_address.hh | 4 +-
{net => include/seastar/net}/ip.hh | 22 +-
{net => include/seastar/net}/ip_checksum.hh | 2 +-
{net => include/seastar/net}/native-stack.hh | 2 +-
{net => include/seastar/net}/net.hh | 18 +-
{net => include/seastar/net}/packet-data-source.hh | 4 +-
{net => include/seastar/net}/packet-util.hh | 2 +-
{net => include/seastar/net}/packet.hh | 6 +-
{net => include/seastar/net}/posix-stack.hh | 6 +-
{net => include/seastar/net}/proxy.hh | 4 +-
{net => include/seastar/net}/socket_defs.hh | 2 +-
{net => include/seastar/net}/stack.hh | 2 +-
{net => include/seastar/net}/tcp-stack.hh | 2 +-
{net => include/seastar/net}/tcp.hh | 22 +-
{net => include/seastar/net}/tls.hh | 8 +-
{net => include/seastar/net}/toeplitz.hh | 0
{net => include/seastar/net}/udp.hh | 10 +-
{net => include/seastar/net}/virtio-interface.hh | 0
{net => include/seastar/net}/virtio.hh | 4 +-
{rpc => include/seastar/rpc}/lz4_compressor.hh | 4 +-
.../seastar/rpc}/multi_algo_compressor_factory.hh | 4 +-
{rpc => include/seastar/rpc}/rpc.hh | 26 +-
{rpc => include/seastar/rpc}/rpc_impl.hh | 16 +-
{rpc => include/seastar/rpc}/rpc_types.hh | 10 +-
.../seastar/util}/alloc_failure_injector.hh | 2 +-
{util => include/seastar/util}/backtrace.hh | 4 +-
{util => include/seastar/util}/bool_class.hh | 0
{util => include/seastar/util}/conversions.hh | 0
{util => include/seastar/util}/defer.hh | 0
{util => include/seastar/util}/eclipse.hh | 0
.../seastar/util}/function_input_iterator.hh | 0
{util => include/seastar/util}/gcc6-concepts.hh | 0
{util => include/seastar/util}/indirect.hh | 0
{util => include/seastar/util}/is_smart_ptr.hh | 0
{util => include/seastar/util}/lazy.hh | 0
{util => include/seastar/util}/log-cli.hh | 6 +-
{util => include/seastar/util}/log.hh | 2 +-
.../seastar/util}/noncopyable_function.hh | 0
.../seastar/util}/optimized_optional.hh | 4 +-
{util => include/seastar/util}/print_safe.hh | 0
{util => include/seastar/util}/program-options.hh | 2 +-
.../seastar/util}/reference_wrapper.hh | 0
{util => include/seastar/util}/spinlock.hh | 0
.../seastar/util}/transform_iterator.hh | 0
{util => include/seastar/util}/tuple_utils.hh | 0
{util => include/seastar/util}/variant_utils.hh | 0
{licenses => license}/dpdk.txt | 0
{licenses => license}/freebsd.txt | 0
pkgconfig/seastar.pc.cmake | 43 +
proto/CMakeLists.txt | 7 -
recipe/dev.cmake | 272 ++++
recipe/dpdk_config | 23 +
.../CMakeLists.txt => recipe/dpdk_configure.cmake | 30 +-
{scripts => script}/dpdk_nic_bind.py | 0
{scripts => script}/perftune.py | 0
{scripts => script}/perftune.yaml | 0
{scripts => script}/posix_net_conf.sh | 0
{scripts => script}/run_with_dpdk.sh | 0
{scripts => script}/seastar-addr2line | 0
{scripts => script}/seastar-cpu-map.sh | 0
{scripts => script}/tap.sh | 0
seastar_cmake.py | 39 -
{core => src/core}/alien.cc | 6 +-
{core => src/core}/app-template.cc | 14 +-
{core => src/core}/dpdk_rte.cc | 6 +-
{core => src/core}/exception_hacks.cc | 6 +-
{core => src/core}/execution_stage.cc | 4 +-
{core => src/core}/file-impl.hh | 4 +-
{core => src/core}/fsqual.cc | 8 +-
{core => src/core}/fstream.cc | 10 +-
{core => src/core}/future-util.cc | 4 +-
{core => src/core}/linux-aio.cc | 2 +-
{core => src/core}/memory.cc | 20 +-
{core => src/core}/metrics.cc | 4 +-
{core => src/core}/posix.cc | 4 +-
{core => src/core}/prometheus.cc | 12 +-
{core => src/core}/reactor.cc | 58 +-
{core => src/core}/resource.cc | 12 +-
{core => src/core}/scollectd-impl.hh | 6 +-
{core => src/core}/scollectd.cc | 11 +-
{core => src/core}/systemwide_memory_barrier.cc | 6 +-
{core => src/core}/thread.cc | 4 +-
{http => src/http}/api_docs.cc | 14 +-
{http => src/http}/common.cc | 2 +-
{http => src/http}/file_handler.cc | 12 +-
{http => src/http}/httpd.cc | 20 +-
{http => src/http}/json_path.cc | 2 +-
{http => src/http}/matcher.cc | 2 +-
{http => src/http}/mime_types.cc | 2 +-
{http => src/http}/reply.cc | 6 +-
{http => src/http}/routes.cc | 8 +-
{http => src/http}/transformers.cc | 2 +-
{json => src/json}/formatter.cc | 4 +-
{json => src/json}/json_elements.cc | 2 +-
{net => src/net}/arp.cc | 2 +-
{net => src/net}/config.cc | 4 +-
{net => src/net}/dhcp.cc | 8 +-
{net => src/net}/dns.cc | 20 +-
{net => src/net}/dpdk.cc | 34 +-
{net => src/net}/ethernet.cc | 2 +-
{net => src/net}/inet_address.cc | 8 +-
{net => src/net}/ip.cc | 12 +-
{net => src/net}/ip_checksum.cc | 4 +-
{net => src/net}/native-stack-impl.hh | 4 +-
{net => src/net}/native-stack.cc | 24 +-
{net => src/net}/net.cc | 8 +-
{net => src/net}/packet.cc | 4 +-
{net => src/net}/posix-stack.cc | 8 +-
{net => src/net}/proxy.cc | 4 +-
{net => src/net}/stack.cc | 4 +-
{net => src/net}/tcp.cc | 12 +-
{net => src/net}/tls.cc | 14 +-
{net => src/net}/udp.cc | 4 +-
{net => src/net}/virtio.cc | 30 +-
{rpc => src/rpc}/lz4_compressor.cc | 4 +-
{rpc => src/rpc}/rpc.cc | 2 +-
{util => src/util}/alloc_failure_injector.cc | 8 +-
{util => src/util}/backtrace.cc | 4 +-
{util => src/util}/conversions.cc | 4 +-
{util => src/util}/log.cc | 10 +-
{util => src/util}/program-options.cc | 2 +-
test.py | 232 ----
.../CMakeLists.txt | 31 +-
test/dist/CMakeLists.txt | 54 +
.../dist/consumer/CMakeLists.txt | 20 +-
.../CMakeLists.txt => test/dist/consumer/Makefile | 15 +-
test/dist/consumer/cmake_consumer.cc | 15 +
test/dist/consumer/pkgconfig_consumer.cc | 15 +
test/dist/consumer/recipe/test_dist.cmake | 10 +
.../dist/consumer_test.sh | 33 +-
{tests => test}/exchanger.hh | 0
test/perf/CMakeLists.txt | 77 ++
.../perf_fstream.cc => test/perf/fstream_perf.cc | 8 +-
.../perf/future_util_perf.cc | 0
{tests => test}/perf/perf-tests.md | 0
{tests => test}/perf/perf_tests.cc | 4 +-
{tests => test}/perf/perf_tests.hh | 4 +-
{tests => test}/test-utils.cc | 11 +-
{tests => test}/test-utils.hh | 2 +-
{tests => test}/test_runner.cc | 19 +-
{tests => test}/test_runner.hh | 5 +-
test/unit/CMakeLists.txt | 260 ++++
{tests => test/unit}/abort_source_test.cc | 8 +-
{tests => test/unit}/alien_test.cc | 8 +-
{tests => test/unit}/alloc_test.cc | 6 +-
{tests => test/unit}/allocator_test.cc | 4 +-
{tests => test/unit}/catest.key | 0
{tests => test/unit}/catest.pem | 0
{tests => test/unit}/checked_ptr_test.cc | 4 +-
{tests => test/unit}/chunked_fifo_test.cc | 4 +-
.../unit}/circular_buffer_fixed_capacity_test.cc | 2 +-
{tests => test/unit}/circular_buffer_test.cc | 2 +-
{tests => test/unit}/connect_test.cc | 4 +-
{tests => test/unit}/defer_test.cc | 2 +-
{tests => test/unit}/directory_test.cc | 8 +-
{tests => test/unit}/distributed_test.cc | 10 +-
{tests => test/unit}/dns_test.cc | 14 +-
{tests => test/unit}/execution_stage_test.cc | 6 +-
{tests => test/unit}/expiring_fifo_test.cc | 6 +-
{tests => test/unit}/fair_queue_test.cc | 16 +-
tests/fileiotest.cc => test/unit/file_io_test.cc | 14 +-
{tests => test/unit}/foreign_ptr_test.cc | 10 +-
{tests => test/unit}/fstream_test.cc | 16 +-
{tests => test/unit}/futures_test.cc | 16 +-
tests/httpd.cc => test/unit/httpd_test.cc | 26 +-
{tests => test/unit}/json_formatter_test.cc | 12 +-
{tests => test/unit}/loopback_socket.hh | 18 +-
{tests => test/unit}/lowres_clock_test.cc | 6 +-
{tests => test/unit}/mkcert.gmk | 0
{tests => test/unit}/mock_file.hh | 2 +-
{tests => test/unit}/netconfig_test.cc | 2 +-
{tests => test/unit}/noncopyable_function_test.cc | 2 +-
{tests => test/unit}/output_stream_test.cc | 14 +-
{tests => test/unit}/packet_test.cc | 2 +-
{tests => test/unit}/program_options_test.cc | 2 +-
{tests => test/unit}/queue_test.cc | 6 +-
{tests => test/unit}/rpc_test.cc | 12 +-
{tests => test/unit}/semaphore_test.cc | 18 +-
{tests => test/unit}/shared_ptr_test.cc | 4 +-
{tests => test/unit}/slab_test.cc | 2 +-
{tests => test/unit}/smp_test.cc | 6 +-
{tests => test/unit}/sstring_test.cc | 2 +-
{tests => test/unit}/test.crl | 0
{tests => test/unit}/test.crt | 0
{tests => test/unit}/test.csr | 0
{tests => test/unit}/test.key | 0
.../unit/thread_context_switch_test.cc | 13 +-
{tests => test/unit}/thread_test.cc | 16 +-
tests/timertest.cc => test/unit/timer_test.cc | 6 +-
{tests => test/unit}/tls-ca-bundle.pem | 0
{tests => test/unit}/tls_test.cc | 48 +-
{tests => test/unit}/tuple_utils_test.cc | 2 +-
{tests => test/unit}/unwind_test.cc | 6 +-
{tests => test/unit}/weak_ptr_test.cc | 2 +-
tests/CMakeLists.txt | 311 -----
tests/perf/CMakeLists.txt | 28 -
396 files changed, 4368 insertions(+), 4159 deletions(-)
create mode 100644 HACKING.md
rename LICENSE => LICENSE.md (100%)
rename NOTICE => NOTICE.md (100%)
rename {apps => app}/CMakeLists.txt (66%)
rename {apps/io_tester => app/httpd}/CMakeLists.txt (68%)
rename {apps => app}/httpd/demo.json (100%)
rename {apps => app}/httpd/main.cc (93%)
rename {apps/iotune => app/io_tester}/CMakeLists.txt (86%)
rename {apps => app}/io_tester/conf.yaml (100%)
rename {apps => app}/io_tester/io_tester.cc (98%)
rename {apps/memcached => app/iotune}/CMakeLists.txt (84%)
rename {apps => app}/iotune/iotune.cc (98%)
copy {tests => app}/memcached/CMakeLists.txt (58%)
rename {apps => app}/memcached/ascii.rl (98%)
rename {apps => app}/memcached/memcache.cc (99%)
rename {apps => app}/memcached/memcached.hh (98%)
create mode 100644 app/memcached/test/CMakeLists.txt
rename {tests/memcached => app/memcached/test}/test.py (100%)
rename {tests/memcached => app/memcached/test}/test_ascii_parser.cc (98%)
rename {tests/memcached => app/memcached/test}/test_memcached.py (100%)
rename {apps => app}/seawreck/CMakeLists.txt (93%)
rename {apps => app}/seawreck/seawreck.cc (96%)
delete mode 160000 c-ares
delete mode 100644 cmake-tests/asan_fiber.cc
delete mode 100644 cmake-tests/have_membarrier.cc
delete mode 100644 cmake-tests/sanitize_vptr.cc
delete mode 100644 cmake-tests/visibility_flags.cc
delete mode 100755 cmake-tools/dpdk_adjust_variables.py
delete mode 100755 cmake-tools/dpdk_query_cflags.py
delete mode 100644 cmake/FindCryptopp.cmake
copy cmake/{FindLz4.cmake => FindGnuTLS.cmake} (50%)
copy cmake-tools/query_link_pool_depth.py => cmake/FindLinuxMembarrier.cmake (55%)
mode change 100755 => 100644
create mode 100644 cmake/FindSanitizers.cmake
create mode 100644 cmake/FindStdFilesystem.cmake
copy cmake/{FindLz4.cmake => Findc-ares.cmake} (51%)
copy cmake/{FindLz4.cmake => Findcryptopp.cmake} (51%)
copy cmake/{FindLz4.cmake => Finddl.cmake} (51%)
create mode 100644 cmake/Finddpdk.cmake
rename cmake/{FindHWLoc.cmake => Findhwloc.cmake} (53%)
copy cmake/{FindLz4.cmake => Findlksctp-tools.cmake} (51%)
rename cmake/{FindLz4.cmake => Findlz4.cmake} (50%)
copy cmake-tools/query_link_pool_depth.py => cmake/Findragel.cmake (56%)
mode change 100755 => 100644
create mode 100644 cmake/Findrt.cmake
rename cmake/{FindYaml-cpp.cmake => Findyaml-cpp.cmake} (50%)
create mode 100644 cmake/
SeastarConfig.cmake.in
create mode 100644 cmake/code_test/LinuxMembarrier_test.cc
create mode 100644 cmake/code_test/Sanitizers_fiber_test.cc
create mode 100644 cmake/code_test/StdFilesystem_test.cc
create mode 100644 cmake/code_test/dl_test.cc
create mode 100644 cmake/code_test/rt_test.cc
delete mode 100755 configure.py
create mode 100755 cooking.sh
create mode 100644 demo/CMakeLists.txt
rename tests/blkdiscard_test.cc => demo/block_discard_demo.cc (93%)
rename tests/echotest.cc => demo/echo_demo.cc (96%)
rename tests/ip_test.cc => demo/ip_demo.cc (89%)
rename tests/l3_test.cc => demo/l3_demo.cc (94%)
rename tests/linecount.cc => demo/line_count_demo.cc (94%)
rename tests/rpc.cc => demo/rpc_demo.cc (98%)
rename {tests => demo}/scheduling_group_demo.cc (96%)
rename tests/tcp_test.cc => demo/tcp_demo.cc (95%)
rename tests/tcp_sctp_client.cc => demo/tcp_sctp_client_demo.cc (98%)
rename tests/tcp_sctp_server.cc => demo/tcp_sctp_server_demo.cc (97%)
rename {tests => demo}/tls_echo_server.hh (94%)
rename tests/tls_echo_server.cc => demo/tls_echo_server_demo.cc (95%)
rename tests/tls_simple_client.cc => demo/tls_simple_client_demo.cc (97%)
rename tests/udp_client.cc => demo/udp_client_demo.cc (94%)
rename tests/udp_server.cc => demo/udp_server_demo.cc (95%)
rename tests/udp_zero_copy.cc => demo/udp_zero_copy_demo.cc (95%)
create mode 100644 doc/CMakeLists.txt
rename Doxyfile => doc/Doxyfile.cmake (99%)
rename DoxygenLayout.xml => doc/DoxygenLayout.xml (100%)
rename dpdk => extern/dpdk (100%)
delete mode 160000 fmt
rename {http => gen/http}/request_parser.rl (97%)
rename http/http_response_parser.rl => gen/http/response_parser.rl (98%)
rename {json => gen}/json2code.py (99%)
rename {proto => gen/proto}/metrics2.proto (100%)
delete mode 100644 http/CMakeLists.txt
rename {core => include/seastar/core}/abort_source.hh (98%)
rename {core => include/seastar/core}/alien.hh (97%)
rename {core => include/seastar/core}/align.hh (100%)
rename {core => include/seastar/core}/aligned_buffer.hh (97%)
rename {core => include/seastar/core}/app-template.hh (97%)
rename {core => include/seastar/core}/apply.hh (100%)
rename {core => include/seastar/core}/array_map.hh (100%)
rename {core => include/seastar/core}/bitops.hh (100%)
rename {core => include/seastar/core}/bitset-iter.hh (100%)
rename {core => include/seastar/core}/byteorder.hh (99%)
rename {core => include/seastar/core}/cacheline.hh (100%)
rename {core => include/seastar/core}/checked_ptr.hh (99%)
rename {core => include/seastar/core}/chunked_fifo.hh (100%)
rename {core => include/seastar/core}/circular_buffer.hh (99%)
rename {core => include/seastar/core}/circular_buffer_fixed_capacity.hh (100%)
rename {core => include/seastar/core}/condition-variable.hh (98%)
rename {core => include/seastar/core}/deleter.hh (100%)
rename {core => include/seastar/core}/distributed.hh (96%)
rename {core => include/seastar/core}/do_with.hh (98%)
rename {core => include/seastar/core}/dpdk_rte.hh (100%)
rename {core => include/seastar/core}/enum.hh (100%)
rename {core => include/seastar/core}/exception_hacks.hh (100%)
rename {core => include/seastar/core}/execution_stage.hh (97%)
rename {core => include/seastar/core}/expiring_fifo.hh (96%)
rename {core => include/seastar/core}/fair_queue.hh (97%)
rename {core => include/seastar/core}/file.hh (98%)
rename {core => include/seastar/core}/fsqual.hh (96%)
rename {core => include/seastar/core}/fstream.hh (97%)
rename {core => include/seastar/core}/function_traits.hh (100%)
rename {core => include/seastar/core}/future-util.hh (99%)
rename {core => include/seastar/core}/future.hh (99%)
rename {core => include/seastar/core}/gate.hh (99%)
rename {core => include/seastar/core}/iostream-impl.hh (99%)
rename {core => include/seastar/core}/iostream.hh (99%)
rename {core => include/seastar/core}/linux-aio.hh (100%)
rename {core => include/seastar/core}/lowres_clock.hh (98%)
rename {core => include/seastar/core}/manual_clock.hh (100%)
rename {core => include/seastar/core}/memory.hh (99%)
rename {core => include/seastar/core}/metrics.hh (99%)
rename {core => include/seastar/core}/metrics_api.hh (99%)
rename {core => include/seastar/core}/metrics_registration.hh (100%)
rename {core => include/seastar/core}/metrics_types.hh (100%)
rename {core => include/seastar/core}/pipe.hh (99%)
rename {core => include/seastar/core}/posix.hh (99%)
rename {core => include/seastar/core}/preempt.hh (100%)
rename {core => include/seastar/core}/prefetch.hh (98%)
rename {core => include/seastar/core}/print.hh (99%)
rename {core => include/seastar/core}/prometheus.hh (97%)
rename {core => include/seastar/core}/queue.hh (98%)
rename {core => include/seastar/core}/ragel.hh (96%)
rename {core => include/seastar/core}/reactor.hh (98%)
rename {core => include/seastar/core}/report_exception.hh (100%)
rename {core => include/seastar/core}/resource.hh (100%)
rename {core => include/seastar/core}/rwlock.hh (99%)
rename {core => include/seastar/core}/scattered_message.hh (95%)
rename {core => include/seastar/core}/scheduling.hh (99%)
rename {core => include/seastar/core}/scollectd.hh (99%)
rename {core => include/seastar/core}/scollectd_api.hh (91%)
rename {core => include/seastar/core}/seastar.hh (99%)
rename {core => include/seastar/core}/semaphore.hh (99%)
rename {core => include/seastar/core}/sharded.hh (99%)
rename {core => include/seastar/core}/shared_future.hh (99%)
rename {core => include/seastar/core}/shared_mutex.hh (98%)
rename {core => include/seastar/core}/shared_ptr.hh (99%)
rename {core => include/seastar/core}/shared_ptr_debug_helper.hh (100%)
rename {core => include/seastar/core}/shared_ptr_incomplete.hh (96%)
rename {core => include/seastar/core}/simple-stream.hh (99%)
rename {core => include/seastar/core}/slab.hh (99%)
rename {core => include/seastar/core}/sleep.hh (94%)
rename {core => include/seastar/core}/sstring.hh (99%)
rename {core => include/seastar/core}/stall_sampler.hh (94%)
rename {core => include/seastar/core}/stream.hh (99%)
rename {core => include/seastar/core}/systemwide_memory_barrier.hh (100%)
rename {core => include/seastar/core}/task.hh (98%)
rename {core => include/seastar/core}/temporary_buffer.hh (99%)
rename {core => include/seastar/core}/thread.hh (98%)
rename {core => include/seastar/core}/thread_cputime_clock.hh (100%)
rename {core => include/seastar/core}/thread_impl.hh (98%)
rename {core => include/seastar/core}/timer-set.hh (99%)
rename {core => include/seastar/core}/timer.hh (97%)
rename {core => include/seastar/core}/transfer.hh (100%)
rename {core => include/seastar/core}/unaligned.hh (100%)
rename {core => include/seastar/core}/units.hh (100%)
rename {core => include/seastar/core}/vector-data-sink.hh (97%)
rename {core => include/seastar/core}/vla.hh (98%)
rename {core => include/seastar/core}/weak_ptr.hh (100%)
rename {http => include/seastar/http}/api_docs.hh (97%)
rename {http => include/seastar/http}/common.hh (98%)
rename {http => include/seastar/http}/exception.hh (98%)
rename {http => include/seastar/http}/file_handler.hh (98%)
rename {http => include/seastar/http}/function_handlers.hh (98%)
rename {http => include/seastar/http}/handlers.hh (93%)
rename {http => include/seastar/http}/httpd.hh (96%)
rename {http => include/seastar/http}/json_path.hh (97%)
rename {http => include/seastar/http}/matcher.hh (97%)
rename {http => include/seastar/http}/matchrules.hh (95%)
rename {http => include/seastar/http}/mime_types.hh (95%)
rename {http => include/seastar/http}/reply.hh (96%)
rename {http => include/seastar/http}/request.hh (97%)
rename {http => include/seastar/http}/routes.hh (97%)
rename {http => include/seastar/http}/transformers.hh (95%)
rename {json => include/seastar/json}/formatter.hh (99%)
rename {json => include/seastar/json}/json_elements.hh (98%)
rename {net => include/seastar/net}/api.hh (97%)
rename {net => include/seastar/net}/arp.hh (98%)
rename {net => include/seastar/net}/byteorder.hh (98%)
rename {net => include/seastar/net}/config.hh (100%)
rename {net => include/seastar/net}/const.hh (100%)
rename {net => include/seastar/net}/dhcp.hh (97%)
rename {net => include/seastar/net}/dns.hh (95%)
rename {net => include/seastar/net}/dpdk.hh (94%)
rename {net => include/seastar/net}/ethernet.hh (97%)
rename {net => include/seastar/net}/inet_address.hh (97%)
rename {net => include/seastar/net}/ip.hh (97%)
rename {net => include/seastar/net}/ip_checksum.hh (98%)
rename {net => include/seastar/net}/native-stack.hh (97%)
rename {net => include/seastar/net}/net.hh (96%)
rename {net => include/seastar/net}/packet-data-source.hh (96%)
rename {net => include/seastar/net}/packet-util.hh (99%)
rename {net => include/seastar/net}/packet.hh (99%)
rename {net => include/seastar/net}/posix-stack.hh (98%)
rename {net => include/seastar/net}/proxy.hh (93%)
rename {net => include/seastar/net}/socket_defs.hh (98%)
rename {net => include/seastar/net}/stack.hh (98%)
rename {net => include/seastar/net}/tcp-stack.hh (97%)
rename {net => include/seastar/net}/tcp.hh (99%)
rename {net => include/seastar/net}/tls.hh (98%)
rename {net => include/seastar/net}/toeplitz.hh (100%)
rename {net => include/seastar/net}/udp.hh (90%)
rename {net => include/seastar/net}/virtio-interface.hh (100%)
rename {net => include/seastar/net}/virtio.hh (94%)
rename {rpc => include/seastar/rpc}/lz4_compressor.hh (95%)
rename {rpc => include/seastar/rpc}/multi_algo_compressor_factory.hh (97%)
rename {rpc => include/seastar/rpc}/rpc.hh (98%)
rename {rpc => include/seastar/rpc}/rpc_impl.hh (98%)
rename {rpc => include/seastar/rpc}/rpc_types.hh (98%)
rename {util => include/seastar/util}/alloc_failure_injector.hh (98%)
rename {util => include/seastar/util}/backtrace.hh (98%)
rename {util => include/seastar/util}/bool_class.hh (100%)
rename {util => include/seastar/util}/conversions.hh (100%)
rename {util => include/seastar/util}/defer.hh (100%)
rename {util => include/seastar/util}/eclipse.hh (100%)
rename {util => include/seastar/util}/function_input_iterator.hh (100%)
rename {util => include/seastar/util}/gcc6-concepts.hh (100%)
rename {util => include/seastar/util}/indirect.hh (100%)
rename {util => include/seastar/util}/is_smart_ptr.hh (100%)
rename {util => include/seastar/util}/lazy.hh (100%)
rename {util => include/seastar/util}/log-cli.hh (95%)
rename {util => include/seastar/util}/log.hh (99%)
rename {util => include/seastar/util}/noncopyable_function.hh (100%)
rename {util => include/seastar/util}/optimized_optional.hh (98%)
rename {util => include/seastar/util}/print_safe.hh (100%)
rename {util => include/seastar/util}/program-options.hh (98%)
rename {util => include/seastar/util}/reference_wrapper.hh (100%)
rename {util => include/seastar/util}/spinlock.hh (100%)
rename {util => include/seastar/util}/transform_iterator.hh (100%)
rename {util => include/seastar/util}/tuple_utils.hh (100%)
rename {util => include/seastar/util}/variant_utils.hh (100%)
rename {licenses => license}/dpdk.txt (100%)
rename {licenses => license}/freebsd.txt (100%)
create mode 100644 pkgconfig/seastar.pc.cmake
delete mode 100644 proto/CMakeLists.txt
create mode 100644 recipe/dev.cmake
create mode 100644 recipe/dpdk_config
rename tests/memcached/CMakeLists.txt => recipe/dpdk_configure.cmake (59%)
rename {scripts => script}/dpdk_nic_bind.py (100%)
rename {scripts => script}/perftune.py (100%)
rename {scripts => script}/perftune.yaml (100%)
rename {scripts => script}/posix_net_conf.sh (100%)
rename {scripts => script}/run_with_dpdk.sh (100%)
rename {scripts => script}/seastar-addr2line (100%)
rename {scripts => script}/seastar-cpu-map.sh (100%)
rename {scripts => script}/tap.sh (100%)
delete mode 100644 seastar_cmake.py
rename {core => src/core}/alien.cc (97%)
rename {core => src/core}/app-template.cc (95%)
rename {core => src/core}/dpdk_rte.cc (96%)
rename {core => src/core}/exception_hacks.cc (97%)
rename {core => src/core}/execution_stage.cc (98%)
rename {core => src/core}/file-impl.hh (99%)
rename {core => src/core}/fsqual.cc (95%)
rename {core => src/core}/fstream.cc (99%)
rename {core => src/core}/future-util.cc (98%)
rename {core => src/core}/linux-aio.cc (99%)
rename {core => src/core}/memory.cc (99%)
rename {core => src/core}/metrics.cc (99%)
rename {core => src/core}/posix.cc (98%)
rename {core => src/core}/prometheus.cc (99%)
rename {core => src/core}/reactor.cc (99%)
rename {core => src/core}/resource.cc (98%)
rename {core => src/core}/scollectd-impl.hh (95%)
rename {core => src/core}/scollectd.cc (99%)
rename {core => src/core}/systemwide_memory_barrier.cc (96%)
rename {core => src/core}/thread.cc (99%)
rename {http => src/http}/api_docs.cc (89%)
rename {http => src/http}/common.cc (96%)
rename {http => src/http}/file_handler.cc (95%)
rename {http => src/http}/httpd.cc (95%)
rename {http => src/http}/json_path.cc (98%)
rename {http => src/http}/matcher.cc (98%)
rename {http => src/http}/mime_types.cc (96%)
rename {http => src/http}/reply.cc (98%)
rename {http => src/http}/routes.cc (97%)
rename {http => src/http}/transformers.cc (99%)
rename {json => src/json}/formatter.cc (96%)
rename {json => src/json}/json_elements.cc (99%)
rename {net => src/net}/arp.cc (98%)
rename {net => src/net}/config.cc (98%)
rename {net => src/net}/dhcp.cc (99%)
rename {net => src/net}/dns.cc (99%)
rename {net => src/net}/dpdk.cc (99%)
rename {net => src/net}/ethernet.cc (97%)
rename {net => src/net}/inet_address.cc (96%)
rename {net => src/net}/ip.cc (98%)
rename {net => src/net}/ip_checksum.cc (96%)
rename {net => src/net}/native-stack-impl.hh (99%)
rename {net => src/net}/native-stack.cc (96%)
rename {net => src/net}/net.cc (98%)
rename {net => src/net}/packet.cc (98%)
rename {net => src/net}/posix-stack.cc (99%)
rename {net => src/net}/proxy.cc (97%)
rename {net => src/net}/stack.cc (98%)
rename {net => src/net}/tcp.cc (96%)
rename {net => src/net}/tls.cc (99%)
rename {net => src/net}/udp.cc (99%)
rename {net => src/net}/virtio.cc (98%)
rename {rpc => src/rpc}/lz4_compressor.cc (97%)
rename {rpc => src/rpc}/rpc.cc (99%)
rename {util => src/util}/alloc_failure_injector.cc (90%)
rename {util => src/util}/backtrace.cc (97%)
rename {util => src/util}/conversions.cc (95%)
rename {util => src/util}/log.cc (98%)
rename {util => src/util}/program-options.cc (98%)
delete mode 100755 test.py
copy cmake-tools/query_link_pool_depth.py => test/CMakeLists.txt (63%)
mode change 100755 => 100644
create mode 100644 test/dist/CMakeLists.txt
copy cmake-tools/query_link_pool_depth.py => test/dist/consumer/CMakeLists.txt (70%)
mode change 100755 => 100644
rename apps/httpd/CMakeLists.txt => test/dist/consumer/Makefile (75%)
create mode 100644 test/dist/consumer/cmake_consumer.cc
create mode 100644 test/dist/consumer/pkgconfig_consumer.cc
create mode 100644 test/dist/consumer/recipe/test_dist.cmake
rename cmake-tools/query_link_pool_depth.py => test/dist/consumer_test.sh (57%)
rename {tests => test}/exchanger.hh (100%)
create mode 100644 test/perf/CMakeLists.txt
rename tests/perf/perf_fstream.cc => test/perf/fstream_perf.cc (96%)
rename tests/perf/perf_future_util.cc => test/perf/future_util_perf.cc (100%)
rename {tests => test}/perf/perf-tests.md (100%)
rename {tests => test}/perf/perf_tests.cc (99%)
rename {tests => test}/perf/perf_tests.hh (98%)
rename {tests => test}/test-utils.cc (87%)
rename {tests => test}/test-utils.hh (98%)
rename {tests => test}/test_runner.cc (93%)
rename {tests => test}/test_runner.hh (93%)
create mode 100644 test/unit/CMakeLists.txt
rename {tests => test/unit}/abort_source_test.cc (96%)
rename {tests => test/unit}/alien_test.cc (96%)
rename {tests => test/unit}/alloc_test.cc (95%)
rename {tests => test/unit}/allocator_test.cc (99%)
rename {tests => test/unit}/catest.key (100%)
rename {tests => test/unit}/catest.pem (100%)
rename {tests => test/unit}/checked_ptr_test.cc (97%)
rename {tests => test/unit}/chunked_fifo_test.cc (99%)
rename {tests => test/unit}/circular_buffer_fixed_capacity_test.cc (98%)
rename {tests => test/unit}/circular_buffer_test.cc (98%)
rename {tests => test/unit}/connect_test.cc (97%)
rename {tests => test/unit}/defer_test.cc (98%)
rename {tests => test/unit}/directory_test.cc (91%)
rename {tests => test/unit}/distributed_test.cc (96%)
rename {tests => test/unit}/dns_test.cc (92%)
rename {tests => test/unit}/execution_stage_test.cc (98%)
rename {tests => test/unit}/expiring_fifo_test.cc (97%)
rename {tests => test/unit}/fair_queue_test.cc (97%)
rename tests/fileiotest.cc => test/unit/file_io_test.cc (95%)
rename {tests => test/unit}/foreign_ptr_test.cc (94%)
rename {tests => test/unit}/fstream_test.cc (98%)
rename {tests => test/unit}/futures_test.cc (99%)
rename tests/httpd.cc => test/unit/httpd_test.cc (98%)
rename {tests => test/unit}/json_formatter_test.cc (89%)
rename {tests => test/unit}/loopback_socket.hh (96%)
rename {tests => test/unit}/lowres_clock_test.cc (97%)
rename {tests => test/unit}/mkcert.gmk (100%)
rename {tests => test/unit}/mock_file.hh (99%)
rename {tests => test/unit}/netconfig_test.cc (99%)
rename {tests => test/unit}/noncopyable_function_test.cc (98%)
rename {tests => test/unit}/output_stream_test.cc (95%)
rename {tests => test/unit}/packet_test.cc (98%)
rename {tests => test/unit}/program_options_test.cc (97%)
rename {tests => test/unit}/queue_test.cc (95%)
rename {tests => test/unit}/rpc_test.cc (98%)
rename {tests => test/unit}/semaphore_test.cc (95%)
rename {tests => test/unit}/shared_ptr_test.cc (98%)
rename {tests => test/unit}/slab_test.cc (99%)
rename {tests => test/unit}/smp_test.cc (95%)
rename {tests => test/unit}/sstring_test.cc (99%)
rename {tests => test/unit}/test.crl (100%)
rename {tests => test/unit}/test.crt (100%)
rename {tests => test/unit}/test.csr (100%)
rename {tests => test/unit}/test.key (100%)
rename tests/thread_context_switch.cc => test/unit/thread_context_switch_test.cc (92%)
rename {tests => test/unit}/thread_test.cc (94%)
rename tests/timertest.cc => test/unit/timer_test.cc (96%)
rename {tests => test/unit}/tls-ca-bundle.pem (100%)
rename {tests => test/unit}/tls_test.cc (91%)
rename {tests => test/unit}/tuple_utils_test.cc (98%)
rename {tests => test/unit}/unwind_test.cc (94%)
rename {tests => test/unit}/weak_ptr_test.cc (99%)
delete mode 100644 tests/CMakeLists.txt
delete mode 100644 tests/perf/CMakeLists.txt
diff --git a/.gitignore b/.gitignore
index 85a6005f..fe63c40d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
build
build.ninja
cscope.*
+cmake/Cooking.cmake
diff --git a/.gitmodules b/.gitmodules
index 0e913cc3..65e179e3 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,9 +1,3 @@
-[submodule "dpdk"]
- path = dpdk
- url = ../dpdk
-[submodule "fmt"]
- path = fmt
- url = ../fmt
-[submodule "c-ares"]
- path = c-ares
- url = ../c-ares
+[submodule "extern/dpdk"]
+ path = extern/dpdk
+ url =
https://github.com/scylladb/dpdk.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05297b75..037f31d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,973 +20,690 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-cmake_minimum_required (VERSION 2.8)
+cmake_minimum_required (VERSION 3.11)
-project (seastar)
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+include (Cooking OPTIONAL)
-message (WARNING "CMake is not yet supported as the Seastar build system. Please use with caution.")
+project (Seastar
+ VERSION 18.7.0
+ LANGUAGES CXX)
-get_filename_component (SEASTAR_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} ABSOLUTE)
-get_filename_component (SEASTAR_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ABSOLUTE)
-
-#
-# Prologue.
-#
-# We define these manually because we want to be explicit about the options that are defined and because CMake defines
-# NDEBUG by default, and we don't wish to.
-
-set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
-set (CMAKE_CXX_FLAGS_RELEASE "-O2")
-set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
-set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
-
-# Set an option defined in a sub-directory.
-# Courtesy of
http://edsiper.linuxchile.cl/blog/2016/01/08/cmake-override-subdirectory-options/
-macro (set_option option value)
- set (${option} ${value} CACHE INTERNAL "" FORCE)
-endmacro ()
-
-#
-# Configuration options.
-#
-option (SEASTAR_ENABLE_TESTS
- "If OFF, used to disable testing altogether." ON)
-
-option (SEASTAR_EXCLUDE_TESTS_BY_DEFAULT
- "If ON, then tests are not built by default when the build tool is invoked"
- ON)
-
-option (SEASTAR_EXCLUDE_APPS_BY_DEFAULT
- "If ON, then applications are not build by default when the build tool is invoked"
- ON)
-
-option(SEASTAR_ENABLE_WERROR "If ON, add -Werror to compile flags" ON)
-
-set (SEASTAR_CXX_DIALECT
- "gnu++17"
- CACHE
- STRING
- "C++ dialect to build with.")
-
-set (SEASTAR_CXX_OPTIMIZATION_FLAGS
- ""
- CACHE
- STRING
- "Extra optimization flags for non-debug builds.")
-
-set (SEASTAR_USER_CXXFLAGS
- ""
- CACHE
- STRING
- "Extra CXXFLAGS, separated by semicolon.")
+option (Seastar_ALLOC_FAILURE_INJECTION
+ "Enable failure injection into the Seastar allocator."
+ OFF)
-set (SEASTAR_USER_CFLAGS
+set (Seastar_ALLOC_PAGE_SIZE
""
CACHE
STRING
- "Extra CFLAGS, separated by semicolon for DPDK submodule.")
+ "Override the Seastar allocator page size, in bytes.")
+option (Seastar_APPS
+ "Enable application targets."
+ ON)
-set (SEASTAR_USER_LDFLAGS
+set (Seastar_CXX_FLAGS
""
CACHE
STRING
- "Extra LDFLAGS, separated by semicolon.")
+ "Semicolon-separated list of extra compilation flags for Seastar itself.")
-option (SEASTAR_ENABLE_HWLOC
- "Enable hwloc support."
+option (Seastar_DEMOS
+ "Enable demonstration targets."
ON)
-option (SEASTAR_ENABLE_DPDK
- "Enable DPDK (from bundled sources)."
- OFF)
-
-option (SEASTAR_ENABLE_EXCEPTION_SCALABILITY_WORKAROUND
- "Override the dl_iterate_phdr symbol to workaround C++ exception scalability issues."
- OFF)
-
-set (SEASTAR_ALLOCATOR_PAGE_SIZE
- ""
- CACHE
- STRING
- "Override the allocator page size in bytes.")
-
-option (SEASTAR_ENABLE_ALLOC_FAILURE_INJECTOR
- "Enable allocation failure injection."
- OFF)
+option (Seastar_DOCS
+ "Enable documentation targets."
+ ON)
-option (SEASTAR_ENABLE_GCC6_CONCEPTS
- "Enable experimental support for C++ concepts as implemented in GCC 6."
+option (Seastar_DPDK
+ "Enable DPDK support."
OFF)
-option (SEASTAR_LINK_STATIC_BOOST
- "Link with the Boost library statically."
+option (Seastar_EXCEPTION_SCALABILITY_WORKAROUND
+ "Enable a workaround for C++ exception scalability issues by preventing override of the `dl_iterate_phdr` symbol."
OFF)
-option (SEASTAR_LINK_STATIC_YAML_CPP
- "Link with the yaml-cpp library statically."
+option (Seastar_EXCLUDE_TESTS_FROM_ALL
+ "When enabled alongide Seastar_TESTING, do not build tests by default."
OFF)
-option (SEASTAR_EXECUTE_ONLY_FAST_TESTS
- "Execute fast unit tests only, where applicable."
+option (Seastar_GCC6_CONCEPTS
+ "Enable compilation with gcc version 6 concepts support."
OFF)
-set (SEASTAR_JENKINS
- ""
- CACHE
- STRING
- "Configure the build and tests for execution within a Jenkins context, with the given identifier.")
-
-#
-# Link pools (only supported for the Ninja generator).
-#
-
-if (${CMAKE_GENERATOR} STREQUAL "Ninja")
- exec_program ("${CMAKE_CURRENT_SOURCE_DIR}/cmake-tools/query_link_pool_depth.py"
- OUTPUT_VARIABLE link_pool_depth
- RETURN_VALUE query_pool_depth_code)
+option (Seastar_HWLOC
+ "Enable hwloc support."
+ ON)
- if (NOT ("${query_pool_depth_code}" STREQUAL 0))
- MESSAGE (FATAL_ERROR "tools/query_link_pool_depth.py had a non-zero exit code.")
- endif ()
+option (Seastar_INSTALL
+ "Install targets."
+ ON)
- set_property (GLOBAL PROPERTY
- JOB_POOLS
- seastar_link_pool=${link_pool_depth})
+option (Seastar_TESTING
+ "Enable testing targets."
+ ON)
- set_property (GLOBAL PROPERTY
- CMAKE_JOB_POOL_LINK seastar_link_pool)
+if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR))
+ set (Seastar_APPS OFF)
+ set (Seastar_DEMOS OFF)
+ set (Seastar_DOCS OFF)
+ set (Seastar_INSTALL OFF)
+ set (Seastar_TESTING OFF)
endif ()
#
-# External projects.
+# Useful (non-cache) variables.
#
-set_option (CARES_STATIC YES)
-set_option (CARES_SHARED NO)
-set_option (CARES_INSTALL NO)
-set_option (CARES_STATIC_PIC YES)
-add_subdirectory (c-ares)
-
-add_subdirectory (fmt)
+set (Seastar_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set (Seastar_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
#
-# System dependencies.
+# Dependencies.
#
-set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-
##
-## Unconditional dependencies.
+## Public dependencies.
##
-if (${SEASTAR_LINK_STATIC_BOOST})
- set (Boost_USE_STATIC_LIBS ON)
-endif ()
-
-if (NOT TARGET Boost)
- find_package (Boost COMPONENTS program_options filesystem unit_test_framework thread REQUIRED)
-endif()
-
-if (${Boost_VERSION} VERSION_LESS "1.58")
- message(error "Seastar requires Boost >= 1.58")
-endif ()
-
-find_package (GnuTLS REQUIRED)
+find_package (Boost 1.64.0 REQUIRED
+ COMPONENTS
+ filesystem
+ program_options
+ thread)
-find_package (Protobuf REQUIRED)
-
-find_package (Cryptopp REQUIRED)
-
-find_package (Lz4 REQUIRED)
-
-find_package (Yaml-cpp REQUIRED)
-
-find_library (RT_LIBRARY rt DOC "The Posix Realtime extension library.")
-
-find_program (Ragel_EXECUTABLE NAMES ragel DOC "Path to the ragel executable.")
+find_package (c-ares 1.13.0 REQUIRED MODULE)
+find_package (cryptopp 5.6.5 REQUIRED)
+# No version information published.
+find_package (dpdk)
+find_package (fmt 3.0.2 REQUIRED)
+find_package (lz4 1.8.0 REQUIRED)
##
-## Conditional dependencies.
+## Private and private/public dependencies.
##
-if (${SEASTAR_ENABLE_HWLOC})
- find_package (HWLoc REQUIRED)
-
- find_package (LibXml2 REQUIRED)
-
- find_package (ZLIB REQUIRED)
-
- find_library (NUMA_LIBRARY numa DOC "The NUMA support library.")
-
- find_library (PCIAccess_LIBRARY pciaccess DOC "The pciaccess library.")
-endif ()
+find_package (GnuTLS 3.5.18 REQUIRED)
+find_package (LinuxMembarrier)
+find_package (Protobuf 3.3.1 REQUIRED)
+find_package (Sanitizers REQUIRED)
+find_package (StdFilesystem REQUIRED)
+find_package (dl REQUIRED)
+find_package (hwloc 1.11.5)
+# No version information published.
+find_package (lksctp-tools REQUIRED)
+find_package (ragel 7.0.0 REQUIRED)
+find_package (rt REQUIRED)
+find_package (yaml-cpp 0.5.3 REQUIRED)
#
-# Code generation.
+# Code generation helpers.
#
-add_subdirectory (proto)
-
-function (seastar_ragel_generate file output_var)
- set (abs_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
-
- get_filename_component (base_name ${file} NAME_WE)
- set (output_name "${base_name}.hh")
+function (seastar_generate_protobuf target var in_file out_dir)
+ get_filename_component (in_file_name ${in_file} NAME_WE)
+ get_filename_component (in_file_dir ${in_file} DIRECTORY)
+ set (header_out ${out_dir}/${in_file_name}.pb.h)
+ set (source_out ${out_dir}/${in_file_name}.pb.cc)
add_custom_command (
- OUTPUT "${output_name}"
- MAIN_DEPENDENCY ${abs_file}
- COMMAND ${Ragel_EXECUTABLE} -G2 -o ${output_name} ${abs_file}
- # sed away a bug in ragel 7 that emits some extraneous _nfa* variables.
- COMMAND sed -i -e '1h\;2,$$H\;$$!d\;g' -re 's/static const char _nfa[^\;]*\;//g' ${output_name})
+ DEPENDS ${in_file}
+ OUTPUT ${header_out} ${source_out}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${out_dir}
+ COMMAND ${Protobuf_PROTOC_EXECUTABLE} --cpp_out=${out_dir} -I${in_file_dir} ${in_file})
+
+ add_custom_target (${target}
+ DEPENDS
+ ${header_out}
+ ${source_out})
- set ("${output_var}" "${CMAKE_CURRENT_BINARY_DIR}/${output_name}" PARENT_SCOPE)
+ set (${var} ${header_out} ${source_out} PARENT_SCOPE)
endfunction ()
-function (seastar_swagger_generate file output_var)
- set (abs_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
- set (output_name "${file}.hh")
- set (output_path "${CMAKE_CURRENT_BINARY_DIR}/${output_name}")
+function (seastar_generate_ragel target var in_file out_file)
+ get_filename_component (out_dir ${out_file} DIRECTORY)
add_custom_command (
- OUTPUT ${output_path}
- MAIN_DEPENDENCY ${abs_file}
- COMMAND "${SEASTAR_SOURCE_DIR}/json/json2code.py" -f ${abs_file} -o ${output_path})
+ DEPENDS ${in_file}
+ OUTPUT ${out_file}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${out_dir}
+ COMMAND ${ragel_RAGEL_EXECUTABLE} -G2 -o ${out_file} ${in_file}
+ COMMAND sed -i -e "'1h;2,$$H;$$!d;g'" -re "'s/static const char _nfa[^;]*;//g'" ${out_file})
- set ("${output_var}" ${output_path} PARENT_SCOPE)
-endfunction ()
+ add_custom_target (${target}
+ DEPENDS ${out_file})
-add_subdirectory (http)
+ set (${var} ${out_file} PARENT_SCOPE)
+endfunction ()
-#
-# Sources.
-#
+function (seastar_generate_swagger target var in_file out_file)
+ get_filename_component (out_dir ${out_file} DIRECTORY)
+ set (generator ${Seastar_SOURCE_DIR}/gen/json2code.py)
-set (core_files
- core/abort_source.hh
- core/alien.hh core/alien.cc
- core/align.hh
- core/execution_stage.hh core/execution_stage.cc
- core/aligned_buffer.hh
- core/app-template.hh core/app-template.cc
- core/apply.hh
- core/array_map.hh
- core/bitops.hh
- core/bitset-iter.hh
- core/byteorder.hh
- core/cacheline.hh
- core/checked_ptr.hh
- core/chunked_fifo.hh
- core/circular_buffer.hh
- core/circular_buffer_fixed_capacity.hh
- core/condition-variable.hh
- core/deleter.hh
- core/distributed.hh
- core/do_with.hh
- core/dpdk_rte.hh core/dpdk_rte.cc
- core/enum.hh
- core/exception_hacks.hh core/exception_hacks.cc
- core/execution_stage.hh
- core/expiring_fifo.hh
- core/fair_queue.hh
- core/file-impl.hh
- core/file.hh
- core/fsqual.hh core/fsqual.cc
- core/fstream.hh core/fstream.cc
- core/function_traits.hh
- core/future-util.hh core/future-util.cc
- core/future.hh
- core/gate.hh
- core/iostream-impl.hh
- core/iostream.hh
- core/linux-aio.hh core/linux-aio.cc
- core/lowres_clock.hh
- core/manual_clock.hh
- core/memory.hh core/memory.cc
- core/metrics.hh core/metrics.cc
- core/metrics_api.hh
- core/metrics_registration.hh
- core/metrics_types.hh
- core/pipe.hh
- core/posix.hh core/posix.cc
- core/preempt.hh
- core/prefetch.hh
- core/print.hh
- core/prometheus.hh core/prometheus.cc
- core/queue.hh
- core/ragel.hh
- core/reactor.hh core/reactor.cc
- core/report_exception.hh
- core/resource.hh core/resource.cc
- core/rwlock.hh
- core/scattered_message.hh
- core/scheduling.hh
- core/scollectd-impl.hh
- core/scollectd.hh core/scollectd.cc
- core/scollectd_api.hh
- core/seastar.hh
- core/semaphore.hh
- core/sharded.hh
- core/shared_future.hh
- core/shared_mutex.hh
- core/shared_ptr.hh
- core/shared_ptr_debug_helper.hh
- core/shared_ptr_incomplete.hh
- core/simple-stream.hh
- core/slab.hh
- core/sleep.hh
- core/sstring.hh
- core/stall_sampler.hh
- core/stream.hh
- core/systemwide_memory_barrier.hh core/systemwide_memory_barrier.cc
- core/task.hh
- core/temporary_buffer.hh
- core/thread.hh core/thread.cc
- core/thread_impl.hh
- core/timer-set.hh
- core/timer.hh
- core/transfer.hh
- core/unaligned.hh
- core/units.hh
- core/vector-data-sink.hh
- core/vla.hh
- core/weak_ptr.hh)
-
-set (http_files
- http/api_docs.hh http/api_docs.cc
- http/common.hh http/common.cc
- http/exception.hh
- http/file_handler.hh http/file_handler.cc
- http/function_handlers.hh
- http/handlers.hh
- http/httpd.hh http/httpd.cc
- http/json_path.hh http/json_path.cc
- http/matcher.hh http/matcher.cc
- http/matchrules.hh
- http/mime_types.hh http/mime_types.cc
- http/reply.hh http/reply.cc
- http/request.hh
- http/routes.hh http/routes.cc
- http/transformers.hh http/transformers.cc)
-
-set (json_files
- json/formatter.hh json/formatter.cc
- json/json_elements.hh json/json_elements.cc)
-
-set (net_files
- net/api.hh
- net/arp.hh net/arp.cc
- net/byteorder.hh
- net/config.hh net/config.cc
- net/const.hh
- net/dhcp.hh net/dhcp.cc
- net/dns.hh net/dns.cc
- net/dpdk.hh net/dpdk.cc
- net/ethernet.hh net/ethernet.cc
- net/inet_address.hh net/inet_address.cc
- net/ip.hh net/ip.cc
- net/ip_checksum.hh net/ip_checksum.cc
- net/native-stack-impl.hh
- net/native-stack.hh net/native-stack.cc
- net/net.hh net/net.cc
- net/packet-data-source.hh
- net/packet-util.hh
- net/packet.hh net/packet.cc
- net/posix-stack.hh net/posix-stack.cc
- net/proxy.hh net/proxy.cc
- net/socket_defs.hh
- net/stack.hh net/stack.cc
- net/tcp-stack.hh
- net/tcp.hh net/tcp.cc
- net/tls.hh net/tls.cc
- net/toeplitz.hh
- net/udp.hh net/udp.cc
- net/virtio-interface.hh
- net/virtio.hh net/virtio.cc)
-
-set (rpc_files
- rpc/lz4_compressor.hh rpc/lz4_compressor.cc
- rpc/multi_algo_compressor_factory.hh
- rpc/rpc.hh rpc/rpc.cc
- rpc/rpc_impl.hh
- rpc/rpc_types.hh)
-
-set (util_files
- util/alloc_failure_injector.hh util/alloc_failure_injector.cc
- util/backtrace.hh util/backtrace.cc
- util/bool_class.hh
- util/conversions.hh util/conversions.cc
- util/defer.hh
- util/eclipse.hh
- util/function_input_iterator.hh
- util/gcc6-concepts.hh
- util/indirect.hh
- util/is_smart_ptr.hh
- util/lazy.hh
- util/log.hh util/log.cc
- util/log-cli.hh
- util/noncopyable_function.hh
- util/optimized_optional.hh
- util/print_safe.hh
- util/program-options.hh util/program-options.cc
- util/reference_wrapper.hh
- util/spinlock.hh
- util/transform_iterator.hh
- util/tuple_utils.hh
- util/variant_utils.hh)
-
-add_library (seastar
- ${core_files}
- ${http_files}
- ${json_files}
- ${net_files}
- ${rpc_files}
- ${util_files}
- $<TARGET_OBJECTS:seastar-protobuf>)
+ add_custom_command (
+ DEPENDS
+ ${in_file}
+ ${generator}
+ OUTPUT ${out_file}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${out_dir}
+ COMMAND ${generator} -f ${in_file} -o ${out_file})
-add_dependencies (seastar
- seastar-http-response-parser
- seastar-http-request-parser)
+ add_custom_target (${target}
+ DEPENDS ${out_file})
-add_library (Seastar::seastar ALIAS seastar)
+ set (${var} ${out_file} PARENT_SCOPE)
+endfunction ()
#
-# DPDK.
-#
-
-if (${SEASTAR_ENABLE_DPDK})
- set (dpdk_source_dir "${CMAKE_CURRENT_SOURCE_DIR}/dpdk")
- set (dpdk_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/dpdk")
-
- #
- # Oh, CMake...
- #
-
- set (arch "")
- foreach (flag ${SEASTAR_USER_CXXFLAGS})
- if (${flag} MATCHES "-march=(.+)")
- set (arch ${CMAKE_MATCH_1})
- endif ()
- endforeach ()
-
- if ("${arch}" STREQUAL "nehalem")
- set (dpdk_machine "nhm")
- elseif ("${arch}" STREQUAL "westmere")
- set (dpdk_machine "wsm")
- elseif ("${arch}" STREQUAL "sandybridge")
- set (dpdk_machine "snb")
- elseif ("${arch}" STREQUAL "ivybridge")
- set (dpdk_machine "ivb")
- else ()
- set (dpdk_machine "native")
- endif ()
-
- if (EXISTS "${dpdk_binary_dir}/.config")
- file (REMOVE "${dpdk_binary_dir}/.config")
- endif ()
-
- exec_program (make
- ARGS -C ${dpdk_source_dir} RTE_OUTPUT=${dpdk_binary_dir} config "T=x86_64-${dpdk_machine}-linuxapp-gcc")
-
- exec_program ("${CMAKE_CURRENT_SOURCE_DIR}/cmake-tools/dpdk_adjust_variables.py"
- ARGS "${dpdk_binary_dir}/.config" ${dpdk_machine})
+# The `seastar` library.
+#
+
+set (BUILD_SHARED_LIBS ${Seastar_SHARED})
+
+seastar_generate_ragel (seastar_http_request_parser
+ http_request_parser_file
+ ${CMAKE_CURRENT_SOURCE_DIR}/gen/http/request_parser.rl
+ ${CMAKE_CURRENT_BINARY_DIR}/gen/seastar/http/request_parser.hh)
+
+seastar_generate_ragel (seastar_http_response_parser
+ http_response_parser_file
+ ${CMAKE_CURRENT_SOURCE_DIR}/gen/http/response_parser.rl
+ ${CMAKE_CURRENT_BINARY_DIR}/gen/seastar/http/response_parser.hh)
+
+seastar_generate_protobuf (seastar_proto_metrics2
+ proto_metrics2_files
+ ${CMAKE_CURRENT_SOURCE_DIR}/gen/proto/metrics2.proto
+ ${CMAKE_CURRENT_BINARY_DIR}/gen/seastar/proto)
+
+add_library (seastar STATIC
+ ${http_request_parser_file}
+ ${proto_metrics2_files}
+ include/seastar/core/abort_source.hh
+ include/seastar/core/alien.hh
+ include/seastar/core/align.hh
+ include/seastar/core/aligned_buffer.hh
+ include/seastar/core/app-template.hh
+ include/seastar/core/apply.hh
+ include/seastar/core/array_map.hh
+ include/seastar/core/bitops.hh
+ include/seastar/core/bitset-iter.hh
+ include/seastar/core/byteorder.hh
+ include/seastar/core/cacheline.hh
+ include/seastar/core/checked_ptr.hh
+ include/seastar/core/chunked_fifo.hh
+ include/seastar/core/circular_buffer.hh
+ include/seastar/core/circular_buffer_fixed_capacity.hh
+ include/seastar/core/condition-variable.hh
+ include/seastar/core/deleter.hh
+ include/seastar/core/distributed.hh
+ include/seastar/core/do_with.hh
+ include/seastar/core/dpdk_rte.hh
+ include/seastar/core/enum.hh
+ include/seastar/core/exception_hacks.hh
+ include/seastar/core/execution_stage.hh
+ include/seastar/core/expiring_fifo.hh
+ include/seastar/core/fair_queue.hh
+ include/seastar/core/file.hh
+ include/seastar/core/fsqual.hh
+ include/seastar/core/fstream.hh
+ include/seastar/core/function_traits.hh
+ include/seastar/core/future-util.hh
+ include/seastar/core/future.hh
+ include/seastar/core/gate.hh
+ include/seastar/core/iostream-impl.hh
+ include/seastar/core/iostream.hh
+ include/seastar/core/linux-aio.hh
+ include/seastar/core/lowres_clock.hh
+ include/seastar/core/manual_clock.hh
+ include/seastar/core/memory.hh
+ include/seastar/core/metrics.hh
+ include/seastar/core/metrics_api.hh
+ include/seastar/core/metrics_registration.hh
+ include/seastar/core/metrics_types.hh
+ include/seastar/core/pipe.hh
+ include/seastar/core/posix.hh
+ include/seastar/core/preempt.hh
+ include/seastar/core/prefetch.hh
+ include/seastar/core/print.hh
+ include/seastar/core/prometheus.hh
+ include/seastar/core/queue.hh
+ include/seastar/core/ragel.hh
+ include/seastar/core/reactor.hh
+ include/seastar/core/report_exception.hh
+ include/seastar/core/resource.hh
+ include/seastar/core/rwlock.hh
+ include/seastar/core/scattered_message.hh
+ include/seastar/core/scheduling.hh
+ include/seastar/core/scollectd.hh
+ include/seastar/core/scollectd_api.hh
+ include/seastar/core/seastar.hh
+ include/seastar/core/semaphore.hh
+ include/seastar/core/sharded.hh
+ include/seastar/core/shared_future.hh
+ include/seastar/core/shared_mutex.hh
+ include/seastar/core/shared_ptr.hh
+ include/seastar/core/shared_ptr_debug_helper.hh
+ include/seastar/core/shared_ptr_incomplete.hh
+ include/seastar/core/simple-stream.hh
+ include/seastar/core/slab.hh
+ include/seastar/core/sleep.hh
+ include/seastar/core/sstring.hh
+ include/seastar/core/stall_sampler.hh
+ include/seastar/core/stream.hh
+ include/seastar/core/systemwide_memory_barrier.hh
+ include/seastar/core/task.hh
+ include/seastar/core/temporary_buffer.hh
+ include/seastar/core/thread.hh
+ include/seastar/core/thread_cputime_clock.hh
+ include/seastar/core/thread_impl.hh
+ include/seastar/core/timer-set.hh
+ include/seastar/core/timer.hh
+ include/seastar/core/transfer.hh
+ include/seastar/core/unaligned.hh
+ include/seastar/core/units.hh
+ include/seastar/core/vector-data-sink.hh
+ include/seastar/core/vla.hh
+ include/seastar/core/weak_ptr.hh
+ include/seastar/http/api_docs.hh
+ include/seastar/http/common.hh
+ include/seastar/http/exception.hh
+ include/seastar/http/file_handler.hh
+ include/seastar/http/function_handlers.hh
+ include/seastar/http/handlers.hh
+ include/seastar/http/httpd.hh
+ include/seastar/http/json_path.hh
+ include/seastar/http/matcher.hh
+ include/seastar/http/matchrules.hh
+ include/seastar/http/mime_types.hh
+ include/seastar/http/reply.hh
+ include/seastar/http/request.hh
+ include/seastar/http/routes.hh
+ include/seastar/http/transformers.hh
+ include/seastar/json/formatter.hh
+ include/seastar/json/json_elements.hh
+ include/seastar/net/api.hh
+ include/seastar/net/arp.hh
+ include/seastar/net/byteorder.hh
+ include/seastar/net/config.hh
+ include/seastar/net/const.hh
+ include/seastar/net/dhcp.hh
+ include/seastar/net/dns.hh
+ include/seastar/net/dpdk.hh
+ include/seastar/net/ethernet.hh
+ include/seastar/net/inet_address.hh
+ include/seastar/net/ip.hh
+ include/seastar/net/ip_checksum.hh
+ include/seastar/net/native-stack.hh
+ include/seastar/net/net.hh
+ include/seastar/net/packet-data-source.hh
+ include/seastar/net/packet-util.hh
+ include/seastar/net/packet.hh
+ include/seastar/net/posix-stack.hh
+ include/seastar/net/proxy.hh
+ include/seastar/net/socket_defs.hh
+ include/seastar/net/stack.hh
+ include/seastar/net/tcp-stack.hh
+ include/seastar/net/tcp.hh
+ include/seastar/net/tls.hh
+ include/seastar/net/toeplitz.hh
+ include/seastar/net/udp.hh
+ include/seastar/net/virtio-interface.hh
+ include/seastar/net/virtio.hh
+ include/seastar/rpc/lz4_compressor.hh
+ include/seastar/rpc/multi_algo_compressor_factory.hh
+ include/seastar/rpc/rpc.hh
+ include/seastar/rpc/rpc_impl.hh
+ include/seastar/rpc/rpc_types.hh
+ include/seastar/util/alloc_failure_injector.hh
+ include/seastar/util/backtrace.hh
+ include/seastar/util/bool_class.hh
+ include/seastar/util/conversions.hh
+ include/seastar/util/defer.hh
+ include/seastar/util/eclipse.hh
+ include/seastar/util/function_input_iterator.hh
+ include/seastar/util/gcc6-concepts.hh
+ include/seastar/util/indirect.hh
+ include/seastar/util/is_smart_ptr.hh
+ include/seastar/util/lazy.hh
+ include/seastar/util/log-cli.hh
+ include/seastar/util/log.hh
+ include/seastar/util/noncopyable_function.hh
+ include/seastar/util/optimized_optional.hh
+ include/seastar/util/print_safe.hh
+ include/seastar/util/program-options.hh
+ include/seastar/util/reference_wrapper.hh
+ include/seastar/util/spinlock.hh
+ include/seastar/util/transform_iterator.hh
+ include/seastar/util/tuple_utils.hh
+ include/seastar/util/variant_utils.hh
+ src/core/alien.cc
+ src/core/app-template.cc
+ src/core/dpdk_rte.cc
+ src/core/exception_hacks.cc
+ src/core/execution_stage.cc
+ src/core/file-impl.hh
+ src/core/fsqual.cc
+ src/core/fstream.cc
+ src/core/future-util.cc
+ src/core/linux-aio.cc
+ src/core/memory.cc
+ src/core/metrics.cc
+ src/core/posix.cc
+ src/core/prometheus.cc
+ src/core/reactor.cc
+ src/core/resource.cc
+ src/core/scollectd.cc
+ src/core/scollectd-impl.hh
+ src/core/systemwide_memory_barrier.cc
+ src/core/thread.cc
+ src/http/api_docs.cc
+ src/http/common.cc
+ src/http/file_handler.cc
+ src/http/httpd.cc
+ src/http/json_path.cc
+ src/http/matcher.cc
+ src/http/mime_types.cc
+ src/http/reply.cc
+ src/http/routes.cc
+ src/http/transformers.cc
+ src/json/formatter.cc
+ src/json/json_elements.cc
+ src/net/arp.cc
+ src/net/config.cc
+ src/net/dhcp.cc
+ src/net/dns.cc
+ src/net/dpdk.cc
+ src/net/ethernet.cc
+ src/net/inet_address.cc
+ src/net/ip.cc
+ src/net/ip_checksum.cc
+ src/net/native-stack-impl.hh
+ src/net/native-stack.cc
+ src/net/net.cc
+ src/net/packet.cc
+ src/net/posix-stack.cc
+ src/net/proxy.cc
+ src/net/stack.cc
+ src/net/tcp.cc
+ src/net/tls.cc
+ src/net/udp.cc
+ src/net/virtio.cc
+ src/rpc/lz4_compressor.cc
+ src/rpc/rpc.cc
+ src/util/alloc_failure_injector.cc
+ src/util/backtrace.cc
+ src/util/conversions.cc
+ src/util/log.cc
+ src/util/program-options.cc)
- exec_program ("${CMAKE_CURRENT_SOURCE_DIR}/cmake-tools/dpdk_query_cflags.py"
- ARGS ${dpdk_binary_dir} ${dpdk_machine}
- OUTPUT_VARIABLE dpdk_cflags)
-
- add_custom_target (seastar-dpdk
- COMMAND make -C ${dpdk_binary_dir} CC=\"${CMAKE_C_COMPILER} -Wno-implicit-fallthrough -Wno-format-truncation -Wno-bool-operation -Wno-maybe-uninitialized ${SEASTAR_USER_CFLAGS}\")
-
- add_dependencies (seastar seastar-dpdk)
-
- target_include_directories (seastar SYSTEM PUBLIC "${dpdk_binary_dir}/include")
- target_compile_options (seastar PUBLIC "${dpdk_cflags}")
-endif ()
+add_library (Seastar::seastar ALIAS seastar)
-#
-# Compilation flags and definitions.
-#
+add_dependencies (seastar
+ seastar_http_request_parser
+ seastar_http_response_parser
+ seastar_proto_metrics2)
-target_compile_options (seastar
- PRIVATE
- -Wall
+target_compile_features (seastar
+ PUBLIC cxx_std_17)
+target_include_directories (seastar
PUBLIC
- "-std=${SEASTAR_CXX_DIALECT}"
- -Wno-error=deprecated-declarations
- -fvisibility=hidden
- -U_FORTIFY_SOURCE)
-
-if(SEASTAR_ENABLE_WERROR)
- target_compile_options (seastar PRIVATE
- -Werror
- )
-endif()
-
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
- target_compile_options (seastar PUBLIC
- -fsanitize=address
- -fsanitize=leak
- -fsanitize=undefined)
-
- target_compile_definitions (seastar PUBLIC
- SEASTAR_DEBUG
- SEASTAR_DEBUG_SHARED_PTR
- SEASTAR_DEFAULT_ALLOCATOR
- SEASTAR_THREAD_STACK_GUARDS
- SEASTAR_ASAN_ENABLED
- SEASTAR_SHUFFLE_TASK_QUEUE)
-else ()
- target_compile_options (seastar PUBLIC "${SEASTAR_CXX_OPTIMIZATION_FLAGS}")
-endif ()
-
-if (${SEASTAR_ENABLE_GCC6_CONCEPTS})
- target_compile_options (seastar PUBLIC -fconcepts)
- target_compile_definitions (seastar PUBLIC SEASTAR_HAVE_GCC6_CONCEPTS)
-endif ()
+ $<INSTALL_INTERFACE:include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/gen>
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
-if (NOT ${SEASTAR_ENABLE_EXCEPTION_SCALABILITY_WORKAROUND})
- target_compile_definitions (seastar PUBLIC
- SEASTAR_NO_EXCEPTION_HACK)
+target_link_libraries (seastar
+ PUBLIC
+ Boost::boost
+ Boost::program_options
+ Boost::thread
+ c-ares::c-ares
+ cryptopp::cryptopp
+ fmt::fmt
+ lz4::lz4
+ PRIVATE
+ Boost::filesystem
+ GnuTLS::gnutls
+ StdFilesystem::filesystem
+ dl::dl
+ lksctp-tools::lksctp-tools
+ protobuf::libprotobuf
+ rt::rt
+ yaml-cpp::yaml-cpp
+ debug Sanitizers::address
+ debug Sanitizers::undefined_behavior)
+
+if (LinuxMembarrier_FOUND)
+ target_compile_definitions (seastar
+ PRIVATE SEASTAR_HAS_MEMBARRIER)
+
+ target_link_libraries (seastar
+ PRIVATE LinuxMembarrier::membarrier)
endif ()
-if (${SEASTAR_ENABLE_HWLOC})
- target_compile_definitions (seastar PUBLIC
- SEASTAR_HAVE_HWLOC SEASTAR_HAVE_NUMA)
+if (Seastar_ALLOC_FAILURE_INJECTION)
+ target_compile_definitions (seastar
+ PUBLIC SEASTAR_ENABLE_ALLOC_FAILURE_INJECTION=1)
endif ()
-if (${SEASTAR_ENABLE_DPDK})
- target_compile_options (seastar PUBLIC
- -Wno-error=literal-suffix
- -Wno-literal-suffix
- -Wno-invalid-offsetof)
-
- target_compile_definitions (seastar PUBLIC
- SEASTAR_HAVE_DPDK)
+if (Sanitizers_FIBER_SUPPORT)
+ target_compile_definitions (seastar
+ PRIVATE SEASTAR_HAVE_ASAN_FIBER_SUPPORT)
endif ()
-if (${SEASTAR_ALLOCATOR_PAGE_SIZE})
- target_compile_definitions (seastar PUBLIC
- SEASTAR_OVERRIDE_ALLOCATOR_PAGE_SIZE=${SEASTAR_ALLOCATOR_PAGE_SIZE})
+if (Seastar_ALLOC_PAGE_SIZE)
+ target_compile_definitions (seastar
+ PUBLIC SEASTAR_OVERRIDE_ALLOCATOR_PAGE_SIZE=${Seastar_ALLOC_PAGE_SIZE})
endif ()
-if (${SEASTAR_ENABLE_ALLOC_FAILURE_INJECTOR})
- target_compile_definitions (seastar PUBLIC
- SEASTAR_ENABLE_ALLOC_FAILURE_INJECTION)
+if (Seastar_CXX_FLAGS)
+ target_compile_options (seastar
+ PRIVATE ${Seastar_CXX_FLAGS})
endif ()
-##
-## Code tests.
-##
-
-###
-### have_lz4_compress_default
-###
+if (Seastar_DPDK)
+ if (NOT dpdk_FOUND)
+ message (FATAL_ERROR "dpdk support is enabled but it is not available!")
+ endif ()
-set (CMAKE_REQUIRED_INCLUDES ${Lz4_INCLUDE_DIRS})
-set (CMAKE_REQUIRED_LIBRARIES ${Lz4_LIBRARIES})
-check_symbol_exists (LZ4_compress_default lz4.h have_lz4_compress_default)
+ target_compile_definitions (seastar
+ PUBLIC SEASTAR_HAVE_DPDK)
-if (${have_lz4_compress_default})
- target_compile_definitions (seastar PUBLIC SEASTAR_HAVE_LZ4_COMPRESS_DEFAULT)
+ target_link_libraries (seastar
+ PUBLIC dpdk::dpdk)
endif ()
-###
-### have_asan_fiber_support
-###
-
-try_compile (have_asan_fiber_support
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake-tests/asan_fiber.cc
- LINK_LIBRARIES -fsanitize=address)
+if (Seastar_GCC6_CONCEPTS)
+ target_compile_definitions (seastar
+ PUBLIC SEASTAR_HAVE_GCC6_CONCEPTS=1)
-if (${have_asan_fiber_support})
- target_compile_definitions (seastar PUBLIC SEASTAR_HAVE_ASAN_FIBER_SUPPORT)
+ target_compile_options (seastar
+ PUBLIC -fconcepts)
endif ()
-###
-### have_sanitize_vptr_flag
-###
-
-#
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67258
-check_cxx_compiler_flag (-fsanitize=vptr have_sanitize_vptr_flag)
-
-set (ENV{UBSAN_OPTIONS} "exitcode=1")
-try_run (sanitize_vptr_run sanitize_vptr_compile
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake-tests/sanitize_vptr.cc
- CMAKE_FLAGS -DCMAKE_CXX_FLAGS="-fsanitize=undefined -fno-sanitize-recover")
-
-# TODO: -fsanitize=vptr is broken even when the test passes.
-if ((NOT "${have_sanitize_vptr_flag}") OR "${sanitize_vptr_run}" AND FALSE)
-else ()
- if ("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
- message (STATUS "-fsanitize=vptr is broken; disabling. Some debug-mode tests are bypassed.")
- target_compile_options (seastar PUBLIC -fno-sanitize=vptr)
- endif ()
+if (NOT Seastar_EXCEPTION_SCALABILITY_WORKAROUND)
+ target_compile_definitions (seastar
+ PRIVATE SEASTAR_NO_EXCEPTION_HACK=1)
endif ()
-###
-### visibility_flags_compile
-###
+if (Seastar_HWLOC)
+ if (NOT hwloc_FOUND)
+ message (FATAL_ERROR "hwloc support is enabled but it is not available!")
+ endif ()
-#
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947
-try_compile (visiblity_flags_compile
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake-tests/visibility_flags.cc
- CMAKE_FLAGS -DCMAKE_CXX_FLAGS="-fvisibility=hidden -std=gnu++1y -Werror=attributes")
+ target_compile_definitions (seastar
+ PRIVATE
+ SEASTAR_HAVE_HWLOC
+ SEASTAR_HAVE_NUMA)
-if (NOT "${visibility_flags_compile}")
- message (STATUS "Disabling -Wattributes due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947")
- target_compile_options (seastar PUBLIC -Wno-attributes)
+ target_link_libraries (seastar
+ PRIVATE hwloc::hwloc)
endif ()
-###
-### have_membarrier
-###
-
-try_compile (have_membarrier
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake-tests/have_membarrier.cc)
-
-if (${have_membarrier})
- target_compile_definitions (seastar PUBLIC SEASTAR_HAS_MEMBARRIER)
+if (lz4_HAVE_COMPRESS_DEFAULT)
+ target_compile_definitions (seastar
+ PRIVATE SEASTAR_HAVE_LZ4_COMPRESS_DEFAULT)
endif ()
-##
-## Warnings.
-##
-
-function (seastar_add_warning_if_supported warning)
- # GCC ignores the `-Wno` prefix even when the warning is not recognized, so strip it.
- string (REGEX REPLACE "^-Wno-" "-W" adjusted ${warning})
- string (REGEX REPLACE "^-W" "warning_" human_name_prefix ${adjusted})
- set (result "${human_name_prefix}_supported")
- check_cxx_compiler_flag (${adjusted} ${result})
-
- if ("${${result}}")
- target_compile_options (seastar PUBLIC ${warning})
- endif ()
-endfunction ()
-
-# Clang-only.
-seastar_add_warning_if_supported (-Wno-mismatched-tags)
-
-# Clang-only: moving a temporary object prevents copy elision.
-seastar_add_warning_if_supported (-Wno-pessimizing-move)
-
-# Clang-only: redundant move in return statement.
-seastar_add_warning_if_supported (-Wno-redundant-move)
-
-# Clang-only: 'x' overrides a member function but is not marked 'override'.
-seastar_add_warning_if_supported (-Wno-inconsistent-missing-override)
-
-# Clang-only: private field 'x' is not used.
-seastar_add_warning_if_supported (-Wno-unused-private-field)
-
-# Clang-only: unknown attribute 'x' ignored (x in this case is gnu::externally_visible).
-seastar_add_warning_if_supported (-Wno-unknown-attributes)
-
-# Clang-only: 'x' function 'y' declared in header file should be declared 'z'.
-seastar_add_warning_if_supported (-Wno-unneeded-internal-declaration)
-
-# Clang-only: inline function 'x' is not defined.
-seastar_add_warning_if_supported (-Wno-undefined-inline)
-
-# Clang-only: 'x' hides overloaded virtual functions.
-seastar_add_warning_if_supported (-Wno-overloaded-virtual)
-
-seastar_add_warning_if_supported (-Wno-maybe-uninitialized)
-
-# GCC: Overzealous: false positives.
-seastar_add_warning_if_supported (-Wno-stringop-overflow)
-
-seastar_add_warning_if_supported (-Wno-error=cpp)
-
-##
-## Extra flags at the end.
-##
-
-target_compile_options (seastar PUBLIC "${SEASTAR_USER_CXXFLAGS}")
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ target_compile_definitions (seastar
+ PUBLIC
+ SEASTAR_DEBUG
+ SEASTAR_DEBUG_SHARED_PTR
+ SEASTAR_ASAN_ENABLED
+ SEASTAR_THREAD_STACK_GUARDS
+ PRIVATE SEASTAR_DEFAULT_ALLOCATOR)
+endif ()
#
-# Configuration.
+# Tests and the testing library.
#
-target_include_directories (seastar SYSTEM
- PUBLIC
- ${GNUTLS_INCLUDE_DIR})
+if (Seastar_TESTING)
+ find_package (Boost REQUIRED
+ COMPONENTS unit_test_framework)
-target_include_directories (seastar PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR})
+ enable_testing ()
-if (${SEASTAR_NABLE_HWLOC})
- target_include_directories (seastar SYSTEM
- PUBLIC
- ${LIBXML2_INCLUDE_DIRS})
-endif ()
-
-target_link_libraries (seastar PUBLIC
- -Wl,--no-as-needed
- -fvisibility=hidden)
-
-target_link_libraries (seastar PUBLIC
- debug -fsanitize=address
- debug -fsanitize=leak
- debug -fsanitize=undefined
- stdc++fs
- -ldl
- -lgcc_s
- ${CMAKE_THREAD_LIBS_INIT}
- ${GNUTLS_LIBRARIES}
- ${PROTOBUF_LIBRARIES}
- ${RT_LIBRARY}
- Boost::boost # Headers only.
- Cryptopp::cryptopp
- Lz4::lz4
- fmt::fmt
- c-ares::cares)
-
-function (seastar_maybe_link_statically static_flag)
- string (REPLACE ";" "," joined_targets "${ARGN}")
-
- if (${static_flag})
- target_link_libraries (seastar PUBLIC "-Wl,-Bstatic" "${joined_targets}" "-Wl,-Bdynamic")
+ if (Seastar_EXCLUDE_TESTS_FROM_ALL)
+ set (exclude EXCLUDE_FROM_ALL)
else ()
- target_link_libraries (seastar PUBLIC "${ARGN}")
+ set (exclude "")
endif ()
-endfunction ()
-
-seastar_maybe_link_statically (${SEASTAR_LINK_STATIC_BOOST}
- Boost::program_options
- Boost::filesystem
- Boost::thread)
-
-seastar_maybe_link_statically (${SEASTAR_LINK_STATIC_YAML_CPP}
- Yaml-cpp::yaml-cpp)
-
-if (${SEASTAR_ENABLE_HWLOC})
- target_link_libraries (seastar PUBLIC
- ${NUMA_LIBRARY}
- ${PCIAccess_LIBRARY}
- ${LIBXML2_LIBRARIES}
- HWLoc::hwloc
- ZLIB::ZLIB)
-endif ()
-if (${SEASTAR_ENABLE_DPDK})
- set (dpdk_libraries
- -lrte_pmd_vmxnet3_uio
- -lrte_pmd_i40e
- -lrte_pmd_ixgbe
- -lrte_pmd_e1000
- -lrte_pmd_ring
- -lrte_pmd_bnxt
- -lrte_pmd_cxgbe
- -lrte_pmd_ena
- -lrte_pmd_enic
- -lrte_pmd_fm10k
- -lrte_pmd_nfp
- -lrte_pmd_qede
- -lrte_pmd_sfc_efx
- -lrte_hash
- -lrte_kvargs
- -lrte_mbuf
- -lrte_ethdev
- -lrte_eal
- -lrte_mempool
- -lrte_ring
- -lrte_cmdline
- -lrte_cfgfile)
-
- string (REPLACE ";" "," joined_dpdk_libraries "${dpdk_libraries}")
-
- target_link_libraries (seastar PUBLIC
- -L"${dpdk_binary_dir}/lib"
- -Wl,--whole-archive,${joined_dpdk_libraries},--no-whole-archive)
+ add_subdirectory (test ${exclude})
endif ()
-target_link_libraries (seastar PUBLIC "${SEASTAR_USER_LDFLAGS}")
-
#
-# Applications.
+# Demonstrations.
#
-if (${SEASTAR_EXCLUDE_APPS_BY_DEFAULT})
- set (exclude_apps EXCLUDE_FROM_ALL)
-else ()
- set (exclude_apps "")
+if (Seastar_DEMOS)
+ add_subdirectory (demo)
endif ()
-add_subdirectory (apps ${exclude_apps})
-
#
-# Tests.
+# Documentation.
#
-enable_testing ()
-
-if (${SEASTAR_EXCLUDE_TESTS_BY_DEFAULT})
- set (exclude_tests EXCLUDE_FROM_ALL)
-else ()
- set (exclude_tests "")
+if (Seastar_DOCS)
+ add_subdirectory (doc)
endif ()
-if(${SEASTAR_ENABLE_TESTS})
- add_subdirectory (tests ${exclude_tests})
-endif()
#
-# Documentation.
+# Applications.
#
-add_custom_target (tutorial-html
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND
- pandoc
- --self-contained
- --smart
- --toc
- -c doc/template.css
- -V documentclas=report
- --chapters
- --number-sections
- -f markdown_github+pandoc_title_block
- --highlight-style tango
- doc/tutorial.md
- -o doc/tutorial.html)
-
-add_custom_target (tutorial-html-split
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc"
- COMMAND mkdir -p split && ./htmlsplit.py
- DEPENDS tutorial-html)
-
-add_custom_target (tutorial-pdf
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND
- pandoc
- -f markdown_github+pandoc_title_block
- --highlight-style tango
- --template=doc/template.tex
- doc/tutorial.md
- -o doc/tutorial.pdf)
+if (Seastar_APPS)
+ add_subdirectory (app)
+endif ()
#
-# Source code navigation tools.
+# pkg-config generation.
+#
+# Note that unlike the CMake "config module", this description is not relocatable because
+# some dependencies do not natively support pkg-config.
#
-add_custom_target (cscope
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND sh -c find -name '*.[chS]' -o -name '*.cc' -o -name '*.hh' | cscope -bq -i-)
+# Necessary here for pkg-config.
+include (GNUInstallDirs)
+
+configure_file (
+ ${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/seastar.pc.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/seastar.pc.cmake
+ @ONLY)
+
+file (GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/seastar.pc
+ INPUT ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/seastar.pc.cmake)
#
-# Generate pkg-config specification.
+# Installation and export.
#
-# This is quite ugly, since we need to extract information from imported targets
-# (like `Boost::program_options`) and resolve generator expessions ($<...>).
-# CMake doesn't make it easy to do either.
-set (imported_target_regex "[a-zA-Z0-9_\\-]+::[a-zA-ZA0-9_\\-]+")
+if (Seastar_INSTALL)
+ include (CMakePackageConfigHelpers)
+ set (install_cmakedir ${CMAKE_INSTALL_LIBDIR}/cmake/Seastar)
-set (pc_cflags "")
-set (pc_libs "")
+ install (
+ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-##
-## Query an imported target for all its non-linking compiler options.
-##
-function (seastar_expand_imported_target_cflags target output)
- get_target_property (definitions ${target} INTERFACE_COMPILE_DEFINITIONS)
- get_target_property (options ${target} INTERFACE_COMPILE_OPTIONS)
- get_target_property (include_dirs ${target} INTERFACE_INCLUDE_DIRECTORIES)
-
- set (cflags "")
- if (definitions)
- # All definitions need to be prefixed with -D.
- string (REGEX REPLACE "([^;]+)" -D\\1 definitions_args "${definitions}")
- list (APPEND cflags "${definitions_args}")
- endif ()
- if (options)
- list (APPEND cflags "${options}")
- endif ()
- if (include_dirs)
- list (REMOVE_DUPLICATES include_dirs)
-
- ##
- ## All directories need to be prefixed with -I. We only care about
- ## BUILD_INTERFACE directories, so we have to manually remove the
- ## INSTALL_INTERFACE ones.
- ##
-
- string (REGEX REPLACE "([^;]+)" -I\\1 include_dirs_args "${include_dirs}")
- string (REGEX REPLACE "-I\\$<INSTALL_INTERFACE:.+>" "" include_dirs_args_no_empty "${include_dirs_args}")
- list (APPEND cflags "${include_dirs_args_no_empty}")
- endif ()
+ install (
+ TARGETS seastar
+ EXPORT seastar-export
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- set ("${output}" "${cflags}" PARENT_SCOPE)
-endfunction ()
+ install (
+ EXPORT seastar-export
+ FILE SeastarTargets.cmake
+ NAMESPACE Seastar::
+ DESTINATION ${install_cmakedir})
-function (seastar_expand_imported_target_libs target output)
- get_target_property (libs ${target} INTERFACE_LINK_LIBRARIES)
- set ("${output}" "${libs}" PARENT_SCOPE)
-endfunction ()
+ write_basic_package_version_file (
+ ${CMAKE_CURRENT_BINARY_DIR}/SeastarConfigVersion.cmake
+ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY ExactVersion)
-##
-## Start with the CMAKE_CXX cflags.
-##
+ configure_package_config_file (
+ ${CMAKE_CURRENT_LIST_DIR}/cmake/
SeastarConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/SeastarConfig.cmake
+ INSTALL_DESTINATION ${install_cmakedir})
-string (TOUPPER "${CMAKE_BUILD_TYPE}" build_type_uppercase)
-string (REGEX REPLACE "[ ]+" ";" global_cflags "${CMAKE_CXX_FLAGS_${build_type_uppercase}}")
-list (APPEND pc_cflags "${global_cflags}")
+ install (
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/SeastarConfig.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/SeastarConfigVersion.cmake
+ DESTINATION ${install_cmakedir})
-seastar_expand_imported_target_cflags (Seastar::seastar seastar_cflags)
-list (APPEND pc_cflags "${seastar_cflags}")
+ install (
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindGnuTLS.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLinuxMembarrier.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindSanitizers.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindStdFilesystem.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findc-ares.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findcryptopp.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Finddpdk.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findhwloc.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findlksctp-tools.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findlz4.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findragel.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findrt.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Finddl.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findyaml-cpp.cmake
+ DESTINATION ${install_cmakedir})
-##
-## We expand the seastar library flags and process each one, looking for imported targets.
-##
+ install (
+ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake/code_test
+ DESTINATION ${install_cmakedir})
-seastar_expand_imported_target_libs (Seastar::seastar seastar_libs_raw)
-foreach (lib ${seastar_libs_raw})
- if (${lib} MATCHES ${imported_target_regex})
- ##
- ## For an imported target, expand its CFLAGS.
- ##
-
- seastar_expand_imported_target_cflags (${lib} lib_cflags)
- list (APPEND pc_cflags "${lib_cflags}")
-
- ##
- ## For non-header-only libraries, add the imported target's actual library file.
- ##
-
- get_target_property (lib_type ${lib} TYPE)
- if (NOT ("${lib_type}" STREQUAL INTERFACE_LIBRARY))
- set (lib_location $<TARGET_FILE:${lib}>)
- list (APPEND pc_libs "${lib_location}")
- endif ()
- else ()
- list (APPEND pc_libs "${lib}")
- endif ()
-endforeach ()
+ install (
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/seastar.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
+ #
+ # Export targets from the build tree for the user package registry.
+ #
-list (REMOVE_DUPLICATES pc_cflags)
+ export (
+ EXPORT seastar-export
+ FILE ${CMAKE_CURRENT_BINARY_DIR}/SeastarTargets.cmake
+ NAMESPACE Seastar::)
-set (pc_file "${CMAKE_CURRENT_BINARY_DIR}/seastar.pc")
+ export (PACKAGE Seastar)
-# At this point, both pc_libs and pc_cflags can contain generator expressions
-# ($<...>). CMake gives us no way to evaluate these in code. They are evaluated
-# by CMake internally at the build phase (but not the configure phase). Creating
-# a target and echoing the strings forces their evaluation at the right time.
-# This would not be possible with CONFIGURE_FILE.
-#
-# Note that seastar needs to be listed prior to other static libraries to
-# prevent symbols from being omitted from them.
-add_custom_target (pkg-config ALL
- COMMAND echo "Name: Seastar" > ${pc_file}
- COMMAND echo "URL:
http://seastar-project.org/" >> ${pc_file}
- COMMAND echo "Description: Advanced C++ framework for high-performance server applications on modern hardware." >> ${pc_file}
- COMMAND echo "Version: 1.0" >> ${pc_file}
- COMMAND echo "Libs:" '-Wl,--whole-archive,$<TARGET_FILE:Seastar::seastar>,--no-whole-archive' '${pc_libs}' >> ${pc_file}
- COMMAND echo "Cflags:" '${pc_cflags}' >> ${pc_file})
+ #
+ # Packaging.
+ #
+
+ set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
+ set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
+ set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+
+ include (CPack)
+endif ()
diff --git a/HACKING.md b/HACKING.md
new file mode 100644
index 00000000..22bc301a
--- /dev/null
+++ b/HACKING.md
@@ -0,0 +1,138 @@
+# Developing and using Seastar
+
+## Configuring the project
+
+- Use `cmake-cooking` to prepare a development environment with all dependencies:
+
+```
+./cooking.sh -r dev
+```
+
+- The same as above, and enable DPDK support:
+
+```
+./cooking.sh -r dev -- -DSeastar_DPDK=ON
+```
+
+- Use system packages for all dependencies except `fmt` and `c-ares`, which are provided by `cmake-cooking` (and not yet widely available via system package-managers):
+
+```
+./cooking.sh -r dev -i c-ares -i fmt
+```
+
+- Use `cmake-cooking` for all dependencies except for Boost:
+
+```
+./cooking.sh -r dev -e Boost
+```
+
+- The same, but compile in "release" mode:
+
+```
+./cooking.sh -r dev -e Boost -t Release
+```
+
+## Building the project
+
+```
+cd build
+ninja
+```
+
+## Running tests
+
+Make sure you are in the "build" directory.
+
+- Run unit tests:
+
+```
+ninja test_unit
+```
+
+- Run distribution tests (these take a long time the first time, but then the dependencies are cached):
+
+```
+ninja test_dist
+```
+
+- Run all tests:
+
+```
+ninja test
+```
+
+- Build and run a specific test:
+
+```
+ninja test_unit_thread_run
+```
+
+
+## Building documentation
+
+Make sure you are in the "build" directory.
+
+- Build all documentation:
+
+```
+ninja docs
+```
+
+- Build the tutorial in HTML form:
+
+```
+ninja doc_tutorial_html
+```
+
+- Build the tutorial in HTML form (one file per chapter):
+
+```
+ninja doc_tutorial_html_split
+```
+
+- Build the Doxygen documentation:
+
+```
+ninja doc_html
+```
+
+## Installing the project
+
+Choose the install path:
+
+```
+./cooking.sh -r dev -- -DCMAKE_INSTALL_PREFIX=/my/install/path
+```
+
+```
+ninja -C build install
+```
+
+## Using Seastar in an application
+
+Once Seastar has been installed, it is sufficient to add a dependency on Seastar with
+
+```
+find_package (Seastar ${VERSION} REQUIRED)
+
+add_executable (my_program
+ my_program.cc)
+
+target_link_libraries (my_program
+ PRIVATE Seastar::seastar)
+```
+
+where `VERSION` is the desired version.
+
+If you'd like to use `cmake-cooking` to set up a development environment which includes Seastar and its dependencies (a "recipe"), you can include Seastar as follows:
+
+```
+cooking_ingredient (Seastar
+ SOURCE_DIR ${MY_SEASTAR_SOURCE_DIR}
+ COOKING_RECIPE dev
+ CMAKE_ARGS
+ -DSeastar_APPS=OFF
+ -DSeastar_DEMOS=OFF
+ -DSeastar_DOCS=OFF
+ -DSeastar_TESTING=OFF)
+```
diff --git a/LICENSE b/LICENSE.md
similarity index 100%
rename from LICENSE
rename to LICENSE.md
diff --git a/NOTICE b/NOTICE.md
similarity index 100%
rename from NOTICE
rename to NOTICE.md
diff --git a/README.md b/README.md
index 838ed964..7be7bfae 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,24 @@ It is based on [futures](
http://en.wikipedia.org/wiki/Futures_and_promises).
Building Seastar
--------------------
-See instructions for [Fedora](doc/building-fedora.md), [CentOS](doc/building-centos.md) and [Ubuntu](doc/building-ubuntu.md).
+For more detailed instructions, read [HACKING.md](./HACKING.md).
+
+Configuring Seastar via
+
+```
+./cooking.sh -r dev
+```
+
+will create a localized development environment specific to Seastar by downloading, compiling, and installing all dependencies of the library.
+
+You can then compile:
+
+```
+$ cd build
+$ ninja
+```
+
+Alternatively, system packages (via RPM or APT packages, for example) can be used to supply dependencies as well. There are distribution-specific instructions for [Fedora](doc/building-fedora.md), [CentOS](doc/building-centos.md) and [Ubuntu](doc/building-ubuntu.md). In general, the `install-dependencies.sh` will attempt to install all necessary packages for your distribution.
There are also instructions for building on any host that supports [Docker](doc/building-docker.md).
diff --git a/apps/CMakeLists.txt b/app/CMakeLists.txt
similarity index 66%
rename from apps/CMakeLists.txt
rename to app/CMakeLists.txt
index 896c8dc9..4acfc51c 100644
--- a/apps/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -23,11 +23,31 @@
# Logical target for all applications.
add_custom_target (apps)
-function (add_seastar_app name)
- add_executable (${name} ${ARGN})
- target_link_libraries (${name} PRIVATE seastar)
- add_dependencies (apps ${name})
-endfunction ()
+macro (seastar_add_app name)
+ set (args ${ARGN})
+
+ cmake_parse_arguments (
+ parsed_args
+ ""
+ ""
+ "SOURCES"
+ ${args})
+
+ set (target app_${name})
+ add_executable (${target} ${parsed_args_SOURCES})
+
+ target_include_directories (${target}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+
+ target_link_libraries (${target}
+ PRIVATE seastar)
+
+ set_target_properties (${target}
+ PROPERTIES
+ OUTPUT_NAME ${name})
+
+ add_dependencies (apps ${target})
+endmacro ()
add_subdirectory (httpd)
add_subdirectory (io_tester)
diff --git a/apps/io_tester/CMakeLists.txt b/app/httpd/CMakeLists.txt
similarity index 68%
rename from apps/io_tester/CMakeLists.txt
rename to app/httpd/CMakeLists.txt
index 139889ec..a6747e1c 100644
--- a/apps/io_tester/CMakeLists.txt
+++ b/app/httpd/CMakeLists.txt
@@ -20,5 +20,17 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-add_seastar_app (io_tester io_tester.cc)
-target_link_libraries (io_tester PRIVATE Yaml-cpp::yaml-cpp)
+seastar_generate_swagger (app_httpd_swagger
+ app_httpd_swagger_file
+ ${CMAKE_CURRENT_SOURCE_DIR}/demo.json
+ ${CMAKE_CURRENT_BINARY_DIR}/demo.json.hh)
+
+seastar_add_app (httpd
+ SOURCES
+ ${app_httpd_swagger_file}
+ main.cc)
+
+target_include_directories (app_httpd
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+
+add_dependencies (app_httpd app_httpd_swagger)
diff --git a/apps/httpd/demo.json b/app/httpd/demo.json
similarity index 100%
rename from apps/httpd/demo.json
rename to app/httpd/demo.json
diff --git a/apps/httpd/main.cc b/app/httpd/main.cc
similarity index 93%
rename from apps/httpd/main.cc
rename to app/httpd/main.cc
index 8c76cfaf..62af9434 100644
--- a/apps/httpd/main.cc
+++ b/app/httpd/main.cc
@@ -19,12 +19,12 @@
* Copyright 2015 Cloudius Systems
*/
-#include "http/httpd.hh"
-#include "http/handlers.hh"
-#include "http/function_handlers.hh"
-#include "http/file_handler.hh"
-#include "apps/httpd/demo.json.hh"
-#include "http/api_docs.hh"
+#include <seastar/http/httpd.hh>
+#include <seastar/http/handlers.hh>
+#include <seastar/http/function_handlers.hh>
+#include <seastar/http/file_handler.hh>
+#include "demo.json.hh"
+#include <seastar/http/api_docs.hh>
namespace bpo = boost::program_options;
diff --git a/apps/iotune/CMakeLists.txt b/app/io_tester/CMakeLists.txt
similarity index 86%
rename from apps/iotune/CMakeLists.txt
rename to app/io_tester/CMakeLists.txt
index ffd4cc34..266ff4e5 100644
--- a/apps/iotune/CMakeLists.txt
+++ b/app/io_tester/CMakeLists.txt
@@ -20,8 +20,8 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-add_seastar_app (iotune iotune.cc)
+seastar_add_app (io_tester
+ SOURCES io_tester.cc)
-target_link_libraries (iotune
- PRIVATE
- stdc++fs)
+target_link_libraries (app_io_tester
+ PRIVATE yaml-cpp::yaml-cpp)
diff --git a/apps/io_tester/conf.yaml b/app/io_tester/conf.yaml
similarity index 100%
rename from apps/io_tester/conf.yaml
rename to app/io_tester/conf.yaml
diff --git a/apps/io_tester/io_tester.cc b/app/io_tester/io_tester.cc
similarity index 98%
rename from apps/io_tester/io_tester.cc
rename to app/io_tester/io_tester.cc
index 44c7c94c..621fe6fa 100644
--- a/apps/io_tester/io_tester.cc
+++ b/app/io_tester/io_tester.cc
@@ -18,16 +18,16 @@
/*
* Copyright (C) 2017 ScyllaDB
*/
-#include "core/app-template.hh"
-#include "core/distributed.hh"
-#include "core/reactor.hh"
-#include "core/future.hh"
-#include "core/shared_ptr.hh"
-#include "core/file.hh"
-#include "core/sleep.hh"
-#include "core/align.hh"
-#include "core/timer.hh"
-#include "core/thread.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/distributed.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/future.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/file.hh>
+#include <seastar/core/sleep.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/timer.hh>
+#include <seastar/core/thread.hh>
#include <chrono>
#include <vector>
#include <boost/range/irange.hpp>
diff --git a/apps/memcached/CMakeLists.txt b/app/iotune/CMakeLists.txt
similarity index 84%
rename from apps/memcached/CMakeLists.txt
rename to app/iotune/CMakeLists.txt
index ee04b0c2..18788c14 100644
--- a/apps/memcached/CMakeLists.txt
+++ b/app/iotune/CMakeLists.txt
@@ -20,5 +20,10 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-seastar_ragel_generate (ascii.rl memcached_ragel_sources)
-add_seastar_app (memcached memcache.cc "${memcached_ragel_sources}")
+seastar_add_app (iotune
+ SOURCES iotune.cc)
+
+target_link_libraries (app_iotune
+ PRIVATE
+ StdFilesystem::filesystem
+ yaml-cpp::yaml-cpp)
diff --git a/apps/iotune/iotune.cc b/app/iotune/iotune.cc
similarity index 98%
rename from apps/iotune/iotune.cc
rename to app/iotune/iotune.cc
index f55d5243..b0f4a86a 100644
--- a/apps/iotune/iotune.cc
+++ b/app/iotune/iotune.cc
@@ -36,17 +36,17 @@
#include <experimental/filesystem>
#include <wordexp.h>
#include <yaml-cpp/yaml.h>
-#include "core/thread.hh"
-#include "core/sstring.hh"
-#include "core/posix.hh"
-#include "core/resource.hh"
-#include "core/aligned_buffer.hh"
-#include "core/sharded.hh"
-#include "core/app-template.hh"
-#include "core/shared_ptr.hh"
-#include "core/fsqual.hh"
-#include "util/defer.hh"
-#include "util/log.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/posix.hh>
+#include <seastar/core/resource.hh>
+#include <seastar/core/aligned_buffer.hh>
+#include <seastar/core/sharded.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/fsqual.hh>
+#include <seastar/util/defer.hh>
+#include <seastar/util/log.hh>
using namespace seastar;
using namespace std::chrono_literals;
diff --git a/tests/memcached/CMakeLists.txt b/app/memcached/CMakeLists.txt
similarity index 58%
copy from tests/memcached/CMakeLists.txt
copy to app/memcached/CMakeLists.txt
index 132b8d9f..e90b0a1e 100644
--- a/tests/memcached/CMakeLists.txt
+++ b/app/memcached/CMakeLists.txt
@@ -20,21 +20,29 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-if (${SEASTAR_EXECUTE_ONLY_FAST_TESTS})
- set (fast --fast)
-else ()
- set (fast "")
-endif()
+set (Seastar_APP_MEMCACHED_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set (Seastar_APP_MEMCACHED_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-# Special case dependency since `memcached_test` depends on the `memcached` target being built.
-add_dependencies (tests memcached)
+seastar_generate_ragel (app_memcached_ascii
+ app_memcached_ascii_file
+ ${CMAKE_CURRENT_SOURCE_DIR}/ascii.rl
+ ${CMAKE_CURRENT_BINARY_DIR}/ascii.hh)
-add_test (
- NAME memcached_test
- COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/test.py" ${fast} --memcached $<TARGET_FILE:memcached>)
+seastar_add_app (memcached
+ SOURCES
+ ${app_memcached_ascii_file}
+ memcache.cc
+ memcached.hh)
-add_seastar_test (NAME memcached_ascii_parser_test
- SUITE
- SOURCES test_ascii_parser.cc)
+target_include_directories (app_memcached
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
-add_dependencies (memcached_ascii_parser_test memcached)
+add_dependencies (app_memcached app_memcached_ascii)
+
+#
+# Tests.
+#
+
+if (Seastar_TESTING)
+ add_subdirectory (test)
+endif ()
diff --git a/apps/memcached/ascii.rl b/app/memcached/ascii.rl
similarity index 98%
rename from apps/memcached/ascii.rl
rename to app/memcached/ascii.rl
index fe5ad0a9..04d161ff 100644
--- a/apps/memcached/ascii.rl
+++ b/app/memcached/ascii.rl
@@ -19,8 +19,8 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/ragel.hh"
-#include "apps/memcached/memcached.hh"
+#include <seastar/core/ragel.hh>
+#include "memcached.hh"
#include <memory>
#include <algorithm>
#include <functional>
diff --git a/apps/memcached/memcache.cc b/app/memcached/memcache.cc
similarity index 99%
rename from apps/memcached/memcache.cc
rename to app/memcached/memcache.cc
index 4914739f..4e349270 100644
--- a/apps/memcached/memcache.cc
+++ b/app/memcached/memcache.cc
@@ -26,21 +26,21 @@
#include <boost/optional.hpp>
#include <iomanip>
#include <sstream>
-#include "core/app-template.hh"
-#include "core/future-util.hh"
-#include "core/timer-set.hh"
-#include "core/shared_ptr.hh"
-#include "core/stream.hh"
-#include "core/memory.hh"
-#include "core/units.hh"
-#include "core/distributed.hh"
-#include "core/vector-data-sink.hh"
-#include "core/bitops.hh"
-#include "core/slab.hh"
-#include "core/align.hh"
-#include "net/api.hh"
-#include "net/packet-data-source.hh"
-#include "apps/memcached/ascii.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/timer-set.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/stream.hh>
+#include <seastar/core/memory.hh>
+#include <seastar/core/units.hh>
+#include <seastar/core/distributed.hh>
+#include <seastar/core/vector-data-sink.hh>
+#include <seastar/core/bitops.hh>
+#include <seastar/core/slab.hh>
+#include <seastar/core/align.hh>
+#include <seastar/net/api.hh>
+#include <seastar/net/packet-data-source.hh>
+#include "ascii.hh"
#include "memcached.hh"
#include <unistd.h>
diff --git a/apps/memcached/memcached.hh b/app/memcached/memcached.hh
similarity index 98%
rename from apps/memcached/memcached.hh
rename to app/memcached/memcached.hh
index 10a35532..2c82491b 100644
--- a/apps/memcached/memcached.hh
+++ b/app/memcached/memcached.hh
@@ -18,7 +18,7 @@
#ifndef _MEMCACHED_HH
#define _MEMCACHED_HH
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
namespace memcache {
diff --git a/app/memcached/test/CMakeLists.txt b/app/memcached/test/CMakeLists.txt
new file mode 100644
index 00000000..6723c9e1
--- /dev/null
+++ b/app/memcached/test/CMakeLists.txt
@@ -0,0 +1,56 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+add_custom_target (app_memcached_test_memcached_run
+ DEPENDS
+ ${memcached_app}
+ ${CMAKE_CURRENT_SOURCE_DIR}/test.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/test_memcached.py
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test.py --memcached $<TARGET_FILE:app_memcached>
+ USES_TERMINAL)
+
+add_test (
+ NAME Seastar.app.memcached.memcached
+ COMMAND ${CMAKE_COMMAND} --build ${Seastar_BINARY_DIR} --target app_memcached_test_memcached_run)
+
+add_executable (app_memcached_test_ascii
+ test_ascii_parser.cc)
+
+add_dependencies (app_memcached_test_ascii app_memcached)
+
+target_include_directories (app_memcached_test_ascii
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${Seastar_APP_MEMCACHED_BINARY_DIR}
+ ${Seastar_APP_MEMCACHED_SOURCE_DIR})
+
+target_link_libraries (app_memcached_test_ascii
+ PRIVATE seastar_testing)
+
+add_custom_target (app_memcached_test_ascii_run
+ DEPENDS app_memcached_test_ascii
+ COMMAND app_memcached_test_ascii -- -c 2
+ USES_TERMINAL)
+
+add_test (
+ NAME Seastar.app.memcached.ascii
+ COMMAND ${CMAKE_COMMAND} --build ${Seastar_BINARY_DIR} --target app_memcached_test_ascii_run)
diff --git a/tests/memcached/test.py b/app/memcached/test/test.py
similarity index 100%
rename from tests/memcached/test.py
rename to app/memcached/test/test.py
diff --git a/tests/memcached/test_ascii_parser.cc b/app/memcached/test/test_ascii_parser.cc
similarity index 98%
rename from tests/memcached/test_ascii_parser.cc
rename to app/memcached/test/test_ascii_parser.cc
index 4c27291f..2a71b70d 100644
--- a/tests/memcached/test_ascii_parser.cc
+++ b/app/memcached/test/test_ascii_parser.cc
@@ -21,11 +21,11 @@
#include <iostream>
#include <limits>
-#include "tests/test-utils.hh"
-#include "core/shared_ptr.hh"
-#include "net/packet-data-source.hh"
-#include "apps/memcached/ascii.hh"
-#include "core/future-util.hh"
+#include "test-utils.hh"
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/net/packet-data-source.hh>
+#include "ascii.hh"
+#include <seastar/core/future-util.hh>
using namespace seastar;
using namespace net;
diff --git a/tests/memcached/test_memcached.py b/app/memcached/test/test_memcached.py
similarity index 100%
rename from tests/memcached/test_memcached.py
rename to app/memcached/test/test_memcached.py
diff --git a/apps/seawreck/CMakeLists.txt b/app/seawreck/CMakeLists.txt
similarity index 93%
rename from apps/seawreck/CMakeLists.txt
rename to app/seawreck/CMakeLists.txt
index 770c9840..f9ffd357 100644
--- a/apps/seawreck/CMakeLists.txt
+++ b/app/seawreck/CMakeLists.txt
@@ -20,4 +20,5 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-add_seastar_app (seawreck seawreck.cc)
+seastar_add_app (seawreck
+ SOURCES seawreck.cc)
diff --git a/apps/seawreck/seawreck.cc b/app/seawreck/seawreck.cc
similarity index 96%
rename from apps/seawreck/seawreck.cc
rename to app/seawreck/seawreck.cc
index 96bea9fd..f46e119f 100644
--- a/apps/seawreck/seawreck.cc
+++ b/app/seawreck/seawreck.cc
@@ -19,14 +19,14 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "http/http_response_parser.hh"
-#include "core/print.hh"
-#include "core/reactor.hh"
-#include "core/app-template.hh"
-#include "core/future-util.hh"
-#include "core/distributed.hh"
-#include "core/semaphore.hh"
-#include "core/future-util.hh"
+#include <seastar/http/response_parser.hh>
+#include <seastar/core/print.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/distributed.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/future-util.hh>
#include <chrono>
using namespace seastar;
diff --git a/c-ares b/c-ares
deleted file mode 160000
index fd6124c7..00000000
--- a/c-ares
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit fd6124c74da0801f23f9d324559d8b66fb83f533
diff --git a/cmake-tests/asan_fiber.cc b/cmake-tests/asan_fiber.cc
deleted file mode 100644
index 3dfee7b1..00000000
--- a/cmake-tests/asan_fiber.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is open source software, licensed to you under the terms
- * of the Apache License, Version 2.0 (the "License"). See the NOTICE file
- * distributed with this work for additional information regarding copyright
- * ownership. You may not use this file except in compliance with the License.
- *
- * You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/*
- * Copyright (C) 2018 Scylladb, Ltd.
- */
-
-#include <cstddef>
-
-extern "C" {
-void __sanitizer_start_switch_fiber(void**, const void*, size_t);
-void __sanitizer_finish_switch_fiber(void*, const void**, size_t*);
-}
-
-int main() {
- __sanitizer_start_switch_fiber(nullptr, nullptr, 0);
- __sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
-}
diff --git a/cmake-tests/have_membarrier.cc b/cmake-tests/have_membarrier.cc
deleted file mode 100644
index e1e2a21a..00000000
--- a/cmake-tests/have_membarrier.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is open source software, licensed to you under the terms
- * of the Apache License, Version 2.0 (the "License"). See the NOTICE file
- * distributed with this work for additional information regarding copyright
- * ownership. You may not use this file except in compliance with the License.
- *
- * You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/*
- * Copyright (C) 2018 Scylladb, Ltd.
- */
-
-extern "C" {
-#include <linux/membarrier.h>
-}
-
-int main() {
- int x = MEMBARRIER_CMD_PRIVATE_EXPEDITED | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED;
-}
diff --git a/cmake-tests/sanitize_vptr.cc b/cmake-tests/sanitize_vptr.cc
deleted file mode 100644
index f6b6d622..00000000
--- a/cmake-tests/sanitize_vptr.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is open source software, licensed to you under the terms
- * of the Apache License, Version 2.0 (the "License"). See the NOTICE file
- * distributed with this work for additional information regarding copyright
- * ownership. You may not use this file except in compliance with the License.
- *
- * You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/*
- * Copyright (C) 2018 Scylladb, Ltd.
- */
-
-struct A {
- virtual ~A() {}
-};
-
-struct B : virtual A {};
-struct C : virtual A {};
-struct D : V, virtual C {};
-
-int main() {
- D d;
-}
diff --git a/cmake-tests/visibility_flags.cc b/cmake-tests/visibility_flags.cc
deleted file mode 100644
index c1b778f5..00000000
--- a/cmake-tests/visibility_flags.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This file is open source software, licensed to you under the terms
- * of the Apache License, Version 2.0 (the "License"). See the NOTICE file
- * distributed with this work for additional information regarding copyright
- * ownership. You may not use this file except in compliance with the License.
- *
- * You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/*
- * Copyright (C) 2018 Scylladb, Ltd.
- */
-
-template <class T>
-class my_class {
-public:
- my_class() {
- auto outer = [this]() {
- auto fn = [this] {};
- // Use `fn` for something here.
- };
- }
-};
-
-template<typename T>
-void foo() {
- struct inner {
- inner() {
- (void)([this] { });
- }
- };
-}
-
-int main() {
- my_class<int> r;
- foo<int>();
-}
diff --git a/cmake-tools/dpdk_adjust_variables.py b/cmake-tools/dpdk_adjust_variables.py
deleted file mode 100755
index e94f404a..00000000
--- a/cmake-tools/dpdk_adjust_variables.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/python3
-
-#
-# This file is open source software, licensed to you under the terms
-# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
-# distributed with this work for additional information regarding copyright
-# ownership. You may not use this file except in compliance with the License.
-#
-# You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Copyright (C) 2018 Scylladb, Ltd.
-#
-
-"""
-Doing this from CMake is a pain due to its poor type system.
-"""
-
-import argparse
-import os
-
-# Adjust to taste.
-DEFAULTS = {
- 'CONFIG_RTE_LIBRTE_PMD_BOND': 'n',
- 'CONFIG_RTE_MBUF_SCATTER_GATHER': 'n',
- 'CONFIG_RTE_LIBRTE_IP_FRAG': 'n',
- 'CONFIG_RTE_APP_TEST': 'n',
- 'CONFIG_RTE_TEST_PMD': 'n',
- 'CONFIG_RTE_MBUF_REFCNT_ATOMIC': 'n',
- 'CONFIG_RTE_MAX_MEMSEG': '8192',
- 'CONFIG_RTE_EAL_IGB_UIO': 'n',
- 'CONFIG_RTE_LIBRTE_KNI': 'n',
- 'CONFIG_RTE_KNI_KMOD': 'n',
- 'CONFIG_RTE_LIBRTE_JOBSTATS': 'n',
- 'CONFIG_RTE_LIBRTE_LPM': 'n',
- 'CONFIG_RTE_LIBRTE_ACL': 'n',
- 'CONFIG_RTE_LIBRTE_POWER': 'n',
- 'CONFIG_RTE_LIBRTE_IP_FRAG': 'n',
- 'CONFIG_RTE_LIBRTE_METER': 'n',
- 'CONFIG_RTE_LIBRTE_SCHED': 'n',
- 'CONFIG_RTE_LIBRTE_DISTRIBUTOR': 'n',
- 'CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER': 'n',
- 'CONFIG_RTE_LIBRTE_REORDER': 'n',
- 'CONFIG_RTE_LIBRTE_PORT': 'n',
- 'CONFIG_RTE_LIBRTE_TABLE': 'n',
- 'CONFIG_RTE_LIBRTE_PIPELINE': 'n',
-}
-
-parser = argparse.ArgumentParser(description='Update the configuration variables for DPDK.')
-parser.add_argument('file', metavar='FILE', help="Path of the DPDK configuration file.")
-parser.add_argument('machine', metavar='NAME', help="The architecture identifier for DPDK, like `ivb`.")
-
-args = parser.parse_args()
-
-lines = open(args.file, encoding='UTF-8').readlines()
-new_lines = []
-
-for line in lines:
- for var, val in DEFAULTS.items():
- if line.startswith(var + '='):
- line = '{}={}\n'.format(var, val)
-
- new_lines.append(line)
-
-new_lines += 'CONFIG_RTE_MACHINE={}\n'.format(args.machine)
-open(args.file, 'w', encoding='UTF-8').writelines(new_lines)
diff --git a/cmake-tools/dpdk_query_cflags.py b/cmake-tools/dpdk_query_cflags.py
deleted file mode 100755
index a3cba4a0..00000000
--- a/cmake-tools/dpdk_query_cflags.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/python3
-
-#
-# This file is open source software, licensed to you under the terms
-# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
-# distributed with this work for additional information regarding copyright
-# ownership. You may not use this file except in compliance with the License.
-#
-# You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Copyright (C) 2018 Scylladb, Ltd.
-#
-
-import argparse
-import os
-import re
-import subprocess
-import tempfile
-
-parser = argparse.ArgumentParser(description="Query necessary CFLAGS for compiling DPDK.")
-parser.add_argument('build_dir', metavar='DIR', help="The build directory of DPDK.")
-parser.add_argument('machine', help="The architecture identifier for DPDK, like `ivb`.")
-args = parser.parse_args()
-
-with tempfile.NamedTemporaryFile() as sfile:
- dpdk_sdk_path = os.path.dirname(os.path.realpath(__file__)) + '/../dpdk'
- dpdk_target = args.build_dir
- dpdk_target_name = 'x86_64-{}-linuxapp-gcc'.format(args.machine)
- dpdk_arch = 'x86_64'
-
- sfile.file.write(bytes('include ' + dpdk_sdk_path + '/mk/
rte.vars.mk' + "\n", 'utf-8'))
- sfile.file.write(bytes('all:' + "\n\t", 'utf-8'))
- sfile.file.write(bytes('@echo $(MACHINE_CFLAGS)' + "\n", 'utf-8'))
- sfile.file.flush()
-
- dpdk_cflags = subprocess.check_output(['make', '--no-print-directory',
- '-f',
sfile.name,
- 'RTE_SDK=' + dpdk_sdk_path,
- 'RTE_OUTPUT=' + dpdk_target,
- 'RTE_TARGET=' + dpdk_target_name,
- 'RTE_SDK_BIN=' + dpdk_target,
- 'RTE_ARCH=' + dpdk_arch])
- dpdk_cflags_str = dpdk_cflags.decode('utf-8')
- dpdk_cflags_str = re.sub(r'\n+$', '', dpdk_cflags_str)
-
- # CMake likes comma-separated values.
- print(';'.join(dpdk_cflags_str.split()))
diff --git a/cmake/FindCryptopp.cmake b/cmake/FindCryptopp.cmake
deleted file mode 100644
index 51d197a0..00000000
--- a/cmake/FindCryptopp.cmake
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# This file is open source software, licensed to you under the terms
-# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
-# distributed with this work for additional information regarding copyright
-# ownership. You may not use this file except in compliance with the License.
-#
-# You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Copyright (C) 2018 Scylladb, Ltd.
-#
-
-find_package (PkgConfig)
-
-pkg_check_modules (PC_Cryptopp QUIET cryptopp)
-
-find_path (Cryptopp_INCLUDE_DIR
- NAMES default.h
- PATHS ${PC_Cryptopp_INCLUDE_DIRS}
- PATH_SUFFIXES cryptopp)
-
-find_library (Cryptopp_LIBRARY
- NAMES cryptopp
- PATHS ${PC_Cryptopp_LIBRARY_DIRS})
-
-set (Cryptopp_VERSION ${PC_Cryptopp_VERSION})
-
-include (FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args (Cryptopp
- FOUND_VAR Cryptopp_FOUND
- REQUIRED_VARS
- Cryptopp_LIBRARY
- Cryptopp_INCLUDE_DIR
- VERSION_VAR Cryptopp_VERSION)
-
-if (Cryptopp_FOUND)
- set (Cryptopp_LIBRARIES ${Cryptopp_LIBRARY})
- set (Cryptopp_INCLUDE_DIRS ${Cryptopp_INCLUDE_DIR})
- set (Cryptopp_DEFINITIONS ${PC_Cryptopp_CFLAGS_OTHER})
-endif ()
-
-if (Cryptopp_FOUND AND NOT TARGET Cryptopp::cryptopp)
- add_library (Cryptopp::cryptopp UNKNOWN IMPORTED)
-
- set_target_properties (Cryptopp::cryptopp PROPERTIES
- IMPORTED_LOCATION "${Cryptopp_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Cryptopp_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Cryptopp_INCLUDE_DIR}")
-endif ()
diff --git a/cmake/FindLz4.cmake b/cmake/FindGnuTLS.cmake
similarity index 50%
copy from cmake/FindLz4.cmake
copy to cmake/FindGnuTLS.cmake
index 9cb3052e..5395be3f 100644
--- a/cmake/FindLz4.cmake
+++ b/cmake/FindGnuTLS.cmake
@@ -22,38 +22,44 @@
find_package (PkgConfig)
-pkg_check_modules (PC_Lz4 QUIET liblz4)
+pkg_search_module (PC_GnuTLS
+ QUIET
+ REQUIRED
+ gnutls)
-find_path (Lz4_INCLUDE_DIR
- NAMES lz4.h
- PATHS ${PC_Lz4_INCLUDE_DIRS})
+find_path (GnuTLS_INCLUDE_DIR
+ NAMES gnutls/gnutls.h
+ PATHS ${PC_GnuTLS_INCLUDE_DIRS})
-find_library (Lz4_LIBRARY
- NAMES lz4
- PATHS ${PC_Lz4_LIBRARY_DIRS})
+find_library (GnuTLS_LIBRARY
+ NAMES gnutls
+ PATHS ${PC_GnuTLS_LIBRARY_DIRS})
-set (Lz4_VERSION ${PC_Lz4_VERSION})
+set (GnuTLS_VERSION ${PC_GnuTLS_VERSION})
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Lz4
- FOUND_VAR Lz4_FOUND
+find_package_handle_standard_args (GnuTLS
+ FOUND_VAR GnuTLS_FOUND
REQUIRED_VARS
- Lz4_LIBRARY
- Lz4_INCLUDE_DIR
- VERSION_VAR Lz4_VERSION)
-
-if (Lz4_FOUND)
- set (Lz4_LIBRARIES ${Lz4_LIBRARY})
- set (Lz4_INCLUDE_DIRS ${Lz4_INCLUDE_DIR})
- set (Lz4_DEFINITIONS ${PC_Lz4_CFLAGS_OTHER})
+ GnuTLS_INCLUDE_DIR
+ GnuTLS_LIBRARY
+ VERSION_VAR GnuTLS_VERSION)
+
+if (GnuTLS_FOUND)
+ set (GnuTLS_INCLUDE_DIRS ${GnuTLS_INCLUDE_DIR})
endif ()
-if (Lz4_FOUND AND NOT TARGET Lz4::lz4)
- add_library (Lz4::lz4 UNKNOWN IMPORTED)
+if (GnuTLS_FOUND AND NOT (TARGET GnuTLS::gnutls))
+ add_library (GnuTLS::gnutls UNKNOWN IMPORTED)
- set_target_properties (Lz4::lz4 PROPERTIES
- IMPORTED_LOCATION "${Lz4_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Lz4_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Lz4_INCLUDE_DIR}")
+ set_target_properties (GnuTLS::gnutls
+ PROPERTIES
+ IMPORTED_LOCATION ${GnuTLS_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS "${PC_GnuTLS_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES ${GnuTLS_INCLUDE_DIR})
endif ()
+
+mark_as_advanced (
+ GnuTLS_INCLUDE_DIR
+ GnuTLS_LIBRARY)
diff --git a/cmake-tools/query_link_pool_depth.py b/cmake/FindLinuxMembarrier.cmake
old mode 100755
new mode 100644
similarity index 55%
copy from cmake-tools/query_link_pool_depth.py
copy to cmake/FindLinuxMembarrier.cmake
index 0084c934..9cd19557
--- a/cmake-tools/query_link_pool_depth.py
+++ b/cmake/FindLinuxMembarrier.cmake
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
@@ -22,13 +20,19 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-import os
+find_path (LinuxMembarrier_INCLUDE_DIR
+ NAMES linux/membarrier.h)
+
+include (CheckCXXSourceCompiles)
+file (READ ${CMAKE_CURRENT_LIST_DIR}/code_test/LinuxMembarrier_test.cc _linuxmembarrier_test_code)
+check_cxx_source_compiles ("${_linuxmembarrier_test_code}" LinuxMembarrier_FOUND)
-MEMORY_PER_LINK_PROCESS = 7e9
+include (FindPackageHandleStandardArgs)
-def query_physical_memory():
- return os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
+if (LinuxMembarrier_FOUND AND NOT (TARGET LinuxMembarrier::membarrier))
+ add_library (LinuxMembarrier::membarrier INTERFACE IMPORTED)
-if __name__ == '__main__':
- link_depth = max(1, int(query_physical_memory() / MEMORY_PER_LINK_PROCESS))
- print(link_depth)
+ set_target_properties (LinuxMembarrier::membarrier
+ PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${LinuxMembarrier_INCLUDE_DIR})
+endif ()
diff --git a/cmake/FindSanitizers.cmake b/cmake/FindSanitizers.cmake
new file mode 100644
index 00000000..ea2d22fb
--- /dev/null
+++ b/cmake/FindSanitizers.cmake
@@ -0,0 +1,79 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+include (CheckCXXSourceCompiles)
+
+set (CMAKE_REQUIRED_FLAGS -fsanitize=address)
+check_cxx_source_compiles ("int main() {}" Sanitizers_ADDRESS_FOUND)
+
+if (Sanitizers_ADDRESS_FOUND)
+ set (Sanitizers_ADDRESS_COMPILER_OPTIONS -fsanitize=address)
+endif ()
+
+set (CMAKE_REQUIRED_FLAGS -fsanitize=undefined)
+check_cxx_source_compiles ("int main() {}" Sanitizers_UNDEFINED_BEHAVIOR_FOUND)
+
+if (Sanitizers_UNDEFINED_BEHAVIOR_FOUND)
+ set (Sanitizers_UNDEFINED_BEHAVIOR_COMPILER_OPTIONS -fsanitize=undefined)
+endif ()
+
+if (Sanitizers_ADDRESS_FOUND AND Sanitizers_UNDEFINED_BEHAVIOR_FOUND)
+ set (Sanitizers_FOUND ON)
+endif ()
+
+set (Sanitizers_COMPILER_OPTIONS
+ ${Sanitizers_ADDRESS_COMPILER_OPTIONS}
+ ${Sanitizers_UNDEFINED_BEHAVIOR_COMPILER_OPTIONS})
+
+file (READ ${CMAKE_CURRENT_LIST_DIR}/code_test/Sanitizers_fiber_test.cc _sanitizers_fiber_test_code)
+set (CMAKE_REQUIRED_FLAGS ${Sanitizers_COMPILER_OPTIONS})
+check_cxx_source_compiles ("${_sanitizers_fiber_test_code}" Sanitizers_FIBER_SUPPORT)
+
+include (FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args (Sanitizers
+ FOUND_VAR Sanitizers_FOUND
+ REQUIRED_VARS
+ Sanitizers_FIBER_SUPPORT
+ Sanitizers_ADDRESS_COMPILER_OPTIONS
+ Sanitizers_UNDEFINED_BEHAVIOR_COMPILER_OPTIONS)
+
+if (Sanitizers_FOUND)
+
+ if (NOT (TARGET Sanitizers::address))
+ add_library (Sanitizers::address INTERFACE IMPORTED)
+
+ set_target_properties (Sanitizers::address
+ PROPERTIES
+ INTERFACE_COMPILE_OPTIONS ${Sanitizers_ADDRESS_COMPILER_OPTIONS}
+ INTERFACE_LINK_LIBRARIES ${Sanitizers_ADDRESS_COMPILER_OPTIONS})
+ endif ()
+
+ if (NOT (TARGET Sanitizers::undefined_behavior))
+ add_library (Sanitizers::undefined_behavior INTERFACE IMPORTED)
+
+ set_target_properties (Sanitizers::undefined_behavior
+ PROPERTIES
+ INTERFACE_COMPILE_OPTIONS ${Sanitizers_UNDEFINED_BEHAVIOR_COMPILER_OPTIONS}
+ INTERFACE_LINK_LIBRARIES ${Sanitizers_UNDEFINED_BEHAVIOR_COMPILER_OPTIONS})
+ endif ()
+endif ()
diff --git a/cmake/FindStdFilesystem.cmake b/cmake/FindStdFilesystem.cmake
new file mode 100644
index 00000000..e368c92b
--- /dev/null
+++ b/cmake/FindStdFilesystem.cmake
@@ -0,0 +1,65 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+set (_stdfilesystem_test_source ${CMAKE_CURRENT_LIST_DIR}/code_test/StdFilesystem_test.cc)
+
+try_compile (StdFilesystem_test_stdc++fs
+ ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${_stdfilesystem_test_source}
+ CXX_STANDARD 17
+ LINK_LIBRARIES stdc++fs)
+
+if (StdFilesystem_test_stdc++fs)
+ set (StdFilesystem_LIBRARY_NAME stdc++fs)
+else ()
+ # Try libc++.
+ try_compile (StdFilesystem_test_c++experimental
+ ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${_stdfilesystem_test_source}
+ CXX_STANDARD 17
+ LINK_LIBRARIES libc++experimental)
+
+ if (StdFilesystem_test_c++experimental)
+ set (StdFilesystem_LIBRARY_NAME c++experimental)
+ endif ()
+endif ()
+
+if (StdFilesystem_LIBRARY_NAME)
+ set (StdFilesystem_FOUND ON)
+endif ()
+
+include (FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args (StdFilesystem
+ FOUND_VAR StdFilesystem_FOUND
+ REQUIRED_VARS
+ StdFilesystem_LIBRARY_NAME)
+
+if (StdFilesystem_FOUND AND NOT (TARGET StdFilesystem::filesystem))
+ add_library (StdFilesystem::filesystem INTERFACE IMPORTED)
+
+ set_target_properties (StdFilesystem::filesystem
+ PROPERTIES
+ IMPORTED_LIBNAME ${StdFilesystem_LIBRARY_NAME})
+endif ()
+
+mark_as_advanced (StdFilesystem_LIBRARY_NAME)
diff --git a/cmake/FindLz4.cmake b/cmake/Findc-ares.cmake
similarity index 51%
copy from cmake/FindLz4.cmake
copy to cmake/Findc-ares.cmake
index 9cb3052e..23a88137 100644
--- a/cmake/FindLz4.cmake
+++ b/cmake/Findc-ares.cmake
@@ -20,40 +20,36 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-find_package (PkgConfig)
+find_path (c-ares_INCLUDE_DIR
+ NAMES ares_dns.h)
-pkg_check_modules (PC_Lz4 QUIET liblz4)
+find_library (c-ares_LIBRARY
+ NAMES cares)
-find_path (Lz4_INCLUDE_DIR
- NAMES lz4.h
- PATHS ${PC_Lz4_INCLUDE_DIRS})
-
-find_library (Lz4_LIBRARY
- NAMES lz4
- PATHS ${PC_Lz4_LIBRARY_DIRS})
-
-set (Lz4_VERSION ${PC_Lz4_VERSION})
+set (c-ares_VERSION ${PC_c-ares_VERSION})
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Lz4
- FOUND_VAR Lz4_FOUND
+find_package_handle_standard_args (c-ares
+ FOUND_VAR c-ares_FOUND
REQUIRED_VARS
- Lz4_LIBRARY
- Lz4_INCLUDE_DIR
- VERSION_VAR Lz4_VERSION)
-
-if (Lz4_FOUND)
- set (Lz4_LIBRARIES ${Lz4_LIBRARY})
- set (Lz4_INCLUDE_DIRS ${Lz4_INCLUDE_DIR})
- set (Lz4_DEFINITIONS ${PC_Lz4_CFLAGS_OTHER})
+ c-ares_INCLUDE_DIR
+ c-ares_LIBRARY
+ VERSION_VAR c-ares_VERSION)
+
+if (c-ares_FOUND)
+ set (c-ares_INCLUDE_DIRS ${c-ares_INCLUDE_DIR})
endif ()
-if (Lz4_FOUND AND NOT TARGET Lz4::lz4)
- add_library (Lz4::lz4 UNKNOWN IMPORTED)
+if (c-ares_FOUND AND NOT (TARGET c-ares::c-ares))
+ add_library (c-ares::c-ares UNKNOWN IMPORTED)
- set_target_properties (Lz4::lz4 PROPERTIES
- IMPORTED_LOCATION "${Lz4_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Lz4_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Lz4_INCLUDE_DIR}")
+ set_target_properties (c-ares::c-ares
+ PROPERTIES
+ IMPORTED_LOCATION ${c-ares_LIBRARY}
+ INTERFACE_INCLUDE_DIRECTORIES ${c-ares_INCLUDE_DIR})
endif ()
+
+mark_as_advanced (
+ c-ares_INCLUDE_DIR
+ c-ares_LIBRARY)
diff --git a/cmake/FindLz4.cmake b/cmake/Findcryptopp.cmake
similarity index 51%
copy from cmake/FindLz4.cmake
copy to cmake/Findcryptopp.cmake
index 9cb3052e..fdef287b 100644
--- a/cmake/FindLz4.cmake
+++ b/cmake/Findcryptopp.cmake
@@ -20,40 +20,38 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-find_package (PkgConfig)
+find_path (cryptopp_INCLUDE_DIR
+ NAMES cryptopp/aes.h)
-pkg_check_modules (PC_Lz4 QUIET liblz4)
+find_library (cryptopp_LIBRARY
+ NAMES cryptopp)
-find_path (Lz4_INCLUDE_DIR
- NAMES lz4.h
- PATHS ${PC_Lz4_INCLUDE_DIRS})
-
-find_library (Lz4_LIBRARY
- NAMES lz4
- PATHS ${PC_Lz4_LIBRARY_DIRS})
-
-set (Lz4_VERSION ${PC_Lz4_VERSION})
+if (cryptopp_INCLUDE_DIR AND cryptopp_LIBRARY)
+ set (cryptopp_FOUND ON)
+endif ()
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Lz4
- FOUND_VAR Lz4_FOUND
+find_package_handle_standard_args (cryptopp
+ FOUND_VAR cryptopp_FOUND
REQUIRED_VARS
- Lz4_LIBRARY
- Lz4_INCLUDE_DIR
- VERSION_VAR Lz4_VERSION)
-
-if (Lz4_FOUND)
- set (Lz4_LIBRARIES ${Lz4_LIBRARY})
- set (Lz4_INCLUDE_DIRS ${Lz4_INCLUDE_DIR})
- set (Lz4_DEFINITIONS ${PC_Lz4_CFLAGS_OTHER})
+ cryptopp_INCLUDE_DIR
+ cryptopp_LIBRARY
+ VERSION_VAR cryptopp_VERSION)
+
+if (cryptopp_FOUND)
+ set (cryptopp_INCLUDE_DIRS ${cryptopp_INCLUDE_DIR})
endif ()
-if (Lz4_FOUND AND NOT TARGET Lz4::lz4)
- add_library (Lz4::lz4 UNKNOWN IMPORTED)
+if (cryptopp_FOUND AND NOT (TARGET cryptopp::cryptopp))
+ add_library (cryptopp::cryptopp UNKNOWN IMPORTED)
- set_target_properties (Lz4::lz4 PROPERTIES
- IMPORTED_LOCATION "${Lz4_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Lz4_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Lz4_INCLUDE_DIR}")
+ set_target_properties (cryptopp::cryptopp
+ PROPERTIES
+ IMPORTED_LOCATION ${cryptopp_LIBRARY}
+ INTERFACE_INCLUDE_DIRECTORIES ${cryptopp_INCLUDE_DIR})
endif ()
+
+mark_as_advanced (
+ cryptopp_INCLUDE_DIR
+ cryptopp_LIBRARY)
diff --git a/cmake/FindLz4.cmake b/cmake/Finddl.cmake
similarity index 51%
copy from cmake/FindLz4.cmake
copy to cmake/Finddl.cmake
index 9cb3052e..4c896baf 100644
--- a/cmake/FindLz4.cmake
+++ b/cmake/Finddl.cmake
@@ -20,40 +20,43 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-find_package (PkgConfig)
+set (_dl_test_source ${CMAKE_CURRENT_LIST_DIR}/code_test/dl_test.cc)
-pkg_check_modules (PC_Lz4 QUIET liblz4)
+# Try to compile without the library first.
+try_compile (_dl_test_nil
+ ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${_dl_test_source})
-find_path (Lz4_INCLUDE_DIR
- NAMES lz4.h
- PATHS ${PC_Lz4_INCLUDE_DIRS})
+if (NOT _dl_test_nil)
+ # The `dl` library is required.
-find_library (Lz4_LIBRARY
- NAMES lz4
- PATHS ${PC_Lz4_LIBRARY_DIRS})
+ try_compile (_dl_test
+ ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${_dl_test_source}
+ LINK_LIBRARIES dl)
-set (Lz4_VERSION ${PC_Lz4_VERSION})
+ if (_dl_test)
+ set (dl_LIBRARY_NAME dl)
+ endif ()
+endif ()
+
+if (_dl_test_nil OR dl_LIBRARY_NAME)
+ set (dl_FOUND ON)
+endif ()
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Lz4
- FOUND_VAR Lz4_FOUND
+find_package_handle_standard_args (dl
+ FOUND_VAR dl_FOUND
REQUIRED_VARS
- Lz4_LIBRARY
- Lz4_INCLUDE_DIR
- VERSION_VAR Lz4_VERSION)
-
-if (Lz4_FOUND)
- set (Lz4_LIBRARIES ${Lz4_LIBRARY})
- set (Lz4_INCLUDE_DIRS ${Lz4_INCLUDE_DIR})
- set (Lz4_DEFINITIONS ${PC_Lz4_CFLAGS_OTHER})
-endif ()
+ dl_LIBRARY_NAME)
-if (Lz4_FOUND AND NOT TARGET Lz4::lz4)
- add_library (Lz4::lz4 UNKNOWN IMPORTED)
+if (dl_FOUND AND NOT (TARGET dl::dl))
+ add_library (dl::dl INTERFACE IMPORTED)
- set_target_properties (Lz4::lz4 PROPERTIES
- IMPORTED_LOCATION "${Lz4_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Lz4_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Lz4_INCLUDE_DIR}")
+ set_target_properties (dl::dl
+ PROPERTIES
+ IMPORTED_LIBNAME "${dl_LIBRARY_NAME}")
endif ()
+
+mark_as_advanced (dl_LIBRARY_NAME)
diff --git a/cmake/Finddpdk.cmake b/cmake/Finddpdk.cmake
new file mode 100644
index 00000000..1a1c71d9
--- /dev/null
+++ b/cmake/Finddpdk.cmake
@@ -0,0 +1,373 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+find_path (dpdk_INCLUDE_DIR
+ NAMES rte_atomic.h
+ PATH_SUFFIXES dpdk)
+
+if (dpdk_INCLUDE_DIR)
+ set (dpdk_FOUND ON)
+endif ()
+
+include (FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args (dpdk
+ FOUND_VAR dpdk_FOUND
+ REQUIRED_VARS dpdk_INCLUDE_DIR)
+
+if (dpdk_FOUND AND NOT (TARGET dpdk::dpdk))
+ #
+ # pmd_vmxnet3_uio
+ #
+
+ find_library (dpdk_PMD_VMXNET3_UIO_LIBRARY rte_pmd_vmxnet3_uio)
+ add_library (dpdk::pmd_vmxnet3_uio UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_vmxnet3_uio
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_VMXNET3_UIO_LIBRARY}
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_i40e
+ #
+
+ find_library (dpdk_PMD_I40E_LIBRARY rte_pmd_i40e)
+ add_library (dpdk::pmd_i40e UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_i40e
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_I40E_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_ixgbe
+ #
+
+ find_library (dpdk_PMD_IXGBE_LIBRARY rte_pmd_ixgbe)
+ add_library (dpdk::pmd_ixgbe UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_ixgbe
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_IXGBE_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_e1000
+ #
+
+ find_library (dpdk_PMD_E1000_LIBRARY rte_pmd_e1000)
+ add_library (dpdk::pmd_e1000 UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_e1000
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_E1000_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_bnxt
+ #
+
+ find_library (dpdk_PMD_BNXT_LIBRARY rte_pmd_bnxt)
+ add_library (dpdk::pmd_bnxt UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_bnxt
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_BNXT_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_ring
+ #
+
+ find_library (dpdk_PMD_RING_LIBRARY rte_pmd_ring)
+ add_library (dpdk::pmd_ring UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_ring
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_RING_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_cxgbe
+ #
+
+ find_library (dpdk_PMD_CXGBE_LIBRARY rte_pmd_cxgbe)
+ add_library (dpdk::pmd_cxgbe UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_cxgbe
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_CXGBE_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_ena
+ #
+
+ find_library (dpdk_PMD_ENA_LIBRARY rte_pmd_ena)
+ add_library (dpdk::pmd_ena UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_ena
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_ENA_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_enic
+ #
+
+ find_library (dpdk_PMD_ENIC_LIBRARY rte_pmd_enic)
+ add_library (dpdk::pmd_enic UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_enic
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_ENIC_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_fm10k
+ #
+
+ find_library (dpdk_PMD_FM10K_LIBRARY rte_pmd_fm10k)
+ add_library (dpdk::pmd_fm10k UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_fm10k
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_FM10K_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_nfp
+ #
+
+ find_library (dpdk_PMD_NFP_LIBRARY rte_pmd_nfp)
+ add_library (dpdk::pmd_nfp UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_nfp
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_NFP_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_qede
+ #
+
+ find_library (dpdk_PMD_QEDE_LIBRARY rte_pmd_qede)
+ add_library (dpdk::pmd_qede UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_qede
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_QEDE_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # pmd_sfc_efx
+ #
+
+ find_library (dpdk_PMD_SFC_EFX_LIBRARY rte_pmd_sfc_efx)
+ add_library (dpdk::pmd_sfc_efx UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::pmd_sfc_efx
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_PMD_SFC_EFX_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # hash
+ #
+
+ find_library (dpdk_HASH_LIBRARY rte_hash)
+ add_library (dpdk::hash UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::hash
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_HASH_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # kvargs
+ #
+
+ find_library (dpdk_KVARGS_LIBRARY rte_kvargs)
+ add_library (dpdk::kvargs UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::kvargs
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_KVARGS_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # mbuf
+ #
+
+ find_library (dpdk_MBUF_LIBRARY rte_mbuf)
+ add_library (dpdk::mbuf UNKNOWN IMPORTED)
+
+ target_link_libraries (dpdk::mbuf
+ INTERFACE dpdk::eal)
+
+ set_target_properties (dpdk::mbuf
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_MBUF_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # eal
+ #
+
+ find_library (dpdk_EAL_LIBRARY rte_eal)
+ add_library (dpdk::eal UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::eal
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_EAL_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # ethdev
+ #
+
+ find_library (dpdk_ETHDEV_LIBRARY rte_ethdev)
+ add_library (dpdk::ethdev UNKNOWN IMPORTED)
+
+ target_link_libraries (dpdk::ethdev
+ INTERFACE dpdk::eal)
+
+ set_target_properties (dpdk::ethdev
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_ETHDEV_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # mempool
+ #
+
+ find_library (dpdk_MEMPOOL_LIBRARY rte_mempool)
+ add_library (dpdk::mempool UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::mempool
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_MEMPOOL_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # mempool_ring
+ #
+
+ find_library (dpdk_MEMPOOL_RING_LIBRARY rte_mempool_ring)
+ add_library (dpdk::mempool_ring UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::mempool_ring
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_MEMPOOL_RING_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # ring
+ #
+
+ find_library (dpdk_RING_LIBRARY rte_ring)
+ add_library (dpdk::ring UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::ring
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_RING_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # cmdline
+ #
+
+ find_library (dpdk_CMDLINE_LIBRARY rte_cmdline)
+ add_library (dpdk::cmdline UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::cmdline
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_CMDLINE_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # cfgfile
+ #
+
+ find_library (dpdk_CFGFILE_LIBRARY rte_cfgfile)
+ add_library (dpdk::cfgfile UNKNOWN IMPORTED)
+
+ set_target_properties (dpdk::cfgfile
+ PROPERTIES
+ IMPORTED_LOCATION ${dpdk_CFGFILE_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS -march=native
+ INTERFACE_INCLUDE_DIRECTORIES ${dpdk_INCLUDE_DIR})
+
+ #
+ # Summary.
+ #
+
+ add_library (dpdk::dpdk INTERFACE IMPORTED)
+
+ target_link_libraries (dpdk::dpdk
+ INTERFACE
+ dpdk::cfgfile
+ dpdk::cmdline
+ dpdk::eal
+ dpdk::ethdev
+ dpdk::hash
+ dpdk::kvargs
+ dpdk::mbuf
+ dpdk::mempool
+ dpdk::mempool_ring
+ dpdk::pmd_bnxt
+ dpdk::pmd_cxgbe
+ dpdk::pmd_e1000
+ dpdk::pmd_ena
+ dpdk::pmd_enic
+ dpdk::pmd_fm10k
+ dpdk::pmd_qede
+ dpdk::pmd_i40e
+ dpdk::pmd_ixgbe
+ dpdk::pmd_nfp
+ dpdk::pmd_ring
+ dpdk::pmd_sfc_efx
+ dpdk::pmd_vmxnet3_uio
+ dpdk::ring)
+endif ()
diff --git a/cmake/FindHWLoc.cmake b/cmake/Findhwloc.cmake
similarity index 53%
rename from cmake/FindHWLoc.cmake
rename to cmake/Findhwloc.cmake
index f76dc8a9..36939237 100644
--- a/cmake/FindHWLoc.cmake
+++ b/cmake/Findhwloc.cmake
@@ -22,38 +22,44 @@
find_package (PkgConfig)
-pkg_check_modules (PC_HWLoc QUIET hwloc)
+pkg_search_module (PC_hwloc
+ REQUIRED
+ QUIET
+ hwloc)
-find_path (HWLoc_INCLUDE_DIR
+find_path (hwloc_INCLUDE_DIR
NAMES hwloc.h
- PATHS ${PC_HWLoc_INCLUDE_DIRS})
+ PATHS ${PC_hwloc_INCLUDE_DIRS})
-find_library (HWLoc_LIBRARY
+find_library (hwloc_LIBRARY
NAMES hwloc
- PATHS ${PC_HWLoc_LIBRARY_DIRS})
+ PATHS ${PC_hwloc_LIBRARY_DIRS})
-set (HWLoc_VERSION ${PC_HWLoc_VERSION})
+set (hwloc_VERSION ${PC_hwloc_VERSION})
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (HWLoc
- FOUND_VAR HWLoc_FOUND
+find_package_handle_standard_args (hwloc
+ FOUND_VAR hwloc_FOUND
REQUIRED_VARS
- HWLoc_LIBRARY
- HWLoc_INCLUDE_DIR
- VERSION_VAR HWLoc_VERSION)
-
-if (HWLoc_FOUND)
- set (HWLoc_LIBRARIES ${HWLoc_LIBRARY})
- set (HWLoc_INCLUDE_DIRS ${HWLoc_INCLUDE_DIR})
- set (HWLoc_DEFINITIONS ${PC_HWLoc_CFLAGS_OTHER})
+ hwloc_INCLUDE_DIR
+ hwloc_LIBRARY
+ VERSION_VAR hwloc_VERSION)
+
+if (hwloc_FOUND)
+ set (hwloc_INCLUDE_DIRS ${hwloc_INCLUDE_DIR})
endif ()
-if (HWLoc_FOUND AND NOT TARGET HWLoc::hwloc)
- add_library (HWLoc::hwloc UNKNOWN IMPORTED)
+if (hwloc_FOUND AND NOT (TARGET hwloc::hwloc))
+ add_library (hwloc::hwloc UNKNOWN IMPORTED)
- set_target_properties (HWLoc::hwloc PROPERTIES
- IMPORTED_LOCATION "${HWLoc_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_HWLoc_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${HWLoc_INCLUDE_DIR}")
+ set_target_properties (hwloc::hwloc
+ PROPERTIES
+ IMPORTED_LOCATION ${hwloc_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS "${PC_hwloc_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES ${hwloc_INCLUDE_DIR})
endif ()
+
+mark_as_advanced (
+ hwloc_INCLUDE_DIR
+ hwloc_LIBRARY)
diff --git a/cmake/FindLz4.cmake b/cmake/Findlksctp-tools.cmake
similarity index 51%
copy from cmake/FindLz4.cmake
copy to cmake/Findlksctp-tools.cmake
index 9cb3052e..c0861000 100644
--- a/cmake/FindLz4.cmake
+++ b/cmake/Findlksctp-tools.cmake
@@ -20,40 +20,37 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-find_package (PkgConfig)
+find_path (lksctp-tools_INCLUDE_DIR
+ NAMES netinet/sctp.h)
-pkg_check_modules (PC_Lz4 QUIET liblz4)
+find_library (lksctp-tools_LIBRARY
+ NAMES sctp)
-find_path (Lz4_INCLUDE_DIR
- NAMES lz4.h
- PATHS ${PC_Lz4_INCLUDE_DIRS})
-
-find_library (Lz4_LIBRARY
- NAMES lz4
- PATHS ${PC_Lz4_LIBRARY_DIRS})
-
-set (Lz4_VERSION ${PC_Lz4_VERSION})
+if (lksctp-tools_INCLUDE_DIR AND lksctp-tools_LIBRARY)
+ set (lksctp-tools_FOUND ON)
+endif ()
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Lz4
- FOUND_VAR Lz4_FOUND
+find_package_handle_standard_args (lksctp-tools
+ FOUND_VAR lksctp-tools_FOUND
REQUIRED_VARS
- Lz4_LIBRARY
- Lz4_INCLUDE_DIR
- VERSION_VAR Lz4_VERSION)
-
-if (Lz4_FOUND)
- set (Lz4_LIBRARIES ${Lz4_LIBRARY})
- set (Lz4_INCLUDE_DIRS ${Lz4_INCLUDE_DIR})
- set (Lz4_DEFINITIONS ${PC_Lz4_CFLAGS_OTHER})
+ lksctp-tools_INCLUDE_DIR
+ lksctp-tools_LIBRARY)
+
+if (lksctp-tools_FOUND)
+ set (lksctp-tools_INCLUDE_DIRS ${lksctp-tools_INCLUDE_DIR})
endif ()
-if (Lz4_FOUND AND NOT TARGET Lz4::lz4)
- add_library (Lz4::lz4 UNKNOWN IMPORTED)
+if (lksctp-tools_FOUND AND NOT (TARGET lksctp-tools::lksctp-tools))
+ add_library (lksctp-tools::lksctp-tools UNKNOWN IMPORTED)
- set_target_properties (Lz4::lz4 PROPERTIES
- IMPORTED_LOCATION "${Lz4_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Lz4_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Lz4_INCLUDE_DIR}")
+ set_target_properties (lksctp-tools::lksctp-tools
+ PROPERTIES
+ IMPORTED_LOCATION ${lksctp-tools_LIBRARY}
+ INTERFACE_INCLUDE_DIRECTORIES ${lksctp-tools_INCLUDE_DIR})
endif ()
+
+mark_as_advanced (
+ lksctp-tools_INCLUDE_DIR
+ lksctp-tools_LIBRARY)
diff --git a/cmake/FindLz4.cmake b/cmake/Findlz4.cmake
similarity index 50%
rename from cmake/FindLz4.cmake
rename to cmake/Findlz4.cmake
index 9cb3052e..9ca80007 100644
--- a/cmake/FindLz4.cmake
+++ b/cmake/Findlz4.cmake
@@ -22,38 +22,50 @@
find_package (PkgConfig)
-pkg_check_modules (PC_Lz4 QUIET liblz4)
+pkg_search_module (PC_lz4
+ REQUIRED
+ QUIET
+ liblz4)
-find_path (Lz4_INCLUDE_DIR
+find_path (lz4_INCLUDE_DIR
NAMES lz4.h
- PATHS ${PC_Lz4_INCLUDE_DIRS})
+ PATHS ${PC_lz4_INCLUDE_DIRS})
-find_library (Lz4_LIBRARY
+find_library (lz4_LIBRARY
NAMES lz4
- PATHS ${PC_Lz4_LIBRARY_DIRS})
+ PATHS ${PC_lz4_LIBRARY_DIRS})
-set (Lz4_VERSION ${PC_Lz4_VERSION})
+set (lz4_VERSION ${PC_lz4_VERSION})
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Lz4
- FOUND_VAR Lz4_FOUND
+find_package_handle_standard_args (lz4
+ FOUND_VAR lz4_FOUND
REQUIRED_VARS
- Lz4_LIBRARY
- Lz4_INCLUDE_DIR
- VERSION_VAR Lz4_VERSION)
-
-if (Lz4_FOUND)
- set (Lz4_LIBRARIES ${Lz4_LIBRARY})
- set (Lz4_INCLUDE_DIRS ${Lz4_INCLUDE_DIR})
- set (Lz4_DEFINITIONS ${PC_Lz4_CFLAGS_OTHER})
+ lz4_INCLUDE_DIR
+ lz4_LIBRARY
+ VERSION_VAR lz4_VERSION)
+
+if (lz4_FOUND)
+ set (CMAKE_REQUIRED_LIBRARIES ${lz4_LIBRARY})
+
+ check_symbol_exists (LZ4_compress_default
+ ${lz4_INCLUDE_DIR}/lz4.h
+ lz4_HAVE_COMPRESS_DEFAULT)
+
+ set (lz4_INCLUDE_DIRS ${lz4_INCLUDE_DIR})
endif ()
-if (Lz4_FOUND AND NOT TARGET Lz4::lz4)
- add_library (Lz4::lz4 UNKNOWN IMPORTED)
+if (lz4_FOUND AND NOT (TARGET lz4::lz4))
+ add_library (lz4::lz4 UNKNOWN IMPORTED)
- set_target_properties (Lz4::lz4 PROPERTIES
- IMPORTED_LOCATION "${Lz4_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Lz4_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Lz4_INCLUDE_DIR}")
+ set_target_properties (lz4::lz4
+ PROPERTIES
+ IMPORTED_LOCATION ${lz4_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS "${PC_lz4_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR})
endif ()
+
+mark_as_advanced (
+ lz4_INCLUDE_DIR
+ lz4_LIBRARY)
diff --git a/cmake-tools/query_link_pool_depth.py b/cmake/Findragel.cmake
old mode 100755
new mode 100644
similarity index 56%
copy from cmake-tools/query_link_pool_depth.py
copy to cmake/Findragel.cmake
index 0084c934..86853af5
--- a/cmake-tools/query_link_pool_depth.py
+++ b/cmake/Findragel.cmake
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
@@ -22,13 +20,27 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-import os
+find_program (
+ ragel_RAGEL_EXECUTABLE
+ ragel)
+
+set (_ragel_version_pattern "[0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?")
+
+if (ragel_RAGEL_EXECUTABLE)
+ set (ragel_FOUND ON)
+
+ exec_program (${ragel_RAGEL_EXECUTABLE}
+ ARGS -v
+ OUTPUT_VARIABLE _ragel_version_output)
-MEMORY_PER_LINK_PROCESS = 7e9
+ if (${_ragel_version_output} MATCHES "version (${_ragel_version_pattern})")
+ set (ragel_VERSION ${CMAKE_MATCH_1})
+ endif ()
+endif ()
-def query_physical_memory():
- return os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
+find_package_handle_standard_args (ragel
+ FOUND_VAR ragel_FOUND
+ REQUIRED_VARS ragel_RAGEL_EXECUTABLE
+ VERSION_VAR ragel_VERSION)
-if __name__ == '__main__':
- link_depth = max(1, int(query_physical_memory() / MEMORY_PER_LINK_PROCESS))
- print(link_depth)
+mark_as_advanced (ragel_RAGEL_EXECUTABLE)
diff --git a/cmake/Findrt.cmake b/cmake/Findrt.cmake
new file mode 100644
index 00000000..972e9b40
--- /dev/null
+++ b/cmake/Findrt.cmake
@@ -0,0 +1,59 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+set (_rt_test_source ${CMAKE_CURRENT_LIST_DIR}/code_test/rt_test.cc)
+
+# Try to compile without the library first.
+try_compile (_rt_test_nil
+ ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${_rt_test_source})
+
+if (NOT _rt_test_nil)
+ # The `rt` library is required.
+
+ try_compile (_rt_test
+ ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${_rt_test_source}
+ LINK_LIBRARIES rt)
+
+ if (_rt_test)
+ set (rt_LIBRARY_NAME rt)
+ endif ()
+endif ()
+
+if (_rt_test_nil OR rt_LIBRARY_NAME)
+ set (rt_FOUND ON)
+endif ()
+
+find_package_handle_standard_args (rt
+ FOUND_VAR rt_FOUND
+ REQUIRED_VARS
+ rt_LIBRARY_NAME)
+
+if (rt_FOUND AND NOT (TARGET rt::rt))
+ add_library (rt::rt INTERFACE IMPORTED)
+ set_target_properties (rt::rt
+ PROPERTIES
+ IMPORTED_LIBNAME "${rt_LIBRARY_NAME}")
+endif ()
+
+mark_as_advanced (rt_LIBRARY_NAME)
diff --git a/cmake/FindYaml-cpp.cmake b/cmake/Findyaml-cpp.cmake
similarity index 50%
rename from cmake/FindYaml-cpp.cmake
rename to cmake/Findyaml-cpp.cmake
index 512eaa45..07a6324d 100644
--- a/cmake/FindYaml-cpp.cmake
+++ b/cmake/Findyaml-cpp.cmake
@@ -22,38 +22,44 @@
find_package (PkgConfig)
-pkg_check_modules (PC_Yaml-cpp QUIET yaml-cpp)
+pkg_search_module (PC_yaml-cpp
+ REQUIRED
+ QUIET
+ yaml-cpp)
-find_path (Yaml-cpp_INCLUDE_DIR
+find_path (yaml-cpp_INCLUDE_DIR
NAMES yaml-cpp/yaml.h
- PATHS ${PC_Yaml-cpp_INCLUDE_DIRS})
+ PATHS ${PC_yaml-cpp_INCLUDE_DIRS})
-find_library (Yaml-cpp_LIBRARY
+find_library (yaml-cpp_LIBRARY
NAMES yaml-cpp
- PATHS ${PC_Yaml-cpp_LIBRARY_DIRS})
+ PATHS ${PC_yaml-cpp_LIBRARY_DIRS})
-set (Yaml-cpp_VERSION ${PC_Yaml-cpp_VERSION})
+set (yaml-cpp_VERSION ${PC_yaml-cpp_VERSION})
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Yaml-cpp
- FOUND_VAR Yaml-cpp_FOUND
+find_package_handle_standard_args (yaml-cpp
+ FOUND_VAR yaml-cpp_FOUND
REQUIRED_VARS
- Yaml-cpp_LIBRARY
- Yaml-cpp_INCLUDE_DIR
- VERSION_VAR Yaml-cpp_VERSION)
-
-if (Yaml-cpp_FOUND)
- set (Yaml-cpp_LIBRARIES ${Yaml-cpp_LIBRARY})
- set (Yaml-cpp_INCLUDE_DIRS ${Yaml-cpp_INCLUDE_DIR})
- set (Yaml-cpp_DEFINITIONS ${PC_Yaml-cpp_CFLAGS_OTHER})
+ yaml-cpp_INCLUDE_DIR
+ yaml-cpp_LIBRARY
+ VERSION_VAR yaml-cpp_VERSION)
+
+if (yaml-cpp_FOUND)
+ set (yaml-cpp_INCLUDE_DIRS ${yaml-cpp_INCLUDE_DIR})
endif ()
-if (Yaml-cpp_FOUND AND NOT TARGET Yaml-cpp::yaml-cpp)
- add_library (Yaml-cpp::yaml-cpp UNKNOWN IMPORTED)
+if (yaml-cpp_FOUND AND NOT (TARGET yaml-cpp::yaml-cpp))
+ add_library (yaml-cpp::yaml-cpp UNKNOWN IMPORTED)
- set_target_properties (Yaml-cpp::yaml-cpp PROPERTIES
- IMPORTED_LOCATION "${Yaml-cpp_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_Yaml-cpp_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${Yaml-cpp_INCLUDE_DIR}")
+ set_target_properties (yaml-cpp::yaml-cpp
+ PROPERTIES
+ IMPORTED_LOCATION ${yaml-cpp_LIBRARY}
+ INTERFACE_COMPILE_OPTIONS "${PC_yaml-cpp_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIR})
endif ()
+
+mark_as_advanced (
+ yaml-cpp_INCLUDE_DIR
+ yaml-cpp_LIBRARY)
diff --git a/cmake/
SeastarConfig.cmake.in b/cmake/
SeastarConfig.cmake.in
new file mode 100644
index 00000000..1f60c3a3
--- /dev/null
+++ b/cmake/
SeastarConfig.cmake.in
@@ -0,0 +1,60 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+include (CMakeFindDependencyMacro)
+
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+#
+# Public dependencies.
+#
+
+find_dependency (Boost 1.64.0 REQUIRED
+ COMPONENTS
+ filesystem
+ program_options
+ thread)
+
+find_dependency (c-ares 1.13.0 REQUIRED MODULE)
+find_dependency (cryptopp 5.6.5 REQUIRED)
+find_dependency (dpdk)
+find_dependency (fmt 3.0.2 REQUIRED)
+find_dependency (lz4 1.8.0 REQUIRED)
+
+#
+# Private and private/public dependencies.
+#
+
+find_dependency (GnuTLS 3.5.18 REQUIRED)
+find_dependency (LinuxMembarrier)
+find_dependency (Protobuf 3.3.1 REQUIRED)
+find_dependency (Sanitizers REQUIRED)
+find_dependency (StdFilesystem REQUIRED)
+find_dependency (dl REQUIRED)
+find_dependency (hwloc 1.11.5)
+find_package (lksctp-tools REQUIRED)
+find_dependency (rt REQUIRED)
+find_dependency (yaml-cpp 0.5.3 REQUIRED)
+
+if (NOT TARGET Seastar::seastar)
+ include ("${CMAKE_CURRENT_LIST_DIR}/SeastarTargets.cmake")
+endif ()
diff --git a/cmake/code_test/LinuxMembarrier_test.cc b/cmake/code_test/LinuxMembarrier_test.cc
new file mode 100644
index 00000000..7cb1fdfb
--- /dev/null
+++ b/cmake/code_test/LinuxMembarrier_test.cc
@@ -0,0 +1,8 @@
+extern "C" {
+#include <linux/membarrier.h>
+}
+
+int main() {
+ int x = MEMBARRIER_CMD_PRIVATE_EXPEDITED | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED;
+ (void)x;
+}
diff --git a/cmake/code_test/Sanitizers_fiber_test.cc b/cmake/code_test/Sanitizers_fiber_test.cc
new file mode 100644
index 00000000..9df531f2
--- /dev/null
+++ b/cmake/code_test/Sanitizers_fiber_test.cc
@@ -0,0 +1,11 @@
+#include <cstddef>
+
+extern "C" {
+ void __sanitizer_start_switch_fiber(void**, const void*, size_t);
+ void __sanitizer_finish_switch_fiber(void*, const void**, size_t*);
+}
+
+int main() {
+ __sanitizer_start_switch_fiber(nullptr, nullptr, 0);
+ __sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
+}
diff --git a/cmake/code_test/StdFilesystem_test.cc b/cmake/code_test/StdFilesystem_test.cc
new file mode 100644
index 00000000..267de3b7
--- /dev/null
+++ b/cmake/code_test/StdFilesystem_test.cc
@@ -0,0 +1,6 @@
+#include <experimental/filesystem>
+
+int main() {
+ std::experimental::filesystem::path path("/root");
+ (void)path;
+}
diff --git a/cmake/code_test/dl_test.cc b/cmake/code_test/dl_test.cc
new file mode 100644
index 00000000..927b377d
--- /dev/null
+++ b/cmake/code_test/dl_test.cc
@@ -0,0 +1,7 @@
+extern "C" {
+#include <dlfcn.h>
+}
+
+int main() {
+ dlopen("foobar", 42);
+}
diff --git a/cmake/code_test/rt_test.cc b/cmake/code_test/rt_test.cc
new file mode 100644
index 00000000..c0bf83e3
--- /dev/null
+++ b/cmake/code_test/rt_test.cc
@@ -0,0 +1,10 @@
+extern "C" {
+#include <signal.h>
+#include <time.h>
+}
+
+int main() {
+ timer_t td;
+ struct sigevent sev;
+ timer_create(CLOCK_MONOTONIC, &sev, &td);
+}
diff --git a/configure.py b/configure.py
deleted file mode 100755
index d27e910d..00000000
--- a/configure.py
+++ /dev/null
@@ -1,1078 +0,0 @@
-#!/usr/bin/python3
-#
-# This file is open source software, licensed to you under the terms
-# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
-# distributed with this work for additional information regarding copyright
-# ownership. You may not use this file except in compliance with the License.
-#
-# You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-import os, os.path, textwrap, argparse, sys, shlex, subprocess, tempfile, re
-import distutils.dir_util
-import distutils.spawn
-import seastar_cmake
-
-configure_args = str.join(' ', [shlex.quote(x) for x in sys.argv[1:]])
-
-tempfile.tempdir = "./build/tmp"
-
-srcdir = os.getcwd()
-
-ninja_exe = distutils.spawn.find_executable('ninja-build') or distutils.spawn.find_executable('ninja')
-
-def get_flags():
- with open('/proc/cpuinfo') as f:
- for line in f:
- if line.strip():
- if line.rstrip('\n').startswith('flags'):
- return re.sub(r'^flags\s+: ', '', line).split()
-
-def add_tristate(arg_parser, name, dest, help):
- arg_parser.add_argument('--enable-' + name, dest = dest, action = 'store_true', default = None,
- help = 'Enable ' + help)
- arg_parser.add_argument('--disable-' + name, dest = dest, action = 'store_false', default = None,
- help = 'Disable ' + help)
-
-def apply_tristate(var, test, note, missing):
- if (var is None) or var:
- if test():
- return True
- elif var == True:
- print(missing)
- sys.exit(1)
- else:
- print(note)
- return False
- return False
-
-#
-# dpdk_cflags - fetch the DPDK specific CFLAGS
-#
-# Run a simple makefile that "includes" the DPDK main makefile and prints the
-# MACHINE_CFLAGS value
-#
-def dpdk_cflags (dpdk_target):
- ensure_tmp_dir_exists()
- with tempfile.NamedTemporaryFile() as sfile:
- dpdk_target = os.path.abspath(dpdk_target)
- dpdk_target = re.sub(r'\/+$', '', dpdk_target)
- dpdk_sdk_path = os.path.dirname(dpdk_target)
- dpdk_target_name = os.path.basename(dpdk_target)
- dpdk_arch = dpdk_target_name.split('-')[0]
- if args.dpdk:
- dpdk_sdk_path = 'dpdk'
- dpdk_target = os.getcwd() + '/build/dpdk'
- dpdk_target_name = 'x86_64-{}-linuxapp-gcc'.format(dpdk_machine)
- dpdk_arch = 'x86_64'
-
- sfile.file.write(bytes('include ' + dpdk_sdk_path + '/mk/
rte.vars.mk' + "\n", 'utf-8'))
- sfile.file.write(bytes('all:' + "\n\t", 'utf-8'))
- sfile.file.write(bytes('@echo $(MACHINE_CFLAGS)' + "\n", 'utf-8'))
- sfile.file.flush()
-
- dpdk_cflags = subprocess.check_output(['make', '--no-print-directory',
- '-f',
sfile.name,
- 'RTE_SDK=' + dpdk_sdk_path,
- 'RTE_OUTPUT=' + dpdk_target,
- 'RTE_TARGET=' + dpdk_target_name,
- 'RTE_SDK_BIN=' + dpdk_target,
- 'RTE_ARCH=' + dpdk_arch])
- dpdk_cflags_str = dpdk_cflags.decode('utf-8')
- dpdk_cflags_str = re.sub(r'\n+$', '', dpdk_cflags_str)
- dpdk_cflags_final = ''
-
- return dpdk_cflags_str
-
-def try_compile(compiler, source = '', flags = []):
- return try_compile_and_link(compiler, source, flags = flags + ['-c'])
-
-def ensure_tmp_dir_exists():
- if not os.path.exists(tempfile.tempdir):
- os.makedirs(tempfile.tempdir)
-
-def try_compile_and_link(compiler, source = '', flags = []):
- ensure_tmp_dir_exists()
- with tempfile.NamedTemporaryFile() as sfile:
- ofile = tempfile.mktemp()
- try:
- sfile.file.write(bytes(source, 'utf-8'))
- sfile.file.flush()
- # We can't write to /dev/null, since in some cases (-ftest-coverage) gcc will create an auxiliary
- # output file based on the name of the output file, and "/dev/null.gcsa" is not a good name
- return subprocess.call([compiler, '-x', 'c++', '-o', ofile,
sfile.name] + flags,
- stdout = subprocess.DEVNULL,
- stderr = subprocess.DEVNULL) == 0
- finally:
- if os.path.exists(ofile):
- os.unlink(ofile)
-
-def try_compile_and_run(compiler, flags, source, env = {}):
- ensure_tmp_dir_exists()
- mktemp = tempfile.NamedTemporaryFile
- with mktemp() as sfile, mktemp(mode='rb') as xfile:
- sfile.file.write(bytes(source, 'utf-8'))
- sfile.file.flush()
- xfile.file.close()
- if subprocess.call([compiler, '-x', 'c++', '-o',
xfile.name,
sfile.name] + args.user_cflags.split() + flags,
- stdout = subprocess.DEVNULL, stderr = subprocess.DEVNULL) != 0:
- # The compiler may delete the target on failure, and lead to
- # NamedTemporaryFile's destructor throwing an exception.
- open(
xfile.name, 'a').close()
- return False
- e = os.environ.copy()
- e.update(env)
- env = e
- return subprocess.call([
xfile.name], stdout = subprocess.DEVNULL, stderr = subprocess.DEVNULL, env=env) == 0
-
-def warning_supported(warning, compiler, flags):
- # gcc ignores -Wno-x even if it is not supported
- adjusted = re.sub('^-Wno-', '-W', warning)
- return try_compile(flags=flags + [adjusted, '-Werror'], compiler = compiler)
-
-def debug_flag(compiler, flags):
- src_with_auto = textwrap.dedent('''\
- template <typename T>
- struct x { auto f() {} };
-
- x<int> a;
- ''')
- if try_compile(source = src_with_auto, flags = flags + ['-g', '-std=gnu++1y'], compiler = compiler):
- return '-g'
- else:
- print('Note: debug information disabled; upgrade your compiler')
- return ''
-
-def dialect_supported(dialect, compiler='g++'):
- return try_compile(compiler=compiler, source='', flags=['-std=' + dialect])
-
-def detect_membarrier(compiler, flags):
- return try_compile(compiler=compiler, flags=flags, source=textwrap.dedent('''\
- #include <linux/membarrier.h>
-
- int x = MEMBARRIER_CMD_PRIVATE_EXPEDITED | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED;
- '''))
-
-def sanitize_vptr_flag(compiler, flags):
- #
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67258
- if (not try_compile(compiler, flags=flags + ['-fsanitize=vptr'])
- or (try_compile_and_run(compiler, flags=flags + ['-fsanitize=undefined', '-fno-sanitize-recover'],
- env={'UBSAN_OPTIONS': 'exitcode=1'}, source=textwrap.dedent('''
- struct A
- {
- virtual ~A() {}
- };
- struct B : virtual A {};
- struct C : virtual A {};
- struct D : B, virtual C {};
-
- int main()
- {
- D d;
- }
- '''))
- and False)): # -fsanitize=vptr is broken even when the test above passes
- return ''
- else:
- print('Notice: -fsanitize=vptr is broken, disabling; some debug mode tests are bypassed.')
- return '-fno-sanitize=vptr'
-
-
-def adjust_visibility_flags(compiler, flags):
- #
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947
- flags = flags + ['-fvisibility=hidden', '-std=gnu++1y', '-Werror=attributes']
- if not try_compile(compiler, flags=flags, source=textwrap.dedent('''
- template <class T>
- class MyClass {
- public:
- MyClass() {
- auto outer = [this] ()
- {
- auto fn = [this] { };
- //use fn for something here
- };
- }
- };
-
- template<typename T>
- void foo() {
- struct inner {
- inner() {
- (void)([this] { });
- }
- };
- }
-
- int main() {
- MyClass<int> r;
- foo<int>();
- }
- ''')):
- print('Notice: disabling -Wattributes due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947')
- return '-Wno-attributes'
- else:
- return ''
-
-def configure_fmt(mode, cxx='g++', cc='gcc'):
- builddir = 'build/{}/fmt'.format(mode)
- os.makedirs(builddir, exist_ok=True)
- subprocess.check_output(args=['cmake', '-G', 'Ninja', '../../../fmt', '-DCMAKE_CXX_COMPILER=' + cxx, '-DCMAKE_C_COMPILER=' + cc], cwd=builddir)
-
-modes = {
- 'debug': {
- 'sanitize': '-fsanitize=address -fsanitize=leak -fsanitize=undefined',
- 'sanitize_libs': '-lasan -lubsan',
- 'opt': '-O0 -DSEASTAR_DEBUG -DSEASTAR_DEBUG_SHARED_PTR -DSEASTAR_DEFAULT_ALLOCATOR -DSEASTAR_THREAD_STACK_GUARDS -DSEASTAR_NO_EXCEPTION_HACK -DSEASTAR_SHUFFLE_TASK_QUEUE',
- 'libs': '',
- 'cares_opts': '-DCARES_STATIC=ON -DCARES_SHARED=OFF -DCMAKE_BUILD_TYPE=Debug',
- },
- 'release': {
- 'sanitize': '',
- 'sanitize_libs': '',
- 'opt': '-O2',
- 'libs': '',
- 'cares_opts': '-DCARES_STATIC=ON -DCARES_SHARED=OFF -DCMAKE_BUILD_TYPE=Release',
- },
-}
-
-perf_tests = [
- 'tests/perf/perf_future_util',
-]
-
-tests = [
- 'tests/file_io_test',
- 'tests/directory_test',
- 'tests/linecount',
- 'tests/echotest',
- 'tests/l3_test',
- 'tests/ip_test',
- 'tests/timer_test',
- 'tests/tcp_test',
- 'tests/futures_test',
- 'tests/alloc_test',
- 'tests/foreign_ptr_test',
- 'tests/smp_test',
- 'tests/thread_test',
- 'tests/thread_context_switch_test',
- 'tests/udp_server',
- 'tests/udp_client',
- 'tests/blkdiscard_test',
- 'tests/sstring_test',
- 'tests/unwind_test',
- 'tests/defer_test',
- 'tests/httpd_test',
- 'tests/memcached/memcached_ascii_parser_test',
- 'tests/tcp_sctp_server',
- 'tests/tcp_sctp_client',
- 'tests/allocator_test',
- 'tests/output_stream_test',
- 'tests/udp_zero_copy',
- 'tests/shared_ptr_test',
- 'tests/weak_ptr_test',
- 'tests/checked_ptr_test',
- 'tests/slab_test',
- 'tests/fstream_test',
- 'tests/distributed_test',
- 'tests/rpc',
- 'tests/semaphore_test',
- 'tests/expiring_fifo_test',
- 'tests/packet_test',
- 'tests/tls_test',
- 'tests/fair_queue_test',
- 'tests/rpc_test',
- 'tests/connect_test',
- 'tests/chunked_fifo_test',
- 'tests/circular_buffer_test',
- 'tests/perf/perf_fstream',
- 'tests/json_formatter_test',
- 'tests/dns_test',
- 'tests/execution_stage_test',
- 'tests/lowres_clock_test',
- 'tests/program_options_test',
- 'tests/tuple_utils_test',
- 'tests/tls_echo_server',
- 'tests/tls_simple_client',
- 'tests/circular_buffer_fixed_capacity_test',
- 'tests/noncopyable_function_test',
- 'tests/netconfig_test',
- 'tests/abort_source_test',
- 'tests/alien_test',
- ] + perf_tests
-
-apps = [
- 'apps/httpd/httpd',
- 'apps/seawreck/seawreck',
- 'apps/io_tester/io_tester',
- 'apps/memcached/memcached',
- 'apps/iotune/iotune',
- 'tests/scheduling_group_demo',
- ]
-
-extralibs = {
- 'apps/io_tester/io_tester': [ '-lyaml-cpp' ]
-}
-
-all_artifacts = apps + tests + ['libseastar.a', 'seastar.pc', 'fmt/fmt/libfmt.a']
-
-cpp_dialects = ['gnu++17', 'gnu++1z', 'gnu++14', 'gnu++1y']
-try:
- default_cpp_dialect = [x for x in cpp_dialects if dialect_supported(x, compiler='g++')][0]
-except:
- # if g++ is not available, fallback to something safe-ish
- default_cpp_dialect='gnu++1y'
-
-arg_parser = argparse.ArgumentParser('Configure seastar')
-arg_parser.add_argument('--static', dest = 'static', action = 'store_const', default = '',
- const = '-static',
- help = 'Static link (useful for running on hosts outside the build environment')
-arg_parser.add_argument('--pie', dest = 'pie', action = 'store_true',
- help = 'Build position-independent executable (PIE)')
-arg_parser.add_argument('--so', dest = 'so', action = 'store_true',
- help = 'Build shared object (SO) instead of executable')
-arg_parser.add_argument('--mode', action='store', choices=list(modes.keys()) + ['all'], default='all')
-arg_parser.add_argument('--with', dest='artifacts', action='append', choices=all_artifacts, default=[])
-arg_parser.add_argument('--cflags', action = 'store', dest = 'user_cflags', default = '',
- help = 'Extra flags for the C++ compiler')
-arg_parser.add_argument('--ldflags', action = 'store', dest = 'user_ldflags', default = '',
- help = 'Extra flags for the linker')
-arg_parser.add_argument('--optflags', action = 'store', dest = 'user_optflags', default = '',
- help = 'Extra optimization flags for the release mode')
-arg_parser.add_argument('--compiler', action = 'store', dest = 'cxx', default = 'g++',
- help = 'C++ compiler path')
-arg_parser.add_argument('--c-compiler', action='store', dest='cc', default='gcc',
- help = 'C compiler path (for bundled libraries such as dpdk and c-ares)')
-arg_parser.add_argument('--c++-dialect', action='store', dest='cpp_dialect', default=default_cpp_dialect,
- help='C++ dialect to build with [default: %(default)s]')
-arg_parser.add_argument('--with-osv', action = 'store', dest = 'with_osv', default = '',
- help = 'Shortcut for compile for OSv')
-arg_parser.add_argument('--enable-dpdk', action = 'store_true', dest = 'dpdk', default = False,
- help = 'Enable dpdk (from included dpdk sources)')
-arg_parser.add_argument('--dpdk-target', action = 'store', dest = 'dpdk_target', default = '',
- help = 'Path to DPDK SDK target location (e.g. <DPDK SDK dir>/x86_64-native-linuxapp-gcc)')
-arg_parser.add_argument('--debuginfo', action = 'store', dest = 'debuginfo', type = int, default = 1,
- help = 'Enable(1)/disable(0)compiler debug information generation')
-arg_parser.add_argument('--tests-debuginfo', action='store', dest='tests_debuginfo', type=int, default=0,
- help='Enable(1)/disable(0)compiler debug information generation for tests')
-arg_parser.add_argument('--static-stdc++', dest = 'staticcxx', action = 'store_true',
- help = 'Link libgcc and libstdc++ statically')
-arg_parser.add_argument('--static-boost', dest = 'staticboost', action = 'store_true',
- help = 'Link with boost statically')
-arg_parser.add_argument('--static-yaml-cpp', dest = 'staticyamlcpp', action = 'store_true',
- help = 'Link libyaml-cpp statically')
-add_tristate(arg_parser, name = 'hwloc', dest = 'hwloc', help = 'hwloc support')
-arg_parser.add_argument('--enable-gcc6-concepts', dest='gcc6_concepts', action='store_true', default=False,
- help='enable experimental support for C++ Concepts as implemented in GCC 6')
-arg_parser.add_argument('--enable-alloc-failure-injector', dest='alloc_failure_injector', action='store_true', default=False,
- help='enable allocation failure injection')
-add_tristate(arg_parser, name = 'exception-scalability-workaround', dest='exception_workaround',
- help='disabling override of dl_iterate_phdr symbol to workaround C++ exception scalability issues')
-arg_parser.add_argument('--allocator-page-size', dest='allocator_page_size', type=int, help='override allocator page size')
-arg_parser.add_argument('--protoc-compiler', action = 'store', dest='protoc', default='protoc',
- help = 'Path to protoc compiler, the default is protoc')
-arg_parser.add_argument('--cmake', dest='cmake', action='store_true',
- help='Use CMake as the underlying build-sytem')
-arg_parser.add_argument('--without-tests', dest='exclude_tests', action='store_true', help='Do not build tests by default (CMake only)')
-arg_parser.add_argument('--without-apps', dest='exclude_apps', action='store_true', help='Do not build applications by default (CMake only)')
-args = arg_parser.parse_args()
-
-# Forwarding to CMake.
-if args.cmake:
- MODES = seastar_cmake.SUPPORTED_MODES if args.mode is 'all' else [args.mode]
-
- # For convenience.
- tr = seastar_cmake.translate_arg
-
- def configure_mode(mode):
- BUILD_PATH = seastar_cmake.BUILD_PATHS[mode]
-
- TRANSLATED_ARGS = [
- '-DCMAKE_BUILD_TYPE={}'.format(mode.title()),
- '-DCMAKE_C_COMPILER={}'.format(args.cc),
- '-DCMAKE_CXX_COMPILER={}'.format(args.cxx),
- tr(args.exclude_tests, 'EXCLUDE_TESTS_BY_DEFAULT'),
- tr(args.exclude_apps, 'EXCLUDE_APPS_BY_DEFAULT'),
- tr(args.user_cflags, 'USER_CXXFLAGS'),
- tr(args.user_ldflags, 'USER_LDFLAGS'),
- tr(args.user_optflags, 'CXX_OPTIMIZATION_FLAGS'),
- tr(args.cpp_dialect, 'CXX_DIALECT'),
- tr(args.dpdk, 'ENABLE_DPDK'),
- tr(args.staticboost, 'LINK_STATIC_BOOST'),
- tr(args.staticyamlcpp, 'LINK_STATIC_YAML_CPP'),
- tr(args.hwloc, 'ENABLE_HWLOC'),
- tr(args.gcc6_concepts, 'ENABLE_GCC6_CONCEPTS'),
- tr(args.alloc_failure_injector, 'ENABLE_ALLOC_FAILURE_INJECTOR'),
- tr(args.exception_workaround, 'ENABLE_EXCEPTION_SCALABILITY_WORKAROUND'),
- tr(args.allocator_page_size, 'ALLOCATOR_PAGE_SIZE'),
- ]
-
- # Generate a new build by pointing to the source directory.
- ARGS = seastar_cmake.CMAKE_BASIC_ARGS + [seastar_cmake.ROOT_PATH] + TRANSLATED_ARGS
- print(ARGS)
- distutils.dir_util.mkpath(BUILD_PATH)
- subprocess.check_call(ARGS, shell=False, cwd=BUILD_PATH)
-
- for mode in MODES:
- configure_mode(mode)
-
- sys.exit(0)
-
-libnet = [
- 'net/proxy.cc',
- 'net/virtio.cc',
- 'net/dpdk.cc',
- 'net/ip.cc',
- 'net/ethernet.cc',
- 'net/arp.cc',
- 'net/native-stack.cc',
- 'net/ip_checksum.cc',
- 'net/udp.cc',
- 'net/tcp.cc',
- 'net/dhcp.cc',
- 'net/tls.cc',
- 'net/dns.cc',
- 'net/config.cc',
- ]
-
-core = [
- 'core/reactor.cc',
- 'core/alien.cc',
- 'core/execution_stage.cc',
- 'core/systemwide_memory_barrier.cc',
- 'core/fstream.cc',
- 'core/posix.cc',
- 'core/memory.cc',
- 'core/resource.cc',
- 'core/scollectd.cc',
- 'core/metrics.cc',
- 'core/app-template.cc',
- 'core/thread.cc',
- 'core/dpdk_rte.cc',
- 'core/fsqual.cc',
- 'core/linux-aio.cc',
- 'util/conversions.cc',
- 'util/program-options.cc',
- 'util/log.cc',
- 'util/backtrace.cc',
- 'util/alloc_failure_injector.cc',
- 'net/packet.cc',
- 'net/posix-stack.cc',
- 'net/net.cc',
- 'net/stack.cc',
- 'net/inet_address.cc',
- 'rpc/rpc.cc',
- 'rpc/lz4_compressor.cc',
- 'core/exception_hacks.cc',
- 'core/future-util.cc',
- ]
-
-protobuf = [
- 'proto/metrics2.proto',
- ]
-
-prometheus = [
- 'core/prometheus.cc',
- ]
-
-http = ['http/transformers.cc',
- 'http/json_path.cc',
- 'http/file_handler.cc',
- 'http/common.cc',
- 'http/routes.cc',
- 'json/json_elements.cc',
- 'json/formatter.cc',
- 'http/matcher.cc',
- 'http/mime_types.cc',
- 'http/httpd.cc',
- 'http/reply.cc',
- 'http/request_parser.rl',
- 'http/api_docs.cc',
- ]
-
-boost_test_lib = [
- 'tests/test-utils.cc',
- 'tests/test_runner.cc',
-]
-
-
-def maybe_static(flag, libs):
- if flag and not args.static:
- libs = '-Wl,-Bstatic {} -Wl,-Bdynamic'.format(libs)
- return libs
-
-defines = []
-libs = ' '.join([maybe_static(args.staticboost,
- '-lboost_program_options -lboost_system -lboost_filesystem'),
- '-lstdc++ -lm', '-lstdc++fs',
- maybe_static(args.staticboost, '-lboost_thread'),
- '-lcryptopp -lrt -lgnutls -lgnutlsxx -llz4 -lprotobuf -ldl -lgcc_s ',
- maybe_static(args.staticyamlcpp, '-lyaml-cpp'),
- ])
-
-boost_unit_test_lib = maybe_static(args.staticboost, '-lboost_unit_test_framework')
-
-
-hwloc_libs = '-lhwloc -lnuma -lpciaccess -lxml2 -lz'
-
-if args.gcc6_concepts or try_compile(args.cxx, source="""#if __cpp_concepts == 201507
-int main() { return 0; }
-#endif""", flags=['-fconcepts']):
- defines.append('SEASTAR_HAVE_GCC6_CONCEPTS')
- args.user_cflags += ' -fconcepts'
-
-if args.alloc_failure_injector:
- defines.append('SEASTAR_ENABLE_ALLOC_FAILURE_INJECTION')
-
-if not apply_tristate(args.exception_workaround, test = lambda: not args.staticcxx and not args.static,
- note = "Note: disabling exception scalability workaround due to static linkage of libgcc and libstdc++",
- missing = "Error: cannot enable exception scalability workaround with static linkage of libgcc and libstdc++"):
- defines.append('SEASTAR_NO_EXCEPTION_HACK')
-
-if args.staticcxx:
- libs = libs.replace('-lstdc++ ', ' ')
- libs += ' -static-libgcc -static-libstdc++'
-
-if args.staticcxx or args.static:
- defines.append("NO_EXCEPTION_INTERCEPT");
-
-memcache_base = [
- 'apps/memcached/ascii.rl'
-] + libnet + core
-
-deps = {
- 'libseastar.a' : core + libnet + http + protobuf + prometheus,
- 'seastar.pc': [],
- 'fmt/fmt/libfmt.a': [],
- 'apps/httpd/httpd': ['apps/httpd/demo.json', 'apps/httpd/main.cc'] + http + libnet + core,
- 'apps/memcached/memcached': ['apps/memcached/memcache.cc'] + memcache_base,
- 'tests/memcached/memcached_ascii_parser_test': ['tests/memcached/test_ascii_parser.cc'] + memcache_base,
- 'tests/file_io_test': ['tests/fileiotest.cc'] + core,
- 'tests/directory_test': ['tests/directory_test.cc'] + core,
- 'tests/linecount': ['tests/linecount.cc'] + core,
- 'tests/echotest': ['tests/echotest.cc'] + core + libnet,
- 'tests/l3_test': ['tests/l3_test.cc'] + core + libnet,
- 'tests/ip_test': ['tests/ip_test.cc'] + core + libnet,
- 'tests/tcp_test': ['tests/tcp_test.cc'] + core + libnet,
- 'tests/timer_test': ['tests/timertest.cc'] + core,
- 'tests/futures_test': ['tests/futures_test.cc'] + core,
- 'tests/alloc_test': ['tests/alloc_test.cc'] + core,
- 'tests/foreign_ptr_test': ['tests/foreign_ptr_test.cc'] + core,
- 'tests/semaphore_test': ['tests/semaphore_test.cc'] + core,
- 'tests/expiring_fifo_test': ['tests/expiring_fifo_test.cc'] + core,
- 'tests/smp_test': ['tests/smp_test.cc'] + core,
- 'tests/thread_test': ['tests/thread_test.cc'] + core,
- 'tests/thread_context_switch_test': ['tests/thread_context_switch.cc'] + core,
- 'tests/udp_server': ['tests/udp_server.cc'] + core + libnet,
- 'tests/udp_client': ['tests/udp_client.cc'] + core + libnet,
- 'tests/tcp_sctp_server': ['tests/tcp_sctp_server.cc'] + core + libnet,
- 'tests/tcp_sctp_client': ['tests/tcp_sctp_client.cc'] + core + libnet,
- 'tests/tls_test': ['tests/tls_test.cc'] + core + libnet,
- 'tests/fair_queue_test': ['tests/fair_queue_test.cc'] + core,
- 'apps/seawreck/seawreck': ['apps/seawreck/seawreck.cc', 'http/http_response_parser.rl'] + core + libnet,
- 'apps/io_tester/io_tester': ['apps/io_tester/io_tester.cc'] + core,
- 'apps/iotune/iotune': ['apps/iotune/iotune.cc'] + core,
- 'tests/blkdiscard_test': ['tests/blkdiscard_test.cc'] + core,
- 'tests/sstring_test': ['tests/sstring_test.cc'] + core,
- 'tests/unwind_test': ['tests/unwind_test.cc'] + core,
- 'tests/defer_test': ['tests/defer_test.cc'] + core,
- 'tests/httpd_test': ['tests/httpd.cc'] + http + core,
- 'tests/allocator_test': ['tests/allocator_test.cc'] + core,
- 'tests/output_stream_test': ['tests/output_stream_test.cc'] + core + libnet,
- 'tests/udp_zero_copy': ['tests/udp_zero_copy.cc'] + core + libnet,
- 'tests/shared_ptr_test': ['tests/shared_ptr_test.cc'] + core,
- 'tests/weak_ptr_test': ['tests/weak_ptr_test.cc'] + core,
- 'tests/checked_ptr_test': ['tests/checked_ptr_test.cc'] + core,
- 'tests/slab_test': ['tests/slab_test.cc'] + core,
- 'tests/fstream_test': ['tests/fstream_test.cc'] + core,
- 'tests/distributed_test': ['tests/distributed_test.cc'] + core,
- 'tests/rpc': ['tests/rpc.cc'] + core + libnet,
- 'tests/rpc_test': ['tests/rpc_test.cc'] + core + libnet,
- 'tests/packet_test': ['tests/packet_test.cc'] + core + libnet,
- 'tests/connect_test': ['tests/connect_test.cc'] + core + libnet,
- 'tests/chunked_fifo_test': ['tests/chunked_fifo_test.cc'] + core,
- 'tests/circular_buffer_test': ['tests/circular_buffer_test.cc'] + core,
- 'tests/perf/perf_fstream': ['tests/perf/perf_fstream.cc'] + core,
- 'tests/json_formatter_test': ['tests/json_formatter_test.cc'] + core + http,
- 'tests/dns_test': ['tests/dns_test.cc'] + core + libnet,
- 'tests/execution_stage_test': ['tests/execution_stage_test.cc'] + core,
- 'tests/lowres_clock_test': ['tests/lowres_clock_test.cc'] + core,
- 'tests/program_options_test': ['tests/program_options_test.cc'] + core,
- 'tests/tuple_utils_test': ['tests/tuple_utils_test.cc'],
- 'tests/tls_echo_server': ['tests/tls_echo_server.cc'] + core + libnet,
- 'tests/tls_simple_client': ['tests/tls_simple_client.cc'] + core + libnet,
- 'tests/circular_buffer_fixed_capacity_test': ['tests/circular_buffer_fixed_capacity_test.cc'],
- 'tests/scheduling_group_demo': ['tests/scheduling_group_demo.cc'] + core,
- 'tests/noncopyable_function_test': ['tests/noncopyable_function_test.cc'],
- 'tests/netconfig_test': ['tests/netconfig_test.cc'] + core + libnet,
- 'tests/abort_source_test': ['tests/abort_source_test.cc'] + core,
- 'tests/alien_test': ['tests/alien_test.cc'] + core,
-}
-
-boost_tests = [
- 'tests/memcached/memcached_ascii_parser_test',
- 'tests/file_io_test',
- 'tests/futures_test',
- 'tests/alloc_test',
- 'tests/foreign_ptr_test',
- 'tests/semaphore_test',
- 'tests/expiring_fifo_test',
- 'tests/thread_test',
- 'tests/tls_test',
- 'tests/fair_queue_test',
- 'tests/httpd_test',
- 'tests/output_stream_test',
- 'tests/fstream_test',
- 'tests/rpc_test',
- 'tests/connect_test',
- 'tests/json_formatter_test',
- 'tests/dns_test',
- 'tests/execution_stage_test',
- 'tests/lowres_clock_test',
- 'tests/abort_source_test',
- ]
-
-for bt in boost_tests:
- deps[bt] += boost_test_lib
-
-for pt in perf_tests:
- deps[pt] = [pt + '.cc'] + core + ['tests/perf/perf_tests.cc']
-
-warnings = [
- '-Wno-mismatched-tags', # clang-only
- '-Wno-pessimizing-move', # clang-only: moving a temporary object prevents copy elision
- '-Wno-redundant-move', # clang-only: redundant move in return statement
- '-Wno-inconsistent-missing-override', # clang-only: 'x' overrides a member function but is not marked 'override'
- '-Wno-unused-private-field', # clang-only: private field 'x' is not used
- '-Wno-unknown-attributes', # clang-only: unknown attribute 'x' ignored (x in this case is gnu::externally_visible)
- '-Wno-unneeded-internal-declaration', # clang-only: 'x' function 'x' declared in header file shouldb e declared 'x'
- '-Wno-undefined-inline', # clang-only: inline function 'x' is not defined
- '-Wno-overloaded-virtual', # clang-only: 'x' hides overloaded virtual functions
- '-Wno-maybe-uninitialized',
- '-Wno-error=cpp', # Allow preprocessor warnings
- '-Wno-stringop-overflow', # gcc: overzealous, false positives
- ]
-
-# The "--with-osv=<path>" parameter is a shortcut for a bunch of other
-# settings:
-if args.with_osv:
- args.so = True
- args.hwloc = False
- args.user_cflags = (args.user_cflags +
- ' -DSEASTAR_DEFAULT_ALLOCATOR -fvisibility=default -DHAVE_OSV -I' +
- args.with_osv + ' -I' + args.with_osv + '/include -I' +
- args.with_osv + '/arch/x64')
-
-if args.allocator_page_size:
- args.user_cflags += ' -DSEASTAR_OVERRIDE_ALLOCATOR_PAGE_SIZE=' + str(args.allocator_page_size)
-
-dpdk_arch_xlat = {
- 'native': 'native',
- 'nehalem': 'nhm',
- 'westmere': 'wsm',
- 'sandybridge': 'snb',
- 'ivybridge': 'ivb',
- }
-
-dpdk_machine = 'native'
-
-if args.dpdk:
- if not os.path.exists('dpdk') or not os.listdir('dpdk'):
- raise Exception('--enable-dpdk: dpdk/ is empty. Run "git submodule update --init".')
- cflags = args.user_cflags.split()
- dpdk_machine = ([dpdk_arch_xlat[cflag[7:]]
- for cflag in cflags
- if cflag.startswith('-march')] or ['native'])[0]
- subprocess.check_call('make -C dpdk RTE_OUTPUT=$PWD/build/dpdk/ config T=x86_64-native-linuxapp-gcc'.format(
- dpdk_machine=dpdk_machine),
- shell = True)
- # adjust configutation to taste
- dotconfig = 'build/dpdk/.config'
- lines = open(dotconfig, encoding='UTF-8').readlines()
- def update(lines, vars):
- ret = []
- for line in lines:
- for var, val in vars.items():
- if line.startswith(var + '='):
- line = var + '=' + val + '\n'
- ret.append(line)
- return ret
- lines = update(lines, {'CONFIG_RTE_LIBRTE_PMD_BOND': 'n',
- 'CONFIG_RTE_MBUF_SCATTER_GATHER': 'n',
- 'CONFIG_RTE_LIBRTE_IP_FRAG': 'n',
- 'CONFIG_RTE_APP_TEST': 'n',
- 'CONFIG_RTE_TEST_PMD': 'n',
- 'CONFIG_RTE_MBUF_REFCNT_ATOMIC': 'n',
- 'CONFIG_RTE_MAX_MEMSEG': '8192',
- 'CONFIG_RTE_EAL_IGB_UIO': 'n',
- 'CONFIG_RTE_LIBRTE_KNI': 'n',
- 'CONFIG_RTE_KNI_KMOD': 'n',
- 'CONFIG_RTE_LIBRTE_JOBSTATS': 'n',
- 'CONFIG_RTE_LIBRTE_LPM': 'n',
- 'CONFIG_RTE_LIBRTE_ACL': 'n',
- 'CONFIG_RTE_LIBRTE_POWER': 'n',
- 'CONFIG_RTE_LIBRTE_IP_FRAG': 'n',
- 'CONFIG_RTE_LIBRTE_METER': 'n',
- 'CONFIG_RTE_LIBRTE_SCHED': 'n',
- 'CONFIG_RTE_LIBRTE_DISTRIBUTOR': 'n',
- 'CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER': 'n',
- 'CONFIG_RTE_LIBRTE_REORDER': 'n',
- 'CONFIG_RTE_LIBRTE_PORT': 'n',
- 'CONFIG_RTE_LIBRTE_TABLE': 'n',
- 'CONFIG_RTE_LIBRTE_PIPELINE': 'n',
- })
- lines += 'CONFIG_RTE_MACHINE={}'.format(dpdk_machine)
- open(dotconfig, 'w', encoding='UTF-8').writelines(lines)
- args.dpdk_target = os.getcwd() + '/build/dpdk'
-
-if args.dpdk_target:
- args.user_cflags = (args.user_cflags +
- ' -DSEASTAR_HAVE_DPDK -I' + args.dpdk_target + '/include ' +
- dpdk_cflags(args.dpdk_target) +
- ' -Wno-error=literal-suffix -Wno-literal-suffix -Wno-invalid-offsetof')
- libs += (' -L' + args.dpdk_target + '/lib ')
- if args.with_osv:
- libs += '-lintel_dpdk -lrt -lm -ldl'
- else:
- libs += '-Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring -lrte_pmd_bnxt -lrte_pmd_cxgbe -lrte_pmd_ena -lrte_pmd_enic -lrte_pmd_fm10k -lrte_pmd_nfp -lrte_pmd_qede -lrte_pmd_sfc_efx -lrte_hash -lrte_kvargs -lrte_mbuf -lrte_ethdev -lrte_eal -lrte_mempool -lrte_mempool_ring -lrte_ring -lrte_cmdline -lrte_cfgfile -Wl,--no-whole-archive -lrt -lm -ldl'
-
-args.user_cflags += ' -I{srcdir}/fmt'.format(**globals())
-
-if not args.staticboost:
- args.user_cflags += ' -DBOOST_TEST_DYN_LINK'
-
-warnings = [w
- for w in warnings
- if warning_supported(warning = w, compiler = args.cxx, flags=args.user_cflags.split())]
-
-warnings = ' '.join(warnings)
-
-dbgflag = debug_flag(args.cxx, flags=args.user_cflags.split()) if args.debuginfo else ''
-tests_link_rule = 'link' if args.tests_debuginfo else 'link_stripped'
-
-sanitize_flags = sanitize_vptr_flag(args.cxx, flags=args.user_cflags.split())
-
-visibility_flags = adjust_visibility_flags(args.cxx, flags=args.user_cflags.split())
-
-if not try_compile(args.cxx, source='#include <gnutls/gnutls.h>', flags=args.user_cflags.split()):
- print('Seastar requires gnutls. Install gnutls-devel/libgnutls-dev')
- sys.exit(1)
-
-if not try_compile(args.cxx, source='#include <gnutls/gnutls.h>\nint x = GNUTLS_NONBLOCK;', flags=args.user_cflags.split()):
- print('Seastar requires gnutls >= 2.8. Install libgnutls28-dev or later.')
- sys.exit(1)
-
-if not try_compile(args.cxx, source='#include <experimental/string_view>', flags=['-std=gnu++1y'] + args.user_cflags.split()):
- print('Seastar requires g++ >= 4.9. Install g++-4.9 or later (use --compiler option).')
- sys.exit(1)
-
-if not try_compile(args.cxx, '''#include <boost/version.hpp>\n\
- #if BOOST_VERSION < 105800\n\
- #error "Invalid boost version"\n\
- #endif''', flags=args.user_cflags.split()):
- print("Seastar requires boost >= 1.58")
- sys.exit(1)
-
-
-modes['debug']['sanitize'] += ' ' + sanitize_flags
-modes['release']['opt'] += ' ' + args.user_optflags
-
-def have_hwloc():
- return try_compile(compiler = args.cxx, source = '#include <hwloc.h>\n#include <numa.h>', flags=args.user_cflags.split())
-
-if apply_tristate(args.hwloc, test = have_hwloc,
- note = 'Note: hwloc-devel/numactl-devel not installed. No NUMA support.',
- missing = 'Error: required packages hwloc-devel/numactl-devel not installed.'):
- libs += ' ' + hwloc_libs
- defines.append('SEASTAR_HAVE_HWLOC')
- defines.append('SEASTAR_HAVE_NUMA')
-
-if detect_membarrier(compiler=args.cxx, flags=args.user_cflags.split()):
- defines.append('SEASTAR_HAS_MEMBARRIER')
-
-if try_compile(args.cxx, source = textwrap.dedent('''\
- #include <lz4.h>
-
- void m() {
- LZ4_compress_default(static_cast<const char*>(0), static_cast<char*>(0), 0, 0);
- }
- '''), flags=args.user_cflags.split()):
- defines.append("SEASTAR_HAVE_LZ4_COMPRESS_DEFAULT")
-
-if try_compile_and_link(args.cxx, flags=['-fsanitize=address'] + args.user_cflags.split(), source = textwrap.dedent('''\
- #include <cstddef>
-
- extern "C" {
- void __sanitizer_start_switch_fiber(void**, const void*, size_t);
- void __sanitizer_finish_switch_fiber(void*, const void**, size_t*);
- }
-
- int main() {
- __sanitizer_start_switch_fiber(nullptr, nullptr, 0);
- __sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
- }
- ''')):
- defines.append("SEASTAR_HAVE_ASAN_FIBER_SUPPORT")
-
-if args.so:
- args.pie = '-shared'
- args.fpie = '-fpic'
-elif args.pie:
- args.pie = '-pie'
- args.fpie = '-fpie'
-else:
- args.pie = ''
- args.fpie = ''
-
-defines = ' '.join(['-D' + d for d in defines])
-
-globals().update(vars(args))
-
-total_memory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
-link_pool_depth = max(int(total_memory / 7e9), 1)
-
-build_modes = modes if args.mode == 'all' else [args.mode]
-build_artifacts = all_artifacts if not args.artifacts else args.artifacts
-protoc = args.protoc
-dpdk_sources = []
-if args.dpdk:
- for root, dirs, files in os.walk('dpdk'):
- dpdk_sources += [os.path.join(root, file)
- for file in files
- if file.endswith('.h') or file.endswith('.c')]
-dpdk_sources = ' '.join(dpdk_sources)
-
-# both source and builddir location
-cares_dir = 'c-ares'
-cares_lib = 'cares-seastar'
-cares_src_lib = cares_dir + '/lib/libcares.a'
-
-if not os.path.exists(cares_dir) or not os.listdir(cares_dir):
- raise Exception(cares_dir + ' is empty. Run "git submodule update --init".')
-
-cares_sources = []
-for root, dirs, files in os.walk('c-ares'):
- cares_sources += [os.path.join(root, file)
- for file in files
- if file.endswith('.h') or file.endswith('.c')]
-cares_sources = ' '.join(cares_sources)
-libs += ' -l' + cares_lib
-
-# "libs" contains mostly pre-existing libraries, but if we want to add to
-# it a library which we built here, we need to ensure that this library
-# gets built before actually using "libs". So let's make a list "built_libs"
-# of libraries which are targets built here. These libraries are all relative
-# to the current mode's build directory.
-built_libs = []
-built_libs += ['lib' + cares_lib + '.a']
-built_libs += ['fmt/fmt/libfmt.a']
-
-for mode in build_modes:
- configure_fmt(mode, cxx=args.cxx, cc=args.cc)
-
-libs += ' -lfmt'
-
-fmt_deps = []
-for dirpath, dirnames, filenames in os.walk('fmt'):
- fmt_deps += [os.path.join(dirpath, filename) for filename in filenames]
-fmt_deps = ' '.join(fmt_deps)
-
-outdir = 'build'
-buildfile = 'build.ninja'
-os.makedirs(outdir, exist_ok = True)
-do_sanitize = True
-if args.static:
- do_sanitize = False
-with open(buildfile, 'w') as f:
- dpdk_deps = ''
- if args.dpdk:
- # fake dependencies on dpdk, so that it is built before anything else
- dpdk_deps = ' {dpdk_target}/include/rte_eal.h {dpdk_target}/lib/librte_eal.a'.format(dpdk_target=args.dpdk_target)
- f.write(textwrap.dedent('''\
- configure_args = {configure_args}
- builddir = {outdir}
- full_builddir = {srcdir}/$builddir
- cxx = {cxx}
- # we disable _FORTIFY_SOURCE because it generates false positives with longjmp() (core/thread.cc)
- cxxflags = -std={cpp_dialect} {dbgflag} {fpie} -Wall -Werror -Wno-error=deprecated-declarations -fvisibility=hidden {visibility_flags} -pthread -I{srcdir} -U_FORTIFY_SOURCE {user_cflags} {warnings} {defines}
- ldflags = {dbgflag} -Wl,--no-as-needed {static} {pie} -fvisibility=hidden {visibility_flags} -pthread {user_ldflags}
- libs = {libs}
- pool link_pool
- depth = {link_pool_depth}
- rule ragel
- # sed away a bug in ragel 7 that emits some extraneous _nfa* variables
- # (the $$ is collapsed to a single one by ninja)
- command = ragel -G2 -o $out $in && sed -i -e '1h;2,$$H;$$!d;g' -re 's/static const char _nfa[^;]*;//g' $out
- description = RAGEL $out
- rule gen
- command = /bin/echo -e $text > $out
- description = GEN $out
- rule swagger
- command = json/json2code.py -f $in -o $out
- description = SWAGGER $out
- rule protobuf
- command = {protoc} --cpp_out=$outdir $in
- description = PROTOC $out
- rule copy_file
- command = cp $in $out
- rule ninja
- command = {ninja_exe} -C $subdir
- ''').format(**globals()))
- if args.dpdk:
- f.write(textwrap.dedent('''\
- rule dpdkmake
- command = make -C build/dpdk CC={args.cc}
- build {dpdk_deps} : dpdkmake {dpdk_sources}
- ''').format(**globals()))
- for mode in build_modes:
- objdeps = {}
- modeval = modes[mode]
- if modeval['sanitize'] and not do_sanitize:
- print('Note: --static disables debug mode sanitizers')
- modeval['sanitize'] = ''
- modeval['sanitize_libs'] = ''
- elif modeval['sanitize']:
- modeval['sanitize'] += ' -DSEASTAR_ASAN_ENABLED'
- f.write(textwrap.dedent('''\
- cxxflags_{mode} = {sanitize} {opt} -I$full_builddir/{mode}/gen -I$full_builddir/{mode}/c-ares
- libs_{mode} = {sanitize_libs} {libs}
- rule cxx.{mode}
- command = $cxx -MD -MT $out -MF $out.d $cxxflags_{mode} $cxxflags -c -o $out $in
- description = CXX $out
- depfile = $out.d
- rule link.{mode}
- command = $cxx $cxxflags_{mode} -L$builddir/{mode} -L$builddir/{mode}/fmt/fmt $ldflags -o $out $in $libs $libs_{mode} $extralibs
- description = LINK $out
- pool = link_pool
- rule link_stripped.{mode}
- command = $cxx $cxxflags_{mode} -s -L$builddir/{mode} -L$builddir/{mode}/fmt/fmt $ldflags -o $out $in $libs $libs_{mode} $extralibs
- description = LINK (stripped) $out
- pool = link_pool
- rule ar.{mode}
- command = rm -f $out; ar cr $out $in; ranlib $out
- description = AR $out
- ''').format(mode = mode, **modeval))
- f.write('build {mode}: phony $builddir/{mode}/lib{cares_lib}.a {artifacts}\n'.format(mode = mode, cares_lib=cares_lib,
- artifacts = str.join(' ', ('$builddir/' + mode + '/' + x for x in build_artifacts))))
- f.write(textwrap.dedent('''\
- rule caresmake_{mode}
- command = make -C build/{mode}/{cares_dir} CC={args.cc}
- rule carescmake_{mode}
- command = mkdir -p $builddir/{mode}/{cares_dir} && cd $builddir/{mode}/{cares_dir} && CC={args.cc} cmake {cares_opts} {srcdir}/$in
- build $builddir/{mode}/{cares_dir}/Makefile : carescmake_{mode} {cares_dir}
- build $builddir/{mode}/{cares_dir}/ares_build.h : phony $builddir/{mode}/{cares_dir}/Makefile
- build $builddir/{mode}/{cares_src_lib} : caresmake_{mode} $builddir/{mode}/{cares_dir}/Makefile | {cares_sources}
- build $builddir/{mode}/lib{cares_lib}.a : copy_file $builddir/{mode}/{cares_src_lib}
- ''').format(cares_opts=(modeval['cares_opts']), **globals()))
- objdeps['$builddir/' + mode + '/net/dns.o'] = ' $builddir/' + mode + '/' + cares_dir + '/ares_build.h'
- compiles = {}
- ragels = {}
- swaggers = {}
- protobufs = {}
- for binary in build_artifacts:
- srcs = deps[binary]
- objs = ['$builddir/' + mode + '/' + src.replace('.cc', '.o')
- for src in srcs
- if src.endswith('.cc')]
- objs += ['$builddir/' + mode + '/gen/' + src.replace('.proto', '.pb.o')
- for src in srcs
- if src.endswith('.proto')]
- if binary.endswith('.pc'):
- vars = modeval.copy()
- vars.update(globals())
- pc = textwrap.dedent('''\
- Name: Seastar
- URL:
http://seastar-project.org/
- Description: Advanced C++ framework for high-performance server applications on modern hardware.
- Version: 1.0
- Libs: -L$full_builddir/{mode} -L$full_builddir/{mode}/fmt/fmt -Wl,--whole-archive,-lseastar,--no-whole-archive -lfmt $cxxflags $cxflags_{mode} -Wl,--no-as-needed {static} {pie} {user_ldflags} {sanitize_libs} {libs}
- Cflags: $cxxflags $cxxflags_{mode}
- ''').format(**vars)
- f.write('build $builddir/{}/{}: gen\n text = {}\n'.format(mode, binary, repr(pc)))
- elif binary == 'fmt/fmt/libfmt.a':
- f.write('build $builddir/{}/fmt/fmt//libfmt.a: ninja | {}\n'.format(mode, fmt_deps))
- f.write(' subdir=build/{}/fmt\n'.format(mode))
- elif binary.endswith('.a'):
- f.write('build $builddir/{}/{}: ar.{} {}\n'.format(mode, binary, mode, str.join(' ', objs)))
- else:
- libdeps = str.join(' ', ('$builddir/{}/{}'.format(mode, i) for i in built_libs))
- test_extralibs = [maybe_static(args.staticyamlcpp, '-lyaml-cpp')]
- if binary.startswith('tests/'):
- if binary in boost_tests:
- test_extralibs += [maybe_static(args.staticboost, '-lboost_unit_test_framework')]
- # Our code's debugging information is huge, and multiplied
- # by many tests yields ridiculous amounts of disk space.
- # So we strip the tests by default; The user can very
- # quickly re-link the test unstripped by adding a "_g"
- # to the test name, e.g., "ninja build/release/testname_g"
- f.write('build $builddir/{}/{}: {}.{} {} | {} {}\n'.format(mode, binary, tests_link_rule, mode, str.join(' ', objs), dpdk_deps, libdeps))
- f.write(' extralibs = {}\n'.format(' '.join(test_extralibs)))
- f.write('build $builddir/{}/{}_g: link.{} {} | {} {}\n'.format(mode, binary, mode, str.join(' ', objs), dpdk_deps, libdeps))
- f.write(' extralibs = {}\n'.format(' '.join(test_extralibs)))
- else:
- f.write('build $builddir/{}/{}: link.{} {} | {} {} $builddir/{}/lib{}.a $builddir/{}/fmt/fmt/libfmt.a\n'.format(mode, binary, mode, str.join(' ', objs), dpdk_deps, libdeps, mode, cares_lib, mode))
- if binary in extralibs.keys():
- app_extralibs = extralibs[binary]
- f.write(' extralibs = {}\n'.format(' '.join(app_extralibs)))
-
- for src in srcs:
- if src.endswith('.cc'):
- obj = '$builddir/' + mode + '/' + src.replace('.cc', '.o')
- compiles[obj] = src
- elif src.endswith('.proto'):
- hh = '$builddir/' + mode + '/gen/' + src.replace('.proto', '.pb.h')
- protobufs[hh] = src
- compiles[hh.replace('.h', '.o')] = hh.replace('.h', '.cc')
- elif src.endswith('.rl'):
- hh = '$builddir/' + mode + '/gen/' + src.replace('.rl', '.hh')
- ragels[hh] = src
- elif src.endswith('.json'):
- hh = '$builddir/' + mode + '/gen/' + src + '.hh'
- swaggers[hh] = src
- else:
- raise Exception('No rule for ' + src)
- for obj in compiles:
- src = compiles[obj]
- gen_headers = list(ragels.keys()) + list(swaggers.keys()) + list(protobufs.keys())
- f.write('build {}: cxx.{} {} || {} \n'.format(obj, mode, src, ' '.join(gen_headers) + dpdk_deps + objdeps.get(obj, '')))
- for hh in ragels:
- src = ragels[hh]
- f.write('build {}: ragel {}\n'.format(hh, src))
- for hh in swaggers:
- src = swaggers[hh]
- f.write('build {}: swagger {} | json/json2code.py\n'.format(hh,src))
- for pb in protobufs:
- src = protobufs[pb]
- c_pb = pb.replace('.h','.cc')
- outd = os.path.dirname(os.path.dirname(pb))
- f.write('build {} {}: protobuf {}\n outdir = {}\n'.format(c_pb, pb, src, outd))
-
- f.write(textwrap.dedent('''\
- rule configure
- command = python3 configure.py $configure_args
- generator = 1
- build build.ninja: configure | configure.py
- rule cscope
- command = find -name '*.[chS]' -o -name "*.cc" -o -name "*.hh" | cscope -bq -i-
- description = CSCOPE
- build cscope: cscope
- rule md2html
- command = pandoc --self-contained --smart --toc -c doc/template.css -V documentclass=report --chapters --number-sections -f markdown_github+pandoc_title_block+implicit_header_references --highlight-style tango $in -o $out
- description = PANDOC $out
- rule md2pdf
- command = pandoc -f markdown_github+pandoc_title_block+implicit_header_references --highlight-style tango --template=doc/template.tex $in -o $out
- description = PANDOC $out
- rule htmlsplit
- command = cd doc; ./htmlsplit.py
- description = HTMLSPLIT $out
- build doc/tutorial.html: md2html doc/tutorial.md
- build doc/tutorial.pdf: md2pdf doc/tutorial.md
- build doc/split: htmlsplit doc/tutorial.html
- default {modes_list}
- ''').format(modes_list = ' '.join(build_modes), **globals()))
diff --git a/cooking.sh b/cooking.sh
new file mode 100755
index 00000000..110e7c38
--- /dev/null
+++ b/cooking.sh
@@ -0,0 +1,552 @@
+#!/bin/bash
+
+# MIT License
+#
+# Copyright (c) 2018 Jesse Haber-Kucharsky
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+#
+# This is cmake-cooking v0.4.0
+#
+
+set -e
+
+CMAKE=${CMAKE:-cmake}
+
+source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+recipe=""
+declare -a excluded_ingredients
+declare -a included_ingredients
+build_dir="${source_dir}/build"
+build_type="Debug"
+# Depends on `build_dir`.
+ingredients_dir=""
+generator="Ninja"
+list_only=""
+nested=""
+
+usage() {
+ cat <<EOF
+
+Fetch, configure, build, and install dependencies ("ingredients") for a CMake project
+in a local and repeatable development environment.
+
+Usage: $0 [OPTIONS]
+
+where OPTIONS are:
+
+-r RECIPE
+-e INGREDIENT
+-i INGREDIENT
+-d BUILD_DIR (=${build_dir})
+-p INGREDIENTS_DIR (=${build_dir}/_cooking/installed)
+-t BUILD_TYPE (=${build_type})
+-g GENERATOR (=${generator})
+-l
+-h
+
+If neither [-i] nor [-e] are specified with a recipe ([-r]), then all ingredients of the recipe
+will be fetched and built.
+
+[-i] and [-e] are mutually-exclusive options: only provide one.
+
+Option details:
+
+-r RECIPE
+
+ Prepare the named recipe. Recipes are stored in 'recipe/RECIPE.cmake'.
+ If no recipe is indicated, then configure the build without any ingredients.
+
+-e INGREDIENT
+
+ Exclude an ingredient from a recipe. This option can be supplied many times.
+
+ For example, if a recipe consists of 'apple', 'banana', 'carrot', and 'donut', then
+
+ ./cooking.sh -r dev -e apple -e donut
+
+ will prepare 'banana' and 'carrot' but not prepare 'apple' and 'donut'.
+
+ If an ingredient is excluded, then it is assumed that all ingredients that depend on it
+ can satisfy that dependency in some other way from the system (ie, the dependency is
+ removed internally).
+
+-i INGREDIENT
+
+ Include an ingredient from a recipe, ignoring the others. This option can be supplied
+ many times.
+
+ Similar to [-e], but the opposite.
+
+ For example, if a recipe consists of 'apple', 'banana', 'carrot', and 'donut' then
+
+ ./cooking.sh -r dev -i apple -i donut
+
+ will prepare 'apple' and 'donut' but not prepare 'banana' and 'carrot'.
+
+ If an ingredient is not in the "include-list", then it is assumed that all
+ ingredients that are in the list and which depend on it can satisfy that dependency
+ in some other way from the system.
+
+-d BUILD_DIR (=${build_dir})
+
+ Configure the project and build it in the named directory.
+
+-p INGREDIENTS_DIR (=${build_dir}/_cooking/installed)
+
+ Install compiled ingredients into this directory.
+
+-t BUILD_TYPE (=${build_type})
+
+ Configure all ingredients and the project with the named CMake build-type.
+ An example build type is "Release".
+
+-g GENERATOR (=${generator})
+
+ Use the named CMake generator for building all ingredients and the project.
+ An example generator is "Unix Makfiles".
+
+-l
+
+ Only list available ingredients for a given recipe, and don't do anything else.
+
+-h
+
+ Show this help information and exit.
+
+EOF
+}
+
+yell_include_exclude_mutually_exclusive() {
+ echo "Cooking: [-e] and [-i] are mutually exclusive options!" >&2
+}
+
+while getopts "r:e:i:d:p:t:g:lhx" arg; do
+ case "${arg}" in
+ r) recipe=${OPTARG} ;;
+ e)
+ if [[ ${#included_ingredients[@]} -ne 0 ]]; then
+ yell_include_exclude_mutually_exclusive
+ exit 1
+ fi
+
+ excluded_ingredients+=(${OPTARG})
+ ;;
+ i)
+ if [[ ${#excluded_ingredients[@]} -ne 0 ]]; then
+ yell_include_exclude_mutually_exclusive
+ exit 1
+ fi
+
+ included_ingredients+=(${OPTARG})
+ ;;
+ d) build_dir=$(realpath "${OPTARG}") ;;
+ p) ingredients_dir=$(realpath "${OPTARG}") ;;
+ t) build_type=${OPTARG} ;;
+ g) generator=${OPTARG} ;;
+ l) list_only="1" ;;
+ h) usage; exit 0 ;;
+ x) nested="1" ;;
+ *) usage; exit 1 ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+cooking_dir="${build_dir}/_cooking"
+cmake_dir="${source_dir}/cmake"
+cache_file="${build_dir}/CMakeCache.txt"
+ingredients_ready_file="${cooking_dir}/ready.txt"
+
+if [ -z "${ingredients_dir}" ]; then
+ ingredients_dir="${cooking_dir}/installed"
+fi
+
+mkdir -p "${cmake_dir}"
+
+cat <<'EOF' > "${cmake_dir}/Cooking.cmake"
+# This file was generated by cmake-cooking v0.4.0.
+# cmake-cooking is copyright 2018 by Jesse Haber-Kucharsky and
+# available under the terms of the MIT license.
+
+macro (project name)
+ set (_cooking_dir ${CMAKE_CURRENT_BINARY_DIR}/_cooking)
+
+ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+ set (_cooking_root ON)
+ else ()
+ set (_cooking_root OFF)
+ endif ()
+
+ find_program (Cooking_STOW_EXECUTABLE
+ stow
+ "Executable path of GNU Stow.")
+
+ if (NOT Cooking_STOW_EXECUTABLE)
+ message (FATAL_ERROR "Cooking: GNU Stow is required!")
+ endif ()
+
+ set (Cooking_INGREDIENTS_DIR
+ ${_cooking_dir}/installed
+ CACHE
+ PATH
+ "Directory where ingredients will be installed.")
+
+ set (Cooking_EXCLUDED_INGREDIENTS
+ ""
+ CACHE
+ STRING
+ "Semicolon-separated list of ingredients that are not provided by Cooking.")
+
+ set (Cooking_INCLUDED_INGREDIENTS
+ ""
+ CACHE
+ STRING
+ "Semicolon-separated list of ingredients that are provided by Cooking.")
+
+ option (Cooking_LIST_ONLY
+ "Available ingredients will be listed and nothing will be installed."
+ OFF)
+
+ set (Cooking_RECIPE "" CACHE STRING "Configure ${name}'s dependencies according to the named recipe.")
+
+ if ((NOT DEFINED Cooking_EXCLUDED_INGREDIENTS) OR (Cooking_EXCLUDED_INGREDIENTS STREQUAL ""))
+ set (_cooking_excluding OFF)
+ else ()
+ set (_cooking_excluding ON)
+ endif ()
+
+ if ((NOT DEFINED Cooking_INCLUDED_INGREDIENTS) OR (Cooking_INCLUDED_INGREDIENTS STREQUAL ""))
+ set (_cooking_including OFF)
+ else ()
+ set (_cooking_including ON)
+ endif ()
+
+ if (_cooking_excluding AND _cooking_including)
+ message (
+ FATAL_ERROR
+ "Cooking: The EXCLUDED_INGREDIENTS and INCLUDED_INGREDIENTS lists are mutually exclusive options!")
+ endif ()
+
+ if (_cooking_root)
+ _project (${name} ${ARGN})
+
+ if (NOT ("${Cooking_RECIPE}" STREQUAL ""))
+ add_custom_target (_cooking_ingredients)
+
+ add_custom_command (
+ OUTPUT ${_cooking_dir}/ready.txt
+ DEPENDS _cooking_ingredients
+ COMMAND ${CMAKE_COMMAND} -E touch ${_cooking_dir}/ready.txt)
+
+ add_custom_target (_cooking_ingredients_ready
+ DEPENDS ${_cooking_dir}/ready.txt)
+
+ list (APPEND CMAKE_PREFIX_PATH ${Cooking_INGREDIENTS_DIR})
+ include ("recipe/${Cooking_RECIPE}.cmake")
+
+ if (NOT EXISTS ${_cooking_dir}/ready.txt)
+ return ()
+ endif ()
+ endif ()
+ endif ()
+endmacro ()
+
+set (_cooking_ingredient_name_pattern "([a-zA-Z][a-zA-Z0-9\-_]+)")
+
+function (_cooking_prefix_ingredients var input)
+ string (REGEX REPLACE
+ ${_cooking_ingredient_name_pattern}
+ ingredient_\\0
+ result
+ "${input}")
+
+ set (${var} ${result} PARENT_SCOPE)
+endfunction ()
+
+_cooking_prefix_ingredients (
+ _cooking_excluded_ingredients_prefixed
+ "${Cooking_EXCLUDED_INGREDIENTS}")
+
+_cooking_prefix_ingredients (
+ _cooking_included_ingredients_prefixed
+ "${Cooking_INCLUDED_INGREDIENTS}")
+
+macro (cooking_ingredient name)
+ set (_cooking_args "${ARGN}")
+
+ if (_cooking_excluding)
+ # Strip out any dependencies that are excluded.
+ list (REMOVE_ITEM _cooking_args "${_cooking_excluded_ingredients_prefixed}")
+ elseif (_cooking_including)
+ # Eliminate dependencies that have not been included.
+ foreach (x IN LISTS _cooking_args)
+ if (("${x}" MATCHES ingredient_${_cooking_ingredient_name_pattern})
+ AND NOT ("${x}" IN_LIST Cooking_INCLUDED_INGREDIENTS))
+ list (REMOVE_ITEM _cooking_args ${x})
+ endif ()
+ endforeach ()
+ endif ()
+
+ if ((_cooking_excluding AND (${name} IN_LIST Cooking_EXCLUDED_INGREDIENTS))
+ OR (_cooking_including AND (NOT (${name} IN_LIST Cooking_INCLUDED_INGREDIENTS))))
+ # Nothing.
+ else ()
+ set (_cooking_ingredient_dir ${_cooking_dir}/ingredient/${name})
+
+ add_custom_target (_cooking_ingredient_${name}_post_install
+ DEPENDS ${Cooking_INGREDIENTS_DIR}/.cooking_ingredient_${name})
+
+ add_dependencies (_cooking_ingredients _cooking_ingredient_${name}_post_install)
+
+ if (Cooking_LIST_ONLY)
+ add_custom_command (
+ OUTPUT ${Cooking_INGREDIENTS_DIR}/.cooking_ingredient_${name}
+ MAIN_DEPENDENCY ${Cooking_INGREDIENTS_DIR}/.cooking_stamp
+ COMMAND ${CMAKE_COMMAND} -E touch ${Cooking_INGREDIENTS_DIR}/.cooking_ingredient_${name})
+ else ()
+ cmake_parse_arguments (
+ _cooking_parsed_args
+ ""
+ "COOKING_RECIPE"
+ "CMAKE_ARGS;COOKING_INCLUDE;COOKING_EXCLUDE"
+ ${_cooking_args})
+
+ include (ExternalProject)
+ set (_cooking_stow_dir ${_cooking_dir}/stow)
+ string (REPLACE "<DISABLE>" "" _cooking_forwarded_args "${_cooking_parsed_args_UNPARSED_ARGUMENTS}")
+
+ if (NOT (SOURCE_DIR IN_LIST _cooking_args))
+ set (_cooking_source_dir SOURCE_DIR ${_cooking_ingredient_dir}/src)
+ else ()
+ set (_cooking_source_dir "")
+ endif ()
+
+ if (NOT ((BUILD_IN_SOURCE IN_LIST _cooking_args) OR (BINARY_DIR IN_LIST _cooking_args)))
+ set (_cooking_binary_dir BINARY_DIR ${_cooking_ingredient_dir}/build)
+ else ()
+ set (_cooking_binary_dir "")
+ endif ()
+
+ if (NOT (UPDATE_COMMAND IN_LIST _cooking_args))
+ set (_cooking_update_command UPDATE_COMMAND)
+ else ()
+ set (_cooking_update_command "")
+ endif ()
+
+ set (_cooking_extra_cmake_args
+ -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>)
+
+ if (NOT ("${ARGN}" MATCHES .*CMAKE_BUILD_TYPE.*))
+ list (APPEND _cooking_extra_cmake_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
+ endif ()
+
+ if (_cooking_parsed_args_COOKING_RECIPE)
+ set (_cooking_include_exclude_args "")
+
+ foreach (i ${_cooking_parsed_args_COOKING_INCLUDE})
+ list (APPEND _cooking_include_exclude_args -i ${i})
+ endforeach ()
+
+ foreach (e ${_cooking_parsed_args_COOKING_EXCLUDE})
+ list (APPEND _cooking_include_exclude_args -e ${e})
+ endforeach ()
+
+ set (_cooking_configure_command
+ CONFIGURE_COMMAND
+ <SOURCE_DIR>/cooking.sh
+ -r ${_cooking_parsed_args_COOKING_RECIPE}
+ -d <BINARY_DIR>
+ -p ${Cooking_INGREDIENTS_DIR}
+ -x
+ ${_cooking_include_exclude_args}
+ --
+ ${_cooking_extra_cmake_args}
+ ${_cooking_parsed_args_CMAKE_ARGS})
+ elseif (NOT (CONFIGURE_COMMAND IN_LIST _cooking_args))
+ set (_cooking_configure_command
+ CONFIGURE_COMMAND
+ ${CMAKE_COMMAND}
+ ${_cooking_extra_cmake_args}
+ ${_cooking_parsed_args_CMAKE_ARGS}
+ <SOURCE_DIR>)
+ else ()
+ set (_cooking_configure_command "")
+ endif ()
+
+ if (NOT (BUILD_COMMAND IN_LIST _cooking_args))
+ set (_cooking_build_command BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR>)
+ else ()
+ set (_cooking_build_command "")
+ endif ()
+
+ if (NOT (INSTALL_COMMAND IN_LIST _cooking_args))
+ set (_cooking_install_command INSTALL_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --target install)
+ else ()
+ set (_cooking_install_command "")
+ endif ()
+
+ ExternalProject_add (ingredient_${name}
+ ${_cooking_source_dir}
+ ${_cooking_binary_dir}
+ ${_cooking_update_command} ""
+ ${_cooking_configure_command}
+ ${_cooking_build_command}
+ ${_cooking_install_command}
+ PREFIX ${_cooking_ingredient_dir}
+ STAMP_DIR ${_cooking_ingredient_dir}/stamp
+ INSTALL_DIR ${_cooking_stow_dir}/${name}
+ STEP_TARGETS install
+ CMAKE_ARGS ${_cooking_extra_cmake_args}
+ "${_cooking_forwarded_args}")
+
+ if (_cooking_parsed_args_COOKING_RECIPE)
+ ExternalProject_add_step (ingredient_${name}
+ cooking-reconfigure
+ DEPENDS ${Cooking_INGREDIENTS_DIR}/.cooking_stamp
+ DEPENDERS configure)
+ endif ()
+
+ add_custom_command (
+ OUTPUT ${Cooking_INGREDIENTS_DIR}/.cooking_ingredient_${name}
+ MAIN_DEPENDENCY ${Cooking_INGREDIENTS_DIR}/.cooking_stamp
+ DEPENDS ingredient_${name}-install
+ COMMAND
+ flock
+ --wait 30
+ ${Cooking_INGREDIENTS_DIR}/.cooking_stow.lock
+ ${Cooking_STOW_EXECUTABLE}
+ -t ${Cooking_INGREDIENTS_DIR}
+ -d ${_cooking_stow_dir}
+ ${name}
+ COMMAND ${CMAKE_COMMAND} -E touch ${Cooking_INGREDIENTS_DIR}/.cooking_ingredient_${name})
+
+ add_dependencies (_cooking_ingredients ingredient_${name})
+ endif ()
+ endif ()
+endmacro ()
+EOF
+
+cmake_cooking_args=(
+ "-DCooking_INGREDIENTS_DIR=${ingredients_dir}"
+ "-DCooking_RECIPE=${recipe}"
+)
+
+#
+# Clean-up from a previous run.
+#
+
+if [ -e "${ingredients_ready_file}" ]; then
+ rm "${ingredients_ready_file}"
+fi
+
+if [ -e "${cache_file}" ]; then
+ rm "${cache_file}"
+fi
+
+if [ -d "${ingredients_dir}" -a -z "${nested}" ]; then
+ rm -r --preserve-root "${ingredients_dir}"
+fi
+
+mkdir -p "${ingredients_dir}"
+touch "${ingredients_dir}/.cooking_stamp"
+
+#
+# Validate recipe.
+#
+
+if [ -n "${recipe}" ]; then
+ recipe_file="${source_dir}/recipe/${recipe}.cmake"
+
+ if [ ! -f "${recipe_file}" ]; then
+ echo "Cooking: The '${recipe}' recipe does not exist!" && exit 1
+ fi
+fi
+
+#
+# Prepare lists of included and excluded ingredients.
+#
+
+if [ -n "${excluded_ingredients}" ] && [ -z "${list_only}" ]; then
+ cmake_cooking_args+=(
+ -DCooking_EXCLUDED_INGREDIENTS=$(printf "%s;" "${excluded_ingredients[@]}")
+ -DCooking_INCLUDED_INGREDIENTS=
+ )
+fi
+
+if [ -n "${included_ingredients}" ] && [ -z "${list_only}" ]; then
+ cmake_cooking_args+=(
+ -DCooking_EXCLUDED_INGREDIENTS=
+ -DCooking_INCLUDED_INGREDIENTS=$(printf "%s;" "${included_ingredients[@]}")
+ )
+fi
+
+#
+# Configure and build ingredients.
+#
+
+mkdir -p "${build_dir}"
+mkdir -p "${cooking_dir}"/stow
+touch "${cooking_dir}"/stow/.stow
+cd "${build_dir}"
+
+declare -a build_args
+
+if [ "${generator}" == "Ninja" ]; then
+ build_args+=(-v)
+fi
+
+if [ -n "${list_only}" ]; then
+ cmake_cooking_args+=("-DCooking_LIST_ONLY=ON")
+fi
+
+${CMAKE} -DCMAKE_BUILD_TYPE="${build_type}" "${cmake_cooking_args[@]}" -G "${generator}" "${source_dir}"
+${CMAKE} --build . --target _cooking_ingredients_ready -- "${build_args[@]}"
+
+#
+# Report what we've done (if we're not nested).
+#
+
+if [ -z "${nested}" ]; then
+ ingredients=($(find "${ingredients_dir}" -name '.cooking_ingredient_*' -printf '%f\n' | sed -r 's/\.cooking_ingredient_(.+)/\1/'))
+
+ if [ -z "${list_only}" ]; then
+ printf "\nCooking: Installed the following ingredients:\n"
+ else
+ printf "\nCooking: The following ingredients are necessary for this recipe:\n"
+ fi
+
+ for ingredient in "${ingredients[@]}"; do
+ echo " - ${ingredient}"
+ done
+
+ printf '\n'
+
+ if [ -n "${list_only}" ]; then
+ exit 0
+ fi
+fi
+
+#
+# Configure the project, expecting all requirements satisfied.
+#
+
+${CMAKE} -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON "${@}" .
diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt
new file mode 100644
index 00000000..b752b298
--- /dev/null
+++ b/demo/CMakeLists.txt
@@ -0,0 +1,101 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+# Logical target for all demos.
+add_custom_target (demos)
+
+macro (seastar_add_demo name)
+ set (args ${ARGN})
+
+ cmake_parse_arguments (
+ parsed_args
+ ""
+ ""
+ "SOURCES"
+ ${args})
+
+ set (target demo_${name})
+ add_executable (${target} ${parsed_args_SOURCES})
+
+ target_include_directories (${target}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+
+ target_link_libraries (${target}
+ PRIVATE
+ Boost::program_options
+ seastar)
+
+ set_target_properties (${target}
+ PROPERTIES
+ OUTPUT_NAME ${name})
+
+ add_dependencies (demos ${target})
+endmacro ()
+
+seastar_add_demo (block_discard
+ SOURCES block_discard_demo.cc)
+
+seastar_add_demo (echo
+ SOURCES echo_demo.cc)
+
+seastar_add_demo (ip
+ SOURCES ip_demo.cc)
+
+seastar_add_demo (line_count
+ SOURCES line_count_demo.cc)
+
+seastar_add_demo (l3
+ SOURCES l3_demo.cc)
+
+seastar_add_demo (rpc
+ SOURCES rpc_demo.cc)
+
+seastar_add_demo (scheduling_group
+ SOURCES scheduling_group_demo.cc)
+
+seastar_add_demo (tcp
+ SOURCES tcp_demo.cc)
+
+seastar_add_demo (tcp_sctp_client
+ SOURCES tcp_sctp_client_demo.cc)
+
+seastar_add_demo (tcp_sctp_server
+ SOURCES tcp_sctp_server_demo.cc)
+
+seastar_add_demo (tls_echo_server
+ SOURCES
+ tls_echo_server.hh
+ tls_echo_server_demo.cc)
+
+seastar_add_demo (tls_simple_client
+ SOURCES
+ tls_echo_server.hh
+ tls_simple_client_demo.cc)
+
+seastar_add_demo (udp_client
+ SOURCES udp_client_demo.cc)
+
+seastar_add_demo (udp_server
+ SOURCES udp_server_demo.cc)
+
+seastar_add_demo (udp_zero_copy
+ SOURCES udp_zero_copy_demo.cc)
diff --git a/tests/blkdiscard_test.cc b/demo/block_discard_demo.cc
similarity index 93%
rename from tests/blkdiscard_test.cc
rename to demo/block_discard_demo.cc
index 8d0d17c0..70074148 100644
--- a/tests/blkdiscard_test.cc
+++ b/demo/block_discard_demo.cc
@@ -20,10 +20,10 @@
*/
#include <algorithm>
-#include "core/app-template.hh"
-#include "core/future-util.hh"
-#include "core/file.hh"
-#include "core/reactor.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/file.hh>
+#include <seastar/core/reactor.hh>
using namespace seastar;
diff --git a/tests/echotest.cc b/demo/echo_demo.cc
similarity index 96%
rename from tests/echotest.cc
rename to demo/echo_demo.cc
index e549187f..220e463d 100644
--- a/tests/echotest.cc
+++ b/demo/echo_demo.cc
@@ -20,10 +20,10 @@
*
*/
-#include "net/virtio.hh"
-#include "net/dpdk.hh"
-#include "core/reactor.hh"
-#include "net/ip.hh"
+#include <seastar/net/virtio.hh>
+#include <seastar/net/dpdk.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/net/ip.hh>
#include <iostream>
#include <utility>
#include <algorithm>
diff --git a/tests/ip_test.cc b/demo/ip_demo.cc
similarity index 89%
rename from tests/ip_test.cc
rename to demo/ip_demo.cc
index b1a7eff2..02c88fdc 100644
--- a/tests/ip_test.cc
+++ b/demo/ip_demo.cc
@@ -19,11 +19,11 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "net/arp.hh"
-#include "net/ip.hh"
-#include "net/net.hh"
-#include "core/reactor.hh"
-#include "net/virtio.hh"
+#include <seastar/net/arp.hh>
+#include <seastar/net/ip.hh>
+#include <seastar/net/net.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/net/virtio.hh>
using namespace seastar;
using namespace net;
diff --git a/tests/l3_test.cc b/demo/l3_demo.cc
similarity index 94%
rename from tests/l3_test.cc
rename to demo/l3_demo.cc
index 883ee516..c30d735d 100644
--- a/tests/l3_test.cc
+++ b/demo/l3_demo.cc
@@ -19,9 +19,9 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "net/net.hh"
-#include "core/reactor.hh"
-#include "net/virtio.hh"
+#include <seastar/net/net.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/net/virtio.hh>
using namespace seastar;
using namespace net;
diff --git a/tests/linecount.cc b/demo/line_count_demo.cc
similarity index 94%
rename from tests/linecount.cc
rename to demo/line_count_demo.cc
index 6332da89..46a95209 100644
--- a/tests/linecount.cc
+++ b/demo/line_count_demo.cc
@@ -22,10 +22,10 @@
// Demonstration of file_input_stream. Don't expect stellar performance
// since no read-ahead or caching is done yet.
-#include "core/fstream.hh"
-#include "core/app-template.hh"
-#include "core/shared_ptr.hh"
-#include "core/reactor.hh"
+#include <seastar/core/fstream.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/reactor.hh>
#include <algorithm>
using namespace seastar;
diff --git a/tests/rpc.cc b/demo/rpc_demo.cc
similarity index 98%
rename from tests/rpc.cc
rename to demo/rpc_demo.cc
index 5bfbcbbc..9330c6e0 100644
--- a/tests/rpc.cc
+++ b/demo/rpc_demo.cc
@@ -19,11 +19,11 @@
* Copyright 2015 Cloudius Systems
*/
#include <cmath>
-#include "core/reactor.hh"
-#include "core/app-template.hh"
-#include "rpc/rpc.hh"
-#include "core/sleep.hh"
-#include "rpc/lz4_compressor.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/rpc/rpc.hh>
+#include <seastar/core/sleep.hh>
+#include <seastar/rpc/lz4_compressor.hh>
using namespace seastar;
diff --git a/tests/scheduling_group_demo.cc b/demo/scheduling_group_demo.cc
similarity index 96%
rename from tests/scheduling_group_demo.cc
rename to demo/scheduling_group_demo.cc
index 2725d299..043ad534 100644
--- a/tests/scheduling_group_demo.cc
+++ b/demo/scheduling_group_demo.cc
@@ -20,12 +20,12 @@
*/
-#include "../core/app-template.hh"
-#include "../core/future.hh"
-#include "../core/scheduling.hh"
-#include "../core/thread.hh"
-#include "../core/future-util.hh"
-#include "../core/reactor.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future.hh>
+#include <seastar/core/scheduling.hh>
+#include <seastar/core/thread.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/reactor.hh>
#include <chrono>
#include <cmath>
diff --git a/tests/tcp_test.cc b/demo/tcp_demo.cc
similarity index 95%
rename from tests/tcp_test.cc
rename to demo/tcp_demo.cc
index 8c7df5d7..93750834 100644
--- a/tests/tcp_test.cc
+++ b/demo/tcp_demo.cc
@@ -19,9 +19,9 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "net/ip.hh"
-#include "net/virtio.hh"
-#include "net/tcp.hh"
+#include <seastar/net/ip.hh>
+#include <seastar/net/virtio.hh>
+#include <seastar/net/tcp.hh>
using namespace seastar;
using namespace net;
diff --git a/tests/tcp_sctp_client.cc b/demo/tcp_sctp_client_demo.cc
similarity index 98%
rename from tests/tcp_sctp_client.cc
rename to demo/tcp_sctp_client_demo.cc
index 212550cd..a0f1fd10 100644
--- a/tests/tcp_sctp_client.cc
+++ b/demo/tcp_sctp_client_demo.cc
@@ -19,9 +19,9 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/app-template.hh"
-#include "core/future-util.hh"
-#include "core/distributed.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/distributed.hh>
using namespace seastar;
using namespace net;
diff --git a/tests/tcp_sctp_server.cc b/demo/tcp_sctp_server_demo.cc
similarity index 97%
rename from tests/tcp_sctp_server.cc
rename to demo/tcp_sctp_server_demo.cc
index bed494b3..f8231e17 100644
--- a/tests/tcp_sctp_server.cc
+++ b/demo/tcp_sctp_server_demo.cc
@@ -19,10 +19,10 @@
* Copyright 2014 Cloudius Systems
*/
-#include "core/reactor.hh"
-#include "core/app-template.hh"
-#include "core/temporary_buffer.hh"
-#include "core/distributed.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/temporary_buffer.hh>
+#include <seastar/core/distributed.hh>
#include <vector>
#include <iostream>
diff --git a/tests/tls_echo_server.hh b/demo/tls_echo_server.hh
similarity index 94%
rename from tests/tls_echo_server.hh
rename to demo/tls_echo_server.hh
index 8181c173..e9e09ac6 100644
--- a/tests/tls_echo_server.hh
+++ b/demo/tls_echo_server.hh
@@ -20,14 +20,14 @@
*/
#pragma once
-#include "core/do_with.hh"
-#include "core/sstring.hh"
-#include "core/reactor.hh"
-#include "core/do_with.hh"
-#include "core/future-util.hh"
-#include "core/sharded.hh"
-#include "core/gate.hh"
-#include "net/tls.hh"
+#include <seastar/core/do_with.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sharded.hh>
+#include <seastar/core/gate.hh>
+#include <seastar/net/tls.hh>
using namespace seastar;
diff --git a/tests/tls_echo_server.cc b/demo/tls_echo_server_demo.cc
similarity index 95%
rename from tests/tls_echo_server.cc
rename to demo/tls_echo_server_demo.cc
index 7accc535..1ca0efbb 100644
--- a/tests/tls_echo_server.cc
+++ b/demo/tls_echo_server_demo.cc
@@ -19,10 +19,10 @@
* Copyright 2015 Cloudius Systems
*/
#include <cmath>
-#include "core/reactor.hh"
-#include "core/app-template.hh"
-#include "core/sleep.hh"
-#include "net/dns.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/sleep.hh>
+#include <seastar/net/dns.hh>
#include "tls_echo_server.hh"
using namespace seastar;
diff --git a/tests/tls_simple_client.cc b/demo/tls_simple_client_demo.cc
similarity index 97%
rename from tests/tls_simple_client.cc
rename to demo/tls_simple_client_demo.cc
index 5f087ecd..ea598e48 100644
--- a/tests/tls_simple_client.cc
+++ b/demo/tls_simple_client_demo.cc
@@ -20,11 +20,11 @@
*/
#include <cmath>
-#include "core/shared_ptr.hh"
-#include "core/reactor.hh"
-#include "core/app-template.hh"
-#include "core/sleep.hh"
-#include "net/dns.hh"
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/sleep.hh>
+#include <seastar/net/dns.hh>
#include "tls_echo_server.hh"
using namespace seastar;
diff --git a/tests/udp_client.cc b/demo/udp_client_demo.cc
similarity index 94%
rename from tests/udp_client.cc
rename to demo/udp_client_demo.cc
index 5f01d0cf..9310ea54 100644
--- a/tests/udp_client.cc
+++ b/demo/udp_client_demo.cc
@@ -19,10 +19,10 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/app-template.hh"
-#include "core/future-util.hh"
-#include "core/reactor.hh"
-#include "net/api.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/net/api.hh>
using namespace seastar;
using namespace net;
diff --git a/tests/udp_server.cc b/demo/udp_server_demo.cc
similarity index 95%
rename from tests/udp_server.cc
rename to demo/udp_server_demo.cc
index 6586577f..76eebd3e 100644
--- a/tests/udp_server.cc
+++ b/demo/udp_server_demo.cc
@@ -19,9 +19,9 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/distributed.hh"
-#include "core/app-template.hh"
-#include "core/future-util.hh"
+#include <seastar/core/distributed.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
using namespace seastar;
using namespace net;
diff --git a/tests/udp_zero_copy.cc b/demo/udp_zero_copy_demo.cc
similarity index 95%
rename from tests/udp_zero_copy.cc
rename to demo/udp_zero_copy_demo.cc
index f4ed0a66..5cf20bff 100644
--- a/tests/udp_zero_copy.cc
+++ b/demo/udp_zero_copy_demo.cc
@@ -19,12 +19,12 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/app-template.hh"
-#include "core/future-util.hh"
-#include "core/scattered_message.hh"
-#include "core/vector-data-sink.hh"
-#include "core/shared_ptr.hh"
-#include "core/units.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/scattered_message.hh>
+#include <seastar/core/vector-data-sink.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/units.hh>
#include <random>
#include <iomanip>
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 00000000..1534f7d3
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,80 @@
+find_program (Seastar_DOXYGEN_EXECUTABLE doxygen)
+find_program (Seastar_PANDOC_EXECUTABLE pandoc)
+
+configure_file (
+ ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+ @ONLY)
+
+configure_file (
+ ${CMAKE_CURRENT_SOURCE_DIR}/DoxygenLayout.xml
+ ${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml
+ COPYONLY)
+
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html
+ DEPENDS
+ seastar
+ ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+ ${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml
+ COMMAND ${Seastar_DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+add_custom_target (doc_html
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/html)
+
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tutorial.html
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.md
+ COMMAND
+ ${Seastar_PANDOC_EXECUTABLE}
+ --self-contained
+ --smart
+ --toc
+ -c ${CMAKE_CURRENT_SOURCE_DIR}/template.css
+ --chapters
+ --number-sections
+ -f markdown_github+pandoc_title_block+implicit_header_references
+ --highlight-style tango
+ ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.md
+ -o ${CMAKE_CURRENT_BINARY_DIR}/tutorial.html)
+
+add_custom_target (doc_tutorial_html
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tutorial.html)
+
+configure_file (
+ ${CMAKE_CURRENT_SOURCE_DIR}/htmlsplit.py
+ ${CMAKE_CURRENT_BINARY_DIR}/htmlsplit.py
+ COPYONLY)
+
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tutorial-split
+ DEPENDS
+ doc_tutorial_html
+ ${CMAKE_CURRENT_BINARY_DIR}/htmlsplit.py
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/tutorial-split
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/htmlsplit.py)
+
+add_custom_target (doc_tutorial_html_split
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tutorial-split)
+
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tutorial.pdf
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.md
+ COMMAND
+ ${Seastar_PANDOC_EXECUTABLE}
+ -f markdown_github+pandoc_title_block+implicit_header_references
+ --highlight-style tango
+ --template=${CMAKE_CURRENT_SOURCE_DIR}/template.tex
+ ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.md
+ -o ${CMAKE_CURRENT_BINARY_DIR}/tutorial.pdf)
+
+add_custom_target (doc_tutorial_pdf
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tutorial.pdf)
+
+# Logical target for all documentation.
+add_custom_target (docs
+ DEPENDS
+ doc_html
+ doc_tutorial_html
+ doc_tutorial_html_split
+ doc_tutorial_pdf)
diff --git a/Doxyfile b/doc/Doxyfile.cmake
similarity index 99%
rename from Doxyfile
rename to doc/Doxyfile.cmake
index 9deb3763..f633a71b 100644
--- a/Doxyfile
+++ b/doc/Doxyfile.cmake
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = build/documentation
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-STRIP_FROM_PATH =
+STRIP_FROM_PATH = @Seastar_SOURCE_DIR@/include @Seastar_BINARY_DIR@/gen
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
@@ -758,7 +758,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT =
+INPUT = @Seastar_SOURCE_DIR@/include @Seastar_BINARY_DIR@/gen
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -793,7 +793,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = build fmt dpdk c-ares tests apps scripts
+EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
diff --git a/DoxygenLayout.xml b/doc/DoxygenLayout.xml
similarity index 100%
rename from DoxygenLayout.xml
rename to doc/DoxygenLayout.xml
diff --git a/doc/building-arch.md b/doc/building-arch.md
index 96ff56a7..51863a51 100644
--- a/doc/building-arch.md
+++ b/doc/building-arch.md
@@ -7,6 +7,6 @@ sudo ./install-dependencies.sh
To compile Seastar use:
```
-./configure.py
-ninja
+./cooking.sh -r dev -i 'c-ares;fmt'
+ninja -C build
```
diff --git a/doc/building-centos.md b/doc/building-centos.md
index a7af58dc..ec351385 100644
--- a/doc/building-centos.md
+++ b/doc/building-centos.md
@@ -5,10 +5,11 @@
Installing required packages:
```
sudo ./install-dependencies.sh
+./cooking.sh -r dev -i 'c-ares;fmt'
```
To compile Seastar explicitly using gcc 5, use:
```
-./configure.py --compiler=/opt/scylladb/bin/g++ --static-stdc++
-ninja-build
+CXX=/opt/scylladb/bin/g++ ./cooking.sh -r dev -i 'c-ares;fmt'
+ninja-build -C build
```
diff --git a/doc/building-fedora.md b/doc/building-fedora.md
index 4ebd4c2a..54f8fb0f 100644
--- a/doc/building-fedora.md
+++ b/doc/building-fedora.md
@@ -9,15 +9,14 @@ sudo ./install-dependencies.sh
You then need to run the following to create the "build.ninja" file:
```
-./configure.py
+./cooking.sh -r dev -i 'c-ares;fmt'
```
Note it is enough to run this once, and you don't need to repeat it before
-every build. build.ninja includes a rule which will automatically re-run
-./configure.py if it changes.
+every build.
Then finally:
```
-ninja-build
+ninja-build -C build
```
In case there are compilation issues, especially like ```g++: internal compiler error: Killed (program cc1plus)``` try giving more memory to gcc, either by limiting the amount of threads ( -j1 ) and/or allowing at least 4g ram to your machine
diff --git a/doc/building-ubuntu.md b/doc/building-ubuntu.md
index 3896289e..01fc146f 100644
--- a/doc/building-ubuntu.md
+++ b/doc/building-ubuntu.md
@@ -9,6 +9,6 @@ sudo ./install-dependencies.sh
To compile Seastar explicitly using gcc 5, use:
```
-./configure.py --compiler=g++-5
-ninja
+CXX=g++-5 ./cooking.sh -r dev -i 'c-ares;fmt'
+ninja -C build
```
diff --git a/doc/htmlsplit.py b/doc/htmlsplit.py
index 6731b82e..1795b84b 100755
--- a/doc/htmlsplit.py
+++ b/doc/htmlsplit.py
@@ -43,7 +43,7 @@ def links(out, chapter):
pass
def flush(chapter, header, chunk):
fn = 'index.html' if chapter == 0 else str(chapter) + '.html'
- with open('split/' + fn, 'w') as out:
+ with open('tutorial-split/' + fn, 'w') as out:
out.write(header)
links(out, chapter)
out.write(chunk)
diff --git a/dpdk b/extern/dpdk
similarity index 100%
rename from dpdk
rename to extern/dpdk
diff --git a/fmt b/fmt
deleted file mode 160000
index f61e71cc..00000000
--- a/fmt
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f61e71ccb9ab253f6d76096b2d958caf38fcccaa
diff --git a/http/request_parser.rl b/gen/http/request_parser.rl
similarity index 97%
rename from http/request_parser.rl
rename to gen/http/request_parser.rl
index 91b522bb..53d91ce1 100644
--- a/http/request_parser.rl
+++ b/gen/http/request_parser.rl
@@ -21,10 +21,10 @@
#pragma once
-#include "core/ragel.hh"
+#include <seastar/core/ragel.hh>
#include <memory>
#include <unordered_map>
-#include "http/request.hh"
+#include <seastar/http/request.hh>
namespace seastar {
diff --git a/http/http_response_parser.rl b/gen/http/response_parser.rl
similarity index 98%
rename from http/http_response_parser.rl
rename to gen/http/response_parser.rl
index 3b109fd0..9bc4af20 100644
--- a/http/http_response_parser.rl
+++ b/gen/http/response_parser.rl
@@ -19,7 +19,7 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "core/ragel.hh"
+#include <seastar/core/ragel.hh>
#include <memory>
#include <unordered_map>
diff --git a/json/json2code.py b/gen/json2code.py
similarity index 99%
rename from json/json2code.py
rename to gen/json2code.py
index fff8821f..e6fc35ce 100755
--- a/json/json2code.py
+++ b/gen/json2code.py
@@ -329,8 +329,9 @@ def create_h_file(data, hfile_name, api_name, init_method, base_api):
else:
hfile = open(config.outdir + "/" + hfile_name, "w")
print_h_file_headers(hfile, api_name)
- add_include(hfile, ['"core/sstring.hh"', '"' + config.jsoninc +
- 'json_elements.hh"', '"http/json_path.hh"'])
+ add_include(hfile, ['<seastar/core/sstring.hh>',
+ '<seastar/json/json_elements.hh>',
+ '<seastar/http/json_path.hh>'])
add_include(hfile, ['<iostream>', '<boost/range/irange.hpp>'])
open_namespace(hfile, "seastar")
diff --git a/proto/metrics2.proto b/gen/proto/metrics2.proto
similarity index 100%
rename from proto/metrics2.proto
rename to gen/proto/metrics2.proto
diff --git a/http/CMakeLists.txt b/http/CMakeLists.txt
deleted file mode 100644
index 72d26077..00000000
--- a/http/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-seastar_ragel_generate (http_response_parser.rl SEASTAR_HTTP_RESPONSE_PARSER_HEADER)
-add_custom_target (seastar-http-response-parser SOURCES ${SEASTAR_HTTP_RESPONSE_PARSER_HEADER})
-
-seastar_ragel_generate (request_parser.rl SEASTAR_HTTP_REQUEST_PARSER_HEADER)
-add_custom_target (seastar-http-request-parser SOURCES ${SEASTAR_HTTP_REQUEST_PARSER_HEADER})
diff --git a/core/abort_source.hh b/include/seastar/core/abort_source.hh
similarity index 98%
rename from core/abort_source.hh
rename to include/seastar/core/abort_source.hh
index e8248b57..90d33d5a 100644
--- a/core/abort_source.hh
+++ b/include/seastar/core/abort_source.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "util/noncopyable_function.hh"
-#include "util/optimized_optional.hh"
+#include <seastar/util/noncopyable_function.hh>
+#include <seastar/util/optimized_optional.hh>
#include <boost/intrusive/list.hpp>
@@ -139,4 +139,4 @@ class abort_source {
/// @}
-}
\ No newline at end of file
+}
diff --git a/core/alien.hh b/include/seastar/core/alien.hh
similarity index 97%
rename from core/alien.hh
rename to include/seastar/core/alien.hh
index b2c41f84..3226eafe 100644
--- a/core/alien.hh
+++ b/include/seastar/core/alien.hh
@@ -29,10 +29,10 @@
#include <boost/lockfree/queue.hpp>
-#include "cacheline.hh"
-#include "sstring.hh"
-#include "metrics_registration.hh"
-#include "reactor.hh"
+#include <seastar/core/cacheline.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/metrics_registration.hh>
+#include <seastar/core/reactor.hh>
/// \file
diff --git a/core/align.hh b/include/seastar/core/align.hh
similarity index 100%
rename from core/align.hh
rename to include/seastar/core/align.hh
diff --git a/core/aligned_buffer.hh b/include/seastar/core/aligned_buffer.hh
similarity index 97%
rename from core/aligned_buffer.hh
rename to include/seastar/core/aligned_buffer.hh
index ad6e0db0..97a68f1f 100644
--- a/core/aligned_buffer.hh
+++ b/include/seastar/core/aligned_buffer.hh
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <memory>
#include <stdexcept>
-#include "print.hh"
+#include <seastar/core/print.hh>
namespace seastar {
diff --git a/core/app-template.hh b/include/seastar/core/app-template.hh
similarity index 97%
rename from core/app-template.hh
rename to include/seastar/core/app-template.hh
index 28310566..3eb0e72a 100644
--- a/core/app-template.hh
+++ b/include/seastar/core/app-template.hh
@@ -24,8 +24,8 @@
#include <boost/program_options.hpp>
#include <boost/optional.hpp>
#include <functional>
-#include <core/future.hh>
-#include <core/sstring.hh>
+#include <seastar/core/future.hh>
+#include <seastar/core/sstring.hh>
#include <chrono>
namespace seastar {
diff --git a/core/apply.hh b/include/seastar/core/apply.hh
similarity index 100%
rename from core/apply.hh
rename to include/seastar/core/apply.hh
diff --git a/core/array_map.hh b/include/seastar/core/array_map.hh
similarity index 100%
rename from core/array_map.hh
rename to include/seastar/core/array_map.hh
diff --git a/core/bitops.hh b/include/seastar/core/bitops.hh
similarity index 100%
rename from core/bitops.hh
rename to include/seastar/core/bitops.hh
diff --git a/core/bitset-iter.hh b/include/seastar/core/bitset-iter.hh
similarity index 100%
rename from core/bitset-iter.hh
rename to include/seastar/core/bitset-iter.hh
diff --git a/core/byteorder.hh b/include/seastar/core/byteorder.hh
similarity index 99%
rename from core/byteorder.hh
rename to include/seastar/core/byteorder.hh
index a3ac3f26..cc10a37c 100644
--- a/core/byteorder.hh
+++ b/include/seastar/core/byteorder.hh
@@ -23,7 +23,7 @@
#include <algorithm>
#include <endian.h>
-#include "unaligned.hh"
+#include <seastar/core/unaligned.hh>
namespace seastar {
diff --git a/core/cacheline.hh b/include/seastar/core/cacheline.hh
similarity index 100%
rename from core/cacheline.hh
rename to include/seastar/core/cacheline.hh
diff --git a/core/checked_ptr.hh b/include/seastar/core/checked_ptr.hh
similarity index 99%
rename from core/checked_ptr.hh
rename to include/seastar/core/checked_ptr.hh
index 701ca0c3..0d290a12 100644
--- a/core/checked_ptr.hh
+++ b/include/seastar/core/checked_ptr.hh
@@ -25,7 +25,7 @@
/// \brief Contains a seastar::checked_ptr class implementation.
#include <exception>
-#include "util/gcc6-concepts.hh"
+#include <seastar/util/gcc6-concepts.hh>
/// \namespace seastar
namespace seastar {
diff --git a/core/chunked_fifo.hh b/include/seastar/core/chunked_fifo.hh
similarity index 100%
rename from core/chunked_fifo.hh
rename to include/seastar/core/chunked_fifo.hh
diff --git a/core/circular_buffer.hh b/include/seastar/core/circular_buffer.hh
similarity index 99%
rename from core/circular_buffer.hh
rename to include/seastar/core/circular_buffer.hh
index 2e515802..8d1d8d4e 100644
--- a/core/circular_buffer.hh
+++ b/include/seastar/core/circular_buffer.hh
@@ -22,8 +22,8 @@
#ifndef CIRCULAR_BUFFER_HH_
#define CIRCULAR_BUFFER_HH_
-#include "transfer.hh"
-#include "bitops.hh"
+#include <seastar/core/transfer.hh>
+#include <seastar/core/bitops.hh>
#include <memory>
#include <algorithm>
diff --git a/core/circular_buffer_fixed_capacity.hh b/include/seastar/core/circular_buffer_fixed_capacity.hh
similarity index 100%
rename from core/circular_buffer_fixed_capacity.hh
rename to include/seastar/core/circular_buffer_fixed_capacity.hh
diff --git a/core/condition-variable.hh b/include/seastar/core/condition-variable.hh
similarity index 98%
rename from core/condition-variable.hh
rename to include/seastar/core/condition-variable.hh
index 9f948d91..bbc7173c 100644
--- a/core/condition-variable.hh
+++ b/include/seastar/core/condition-variable.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "core/future-util.hh"
-#include "core/semaphore.hh"
+#include <seastar/core/future-util.hh>
+#include <seastar/core/semaphore.hh>
namespace seastar {
diff --git a/core/deleter.hh b/include/seastar/core/deleter.hh
similarity index 100%
rename from core/deleter.hh
rename to include/seastar/core/deleter.hh
diff --git a/core/distributed.hh b/include/seastar/core/distributed.hh
similarity index 96%
rename from core/distributed.hh
rename to include/seastar/core/distributed.hh
index 0c4b62f7..c2641f61 100644
--- a/core/distributed.hh
+++ b/include/seastar/core/distributed.hh
@@ -21,7 +21,7 @@
#pragma once
-#include "sharded.hh"
+#include <seastar/core/sharded.hh>
namespace seastar {
diff --git a/core/do_with.hh b/include/seastar/core/do_with.hh
similarity index 98%
rename from core/do_with.hh
rename to include/seastar/core/do_with.hh
index 223dc651..5f6bb670 100644
--- a/core/do_with.hh
+++ b/include/seastar/core/do_with.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "apply.hh"
-#include "future.hh"
+#include <seastar/core/apply.hh>
+#include <seastar/core/future.hh>
#include <utility>
#include <memory>
#include <tuple>
diff --git a/core/dpdk_rte.hh b/include/seastar/core/dpdk_rte.hh
similarity index 100%
rename from core/dpdk_rte.hh
rename to include/seastar/core/dpdk_rte.hh
diff --git a/core/enum.hh b/include/seastar/core/enum.hh
similarity index 100%
rename from core/enum.hh
rename to include/seastar/core/enum.hh
diff --git a/core/exception_hacks.hh b/include/seastar/core/exception_hacks.hh
similarity index 100%
rename from core/exception_hacks.hh
rename to include/seastar/core/exception_hacks.hh
diff --git a/core/execution_stage.hh b/include/seastar/core/execution_stage.hh
similarity index 97%
rename from core/execution_stage.hh
rename to include/seastar/core/execution_stage.hh
index eba024ee..47b11c9e 100644
--- a/core/execution_stage.hh
+++ b/include/seastar/core/execution_stage.hh
@@ -21,18 +21,18 @@
#pragma once
-#include "future.hh"
-#include "chunked_fifo.hh"
-#include "function_traits.hh"
-#include "sstring.hh"
-#include "metrics.hh"
-#include "scheduling.hh"
-#include "util/reference_wrapper.hh"
-#include "util/gcc6-concepts.hh"
-#include "util/noncopyable_function.hh"
-#include "../util/tuple_utils.hh"
-#include "../util/defer.hh"
-#include "../fmt/fmt/format.h"
+#include <seastar/core/future.hh>
+#include <seastar/core/chunked_fifo.hh>
+#include <seastar/core/function_traits.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/metrics.hh>
+#include <seastar/core/scheduling.hh>
+#include <seastar/util/reference_wrapper.hh>
+#include <seastar/util/gcc6-concepts.hh>
+#include <seastar/util/noncopyable_function.hh>
+#include <seastar/util/tuple_utils.hh>
+#include <seastar/util/defer.hh>
+#include <fmt/format.h>
#include <vector>
#include <experimental/optional>
#include <boost/range/irange.hpp>
diff --git a/core/expiring_fifo.hh b/include/seastar/core/expiring_fifo.hh
similarity index 96%
rename from core/expiring_fifo.hh
rename to include/seastar/core/expiring_fifo.hh
index 63fe9625..f37d2944 100644
--- a/core/expiring_fifo.hh
+++ b/include/seastar/core/expiring_fifo.hh
@@ -21,13 +21,13 @@
#pragma once
-#include "future.hh"
-#include "chunked_fifo.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/chunked_fifo.hh>
#include <stdexcept>
#include <exception>
-#include "timer.hh"
-#include "future-util.hh"
-#include "lowres_clock.hh"
+#include <seastar/core/timer.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/lowres_clock.hh>
namespace seastar {
diff --git a/core/fair_queue.hh b/include/seastar/core/fair_queue.hh
similarity index 97%
rename from core/fair_queue.hh
rename to include/seastar/core/fair_queue.hh
index b5bfe4dc..a0c4d344 100644
--- a/core/fair_queue.hh
+++ b/include/seastar/core/fair_queue.hh
@@ -21,12 +21,12 @@
*/
#pragma once
-#include "future.hh"
-#include "semaphore.hh"
-#include "shared_ptr.hh"
-#include "print.hh"
-#include "circular_buffer.hh"
-#include "util/noncopyable_function.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/print.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/util/noncopyable_function.hh>
#include <queue>
#include <type_traits>
#include <experimental/optional>
diff --git a/core/file.hh b/include/seastar/core/file.hh
similarity index 98%
rename from core/file.hh
rename to include/seastar/core/file.hh
index d8e6576c..8a35c6cc 100644
--- a/core/file.hh
+++ b/include/seastar/core/file.hh
@@ -22,12 +22,12 @@
#ifndef FILE_HH_
#define FILE_HH_
-#include "stream.hh"
-#include "sstring.hh"
-#include "core/shared_ptr.hh"
-#include "core/align.hh"
-#include "core/future-util.hh"
-#include "core/fair_queue.hh"
+#include <seastar/core/stream.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/fair_queue.hh>
#include <experimental/optional>
#include <system_error>
#include <sys/stat.h>
diff --git a/core/fsqual.hh b/include/seastar/core/fsqual.hh
similarity index 96%
rename from core/fsqual.hh
rename to include/seastar/core/fsqual.hh
index 5c6ee028..2fca7896 100644
--- a/core/fsqual.hh
+++ b/include/seastar/core/fsqual.hh
@@ -23,7 +23,7 @@
#ifndef CORE_FSQUAL_HH_
#define CORE_FSQUAL_HH_
-#include "sstring.hh"
+#include <seastar/core/sstring.hh>
namespace seastar {
diff --git a/core/fstream.hh b/include/seastar/core/fstream.hh
similarity index 97%
rename from core/fstream.hh
rename to include/seastar/core/fstream.hh
index e92622e9..9a9fdb68 100644
--- a/core/fstream.hh
+++ b/include/seastar/core/fstream.hh
@@ -30,9 +30,9 @@
// interface to files, while retaining the zero-copy characteristics of
// seastar files.
-#include "file.hh"
-#include "iostream.hh"
-#include "shared_ptr.hh"
+#include <seastar/core/file.hh>
+#include <seastar/core/iostream.hh>
+#include <seastar/core/shared_ptr.hh>
namespace seastar {
diff --git a/core/function_traits.hh b/include/seastar/core/function_traits.hh
similarity index 100%
rename from core/function_traits.hh
rename to include/seastar/core/function_traits.hh
diff --git a/core/future-util.hh b/include/seastar/core/future-util.hh
similarity index 99%
rename from core/future-util.hh
rename to include/seastar/core/future-util.hh
index fd35977d..abf208c1 100644
--- a/core/future-util.hh
+++ b/include/seastar/core/future-util.hh
@@ -25,18 +25,18 @@
#ifndef CORE_FUTURE_UTIL_HH_
#define CORE_FUTURE_UTIL_HH_
-#include "task.hh"
-#include "future.hh"
-#include "shared_ptr.hh"
-#include "do_with.hh"
-#include "timer.hh"
-#include "util/bool_class.hh"
+#include <seastar/core/task.hh>
+#include <seastar/core/future.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/timer.hh>
+#include <seastar/util/bool_class.hh>
#include <tuple>
#include <iterator>
#include <vector>
#include <experimental/optional>
-#include "util/tuple_utils.hh"
-#include "util/noncopyable_function.hh"
+#include <seastar/util/tuple_utils.hh>
+#include <seastar/util/noncopyable_function.hh>
namespace seastar {
diff --git a/core/future.hh b/include/seastar/core/future.hh
similarity index 99%
rename from core/future.hh
rename to include/seastar/core/future.hh
index 39b7a1fb..556e4e58 100644
--- a/core/future.hh
+++ b/include/seastar/core/future.hh
@@ -22,19 +22,19 @@
#ifndef FUTURE_HH_
#define FUTURE_HH_
-#include "apply.hh"
-#include "task.hh"
-#include "preempt.hh"
-#include "thread_impl.hh"
+#include <seastar/core/apply.hh>
+#include <seastar/core/task.hh>
+#include <seastar/core/preempt.hh>
+#include <seastar/core/thread_impl.hh>
#include <stdexcept>
#include <atomic>
#include <memory>
#include <type_traits>
#include <assert.h>
#include <cstdlib>
-#include "function_traits.hh"
-#include "util/alloc_failure_injector.hh"
-#include "../util/gcc6-concepts.hh"
+#include <seastar/core/function_traits.hh>
+#include <seastar/util/alloc_failure_injector.hh>
+#include <seastar/util/gcc6-concepts.hh>
namespace seastar {
diff --git a/core/gate.hh b/include/seastar/core/gate.hh
similarity index 99%
rename from core/gate.hh
rename to include/seastar/core/gate.hh
index d3d25e99..a5eafcee 100644
--- a/core/gate.hh
+++ b/include/seastar/core/gate.hh
@@ -21,7 +21,7 @@
#pragma once
-#include "future.hh"
+#include <seastar/core/future.hh>
#include <experimental/optional>
#include <exception>
diff --git a/core/iostream-impl.hh b/include/seastar/core/iostream-impl.hh
similarity index 99%
rename from core/iostream-impl.hh
rename to include/seastar/core/iostream-impl.hh
index 991f71b0..df09ebeb 100644
--- a/core/iostream-impl.hh
+++ b/include/seastar/core/iostream-impl.hh
@@ -23,10 +23,10 @@
#pragma once
-#include "future-util.hh"
-#include "net/packet.hh"
-#include "core/future-util.hh"
-#include "util/variant_utils.hh"
+#include <seastar/core/future-util.hh>
+#include <seastar/net/packet.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/util/variant_utils.hh>
namespace seastar {
diff --git a/core/iostream.hh b/include/seastar/core/iostream.hh
similarity index 99%
rename from core/iostream.hh
rename to include/seastar/core/iostream.hh
index 66565f25..36881839 100644
--- a/core/iostream.hh
+++ b/include/seastar/core/iostream.hh
@@ -35,9 +35,9 @@
#pragma once
-#include "future.hh"
-#include "temporary_buffer.hh"
-#include "scattered_message.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/temporary_buffer.hh>
+#include <seastar/core/scattered_message.hh>
#include <boost/variant.hpp>
diff --git a/core/linux-aio.hh b/include/seastar/core/linux-aio.hh
similarity index 100%
rename from core/linux-aio.hh
rename to include/seastar/core/linux-aio.hh
diff --git a/core/lowres_clock.hh b/include/seastar/core/lowres_clock.hh
similarity index 98%
rename from core/lowres_clock.hh
rename to include/seastar/core/lowres_clock.hh
index 86d0cb17..5061edf8 100644
--- a/core/lowres_clock.hh
+++ b/include/seastar/core/lowres_clock.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "cacheline.hh"
-#include "timer.hh"
+#include <seastar/core/cacheline.hh>
+#include <seastar/core/timer.hh>
#include <cstdint>
diff --git a/core/manual_clock.hh b/include/seastar/core/manual_clock.hh
similarity index 100%
rename from core/manual_clock.hh
rename to include/seastar/core/manual_clock.hh
diff --git a/core/memory.hh b/include/seastar/core/memory.hh
similarity index 99%
rename from core/memory.hh
rename to include/seastar/core/memory.hh
index ec5ec046..1635a044 100644
--- a/core/memory.hh
+++ b/include/seastar/core/memory.hh
@@ -22,8 +22,8 @@
#ifndef MEMORY_HH_
#define MEMORY_HH_
-#include "resource.hh"
-#include "bitops.hh"
+#include <seastar/core/resource.hh>
+#include <seastar/core/bitops.hh>
#include <new>
#include <functional>
#include <vector>
diff --git a/core/metrics.hh b/include/seastar/core/metrics.hh
similarity index 99%
rename from core/metrics.hh
rename to include/seastar/core/metrics.hh
index f8b4ec4c..d609af29 100644
--- a/core/metrics.hh
+++ b/include/seastar/core/metrics.hh
@@ -22,12 +22,12 @@
#pragma once
#include <functional>
-#include "sstring.hh"
-#include "core/shared_ptr.hh"
-#include "core/metrics_registration.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/metrics_registration.hh>
#include <boost/lexical_cast.hpp>
#include <map>
-#include "core/metrics_types.hh"
+#include <seastar/core/metrics_types.hh>
#include <boost/variant.hpp>
/*! \file metrics.hh
diff --git a/core/metrics_api.hh b/include/seastar/core/metrics_api.hh
similarity index 99%
rename from core/metrics_api.hh
rename to include/seastar/core/metrics_api.hh
index 1ffd9165..5b08beb8 100644
--- a/core/metrics_api.hh
+++ b/include/seastar/core/metrics_api.hh
@@ -21,9 +21,9 @@
#pragma once
-#include "metrics.hh"
+#include <seastar/core/metrics.hh>
#include <unordered_map>
-#include "sharded.hh"
+#include <seastar/core/sharded.hh>
#include <boost/functional/hash.hpp>
/*!
* \file metrics_api.hh
diff --git a/core/metrics_registration.hh b/include/seastar/core/metrics_registration.hh
similarity index 100%
rename from core/metrics_registration.hh
rename to include/seastar/core/metrics_registration.hh
diff --git a/core/metrics_types.hh b/include/seastar/core/metrics_types.hh
similarity index 100%
rename from core/metrics_types.hh
rename to include/seastar/core/metrics_types.hh
diff --git a/core/pipe.hh b/include/seastar/core/pipe.hh
similarity index 99%
rename from core/pipe.hh
rename to include/seastar/core/pipe.hh
index 606916e1..e3e6abe6 100644
--- a/core/pipe.hh
+++ b/include/seastar/core/pipe.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "future.hh"
-#include "queue.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/queue.hh>
#include <experimental/optional>
diff --git a/core/posix.hh b/include/seastar/core/posix.hh
similarity index 99%
rename from core/posix.hh
rename to include/seastar/core/posix.hh
index ddec0208..6dd6f06c 100644
--- a/core/posix.hh
+++ b/include/seastar/core/posix.hh
@@ -22,7 +22,7 @@
#ifndef FILE_DESC_HH_
#define FILE_DESC_HH_
-#include "sstring.hh"
+#include <seastar/core/sstring.hh>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -44,7 +44,7 @@
#include <chrono>
#include <sys/uio.h>
-#include "net/socket_defs.hh"
+#include <seastar/net/socket_defs.hh>
namespace seastar {
diff --git a/core/preempt.hh b/include/seastar/core/preempt.hh
similarity index 100%
rename from core/preempt.hh
rename to include/seastar/core/preempt.hh
diff --git a/core/prefetch.hh b/include/seastar/core/prefetch.hh
similarity index 98%
rename from core/prefetch.hh
rename to include/seastar/core/prefetch.hh
index fd9ff6a5..1465d0a8 100644
--- a/core/prefetch.hh
+++ b/include/seastar/core/prefetch.hh
@@ -25,8 +25,8 @@
#include <atomic>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/for_each.hpp>
-#include "align.hh"
-#include "cacheline.hh"
+#include <seastar/core/align.hh>
+#include <seastar/core/cacheline.hh>
namespace seastar {
diff --git a/core/print.hh b/include/seastar/core/print.hh
similarity index 99%
rename from core/print.hh
rename to include/seastar/core/print.hh
index b2536bba..73bd5445 100644
--- a/core/print.hh
+++ b/include/seastar/core/print.hh
@@ -28,7 +28,7 @@
#include <iomanip>
#include <chrono>
#include <sstream>
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#if 0
inline
diff --git a/core/prometheus.hh b/include/seastar/core/prometheus.hh
similarity index 97%
rename from core/prometheus.hh
rename to include/seastar/core/prometheus.hh
index f17eb3e4..f9a50353 100644
--- a/core/prometheus.hh
+++ b/include/seastar/core/prometheus.hh
@@ -21,7 +21,7 @@
#pragma once
-#include "http/httpd.hh"
+#include <seastar/http/httpd.hh>
namespace seastar {
diff --git a/core/queue.hh b/include/seastar/core/queue.hh
similarity index 98%
rename from core/queue.hh
rename to include/seastar/core/queue.hh
index 438d3237..83b55568 100644
--- a/core/queue.hh
+++ b/include/seastar/core/queue.hh
@@ -22,8 +22,8 @@
#ifndef QUEUE_HH_
#define QUEUE_HH_
-#include "circular_buffer.hh"
-#include "future.hh"
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/future.hh>
#include <queue>
#include <experimental/optional>
diff --git a/core/ragel.hh b/include/seastar/core/ragel.hh
similarity index 96%
rename from core/ragel.hh
rename to include/seastar/core/ragel.hh
index 7a7ed801..468f1efb 100644
--- a/core/ragel.hh
+++ b/include/seastar/core/ragel.hh
@@ -22,14 +22,14 @@
#ifndef RAGEL_HH_
#define RAGEL_HH_
-#include "sstring.hh"
-#include "temporary_buffer.hh"
-#include "util/eclipse.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/temporary_buffer.hh>
+#include <seastar/util/eclipse.hh>
#include <algorithm>
#include <memory>
#include <cassert>
#include <experimental/optional>
-#include "future.hh"
+#include <seastar/core/future.hh>
namespace seastar {
diff --git a/core/reactor.hh b/include/seastar/core/reactor.hh
similarity index 98%
rename from core/reactor.hh
rename to include/seastar/core/reactor.hh
index d6dd56bc..23ce0aba 100644
--- a/core/reactor.hh
+++ b/include/seastar/core/reactor.hh
@@ -22,11 +22,11 @@
#ifndef REACTOR_HH_
#define REACTOR_HH_
-#include "seastar.hh"
-#include "iostream.hh"
-#include "aligned_buffer.hh"
-#include "cacheline.hh"
-#include "circular_buffer_fixed_capacity.hh"
+#include <seastar/core/seastar.hh>
+#include <seastar/core/iostream.hh>
+#include <seastar/core/aligned_buffer.hh>
+#include <seastar/core/cacheline.hh>
+#include <seastar/core/circular_buffer_fixed_capacity.hh>
#include <memory>
#include <type_traits>
#include <sys/epoll.h>
@@ -55,30 +55,30 @@
#include <boost/thread/barrier.hpp>
#include <boost/container/static_vector.hpp>
#include <set>
-#include "linux-aio.hh"
-#include "util/eclipse.hh"
-#include "future.hh"
-#include "posix.hh"
-#include "apply.hh"
-#include "sstring.hh"
-#include "net/api.hh"
-#include "temporary_buffer.hh"
-#include "circular_buffer.hh"
-#include "file.hh"
-#include "semaphore.hh"
-#include "fair_queue.hh"
-#include "core/scattered_message.hh"
-#include "core/enum.hh"
-#include "core/memory.hh"
-#include "core/thread_cputime_clock.hh"
+#include <seastar/core/linux-aio.hh>
+#include <seastar/util/eclipse.hh>
+#include <seastar/core/future.hh>
+#include <seastar/core/posix.hh>
+#include <seastar/core/apply.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/net/api.hh>
+#include <seastar/core/temporary_buffer.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/file.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/fair_queue.hh>
+#include <seastar/core/scattered_message.hh>
+#include <seastar/core/enum.hh>
+#include <seastar/core/memory.hh>
+#include <seastar/core/thread_cputime_clock.hh>
#include <boost/range/irange.hpp>
-#include "timer.hh"
-#include "condition-variable.hh"
-#include "util/log.hh"
-#include "lowres_clock.hh"
-#include "manual_clock.hh"
-#include "core/metrics_registration.hh"
-#include "scheduling.hh"
+#include <seastar/core/timer.hh>
+#include <seastar/core/condition-variable.hh>
+#include <seastar/util/log.hh>
+#include <seastar/core/lowres_clock.hh>
+#include <seastar/core/manual_clock.hh>
+#include <seastar/core/metrics_registration.hh>
+#include <seastar/core/scheduling.hh>
#ifdef HAVE_OSV
#include <osv/sched.hh>
diff --git a/core/report_exception.hh b/include/seastar/core/report_exception.hh
similarity index 100%
rename from core/report_exception.hh
rename to include/seastar/core/report_exception.hh
diff --git a/core/resource.hh b/include/seastar/core/resource.hh
similarity index 100%
rename from core/resource.hh
rename to include/seastar/core/resource.hh
diff --git a/core/rwlock.hh b/include/seastar/core/rwlock.hh
similarity index 99%
rename from core/rwlock.hh
rename to include/seastar/core/rwlock.hh
index cc475e11..24a3f0a4 100644
--- a/core/rwlock.hh
+++ b/include/seastar/core/rwlock.hh
@@ -22,7 +22,7 @@
#ifndef CORE_RWLOCK_HH_
#define CORE_RWLOCK_HH_
-#include "semaphore.hh"
+#include <seastar/core/semaphore.hh>
namespace seastar {
diff --git a/core/scattered_message.hh b/include/seastar/core/scattered_message.hh
similarity index 95%
rename from core/scattered_message.hh
rename to include/seastar/core/scattered_message.hh
index 109f3993..abcc35fd 100644
--- a/core/scattered_message.hh
+++ b/include/seastar/core/scattered_message.hh
@@ -22,10 +22,10 @@
#ifndef SCATTERED_MESSAGE_HH
#define SCATTERED_MESSAGE_HH
-#include "core/deleter.hh"
-#include "core/temporary_buffer.hh"
-#include "net/packet.hh"
-#include "sstring.hh"
+#include <seastar/core/deleter.hh>
+#include <seastar/core/temporary_buffer.hh>
+#include <seastar/net/packet.hh>
+#include <seastar/core/sstring.hh>
#include <memory>
#include <vector>
#include <experimental/string_view>
diff --git a/core/scheduling.hh b/include/seastar/core/scheduling.hh
similarity index 99%
rename from core/scheduling.hh
rename to include/seastar/core/scheduling.hh
index a7fd5fca..6a8f2b6b 100644
--- a/core/scheduling.hh
+++ b/include/seastar/core/scheduling.hh
@@ -21,7 +21,7 @@
#pragma once
-#include "sstring.hh"
+#include <seastar/core/sstring.hh>
/// \file
diff --git a/core/scollectd.hh b/include/seastar/core/scollectd.hh
similarity index 99%
rename from core/scollectd.hh
rename to include/seastar/core/scollectd.hh
index e541d5b9..381f3ba4 100644
--- a/core/scollectd.hh
+++ b/include/seastar/core/scollectd.hh
@@ -34,14 +34,14 @@
#include <chrono>
#include <boost/program_options.hpp>
-#include "future.hh"
-#include "net/byteorder.hh"
-#include "core/shared_ptr.hh"
-#include "core/sstring.hh"
-#include "core/print.hh"
-#include "util/log.hh"
-
-#include "core/metrics_api.hh"
+#include <seastar/core/future.hh>
+#include <seastar/net/byteorder.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/print.hh>
+#include <seastar/util/log.hh>
+
+#include <seastar/core/metrics_api.hh>
namespace seastar {
diff --git a/core/scollectd_api.hh b/include/seastar/core/scollectd_api.hh
similarity index 91%
rename from core/scollectd_api.hh
rename to include/seastar/core/scollectd_api.hh
index 9baf7463..e57916e2 100644
--- a/core/scollectd_api.hh
+++ b/include/seastar/core/scollectd_api.hh
@@ -5,8 +5,8 @@
#ifndef CORE_SCOLLECTD_API_HH_
#define CORE_SCOLLECTD_API_HH_
-#include "core/scollectd.hh"
-#include "core/metrics_api.hh"
+#include <seastar/core/scollectd.hh>
+#include <seastar/core/metrics_api.hh>
namespace seastar {
diff --git a/core/seastar.hh b/include/seastar/core/seastar.hh
similarity index 99%
rename from core/seastar.hh
rename to include/seastar/core/seastar.hh
index 241dd214..7afbac95 100644
--- a/core/seastar.hh
+++ b/include/seastar/core/seastar.hh
@@ -41,8 +41,8 @@
/// continuations, also known as fibers
/// - \ref thread-module Support for traditional threaded execution
-#include "sstring.hh"
-#include "future.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/future.hh>
namespace seastar {
diff --git a/core/semaphore.hh b/include/seastar/core/semaphore.hh
similarity index 99%
rename from core/semaphore.hh
rename to include/seastar/core/semaphore.hh
index 44f7c213..ef793cd7 100644
--- a/core/semaphore.hh
+++ b/include/seastar/core/semaphore.hh
@@ -22,12 +22,12 @@
#ifndef CORE_SEMAPHORE_HH_
#define CORE_SEMAPHORE_HH_
-#include "future.hh"
-#include "chunked_fifo.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/chunked_fifo.hh>
#include <stdexcept>
#include <exception>
-#include "timer.hh"
-#include "expiring_fifo.hh"
+#include <seastar/core/timer.hh>
+#include <seastar/core/expiring_fifo.hh>
namespace seastar {
diff --git a/core/sharded.hh b/include/seastar/core/sharded.hh
similarity index 99%
rename from core/sharded.hh
rename to include/seastar/core/sharded.hh
index 542321ed..8c0bcac8 100644
--- a/core/sharded.hh
+++ b/include/seastar/core/sharded.hh
@@ -21,10 +21,10 @@
#pragma once
-#include "reactor.hh"
-#include "future-util.hh"
-#include "util/is_smart_ptr.hh"
-#include "do_with.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/util/is_smart_ptr.hh>
+#include <seastar/core/do_with.hh>
#include <boost/iterator/counting_iterator.hpp>
namespace seastar {
diff --git a/core/shared_future.hh b/include/seastar/core/shared_future.hh
similarity index 99%
rename from core/shared_future.hh
rename to include/seastar/core/shared_future.hh
index 1ce252b4..434e3bd7 100644
--- a/core/shared_future.hh
+++ b/include/seastar/core/shared_future.hh
@@ -22,8 +22,8 @@
#pragma once
-#include "future.hh"
-#include "expiring_fifo.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/expiring_fifo.hh>
/// \addtogroup future-module
/// @{
diff --git a/core/shared_mutex.hh b/include/seastar/core/shared_mutex.hh
similarity index 98%
rename from core/shared_mutex.hh
rename to include/seastar/core/shared_mutex.hh
index 5b57e415..b6ab6f02 100644
--- a/core/shared_mutex.hh
+++ b/include/seastar/core/shared_mutex.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "future.hh"
-#include "circular_buffer.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/circular_buffer.hh>
namespace seastar {
diff --git a/core/shared_ptr.hh b/include/seastar/core/shared_ptr.hh
similarity index 99%
rename from core/shared_ptr.hh
rename to include/seastar/core/shared_ptr.hh
index baa83896..2dfdea00 100644
--- a/core/shared_ptr.hh
+++ b/include/seastar/core/shared_ptr.hh
@@ -22,13 +22,13 @@
#ifndef SHARED_PTR_HH_
#define SHARED_PTR_HH_
-#include "shared_ptr_debug_helper.hh"
+#include <seastar/core/shared_ptr_debug_helper.hh>
#include <utility>
#include <type_traits>
#include <functional>
#include <iostream>
-#include "util/is_smart_ptr.hh"
-#include "util/indirect.hh"
+#include <seastar/util/is_smart_ptr.hh>
+#include <seastar/util/indirect.hh>
#include <boost/intrusive/parent_from_member.hpp>
diff --git a/core/shared_ptr_debug_helper.hh b/include/seastar/core/shared_ptr_debug_helper.hh
similarity index 100%
rename from core/shared_ptr_debug_helper.hh
rename to include/seastar/core/shared_ptr_debug_helper.hh
diff --git a/core/shared_ptr_incomplete.hh b/include/seastar/core/shared_ptr_incomplete.hh
similarity index 96%
rename from core/shared_ptr_incomplete.hh
rename to include/seastar/core/shared_ptr_incomplete.hh
index 270c6bf9..022c3611 100644
--- a/core/shared_ptr_incomplete.hh
+++ b/include/seastar/core/shared_ptr_incomplete.hh
@@ -21,7 +21,7 @@
#pragma once
-#include "shared_ptr.hh"
+#include <seastar/core/shared_ptr.hh>
/// \file Include this header files when using \c lw_shared_ptr<some_incomplete_type>, at the point
diff --git a/core/simple-stream.hh b/include/seastar/core/simple-stream.hh
similarity index 99%
rename from core/simple-stream.hh
rename to include/seastar/core/simple-stream.hh
index 939f3732..b5dd9b61 100644
--- a/core/simple-stream.hh
+++ b/include/seastar/core/simple-stream.hh
@@ -20,7 +20,7 @@
*/
#pragma once
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
namespace seastar {
diff --git a/core/slab.hh b/include/seastar/core/slab.hh
similarity index 99%
rename from core/slab.hh
rename to include/seastar/core/slab.hh
index d9afdfed..4c7c9aca 100644
--- a/core/slab.hh
+++ b/include/seastar/core/slab.hh
@@ -30,9 +30,9 @@
#include <memory>
#include <vector>
#include <algorithm>
-#include "core/metrics.hh"
-#include "core/align.hh"
-#include "core/memory.hh"
+#include <seastar/core/metrics.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/memory.hh>
namespace seastar {
diff --git a/core/sleep.hh b/include/seastar/core/sleep.hh
similarity index 94%
rename from core/sleep.hh
rename to include/seastar/core/sleep.hh
index f7330453..ec1481dd 100644
--- a/core/sleep.hh
+++ b/include/seastar/core/sleep.hh
@@ -25,11 +25,11 @@
#include <chrono>
#include <functional>
-#include "core/abort_source.hh"
-#include "core/future.hh"
-#include "core/lowres_clock.hh"
-#include "core/reactor.hh"
-#include "core/shared_ptr.hh"
+#include <seastar/core/abort_source.hh>
+#include <seastar/core/future.hh>
+#include <seastar/core/lowres_clock.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/shared_ptr.hh>
namespace seastar {
@@ -91,4 +91,4 @@ future<> sleep_abortable(typename Clock::duration dur, abort_source& as);
extern template future<> sleep_abortable<steady_clock_type>(typename steady_clock_type::duration, abort_source&);
extern template future<> sleep_abortable<lowres_clock>(typename lowres_clock::duration, abort_source&);
-}
\ No newline at end of file
+}
diff --git a/core/sstring.hh b/include/seastar/core/sstring.hh
similarity index 99%
rename from core/sstring.hh
rename to include/seastar/core/sstring.hh
index fdd2dacd..7f40fd3c 100644
--- a/core/sstring.hh
+++ b/include/seastar/core/sstring.hh
@@ -35,7 +35,7 @@
#include <cstdio>
#include <type_traits>
#include <experimental/string_view>
-#include "core/temporary_buffer.hh"
+#include <seastar/core/temporary_buffer.hh>
namespace seastar {
diff --git a/core/stall_sampler.hh b/include/seastar/core/stall_sampler.hh
similarity index 94%
rename from core/stall_sampler.hh
rename to include/seastar/core/stall_sampler.hh
index f14cb1ad..424c170f 100644
--- a/core/stall_sampler.hh
+++ b/include/seastar/core/stall_sampler.hh
@@ -22,8 +22,8 @@
#pragma once
-#include "core/future.hh"
-#include "util/noncopyable_function.hh"
+#include <seastar/core/future.hh>
+#include <seastar/util/noncopyable_function.hh>
#include <chrono>
#include <iosfwd>
diff --git a/core/stream.hh b/include/seastar/core/stream.hh
similarity index 99%
rename from core/stream.hh
rename to include/seastar/core/stream.hh
index a7f26122..a00669e3 100644
--- a/core/stream.hh
+++ b/include/seastar/core/stream.hh
@@ -22,7 +22,7 @@
#ifndef STREAM_HH_
#define STREAM_HH_
-#include "future.hh"
+#include <seastar/core/future.hh>
#include <exception>
#include <functional>
#include <cassert>
diff --git a/core/systemwide_memory_barrier.hh b/include/seastar/core/systemwide_memory_barrier.hh
similarity index 100%
rename from core/systemwide_memory_barrier.hh
rename to include/seastar/core/systemwide_memory_barrier.hh
diff --git a/core/task.hh b/include/seastar/core/task.hh
similarity index 98%
rename from core/task.hh
rename to include/seastar/core/task.hh
index 16a148f0..5754796b 100644
--- a/core/task.hh
+++ b/include/seastar/core/task.hh
@@ -22,7 +22,7 @@
#pragma once
#include <memory>
-#include "scheduling.hh"
+#include <seastar/core/scheduling.hh>
namespace seastar {
diff --git a/core/temporary_buffer.hh b/include/seastar/core/temporary_buffer.hh
similarity index 99%
rename from core/temporary_buffer.hh
rename to include/seastar/core/temporary_buffer.hh
index 0bbd4b4e..969a9c42 100644
--- a/core/temporary_buffer.hh
+++ b/include/seastar/core/temporary_buffer.hh
@@ -22,8 +22,8 @@
#ifndef TEMPORARY_BUFFER_HH_
#define TEMPORARY_BUFFER_HH_
-#include "deleter.hh"
-#include "util/eclipse.hh"
+#include <seastar/core/deleter.hh>
+#include <seastar/util/eclipse.hh>
#include <malloc.h>
#include <algorithm>
diff --git a/core/thread.hh b/include/seastar/core/thread.hh
similarity index 98%
rename from core/thread.hh
rename to include/seastar/core/thread.hh
index 3d163d43..f0a4b58e 100644
--- a/core/thread.hh
+++ b/include/seastar/core/thread.hh
@@ -22,13 +22,13 @@
#pragma once
-#include "thread_impl.hh"
-#include "future.hh"
-#include "do_with.hh"
-#include "future-util.hh"
-#include "timer.hh"
-#include "reactor.hh"
-#include "scheduling.hh"
+#include <seastar/core/thread_impl.hh>
+#include <seastar/core/future.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/timer.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/scheduling.hh>
#include <memory>
#include <setjmp.h>
#include <type_traits>
diff --git a/core/thread_cputime_clock.hh b/include/seastar/core/thread_cputime_clock.hh
similarity index 100%
rename from core/thread_cputime_clock.hh
rename to include/seastar/core/thread_cputime_clock.hh
diff --git a/core/thread_impl.hh b/include/seastar/core/thread_impl.hh
similarity index 98%
rename from core/thread_impl.hh
rename to include/seastar/core/thread_impl.hh
index ecd66253..67efc063 100644
--- a/core/thread_impl.hh
+++ b/include/seastar/core/thread_impl.hh
@@ -21,7 +21,7 @@
*/
#pragma once
-#include "preempt.hh"
+#include <seastar/core/preempt.hh>
#include <setjmp.h>
#include <ucontext.h>
#include <chrono>
diff --git a/core/timer-set.hh b/include/seastar/core/timer-set.hh
similarity index 99%
rename from core/timer-set.hh
rename to include/seastar/core/timer-set.hh
index 3a6ac45c..0a7c35ee 100644
--- a/core/timer-set.hh
+++ b/include/seastar/core/timer-set.hh
@@ -19,7 +19,7 @@
#include <bitset>
#include <array>
#include <boost/intrusive/list.hpp>
-#include "bitset-iter.hh"
+#include <seastar/core/bitset-iter.hh>
namespace seastar {
diff --git a/core/timer.hh b/include/seastar/core/timer.hh
similarity index 97%
rename from core/timer.hh
rename to include/seastar/core/timer.hh
index 3fdb180b..90c7bb89 100644
--- a/core/timer.hh
+++ b/include/seastar/core/timer.hh
@@ -25,8 +25,8 @@
#include <experimental/optional>
#include <atomic>
#include <functional>
-#include "future.hh"
-#include "timer-set.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/timer-set.hh>
namespace seastar {
diff --git a/core/transfer.hh b/include/seastar/core/transfer.hh
similarity index 100%
rename from core/transfer.hh
rename to include/seastar/core/transfer.hh
diff --git a/core/unaligned.hh b/include/seastar/core/unaligned.hh
similarity index 100%
rename from core/unaligned.hh
rename to include/seastar/core/unaligned.hh
diff --git a/core/units.hh b/include/seastar/core/units.hh
similarity index 100%
rename from core/units.hh
rename to include/seastar/core/units.hh
diff --git a/core/vector-data-sink.hh b/include/seastar/core/vector-data-sink.hh
similarity index 97%
rename from core/vector-data-sink.hh
rename to include/seastar/core/vector-data-sink.hh
index 76cb46c6..9d94a50b 100644
--- a/core/vector-data-sink.hh
+++ b/include/seastar/core/vector-data-sink.hh
@@ -22,7 +22,7 @@
#ifndef VECTOR_DATA_SINK_HH_
#define VECTOR_DATA_SINK_HH_
-#include "core/reactor.hh"
+#include <seastar/core/reactor.hh>
namespace seastar {
diff --git a/core/vla.hh b/include/seastar/core/vla.hh
similarity index 98%
rename from core/vla.hh
rename to include/seastar/core/vla.hh
index 11a569b6..665a8b4c 100644
--- a/core/vla.hh
+++ b/include/seastar/core/vla.hh
@@ -26,7 +26,7 @@
#include <new>
#include <assert.h>
#include <type_traits>
-#include <core/reactor.hh>
+#include <seastar/core/reactor.hh>
namespace seastar {
diff --git a/core/weak_ptr.hh b/include/seastar/core/weak_ptr.hh
similarity index 100%
rename from core/weak_ptr.hh
rename to include/seastar/core/weak_ptr.hh
diff --git a/http/api_docs.hh b/include/seastar/http/api_docs.hh
similarity index 97%
rename from http/api_docs.hh
rename to include/seastar/http/api_docs.hh
index 5a69a735..8cda2972 100644
--- a/http/api_docs.hh
+++ b/include/seastar/http/api_docs.hh
@@ -21,12 +21,12 @@
#ifndef API_DOCS_HH_
#define API_DOCS_HH_
-#include "json/json_elements.hh"
-#include "json/formatter.hh"
-#include "routes.hh"
-#include "transformers.hh"
+#include <seastar/json/json_elements.hh>
+#include <seastar/json/formatter.hh>
+#include <seastar/http/routes.hh>
+#include <seastar/http/transformers.hh>
#include <string>
-#include "util/noncopyable_function.hh"
+#include <seastar/util/noncopyable_function.hh>
namespace seastar {
diff --git a/http/common.hh b/include/seastar/http/common.hh
similarity index 98%
rename from http/common.hh
rename to include/seastar/http/common.hh
index d78db8cd..ef62620b 100644
--- a/http/common.hh
+++ b/include/seastar/http/common.hh
@@ -23,7 +23,7 @@
#define COMMON_HH_
#include <unordered_map>
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
namespace seastar {
diff --git a/http/exception.hh b/include/seastar/http/exception.hh
similarity index 98%
rename from http/exception.hh
rename to include/seastar/http/exception.hh
index 66410af7..f280161a 100644
--- a/http/exception.hh
+++ b/include/seastar/http/exception.hh
@@ -22,8 +22,8 @@
#ifndef EXCEPTION_HH_
#define EXCEPTION_HH_
-#include "reply.hh"
-#include "json/json_elements.hh"
+#include <seastar/http/reply.hh>
+#include <seastar/json/json_elements.hh>
namespace seastar {
diff --git a/http/file_handler.hh b/include/seastar/http/file_handler.hh
similarity index 98%
rename from http/file_handler.hh
rename to include/seastar/http/file_handler.hh
index b901bb30..7587deb8 100644
--- a/http/file_handler.hh
+++ b/include/seastar/http/file_handler.hh
@@ -22,8 +22,8 @@
#ifndef HTTP_FILE_HANDLER_HH_
#define HTTP_FILE_HANDLER_HH_
-#include "handlers.hh"
-#include "core/iostream.hh"
+#include <seastar/http/handlers.hh>
+#include <seastar/core/iostream.hh>
namespace seastar {
diff --git a/http/function_handlers.hh b/include/seastar/http/function_handlers.hh
similarity index 98%
rename from http/function_handlers.hh
rename to include/seastar/http/function_handlers.hh
index fc133a44..01fb5e14 100644
--- a/http/function_handlers.hh
+++ b/include/seastar/http/function_handlers.hh
@@ -21,9 +21,9 @@
#pragma once
-#include "handlers.hh"
+#include <seastar/http/handlers.hh>
#include <functional>
-#include "json/json_elements.hh"
+#include <seastar/json/json_elements.hh>
namespace seastar {
diff --git a/http/handlers.hh b/include/seastar/http/handlers.hh
similarity index 93%
rename from http/handlers.hh
rename to include/seastar/http/handlers.hh
index 269aff34..7d3a1e29 100644
--- a/http/handlers.hh
+++ b/include/seastar/http/handlers.hh
@@ -22,10 +22,10 @@
#ifndef HANDLERS_HH_
#define HANDLERS_HH_
-#include "request.hh"
-#include "common.hh"
-#include "reply.hh"
-#include "core/future-util.hh"
+#include <seastar/http/request.hh>
+#include <seastar/http/common.hh>
+#include <seastar/http/reply.hh>
+#include <seastar/core/future-util.hh>
#include <unordered_map>
diff --git a/http/httpd.hh b/include/seastar/http/httpd.hh
similarity index 96%
rename from http/httpd.hh
rename to include/seastar/http/httpd.hh
index 3e699019..470c4dc2 100644
--- a/http/httpd.hh
+++ b/include/seastar/http/httpd.hh
@@ -22,17 +22,17 @@
#ifndef APPS_HTTPD_HTTPD_HH_
#define APPS_HTTPD_HTTPD_HH_
-#include "http/request_parser.hh"
-#include "http/request.hh"
-#include "core/reactor.hh"
-#include "core/sstring.hh"
+#include <seastar/http/request_parser.hh>
+#include <seastar/http/request.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/sstring.hh>
#include <experimental/string_view>
-#include "core/app-template.hh"
-#include "core/circular_buffer.hh"
-#include "core/distributed.hh"
-#include "core/queue.hh"
-#include "core/future-util.hh"
-#include "core/metrics_registration.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/distributed.hh>
+#include <seastar/core/queue.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/metrics_registration.hh>
#include <iostream>
#include <algorithm>
#include <unordered_map>
@@ -42,7 +42,7 @@
#include <cctype>
#include <vector>
#include <boost/intrusive/list.hpp>
-#include "http/routes.hh"
+#include <seastar/http/routes.hh>
namespace seastar {
diff --git a/http/json_path.hh b/include/seastar/http/json_path.hh
similarity index 97%
rename from http/json_path.hh
rename to include/seastar/http/json_path.hh
index 6f81a62c..0acb0d71 100644
--- a/http/json_path.hh
+++ b/include/seastar/http/json_path.hh
@@ -25,10 +25,10 @@
#include <vector>
#include <unordered_map>
#include <tuple>
-#include "common.hh"
-#include "core/sstring.hh"
-#include "routes.hh"
-#include "function_handlers.hh"
+#include <seastar/http/common.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/http/routes.hh>
+#include <seastar/http/function_handlers.hh>
namespace seastar {
diff --git a/http/matcher.hh b/include/seastar/http/matcher.hh
similarity index 97%
rename from http/matcher.hh
rename to include/seastar/http/matcher.hh
index a990949b..10b5e1f0 100644
--- a/http/matcher.hh
+++ b/include/seastar/http/matcher.hh
@@ -22,9 +22,9 @@
#ifndef MATCHER_HH_
#define MATCHER_HH_
-#include "common.hh"
+#include <seastar/http/common.hh>
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
namespace seastar {
diff --git a/http/matchrules.hh b/include/seastar/http/matchrules.hh
similarity index 95%
rename from http/matchrules.hh
rename to include/seastar/http/matchrules.hh
index 30245f4d..7dfdd92f 100644
--- a/http/matchrules.hh
+++ b/include/seastar/http/matchrules.hh
@@ -22,11 +22,11 @@
#ifndef MATCH_RULES_HH_
#define MATCH_RULES_HH_
-#include "handlers.hh"
-#include "matcher.hh"
-#include "common.hh"
+#include <seastar/http/handlers.hh>
+#include <seastar/http/matcher.hh>
+#include <seastar/http/common.hh>
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#include <vector>
namespace seastar {
diff --git a/http/mime_types.hh b/include/seastar/http/mime_types.hh
similarity index 95%
rename from http/mime_types.hh
rename to include/seastar/http/mime_types.hh
index 02ce81e4..3293b199 100644
--- a/http/mime_types.hh
+++ b/include/seastar/http/mime_types.hh
@@ -11,7 +11,7 @@
#ifndef HTTP_MIME_TYPES_HH
#define HTTP_MIME_TYPES_HH
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
namespace seastar {
diff --git a/http/reply.hh b/include/seastar/http/reply.hh
similarity index 96%
rename from http/reply.hh
rename to include/seastar/http/reply.hh
index bc60d6ef..bee1d929 100644
--- a/http/reply.hh
+++ b/include/seastar/http/reply.hh
@@ -31,12 +31,12 @@
//
#pragma once
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#include <unordered_map>
-#include "http/mime_types.hh"
-#include "core/future-util.hh"
-#include "core/iostream.hh"
-#include "util/noncopyable_function.hh"
+#include <seastar/http/mime_types.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/iostream.hh>
+#include <seastar/util/noncopyable_function.hh>
namespace seastar {
diff --git a/http/request.hh b/include/seastar/http/request.hh
similarity index 97%
rename from http/request.hh
rename to include/seastar/http/request.hh
index cef7111b..189757d0 100644
--- a/http/request.hh
+++ b/include/seastar/http/request.hh
@@ -31,11 +31,11 @@
#ifndef HTTP_REQUEST_HPP
#define HTTP_REQUEST_HPP
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#include <string>
#include <vector>
#include <strings.h>
-#include "common.hh"
+#include <seastar/http/common.hh>
namespace seastar {
diff --git a/http/routes.hh b/include/seastar/http/routes.hh
similarity index 97%
rename from http/routes.hh
rename to include/seastar/http/routes.hh
index a0d9e126..3d2182d6 100644
--- a/http/routes.hh
+++ b/include/seastar/http/routes.hh
@@ -22,15 +22,15 @@
#ifndef ROUTES_HH_
#define ROUTES_HH_
-#include "matchrules.hh"
-#include "handlers.hh"
-#include "common.hh"
-#include "reply.hh"
+#include <seastar/http/matchrules.hh>
+#include <seastar/http/handlers.hh>
+#include <seastar/http/common.hh>
+#include <seastar/http/reply.hh>
#include <boost/program_options/variables_map.hpp>
#include <unordered_map>
#include <vector>
-#include "core/future-util.hh"
+#include <seastar/core/future-util.hh>
namespace seastar {
diff --git a/http/transformers.hh b/include/seastar/http/transformers.hh
similarity index 95%
rename from http/transformers.hh
rename to include/seastar/http/transformers.hh
index 95e42892..356f6db9 100644
--- a/http/transformers.hh
+++ b/include/seastar/http/transformers.hh
@@ -22,8 +22,8 @@
#ifndef TRANSFORMERS_HH_
#define TRANSFORMERS_HH_
-#include "handlers.hh"
-#include "file_handler.hh"
+#include <seastar/http/handlers.hh>
+#include <seastar/http/file_handler.hh>
namespace seastar {
diff --git a/json/formatter.hh b/include/seastar/json/formatter.hh
similarity index 99%
rename from json/formatter.hh
rename to include/seastar/json/formatter.hh
index 4747b3f7..01d59855 100644
--- a/json/formatter.hh
+++ b/include/seastar/json/formatter.hh
@@ -28,8 +28,8 @@
#include <map>
#include <time.h>
#include <sstream>
-#include "core/sstring.hh"
-#include "core/iostream.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/iostream.hh>
namespace seastar {
diff --git a/json/json_elements.hh b/include/seastar/json/json_elements.hh
similarity index 98%
rename from json/json_elements.hh
rename to include/seastar/json/json_elements.hh
index a8a33aff..9cdf0ab6 100644
--- a/json/json_elements.hh
+++ b/include/seastar/json/json_elements.hh
@@ -26,9 +26,9 @@
#include <vector>
#include <time.h>
#include <sstream>
-#include "formatter.hh"
-#include "core/sstring.hh"
-#include "core/iostream.hh"
+#include <seastar/json/formatter.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/iostream.hh>
namespace seastar {
diff --git a/net/api.hh b/include/seastar/net/api.hh
similarity index 97%
rename from net/api.hh
rename to include/seastar/net/api.hh
index 48c9d6f7..4c3cc79d 100644
--- a/net/api.hh
+++ b/include/seastar/net/api.hh
@@ -25,13 +25,13 @@
#include <memory>
#include <vector>
#include <cstring>
-#include "core/future.hh"
-#include "net/byteorder.hh"
-#include "net/socket_defs.hh"
-#include "net/packet.hh"
-#include "core/print.hh"
-#include "core/temporary_buffer.hh"
-#include "core/iostream.hh"
+#include <seastar/core/future.hh>
+#include <seastar/net/byteorder.hh>
+#include <seastar/net/socket_defs.hh>
+#include <seastar/net/packet.hh>
+#include <seastar/core/print.hh>
+#include <seastar/core/temporary_buffer.hh>
+#include <seastar/core/iostream.hh>
#include <sys/types.h>
#include <boost/variant.hpp>
diff --git a/net/arp.hh b/include/seastar/net/arp.hh
similarity index 98%
rename from net/arp.hh
rename to include/seastar/net/arp.hh
index d8bad451..6b941852 100644
--- a/net/arp.hh
+++ b/include/seastar/net/arp.hh
@@ -23,11 +23,11 @@
#ifndef ARP_HH_
#define ARP_HH_
-#include "net.hh"
-#include "core/reactor.hh"
-#include "core/byteorder.hh"
-#include "ethernet.hh"
-#include "core/print.hh"
+#include <seastar/net/net.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/byteorder.hh>
+#include <seastar/net/ethernet.hh>
+#include <seastar/core/print.hh>
#include <unordered_map>
namespace seastar {
diff --git a/net/byteorder.hh b/include/seastar/net/byteorder.hh
similarity index 98%
rename from net/byteorder.hh
rename to include/seastar/net/byteorder.hh
index a9239a1b..6653e2dd 100644
--- a/net/byteorder.hh
+++ b/include/seastar/net/byteorder.hh
@@ -26,7 +26,7 @@
#include <iosfwd>
#include <utility>
-#include "core/unaligned.hh"
+#include <seastar/core/unaligned.hh>
namespace seastar {
diff --git a/net/config.hh b/include/seastar/net/config.hh
similarity index 100%
rename from net/config.hh
rename to include/seastar/net/config.hh
diff --git a/net/const.hh b/include/seastar/net/const.hh
similarity index 100%
rename from net/const.hh
rename to include/seastar/net/const.hh
diff --git a/net/dhcp.hh b/include/seastar/net/dhcp.hh
similarity index 97%
rename from net/dhcp.hh
rename to include/seastar/net/dhcp.hh
index 1f2eaf58..e246240f 100644
--- a/net/dhcp.hh
+++ b/include/seastar/net/dhcp.hh
@@ -22,8 +22,8 @@
#ifndef NET_DHCP_HH_
#define NET_DHCP_HH_
-#include "ip.hh"
-#include "core/reactor.hh"
+#include <seastar/net/ip.hh>
+#include <seastar/core/reactor.hh>
namespace seastar {
diff --git a/net/dns.hh b/include/seastar/net/dns.hh
similarity index 95%
rename from net/dns.hh
rename to include/seastar/net/dns.hh
index 096b035e..9f2069ec 100644
--- a/net/dns.hh
+++ b/include/seastar/net/dns.hh
@@ -26,10 +26,10 @@
#include <memory>
#include <experimental/optional>
-#include "../core/future.hh"
-#include "../core/sstring.hh"
-#include "../core/shared_ptr.hh"
-#include "inet_address.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/net/inet_address.hh>
namespace seastar {
diff --git a/net/dpdk.hh b/include/seastar/net/dpdk.hh
similarity index 94%
rename from net/dpdk.hh
rename to include/seastar/net/dpdk.hh
index be7fc76d..664f97b8 100644
--- a/net/dpdk.hh
+++ b/include/seastar/net/dpdk.hh
@@ -25,9 +25,9 @@
#define _SEASTAR_DPDK_DEV_H
#include <memory>
-#include "config.hh"
-#include "net.hh"
-#include "core/sstring.hh"
+#include <seastar/net/config.hh>
+#include <seastar/net/net.hh>
+#include <seastar/core/sstring.hh>
namespace seastar {
diff --git a/net/ethernet.hh b/include/seastar/net/ethernet.hh
similarity index 97%
rename from net/ethernet.hh
rename to include/seastar/net/ethernet.hh
index 748cfd64..26927ebd 100644
--- a/net/ethernet.hh
+++ b/include/seastar/net/ethernet.hh
@@ -23,8 +23,8 @@
#define ETHERNET_HH_
#include <array>
-#include "byteorder.hh"
-#include "core/print.hh"
+#include <seastar/net/byteorder.hh>
+#include <seastar/core/print.hh>
namespace seastar {
diff --git a/net/inet_address.hh b/include/seastar/net/inet_address.hh
similarity index 97%
rename from net/inet_address.hh
rename to include/seastar/net/inet_address.hh
index 6759563e..849820fd 100644
--- a/net/inet_address.hh
+++ b/include/seastar/net/inet_address.hh
@@ -27,8 +27,8 @@
#include <stdexcept>
#include <vector>
-#include "../core/future.hh"
-#include "../core/sstring.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/sstring.hh>
namespace seastar {
namespace net {
diff --git a/net/ip.hh b/include/seastar/net/ip.hh
similarity index 97%
rename from net/ip.hh
rename to include/seastar/net/ip.hh
index cd18b5f2..3d5550ec 100644
--- a/net/ip.hh
+++ b/include/seastar/net/ip.hh
@@ -31,17 +31,17 @@
#include <map>
#include <list>
#include <chrono>
-#include "core/array_map.hh"
-#include "byteorder.hh"
-#include "core/byteorder.hh"
-#include "arp.hh"
-#include "ip_checksum.hh"
-#include "const.hh"
-#include "packet-util.hh"
-#include "core/shared_ptr.hh"
-#include "toeplitz.hh"
-#include "net/udp.hh"
-#include "core/metrics_registration.hh"
+#include <seastar/core/array_map.hh>
+#include <seastar/net/byteorder.hh>
+#include <seastar/core/byteorder.hh>
+#include <seastar/net/arp.hh>
+#include <seastar/net/ip_checksum.hh>
+#include <seastar/net/const.hh>
+#include <seastar/net/packet-util.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/net/toeplitz.hh>
+#include <seastar/net/udp.hh>
+#include <seastar/core/metrics_registration.hh>
namespace seastar {
diff --git a/net/ip_checksum.hh b/include/seastar/net/ip_checksum.hh
similarity index 98%
rename from net/ip_checksum.hh
rename to include/seastar/net/ip_checksum.hh
index bf388f83..3fe46bbf 100644
--- a/net/ip_checksum.hh
+++ b/include/seastar/net/ip_checksum.hh
@@ -22,7 +22,7 @@
#ifndef IP_CHECKSUM_HH_
#define IP_CHECKSUM_HH_
-#include "packet.hh"
+#include <seastar/net/packet.hh>
#include <cstdint>
#include <cstddef>
#include <arpa/inet.h>
diff --git a/net/native-stack.hh b/include/seastar/net/native-stack.hh
similarity index 97%
rename from net/native-stack.hh
rename to include/seastar/net/native-stack.hh
index c9014083..6409d270 100644
--- a/net/native-stack.hh
+++ b/include/seastar/net/native-stack.hh
@@ -22,7 +22,7 @@
#ifndef STACK_HH_
#define STACK_HH_
-#include "net/net.hh"
+#include <seastar/net/net.hh>
#include <boost/program_options.hpp>
namespace seastar {
diff --git a/net/net.hh b/include/seastar/net/net.hh
similarity index 96%
rename from net/net.hh
rename to include/seastar/net/net.hh
index c9755275..d030ffdb 100644
--- a/net/net.hh
+++ b/include/seastar/net/net.hh
@@ -22,15 +22,15 @@
#ifndef NET_HH_
#define NET_HH_
-#include "core/reactor.hh"
-#include "core/deleter.hh"
-#include "core/queue.hh"
-#include "core/stream.hh"
-#include "core/metrics_registration.hh"
-#include "net/toeplitz.hh"
-#include "ethernet.hh"
-#include "packet.hh"
-#include "const.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/deleter.hh>
+#include <seastar/core/queue.hh>
+#include <seastar/core/stream.hh>
+#include <seastar/core/metrics_registration.hh>
+#include <seastar/net/toeplitz.hh>
+#include <seastar/net/ethernet.hh>
+#include <seastar/net/packet.hh>
+#include <seastar/net/const.hh>
#include <unordered_map>
namespace seastar {
diff --git a/net/packet-data-source.hh b/include/seastar/net/packet-data-source.hh
similarity index 96%
rename from net/packet-data-source.hh
rename to include/seastar/net/packet-data-source.hh
index a055205b..4e498b5d 100644
--- a/net/packet-data-source.hh
+++ b/include/seastar/net/packet-data-source.hh
@@ -18,8 +18,8 @@
#ifndef _PACKET_DATA_SOURCE_HH
#define _PACKET_DATA_SOURCE_HH
-#include "core/reactor.hh"
-#include "net/packet.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/net/packet.hh>
namespace seastar {
diff --git a/net/packet-util.hh b/include/seastar/net/packet-util.hh
similarity index 99%
rename from net/packet-util.hh
rename to include/seastar/net/packet-util.hh
index 96291e74..94de0e94 100644
--- a/net/packet-util.hh
+++ b/include/seastar/net/packet-util.hh
@@ -22,7 +22,7 @@
#ifndef PACKET_UTIL_HH_
#define PACKET_UTIL_HH_
-#include "net/packet.hh"
+#include <seastar/net/packet.hh>
#include <map>
#include <iostream>
diff --git a/net/packet.hh b/include/seastar/net/packet.hh
similarity index 99%
rename from net/packet.hh
rename to include/seastar/net/packet.hh
index f11e6dff..cf24937c 100644
--- a/net/packet.hh
+++ b/include/seastar/net/packet.hh
@@ -22,9 +22,9 @@
#ifndef PACKET_HH_
#define PACKET_HH_
-#include "core/deleter.hh"
-#include "core/temporary_buffer.hh"
-#include "const.hh"
+#include <seastar/core/deleter.hh>
+#include <seastar/core/temporary_buffer.hh>
+#include <seastar/net/const.hh>
#include <vector>
#include <cassert>
#include <algorithm>
diff --git a/net/posix-stack.hh b/include/seastar/net/posix-stack.hh
similarity index 98%
rename from net/posix-stack.hh
rename to include/seastar/net/posix-stack.hh
index 280df88a..d517d28b 100644
--- a/net/posix-stack.hh
+++ b/include/seastar/net/posix-stack.hh
@@ -22,9 +22,9 @@
#ifndef POSIX_STACK_HH_
#define POSIX_STACK_HH_
-#include "core/reactor.hh"
-#include "core/sharded.hh"
-#include "stack.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/sharded.hh>
+#include <seastar/net/stack.hh>
#include <boost/program_options.hpp>
namespace seastar {
diff --git a/net/proxy.hh b/include/seastar/net/proxy.hh
similarity index 93%
rename from net/proxy.hh
rename to include/seastar/net/proxy.hh
index a3fd86f9..863390a6 100644
--- a/net/proxy.hh
+++ b/include/seastar/net/proxy.hh
@@ -19,8 +19,8 @@
#define PROXY_HH_
#include <memory>
-#include "net.hh"
-#include "packet.hh"
+#include <seastar/net/net.hh>
+#include <seastar/net/packet.hh>
namespace seastar {
diff --git a/net/socket_defs.hh b/include/seastar/net/socket_defs.hh
similarity index 98%
rename from net/socket_defs.hh
rename to include/seastar/net/socket_defs.hh
index 0822ee08..1e8dc92f 100644
--- a/net/socket_defs.hh
+++ b/include/seastar/net/socket_defs.hh
@@ -23,7 +23,7 @@
#include <iosfwd>
#include <sys/socket.h>
#include <netinet/ip.h>
-#include "net/byteorder.hh"
+#include <seastar/net/byteorder.hh>
namespace seastar {
diff --git a/net/stack.hh b/include/seastar/net/stack.hh
similarity index 98%
rename from net/stack.hh
rename to include/seastar/net/stack.hh
index c5e5158a..11b65f70 100644
--- a/net/stack.hh
+++ b/include/seastar/net/stack.hh
@@ -21,7 +21,7 @@
#pragma once
#include <chrono>
-#include "api.hh"
+#include <seastar/net/api.hh>
namespace seastar {
diff --git a/net/tcp-stack.hh b/include/seastar/net/tcp-stack.hh
similarity index 97%
rename from net/tcp-stack.hh
rename to include/seastar/net/tcp-stack.hh
index 2b193f90..23755bf1 100644
--- a/net/tcp-stack.hh
+++ b/include/seastar/net/tcp-stack.hh
@@ -24,7 +24,7 @@
#ifndef NET_TCP_STACK_HH
#define NET_TCP_STACK_HH
-#include "core/future.hh"
+#include <seastar/core/future.hh>
namespace seastar {
diff --git a/net/tcp.hh b/include/seastar/net/tcp.hh
similarity index 99%
rename from net/tcp.hh
rename to include/seastar/net/tcp.hh
index d759227c..af9a9942 100644
--- a/net/tcp.hh
+++ b/include/seastar/net/tcp.hh
@@ -22,17 +22,17 @@
#ifndef TCP_HH_
#define TCP_HH_
-#include "core/shared_ptr.hh"
-#include "core/queue.hh"
-#include "core/semaphore.hh"
-#include "core/print.hh"
-#include "core/byteorder.hh"
-#include "core/metrics.hh"
-#include "net.hh"
-#include "ip_checksum.hh"
-#include "ip.hh"
-#include "const.hh"
-#include "packet-util.hh"
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/queue.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/print.hh>
+#include <seastar/core/byteorder.hh>
+#include <seastar/core/metrics.hh>
+#include <seastar/net/net.hh>
+#include <seastar/net/ip_checksum.hh>
+#include <seastar/net/ip.hh>
+#include <seastar/net/const.hh>
+#include <seastar/net/packet-util.hh>
#include <unordered_map>
#include <map>
#include <functional>
diff --git a/net/tls.hh b/include/seastar/net/tls.hh
similarity index 98%
rename from net/tls.hh
rename to include/seastar/net/tls.hh
index 994fb9a9..b557add3 100644
--- a/net/tls.hh
+++ b/include/seastar/net/tls.hh
@@ -26,10 +26,10 @@
#include <boost/any.hpp>
-#include "core/future.hh"
-#include "core/sstring.hh"
-#include "core/shared_ptr.hh"
-#include "socket_defs.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/net/socket_defs.hh>
namespace seastar {
diff --git a/net/toeplitz.hh b/include/seastar/net/toeplitz.hh
similarity index 100%
rename from net/toeplitz.hh
rename to include/seastar/net/toeplitz.hh
diff --git a/net/udp.hh b/include/seastar/net/udp.hh
similarity index 90%
rename from net/udp.hh
rename to include/seastar/net/udp.hh
index aad8d90c..8df06dd6 100644
--- a/net/udp.hh
+++ b/include/seastar/net/udp.hh
@@ -25,11 +25,11 @@
#include <unordered_map>
#include <assert.h>
-#include "core/reactor.hh"
-#include "core/shared_ptr.hh"
-#include "net/api.hh"
-#include "const.hh"
-#include "net.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/net/api.hh>
+#include <seastar/net/const.hh>
+#include <seastar/net/net.hh>
namespace seastar {
diff --git a/net/virtio-interface.hh b/include/seastar/net/virtio-interface.hh
similarity index 100%
rename from net/virtio-interface.hh
rename to include/seastar/net/virtio-interface.hh
diff --git a/net/virtio.hh b/include/seastar/net/virtio.hh
similarity index 94%
rename from net/virtio.hh
rename to include/seastar/net/virtio.hh
index f074b090..da59a7bc 100644
--- a/net/virtio.hh
+++ b/include/seastar/net/virtio.hh
@@ -23,8 +23,8 @@
#define VIRTIO_HH_
#include <memory>
-#include "net.hh"
-#include "core/sstring.hh"
+#include <seastar/net/net.hh>
+#include <seastar/core/sstring.hh>
namespace seastar {
diff --git a/rpc/lz4_compressor.hh b/include/seastar/rpc/lz4_compressor.hh
similarity index 95%
rename from rpc/lz4_compressor.hh
rename to include/seastar/rpc/lz4_compressor.hh
index d3fdd525..92738ddd 100644
--- a/rpc/lz4_compressor.hh
+++ b/include/seastar/rpc/lz4_compressor.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "core/sstring.hh"
-#include "rpc/rpc_types.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/rpc/rpc_types.hh>
#include <lz4.h>
namespace seastar {
diff --git a/rpc/multi_algo_compressor_factory.hh b/include/seastar/rpc/multi_algo_compressor_factory.hh
similarity index 97%
rename from rpc/multi_algo_compressor_factory.hh
rename to include/seastar/rpc/multi_algo_compressor_factory.hh
index bc95ffde..7a4380dc 100644
--- a/rpc/multi_algo_compressor_factory.hh
+++ b/include/seastar/rpc/multi_algo_compressor_factory.hh
@@ -23,8 +23,8 @@
#include <boost/range/adaptor/transformed.hpp>
#include <boost/algorithm/string.hpp>
-#include "core/sstring.hh"
-#include "rpc_types.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/rpc/rpc_types.hh>
namespace seastar {
diff --git a/rpc/rpc.hh b/include/seastar/rpc/rpc.hh
similarity index 98%
rename from rpc/rpc.hh
rename to include/seastar/rpc/rpc.hh
index 7251da69..8258b591 100644
--- a/rpc/rpc.hh
+++ b/include/seastar/rpc/rpc.hh
@@ -24,19 +24,19 @@
#include <unordered_map>
#include <unordered_set>
#include <list>
-#include "core/future.hh"
-#include "net/api.hh"
-#include "core/reactor.hh"
-#include "core/iostream.hh"
-#include "core/shared_ptr.hh"
-#include "core/condition-variable.hh"
-#include "core/gate.hh"
-#include "rpc/rpc_types.hh"
-#include "core/byteorder.hh"
-#include "core/shared_future.hh"
-#include "core/queue.hh"
-#include "core/weak_ptr.hh"
-#include "../core/scheduling.hh"
+#include <seastar/core/future.hh>
+#include <seastar/net/api.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/iostream.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/condition-variable.hh>
+#include <seastar/core/gate.hh>
+#include <seastar/rpc/rpc_types.hh>
+#include <seastar/core/byteorder.hh>
+#include <seastar/core/shared_future.hh>
+#include <seastar/core/queue.hh>
+#include <seastar/core/weak_ptr.hh>
+#include <seastar/core/scheduling.hh>
namespace seastar {
diff --git a/rpc/rpc_impl.hh b/include/seastar/rpc/rpc_impl.hh
similarity index 98%
rename from rpc/rpc_impl.hh
rename to include/seastar/rpc/rpc_impl.hh
index fb44b939..779b2f4e 100644
--- a/rpc/rpc_impl.hh
+++ b/include/seastar/rpc/rpc_impl.hh
@@ -21,16 +21,16 @@
#pragma once
#include <iostream>
-#include "core/function_traits.hh"
-#include "core/apply.hh"
-#include "core/shared_ptr.hh"
-#include "core/sstring.hh"
-#include "core/future-util.hh"
-#include "util/is_smart_ptr.hh"
-#include "core/simple-stream.hh"
+#include <seastar/core/function_traits.hh>
+#include <seastar/core/apply.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/util/is_smart_ptr.hh>
+#include <seastar/core/simple-stream.hh>
#include <boost/range/numeric.hpp>
#include <boost/range/adaptor/transformed.hpp>
-#include "net/packet-data-source.hh"
+#include <seastar/net/packet-data-source.hh>
namespace seastar {
diff --git a/rpc/rpc_types.hh b/include/seastar/rpc/rpc_types.hh
similarity index 98%
rename from rpc/rpc_types.hh
rename to include/seastar/rpc/rpc_types.hh
index 85757295..09963f1e 100644
--- a/rpc/rpc_types.hh
+++ b/include/seastar/rpc/rpc_types.hh
@@ -21,19 +21,19 @@
#pragma once
-#include "net/api.hh"
+#include <seastar/net/api.hh>
#include <stdexcept>
#include <string>
#include <boost/any.hpp>
#include <boost/type.hpp>
#include <experimental/optional>
#include <boost/variant.hpp>
-#include "core/timer.hh"
-#include "core/simple-stream.hh"
-#include "core/lowres_clock.hh"
+#include <seastar/core/timer.hh>
+#include <seastar/core/simple-stream.hh>
+#include <seastar/core/lowres_clock.hh>
#include <boost/functional/hash.hpp>
#include <iostream>
-#include <core/sharded.hh>
+#include <seastar/core/sharded.hh>
namespace seastar {
diff --git a/util/alloc_failure_injector.hh b/include/seastar/util/alloc_failure_injector.hh
similarity index 98%
rename from util/alloc_failure_injector.hh
rename to include/seastar/util/alloc_failure_injector.hh
index a20ddfd7..908f9c0e 100644
--- a/util/alloc_failure_injector.hh
+++ b/include/seastar/util/alloc_failure_injector.hh
@@ -24,7 +24,7 @@
#include <limits>
#include <cstdint>
#include <functional>
-#include "noncopyable_function.hh"
+#include <seastar/util/noncopyable_function.hh>
namespace seastar {
namespace memory {
diff --git a/util/backtrace.hh b/include/seastar/util/backtrace.hh
similarity index 98%
rename from util/backtrace.hh
rename to include/seastar/util/backtrace.hh
index b5d3f452..17327990 100644
--- a/util/backtrace.hh
+++ b/include/seastar/util/backtrace.hh
@@ -25,8 +25,8 @@
#include <iosfwd>
#include <boost/container/static_vector.hpp>
-#include "core/sstring.hh"
-#include "core/print.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/print.hh>
namespace seastar {
diff --git a/util/bool_class.hh b/include/seastar/util/bool_class.hh
similarity index 100%
rename from util/bool_class.hh
rename to include/seastar/util/bool_class.hh
diff --git a/util/conversions.hh b/include/seastar/util/conversions.hh
similarity index 100%
rename from util/conversions.hh
rename to include/seastar/util/conversions.hh
diff --git a/util/defer.hh b/include/seastar/util/defer.hh
similarity index 100%
rename from util/defer.hh
rename to include/seastar/util/defer.hh
diff --git a/util/eclipse.hh b/include/seastar/util/eclipse.hh
similarity index 100%
rename from util/eclipse.hh
rename to include/seastar/util/eclipse.hh
diff --git a/util/function_input_iterator.hh b/include/seastar/util/function_input_iterator.hh
similarity index 100%
rename from util/function_input_iterator.hh
rename to include/seastar/util/function_input_iterator.hh
diff --git a/util/gcc6-concepts.hh b/include/seastar/util/gcc6-concepts.hh
similarity index 100%
rename from util/gcc6-concepts.hh
rename to include/seastar/util/gcc6-concepts.hh
diff --git a/util/indirect.hh b/include/seastar/util/indirect.hh
similarity index 100%
rename from util/indirect.hh
rename to include/seastar/util/indirect.hh
diff --git a/util/is_smart_ptr.hh b/include/seastar/util/is_smart_ptr.hh
similarity index 100%
rename from util/is_smart_ptr.hh
rename to include/seastar/util/is_smart_ptr.hh
diff --git a/util/lazy.hh b/include/seastar/util/lazy.hh
similarity index 100%
rename from util/lazy.hh
rename to include/seastar/util/lazy.hh
diff --git a/util/log-cli.hh b/include/seastar/util/log-cli.hh
similarity index 95%
rename from util/log-cli.hh
rename to include/seastar/util/log-cli.hh
index 2e481fa6..8262a22b 100644
--- a/util/log-cli.hh
+++ b/include/seastar/util/log-cli.hh
@@ -21,10 +21,10 @@
#pragma once
-#include "log.hh"
-#include "program-options.hh"
+#include <seastar/util/log.hh>
+#include <seastar/util/program-options.hh>
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#include <boost/program_options.hpp>
diff --git a/util/log.hh b/include/seastar/util/log.hh
similarity index 99%
rename from util/log.hh
rename to include/seastar/util/log.hh
index a0487012..12f63978 100644
--- a/util/log.hh
+++ b/include/seastar/util/log.hh
@@ -21,7 +21,7 @@
#ifndef LOG_HH_
#define LOG_HH_
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#include <unordered_map>
#include <exception>
#include <iosfwd>
diff --git a/util/noncopyable_function.hh b/include/seastar/util/noncopyable_function.hh
similarity index 100%
rename from util/noncopyable_function.hh
rename to include/seastar/util/noncopyable_function.hh
diff --git a/util/optimized_optional.hh b/include/seastar/util/optimized_optional.hh
similarity index 98%
rename from util/optimized_optional.hh
rename to include/seastar/util/optimized_optional.hh
index e410eb28..69f382fb 100644
--- a/util/optimized_optional.hh
+++ b/include/seastar/util/optimized_optional.hh
@@ -21,7 +21,7 @@
#pragma once
-#include "util/gcc6-concepts.hh"
+#include <seastar/util/gcc6-concepts.hh>
#include <experimental/optional>
#include <experimental/type_traits>
@@ -101,4 +101,4 @@ class optimized_optional {
}
};
-}
\ No newline at end of file
+}
diff --git a/util/print_safe.hh b/include/seastar/util/print_safe.hh
similarity index 100%
rename from util/print_safe.hh
rename to include/seastar/util/print_safe.hh
diff --git a/util/program-options.hh b/include/seastar/util/program-options.hh
similarity index 98%
rename from util/program-options.hh
rename to include/seastar/util/program-options.hh
index 26e5da3b..2d98ba50 100644
--- a/util/program-options.hh
+++ b/include/seastar/util/program-options.hh
@@ -21,7 +21,7 @@
#pragma once
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#include <boost/any.hpp>
#include <boost/program_options.hpp>
diff --git a/util/reference_wrapper.hh b/include/seastar/util/reference_wrapper.hh
similarity index 100%
rename from util/reference_wrapper.hh
rename to include/seastar/util/reference_wrapper.hh
diff --git a/util/spinlock.hh b/include/seastar/util/spinlock.hh
similarity index 100%
rename from util/spinlock.hh
rename to include/seastar/util/spinlock.hh
diff --git a/util/transform_iterator.hh b/include/seastar/util/transform_iterator.hh
similarity index 100%
rename from util/transform_iterator.hh
rename to include/seastar/util/transform_iterator.hh
diff --git a/util/tuple_utils.hh b/include/seastar/util/tuple_utils.hh
similarity index 100%
rename from util/tuple_utils.hh
rename to include/seastar/util/tuple_utils.hh
diff --git a/util/variant_utils.hh b/include/seastar/util/variant_utils.hh
similarity index 100%
rename from util/variant_utils.hh
rename to include/seastar/util/variant_utils.hh
diff --git a/licenses/dpdk.txt b/license/dpdk.txt
similarity index 100%
rename from licenses/dpdk.txt
rename to license/dpdk.txt
diff --git a/licenses/freebsd.txt b/license/freebsd.txt
similarity index 100%
rename from licenses/freebsd.txt
rename to license/freebsd.txt
diff --git a/pkgconfig/seastar.pc.cmake b/pkgconfig/seastar.pc.cmake
new file mode 100644
index 00000000..ddb39486
--- /dev/null
+++ b/pkgconfig/seastar.pc.cmake
@@ -0,0 +1,43 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+
+Name: Seastar
+Url:
http://seastar-project.org
+Description: Advanced C++ framework for high-performance server applications on modern hardware.
+Version: @PROJECT_VERSION@
+
+# Platform dependencies.
+dl_libs=-l$<TARGET_PROPERTY:dl::dl,IMPORTED_LIBNAME>
+rt_libs=-l$<TARGET_PROPERTY:rt::rt,IMPORTED_LIBNAME>
+
+# Dependencies of dependencies.
+boost_system_libs=$<TARGET_LINKER_FILE:Boost::system>
+
+# Dependencies.
+boost_cflags=-I$<JOIN:$<TARGET_PROPERTY:Boost::boost,INTERFACE_INCLUDE_DIRECTORIES>, -I>
+boost_filesystem_libs=$<TARGET_LINKER_FILE:Boost::filesystem>
+boost_program_options_libs=$<TARGET_LINKER_FILE:Boost::program_options>
+boost_thread_libs=${boost_system_libs} $<TARGET_LINKER_FILE:Boost::thread>
+c_ares_cflags=-I$<JOIN:$<TARGET_PROPERTY:c-ares::c-ares,INTERFACE_INCLUDE_DIRECTORIES>, -I>
+c_ares_libs=$<TARGET_LINKER_FILE:c-ares::c-ares>
+cryptopp_cflags=-I$<JOIN:$<TARGET_PROPERTY:cryptopp::cryptopp,INTERFACE_INCLUDE_DIRECTORIES>, -I>
+cryptopp_libs=$<TARGET_LINKER_FILE:cryptopp::cryptopp>
+fmt_cflags=-I$<JOIN:$<TARGET_PROPERTY:fmt::fmt,INTERFACE_INCLUDE_DIRECTORIES>, -I>
+fmt_libs=$<TARGET_LINKER_FILE:fmt::fmt>
+lksctp_tools_cflags=-I$<JOIN:$<TARGET_PROPERTY:lksctp-tools::lksctp-tools,INTERFACE_INCLUDE_DIRECTORIES>, -I>
+lksctp_tools_libs=$<TARGET_LINKER_FILE:lksctp-tools::lksctp-tools>
+sanitizers_cflags=$<JOIN:@Sanitizers_COMPILER_OPTIONS@, >
+stdfilesystem_libs=-l$<TARGET_PROPERTY:StdFilesystem::filesystem,IMPORTED_LIBNAME>
+
+# Us.
+seastar_cflags=-I{includedir} $<JOIN:$<TARGET_PROPERTY:seastar,INTERFACE_COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:seastar,INTERFACE_COMPILE_DEFINITIONS>, -D>
+seastar_libs=$<TARGET_FILE:seastar>
+
+Requires: liblz4 >= 1.8.0
+Requires.private: gnutls >= 3.5.18, protobuf >= 3.3.1, hwloc >= 1.11.5, yaml-cpp >= 0.5.3
+Conflicts:
+Cflags: ${boost_cflags} ${c_ares_cflags} ${cryptopp_cflags} ${fmt_cflags} ${lksctp_tools_cflags} ${sanitizers_cflags} ${seastar_cflags}
+Libs: ${boost_program_options_libs} ${boost_thread_libs} ${c_ares_libs} ${cryptopp_libs} ${fmt_libs} ${seastar_libs}
+Libs.private: ${dl_libs} ${rt_libs} ${boost_filesystem_libs} ${boost_thread_libs} ${lksctp_tools_libs} ${stdfilesystem_libs}
diff --git a/proto/CMakeLists.txt b/proto/CMakeLists.txt
deleted file mode 100644
index f114322d..00000000
--- a/proto/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-protobuf_generate_cpp (sources headers metrics2.proto)
-
-add_library (seastar-protobuf OBJECT
- ${sources}
- ${headers})
-
-target_include_directories (seastar-protobuf PUBLIC ${PROTOBUF_INCLUDE_DIRS})
diff --git a/recipe/dev.cmake b/recipe/dev.cmake
new file mode 100644
index 00000000..5d3b9714
--- /dev/null
+++ b/recipe/dev.cmake
@@ -0,0 +1,272 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+#
+# Useful definitions for `cmake -E env`.
+#
+
+set (amended_PATH PATH=${Cooking_INGREDIENTS_DIR}/bin:$ENV{PATH})
+set (PKG_CONFIG_PATH PKG_CONFIG_PATH=${Cooking_INGREDIENTS_DIR}/lib/pkgconfig)
+
+#
+# Some Autotools ingredients need this information because they don't use pkgconfig.
+#
+
+set (autotools_ingredients_flags
+ CFLAGS=-I${Cooking_INGREDIENTS_DIR}/include
+ CXXFLAGS=-I${Cooking_INGREDIENTS_DIR}/include
+ LDFLAGS=-L${Cooking_INGREDIENTS_DIR}/lib)
+
+#
+# Some Autotools projects amend the info file instead of making a package-specific one.
+# This doesn't play nicely with GNU Stow.
+#
+# Just append the name of the ingredient, like
+#
+# ${info_dir}/gmp
+#
+
+set (info_dir --infodir=<INSTALL_DIR>/share/info)
+
+#
+# Build-concurrency.
+#
+
+cmake_host_system_information (
+ RESULT build_concurrency_factor
+ QUERY NUMBER_OF_LOGICAL_CORES)
+
+set (make_command make -j ${build_concurrency_factor})
+
+#
+# All the ingredients.
+#
+
+##
+## Dependencies of dependencies of dependencies.
+##
+
+cooking_ingredient (gmp
+ URL
https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz
+ URL_MD5 205e230117debf3754944509350627a1
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR> ${info_dir}/gmp
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+##
+## Dependencies of dependencies.
+##
+
+cooking_ingredient (colm
+ URL
http://www.colm.net/files/colm/colm-0.13.0.6.tar.gz
+ URL_MD5 16aaf566cbcfe9a06154e094638ac709
+ # This is upsetting.
+ BUILD_IN_SOURCE YES
+ CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (libpciaccess
+ URL
https://www.x.org/releases/individual/lib/libpciaccess-0.13.4.tar.gz
+ URL_MD5 cc1fad87da60682af1d5fa43a5da45a4
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (nettle
+ DEPENDS ingredient_gmp
+ URL
https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz
+ URL_MD5 dc0f13028264992f58e67b4e8915f53d
+ CONFIGURE_COMMAND
+ <SOURCE_DIR>/configure
+ --prefix=<INSTALL_DIR>
+ --srcdir=<SOURCE_DIR>
+ --libdir=<INSTALL_DIR>/lib
+ ${info_dir}/nettle
+ ${autotools_ingredients_flags}
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (numactl
+ GIT_REPOSITORY
https://github.com/numactl/numactl.git
+ GIT_TAG f1849d0d7a50a6b9d507b7cc6164b04aae948d54
+ PATCH_COMMAND ./autogen.sh
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (zlib
+ URL
https://zlib.net/zlib-1.2.11.tar.gz
+ URL_MD5 1c9f62f0778697a09d36121ead88e08e
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --64
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+##
+## Private and private/public dependencies.
+##
+
+cooking_ingredient (Boost
+ # The 1.67.0 release has a bug in Boost Lockfree around a missing header.
+ URL
https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
+ URL_MD5 319c6ffbbeccc366f14bb68767a6db79
+ PATCH_COMMAND
+ ./bootstrap.sh
+ --prefix=<INSTALL_DIR>
+ --with-libraries=atomic,chrono,date_time,filesystem,program_options,system,test,thread
+ CONFIGURE_COMMAND <DISABLE>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND
+ ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
+ ./b2
+ -j ${build_concurrency_factor}
+ --layout=system
+ --build-dir=<BINARY_DIR>
+ install
+ variant=debug
+ link=shared
+ threading=multi)
+
+cooking_ingredient (GnuTLS
+ DEPENDS
+ ingredient_gmp
+ ingredient_nettle
+ URL
https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.18.tar.xz
+ URL_MD5 c2d93d305ecbc55939bc2a8ed4a76a3d
+ CONFIGURE_COMMAND
+ ${CMAKE_COMMAND} -E env ${PKG_CONFIG_PATH}
+ <SOURCE_DIR>/configure
+ --prefix=<INSTALL_DIR>
+ --srcdir=<SOURCE_DIR>
+ --with-included-unistring
+ --with-included-libtasn1
+ --without-p11-kit
+ #
https://lists.gnupg.org/pipermail/gnutls-help/2016-February/004085.html
+ --disable-non-suiteb-curves
+ --disable-doc
+ ${autotools_ingredients_flags}
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (Protobuf
+ DEPENDS ingredient_zlib
+ URL
https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz
+ URL_MD5 74446d310ce79cf20bab3ffd0e8f8f8f
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (hwloc
+ DEPENDS
+ ingredient_numactl
+ ingredient_libpciaccess
+ URL
https://download.open-mpi.org/release/hwloc/v1.11/hwloc-1.11.5.tar.gz
+ URL_MD5 8f5fe6a9be2eb478409ad5e640b2d3ba
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (ragel
+ DEPENDS ingredient_colm
+ URL
http://www.colm.net/files/ragel/ragel-7.0.0.11.tar.gz
+ URL_MD5 ad58c8f1ac5def94d9c7f4395a03606c
+ # This is upsetting.
+ BUILD_IN_SOURCE YES
+ CONFIGURE_COMMAND
+ ${CMAKE_COMMAND} -E env ${amended_PATH}
+ ./configure
+ --prefix=<INSTALL_DIR>
+ # This is even more upsetting.
+ ${autotools_ingredients_flags}
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (lksctp-tools
+ URL
https://sourceforge.net/projects/lksctp/files/lksctp-tools/lksctp-tools-1.0.16.tar.gz
+ #URL_HASH
+ PATCH_COMMAND ./bootstrap
+ CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} install)
+
+cooking_ingredient (yaml-cpp
+ GIT_REPOSITORY
https://github.com/jbeder/yaml-cpp.git
+ GIT_TAG b57efe94e7d445713c29f863adb8c23438eaa217
+ CMAKE_ARGS
+ -DYAML_CPP_BUILD_TESTS=OFF
+ -DBUILD_SHARED_LIBS=ON)
+
+##
+## Public dependencies.
+##
+
+cooking_ingredient (c-ares
+ GIT_REPOSITORY
https://github.com/c-ares/c-ares.git
+ GIT_TAG fd6124c74da0801f23f9d324559d8b66fb83f533)
+
+cooking_ingredient (cryptopp
+ GIT_REPOSITORY
https://github.com/weidai11/cryptopp.git
+ GIT_TAG c621ce053298fafc1e59191079c33acd76045c26
+ CMAKE_ARGS
+ -DCMAKE_INSTALL_LIBDIR=<INSTALL_DIR>/lib
+ -DBUILD_TESTING=OFF)
+
+set (dpdk_quadruple ${CMAKE_SYSTEM_PROCESSOR}-native-linuxapp-gcc)
+
+set (dpdk_args
+ O=<BINARY_DIR>
+ DESTDIR=<INSTALL_DIR>
+ T=${dpdk_quadruple})
+
+cooking_ingredient (dpdk
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/dpdk
+ CONFIGURE_COMMAND
+ COMMAND
+ ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
+ make ${dpdk_args} config
+ COMMAND
+ ${CMAKE_COMMAND}
+ -DSeastar_DPDK_CONFIG_FILE_IN=<BINARY_DIR>/.config
+ -DSeastar_DPDK_CONFIG_FILE_CHANGES=${CMAKE_CURRENT_LIST_DIR}/dpdk_config
+ -DSeastar_DPDK_CONFIG_FILE_OUT=<BINARY_DIR>/${dpdk_quadruple}/.config
+ -P ${CMAKE_CURRENT_LIST_DIR}/dpdk_configure.cmake
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND
+ ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
+ ${make_command} ${dpdk_args} install)
+
+cooking_ingredient (fmt
+ GIT_REPOSITORY
https://github.com/fmtlib/fmt.git
+ GIT_TAG f61e71ccb9ab253f6d76096b2d958caf38fcccaa
+ CMAKE_ARGS
+ -DBUILD_SHARED_LIBS=ON
+ -DFMT_DOC=OFF
+ -DFMT_TEST=OFF)
+
+cooking_ingredient (lz4
+ GIT_REPOSITORY
https://github.com/lz4/lz4.git
+ GIT_TAG b3692db46d2b23a7c0af2d5e69988c94f126e10a
+ # This is upsetting.
+ BUILD_IN_SOURCE ON
+ CONFIGURE_COMMAND <DISABLE>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND ${make_command} PREFIX=<INSTALL_DIR> install)
diff --git a/recipe/dpdk_config b/recipe/dpdk_config
new file mode 100644
index 00000000..f832a2f8
--- /dev/null
+++ b/recipe/dpdk_config
@@ -0,0 +1,23 @@
+CONFIG_RTE_LIBRTE_PMD_BOND=n
+CONFIG_RTE_MBUF_SCATTER_GATHER=n
+CONFIG_RTE_LIBRTE_IP_FRAG=n
+CONFIG_RTE_APP_TEST=n
+CONFIG_RTE_TEST_PMD=n
+CONFIG_RTE_MBUF_REFCNT_ATOMIC=n
+CONFIG_RTE_MAX_MEMSEG=8192
+CONFIG_RTE_EAL_IGB_UIO=n
+CONFIG_RTE_LIBRTE_KNI=n
+CONFIG_RTE_KNI_KMOD=n
+CONFIG_RTE_LIBRTE_JOBSTATS=n
+CONFIG_RTE_LIBRTE_LPM=n
+CONFIG_RTE_LIBRTE_ACL=n
+CONFIG_RTE_LIBRTE_POWER=n
+CONFIG_RTE_LIBRTE_IP_FRAG=n
+CONFIG_RTE_LIBRTE_METER=n
+CONFIG_RTE_LIBRTE_SCHED=n
+CONFIG_RTE_LIBRTE_DISTRIBUTOR=n
+CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER=n
+CONFIG_RTE_LIBRTE_REORDER=n
+CONFIG_RTE_LIBRTE_PORT=n
+CONFIG_RTE_LIBRTE_TABLE=n
+CONFIG_RTE_LIBRTE_PIPELINE=n
diff --git a/tests/memcached/CMakeLists.txt b/recipe/dpdk_configure.cmake
similarity index 59%
rename from tests/memcached/CMakeLists.txt
rename to recipe/dpdk_configure.cmake
index 132b8d9f..f901df9d 100644
--- a/tests/memcached/CMakeLists.txt
+++ b/recipe/dpdk_configure.cmake
@@ -20,21 +20,21 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-if (${SEASTAR_EXECUTE_ONLY_FAST_TESTS})
- set (fast --fast)
-else ()
- set (fast "")
-endif()
+file (READ ${Seastar_DPDK_CONFIG_FILE_IN} dpdk_config)
+file (STRINGS ${Seastar_DPDK_CONFIG_FILE_CHANGES} dpdk_config_changes)
+set (word_pattern "[^\n\r \t]+")
-# Special case dependency since `memcached_test` depends on the `memcached` target being built.
-add_dependencies (tests memcached)
+foreach (var ${dpdk_config_changes})
+ if (var MATCHES "(${word_pattern})=(${word_pattern})")
+ set (key ${CMAKE_MATCH_1})
+ set (value ${CMAKE_MATCH_2})
-add_test (
- NAME memcached_test
- COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/test.py" ${fast} --memcached $<TARGET_FILE:memcached>)
+ string (REGEX REPLACE
+ "${key}=${word_pattern}"
+ "${key}=${value}"
+ dpdk_config
+ ${dpdk_config})
+ endif ()
+endforeach ()
-add_seastar_test (NAME memcached_ascii_parser_test
- SUITE
- SOURCES test_ascii_parser.cc)
-
-add_dependencies (memcached_ascii_parser_test memcached)
+file (WRITE ${Seastar_DPDK_CONFIG_FILE_OUT} ${dpdk_config})
diff --git a/scripts/dpdk_nic_bind.py b/script/dpdk_nic_bind.py
similarity index 100%
rename from scripts/dpdk_nic_bind.py
rename to script/dpdk_nic_bind.py
diff --git a/scripts/perftune.py b/script/perftune.py
similarity index 100%
rename from scripts/perftune.py
rename to script/perftune.py
diff --git a/scripts/perftune.yaml b/script/perftune.yaml
similarity index 100%
rename from scripts/perftune.yaml
rename to script/perftune.yaml
diff --git a/scripts/posix_net_conf.sh b/script/posix_net_conf.sh
similarity index 100%
rename from scripts/posix_net_conf.sh
rename to script/posix_net_conf.sh
diff --git a/scripts/run_with_dpdk.sh b/script/run_with_dpdk.sh
similarity index 100%
rename from scripts/run_with_dpdk.sh
rename to script/run_with_dpdk.sh
diff --git a/scripts/seastar-addr2line b/script/seastar-addr2line
similarity index 100%
rename from scripts/seastar-addr2line
rename to script/seastar-addr2line
diff --git a/scripts/seastar-cpu-map.sh b/script/seastar-cpu-map.sh
similarity index 100%
rename from scripts/seastar-cpu-map.sh
rename to script/seastar-cpu-map.sh
diff --git a/scripts/tap.sh b/script/tap.sh
similarity index 100%
rename from scripts/tap.sh
rename to script/tap.sh
diff --git a/seastar_cmake.py b/seastar_cmake.py
deleted file mode 100644
index afa39918..00000000
--- a/seastar_cmake.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# This file is open source software, licensed to you under the terms
-# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
-# distributed with this work for additional information regarding copyright
-# ownership. You may not use this file except in compliance with the License.
-#
-# You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import os
-
-SUPPORTED_MODES = ['release', 'debug']
-
-ROOT_PATH = os.path.realpath(os.path.dirname(__file__))
-
-BUILD_PATHS = { mode: os.path.join(ROOT_PATH, 'build', mode) for mode in SUPPORTED_MODES }
-
-CMAKE_BASIC_ARGS = ['cmake', '-G', 'Ninja']
-
-def translate_arg(arg, new_name, value_when_none='no'):
- """
- Translate a value populated from the command-line into a name to pass to the invocation of CMake.
- """
- if arg is None:
- value = value_when_none
- elif type(arg) is bool:
- value = 'yes' if arg else 'no'
- else:
- value = arg
-
- return '-DSEASTAR_{}={}'.format(new_name, value)
diff --git a/core/alien.cc b/src/core/alien.cc
similarity index 97%
rename from core/alien.cc
rename to src/core/alien.cc
index 5f60b95b..64ff10db 100644
--- a/core/alien.cc
+++ b/src/core/alien.cc
@@ -20,9 +20,9 @@
* Copyright (C) 2018 Red Hat
*/
-#include "alien.hh"
-#include "metrics.hh"
-#include "prefetch.hh"
+#include <seastar/core/alien.hh>
+#include <seastar/core/metrics.hh>
+#include <seastar/core/prefetch.hh>
namespace seastar {
namespace alien {
diff --git a/core/app-template.cc b/src/core/app-template.cc
similarity index 95%
rename from core/app-template.cc
rename to src/core/app-template.cc
index b7c31a35..ca861141 100644
--- a/core/app-template.cc
+++ b/src/core/app-template.cc
@@ -19,14 +19,14 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "app-template.hh"
-#include "core/reactor.hh"
-#include "core/scollectd.hh"
-#include "core/metrics_api.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/scollectd.hh>
+#include <seastar/core/metrics_api.hh>
#include <boost/program_options.hpp>
-#include "core/print.hh"
-#include "util/log.hh"
-#include "util/log-cli.hh"
+#include <seastar/core/print.hh>
+#include <seastar/util/log.hh>
+#include <seastar/util/log-cli.hh>
#include <boost/program_options.hpp>
#include <boost/make_shared.hpp>
#include <fstream>
diff --git a/core/dpdk_rte.cc b/src/core/dpdk_rte.cc
similarity index 96%
rename from core/dpdk_rte.cc
rename to src/core/dpdk_rte.cc
index fba0b5af..af445b6f 100644
--- a/core/dpdk_rte.cc
+++ b/src/core/dpdk_rte.cc
@@ -18,9 +18,9 @@
#ifdef SEASTAR_HAVE_DPDK
#include <cinttypes>
-#include "net/dpdk.hh"
-#include "core/dpdk_rte.hh"
-#include "util/conversions.hh"
+#include <seastar/net/dpdk.hh>
+#include <seastar/core/dpdk_rte.hh>
+#include <seastar/util/conversions.hh>
#include <experimental/optional>
#include <rte_pci.h>
diff --git a/core/exception_hacks.cc b/src/core/exception_hacks.cc
similarity index 97%
rename from core/exception_hacks.cc
rename to src/core/exception_hacks.cc
index 71038181..bceff34d 100644
--- a/core/exception_hacks.cc
+++ b/src/core/exception_hacks.cc
@@ -57,9 +57,9 @@
#include <assert.h>
#include <vector>
#include <cstddef>
-#include "exception_hacks.hh"
-#include "reactor.hh"
-#include "util/backtrace.hh"
+#include <seastar/core/exception_hacks.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/util/backtrace.hh>
namespace seastar {
#ifndef SEASTAR_NO_EXCEPTION_HACK
diff --git a/core/execution_stage.cc b/src/core/execution_stage.cc
similarity index 98%
rename from core/execution_stage.cc
rename to src/core/execution_stage.cc
index 8d79ad0c..463fc0bf 100644
--- a/core/execution_stage.cc
+++ b/src/core/execution_stage.cc
@@ -19,8 +19,8 @@
* Copyright (C) 2018 ScyllaDB Ltd.
*/
-#include "execution_stage.hh"
-#include "print.hh"
+#include <seastar/core/execution_stage.hh>
+#include <seastar/core/print.hh>
namespace seastar {
diff --git a/core/file-impl.hh b/src/core/file-impl.hh
similarity index 99%
rename from core/file-impl.hh
rename to src/core/file-impl.hh
index 26460f8a..20af0072 100644
--- a/core/file-impl.hh
+++ b/src/core/file-impl.hh
@@ -21,8 +21,8 @@
#pragma once
-#include "file.hh"
-#include "shared_ptr.hh"
+#include <seastar/core/file.hh>
+#include <seastar/core/shared_ptr.hh>
#include <deque>
#include <atomic>
diff --git a/core/fsqual.cc b/src/core/fsqual.cc
similarity index 95%
rename from core/fsqual.cc
rename to src/core/fsqual.cc
index 8e5dd570..65d69a4d 100644
--- a/core/fsqual.cc
+++ b/src/core/fsqual.cc
@@ -19,9 +19,9 @@
* under the License.
*/
-#include "posix.hh"
-#include "util/defer.hh"
-#include "core/linux-aio.hh"
+#include <seastar/core/posix.hh>
+#include <seastar/util/defer.hh>
+#include <seastar/core/linux-aio.hh>
#include <sys/time.h>
#include <sys/resource.h>
#include <fcntl.h>
@@ -29,7 +29,7 @@
#include <unistd.h>
#include <cstdlib>
#include <type_traits>
-#include "fsqual.hh"
+#include <seastar/core/fsqual.hh>
namespace seastar {
diff --git a/core/fstream.cc b/src/core/fstream.cc
similarity index 99%
rename from core/fstream.cc
rename to src/core/fstream.cc
index 71a7a0ad..e582d162 100644
--- a/core/fstream.cc
+++ b/src/core/fstream.cc
@@ -19,11 +19,11 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "fstream.hh"
-#include "align.hh"
-#include "circular_buffer.hh"
-#include "semaphore.hh"
-#include "reactor.hh"
+#include <seastar/core/fstream.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/reactor.hh>
#include <malloc.h>
#include <string.h>
diff --git a/core/future-util.cc b/src/core/future-util.cc
similarity index 98%
rename from core/future-util.cc
rename to src/core/future-util.cc
index 96d4aa13..bd36cac5 100644
--- a/core/future-util.cc
+++ b/src/core/future-util.cc
@@ -19,7 +19,7 @@
* Copyright (C) 2017 ScyllaDB
*/
-#include "core/sleep.hh"
+#include <seastar/core/sleep.hh>
namespace seastar {
@@ -68,4 +68,4 @@ future<> sleep_abortable(typename Clock::duration dur, abort_source& as) {
template future<> sleep_abortable<steady_clock_type>(typename steady_clock_type::duration, abort_source&);
template future<> sleep_abortable<lowres_clock>(typename lowres_clock::duration, abort_source&);
-}
\ No newline at end of file
+}
diff --git a/core/linux-aio.cc b/src/core/linux-aio.cc
similarity index 99%
rename from core/linux-aio.cc
rename to src/core/linux-aio.cc
index 1ddff279..2e297d3d 100644
--- a/core/linux-aio.cc
+++ b/src/core/linux-aio.cc
@@ -19,7 +19,7 @@
* Copyright (C) 2017 ScyllaDB
*/
-#include "linux-aio.hh"
+#include <seastar/core/linux-aio.hh>
#include <unistd.h>
#include <sys/syscall.h>
#include <atomic>
diff --git a/core/memory.cc b/src/core/memory.cc
similarity index 99%
rename from core/memory.cc
rename to src/core/memory.cc
index 3335f4f0..5b85d469 100644
--- a/core/memory.cc
+++ b/src/core/memory.cc
@@ -52,10 +52,10 @@
// Spans have a size that is a power-of-two and are naturally aligned (aka buddy
// allocator)
-#include "cacheline.hh"
-#include "memory.hh"
-#include "reactor.hh"
-#include "util/alloc_failure_injector.hh"
+#include <seastar/core/cacheline.hh>
+#include <seastar/core/memory.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/util/alloc_failure_injector.hh>
namespace seastar {
@@ -77,10 +77,10 @@ disable_abort_on_alloc_failure_temporarily::~disable_abort_on_alloc_failure_temp
#ifndef SEASTAR_DEFAULT_ALLOCATOR
-#include "bitops.hh"
-#include "align.hh"
-#include "posix.hh"
-#include "shared_ptr.hh"
+#include <seastar/core/bitops.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/posix.hh>
+#include <seastar/core/shared_ptr.hh>
#include <new>
#include <cstdint>
#include <algorithm>
@@ -93,8 +93,8 @@ disable_abort_on_alloc_failure_temporarily::~disable_abort_on_alloc_failure_temp
#include <cstring>
#include <boost/intrusive/list.hpp>
#include <sys/mman.h>
-#include "util/defer.hh"
-#include "util/backtrace.hh"
+#include <seastar/util/defer.hh>
+#include <seastar/util/backtrace.hh>
#ifdef SEASTAR_HAVE_NUMA
#include <numaif.h>
diff --git a/core/metrics.cc b/src/core/metrics.cc
similarity index 99%
rename from core/metrics.cc
rename to src/core/metrics.cc
index c56e480a..6cb11571 100644
--- a/core/metrics.cc
+++ b/src/core/metrics.cc
@@ -19,8 +19,8 @@
* Copyright (C) 2016 ScyllaDB.
*/
-#include "metrics.hh"
-#include "metrics_api.hh"
+#include <seastar/core/metrics.hh>
+#include <seastar/core/metrics_api.hh>
#include <boost/range/algorithm.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/replace.hpp>
diff --git a/core/posix.cc b/src/core/posix.cc
similarity index 98%
rename from core/posix.cc
rename to src/core/posix.cc
index 7dae9804..8e0de27e 100644
--- a/core/posix.cc
+++ b/src/core/posix.cc
@@ -19,8 +19,8 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "posix.hh"
-#include "align.hh"
+#include <seastar/core/posix.hh>
+#include <seastar/core/align.hh>
#include <sys/mman.h>
namespace seastar {
diff --git a/core/prometheus.cc b/src/core/prometheus.cc
similarity index 99%
rename from core/prometheus.cc
rename to src/core/prometheus.cc
index cee22630..28a63c85 100644
--- a/core/prometheus.cc
+++ b/src/core/prometheus.cc
@@ -19,16 +19,16 @@
* Copyright (C) 2016 ScyllaDB
*/
-#include "prometheus.hh"
+#include <seastar/core/prometheus.hh>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
-#include "proto/metrics2.pb.h"
+#include <seastar/proto/metrics2.pb.h>
#include <sstream>
-#include "scollectd_api.hh"
-#include "scollectd-impl.hh"
-#include "metrics_api.hh"
-#include "http/function_handlers.hh"
+#include <seastar/core/scollectd_api.hh>
+#include "core/scollectd-impl.hh"
+#include <seastar/core/metrics_api.hh>
+#include <seastar/http/function_handlers.hh>
#include <boost/algorithm/string/replace.hpp>
#include <boost/range/algorithm_ext/erase.hpp>
#include <boost/algorithm/string.hpp>
diff --git a/core/reactor.cc b/src/core/reactor.cc
similarity index 99%
rename from core/reactor.cc
rename to src/core/reactor.cc
index c27eb7ce..183e481a 100644
--- a/core/reactor.cc
+++ b/src/core/reactor.cc
@@ -27,25 +27,25 @@
#include <sys/statfs.h>
#include <sys/time.h>
#include <sys/resource.h>
-#include "task.hh"
-#include "reactor.hh"
-#include "memory.hh"
-#include "core/posix.hh"
-#include "net/packet.hh"
-#include "net/stack.hh"
-#include "net/posix-stack.hh"
-#include "resource.hh"
-#include "print.hh"
-#include "scollectd-impl.hh"
-#include "util/conversions.hh"
-#include "core/future-util.hh"
-#include "thread.hh"
-#include "systemwide_memory_barrier.hh"
-#include "report_exception.hh"
-#include "core/stall_sampler.hh"
-#include "core/thread_cputime_clock.hh"
-#include "util/log.hh"
-#include "file-impl.hh"
+#include <seastar/core/task.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/memory.hh>
+#include <seastar/core/posix.hh>
+#include <seastar/net/packet.hh>
+#include <seastar/net/stack.hh>
+#include <seastar/net/posix-stack.hh>
+#include <seastar/core/resource.hh>
+#include <seastar/core/print.hh>
+#include "core/scollectd-impl.hh"
+#include <seastar/util/conversions.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/thread.hh>
+#include <seastar/core/systemwide_memory_barrier.hh>
+#include <seastar/core/report_exception.hh>
+#include <seastar/core/stall_sampler.hh>
+#include <seastar/core/thread_cputime_clock.hh>
+#include <seastar/util/log.hh>
+#include "core/file-impl.hh"
#include <cassert>
#include <unistd.h>
#include <fcntl.h>
@@ -73,11 +73,11 @@
#include <xfs/xfs.h>
#undef min
#ifdef SEASTAR_HAVE_DPDK
-#include <core/dpdk_rte.hh>
+#include <seastar/core/dpdk_rte.hh>
#include <rte_lcore.h>
#include <rte_launch.h>
#endif
-#include "prefetch.hh"
+#include <seastar/core/prefetch.hh>
#include <exception>
#include <regex>
#ifdef __GNUC__
@@ -94,9 +94,9 @@
#include <sys/utsname.h>
#include <linux/falloc.h>
#include <linux/magic.h>
-#include "util/backtrace.hh"
-#include "util/spinlock.hh"
-#include "util/print_safe.hh"
+#include <seastar/util/backtrace.hh>
+#include <seastar/util/spinlock.hh>
+#include <seastar/util/print_safe.hh>
#include <sys/sdt.h>
#ifdef HAVE_OSV
@@ -107,11 +107,11 @@
#include <xmmintrin.h>
#endif
-#include "util/defer.hh"
-#include "core/alien.hh"
-#include "core/metrics.hh"
-#include "execution_stage.hh"
-#include "exception_hacks.hh"
+#include <seastar/util/defer.hh>
+#include <seastar/core/alien.hh>
+#include <seastar/core/metrics.hh>
+#include <seastar/core/execution_stage.hh>
+#include <seastar/core/exception_hacks.hh>
#include <yaml-cpp/yaml.h>
diff --git a/core/resource.cc b/src/core/resource.cc
similarity index 98%
rename from core/resource.cc
rename to src/core/resource.cc
index b392afe5..9d4fe0d6 100644
--- a/core/resource.cc
+++ b/src/core/resource.cc
@@ -22,9 +22,9 @@
#include <boost/program_options.hpp>
#include <boost/algorithm/string.hpp>
#include <regex>
-#include "resource.hh"
-#include "core/align.hh"
-#include "core/print.hh"
+#include <seastar/core/resource.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/print.hh>
namespace seastar {
@@ -91,8 +91,8 @@ size_t calculate_memory(configuration c, size_t available_memory, float panic_fa
#ifdef SEASTAR_HAVE_HWLOC
-#include "util/defer.hh"
-#include "core/print.hh"
+#include <seastar/util/defer.hh>
+#include <seastar/core/print.hh>
#include <hwloc.h>
#include <unordered_map>
#include <boost/range/irange.hpp>
@@ -339,7 +339,7 @@ unsigned nr_processing_units() {
#else
-#include "resource.hh"
+#include <seastar/core/resource.hh>
#include <unistd.h>
namespace seastar {
diff --git a/core/scollectd-impl.hh b/src/core/scollectd-impl.hh
similarity index 95%
rename from core/scollectd-impl.hh
rename to src/core/scollectd-impl.hh
index bb21705f..75a7db34 100644
--- a/core/scollectd-impl.hh
+++ b/src/core/scollectd-impl.hh
@@ -21,9 +21,9 @@
#pragma once
-#include "core/scollectd.hh"
-#include "core/reactor.hh"
-#include "core/metrics_api.hh"
+#include <seastar/core/scollectd.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/metrics_api.hh>
namespace seastar {
diff --git a/core/scollectd.cc b/src/core/scollectd.cc
similarity index 99%
rename from core/scollectd.cc
rename to src/core/scollectd.cc
index edc268a5..76e9b61f 100644
--- a/core/scollectd.cc
+++ b/src/core/scollectd.cc
@@ -28,11 +28,12 @@
#include <iostream>
#include <unordered_map>
-#include "scollectd-impl.hh"
-#include "core/future-util.hh"
-#include "scollectd_api.hh"
-#include "core/metrics_api.hh"
-#include "core/byteorder.hh"
+#include <seastar/core/future-util.hh>
+#include <seastar/core/scollectd_api.hh>
+#include <seastar/core/metrics_api.hh>
+#include <seastar/core/byteorder.hh>
+
+#include "core/scollectd-impl.hh"
namespace seastar {
diff --git a/core/systemwide_memory_barrier.cc b/src/core/systemwide_memory_barrier.cc
similarity index 96%
rename from core/systemwide_memory_barrier.cc
rename to src/core/systemwide_memory_barrier.cc
index d65efea0..a227be5d 100644
--- a/core/systemwide_memory_barrier.cc
+++ b/src/core/systemwide_memory_barrier.cc
@@ -19,9 +19,9 @@
* Copyright 2015 Scylla DB
*/
-#include "systemwide_memory_barrier.hh"
-#include "cacheline.hh"
-#include "../util/log.hh"
+#include <seastar/core/systemwide_memory_barrier.hh>
+#include <seastar/core/cacheline.hh>
+#include <seastar/util/log.hh>
#include <sys/mman.h>
#include <unistd.h>
#include <cassert>
diff --git a/core/thread.cc b/src/core/thread.cc
similarity index 99%
rename from core/thread.cc
rename to src/core/thread.cc
index e4ac13cf..3d2407f4 100644
--- a/core/thread.cc
+++ b/src/core/thread.cc
@@ -20,8 +20,8 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "thread.hh"
-#include "posix.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/core/posix.hh>
#include <ucontext.h>
#include <algorithm>
diff --git a/http/api_docs.cc b/src/http/api_docs.cc
similarity index 89%
rename from http/api_docs.cc
rename to src/http/api_docs.cc
index 14c277ba..d74e7f1f 100644
--- a/http/api_docs.cc
+++ b/src/http/api_docs.cc
@@ -19,13 +19,13 @@
* Copyright 2015 Cloudius Systems
*/
-#include "api_docs.hh"
-#include "handlers.hh"
-#include "json/formatter.hh"
-#include "transformers.hh"
-#include "core/reactor.hh"
-#include "core/fstream.hh"
-#include "http/transformers.hh"
+#include <seastar/http/api_docs.hh>
+#include <seastar/http/handlers.hh>
+#include <seastar/json/formatter.hh>
+#include <seastar/http/transformers.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/fstream.hh>
+#include <seastar/http/transformers.hh>
using namespace std;
diff --git a/http/common.cc b/src/http/common.cc
similarity index 96%
rename from http/common.cc
rename to src/http/common.cc
index 1612e0ef..892135b0 100644
--- a/http/common.cc
+++ b/src/http/common.cc
@@ -19,7 +19,7 @@
* Copyright 2015 Cloudius Systems
*/
-#include "common.hh"
+#include <seastar/http/common.hh>
namespace seastar {
diff --git a/http/file_handler.cc b/src/http/file_handler.cc
similarity index 95%
rename from http/file_handler.cc
rename to src/http/file_handler.cc
index 730a52e0..1973379c 100644
--- a/http/file_handler.cc
+++ b/src/http/file_handler.cc
@@ -19,14 +19,14 @@
* Copyright 2015 Cloudius Systems
*/
-#include "file_handler.hh"
+#include <seastar/http/file_handler.hh>
#include <algorithm>
#include <iostream>
-#include "core/reactor.hh"
-#include "core/fstream.hh"
-#include "core/shared_ptr.hh"
-#include "core/app-template.hh"
-#include "exception.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/fstream.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/http/exception.hh>
namespace seastar {
diff --git a/http/httpd.cc b/src/http/httpd.cc
similarity index 95%
rename from http/httpd.cc
rename to src/http/httpd.cc
index 1d5372e8..7439f37f 100644
--- a/http/httpd.cc
+++ b/src/http/httpd.cc
@@ -19,14 +19,14 @@
* Copyright 2015 Cloudius Systems
*/
-#include "core/reactor.hh"
-#include "core/sstring.hh"
-#include "core/app-template.hh"
-#include "core/circular_buffer.hh"
-#include "core/distributed.hh"
-#include "core/queue.hh"
-#include "core/future-util.hh"
-#include "core/metrics.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/distributed.hh>
+#include <seastar/core/queue.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/metrics.hh>
#include <iostream>
#include <algorithm>
#include <unordered_map>
@@ -35,8 +35,8 @@
#include <limits>
#include <cctype>
#include <vector>
-#include "httpd.hh"
-#include "reply.hh"
+#include <seastar/http/httpd.hh>
+#include <seastar/http/reply.hh>
using namespace std::chrono_literals;
diff --git a/http/json_path.cc b/src/http/json_path.cc
similarity index 98%
rename from http/json_path.cc
rename to src/http/json_path.cc
index 8f04409b..125b0d9a 100644
--- a/http/json_path.cc
+++ b/src/http/json_path.cc
@@ -19,7 +19,7 @@
* Copyright 2015 Cloudius Systems
*/
-#include "json_path.hh"
+#include <seastar/http/json_path.hh>
namespace seastar {
diff --git a/http/matcher.cc b/src/http/matcher.cc
similarity index 98%
rename from http/matcher.cc
rename to src/http/matcher.cc
index 3dc706e4..a1b3bcde 100644
--- a/http/matcher.cc
+++ b/src/http/matcher.cc
@@ -19,7 +19,7 @@
* Copyright 2015 Cloudius Systems
*/
-#include "matcher.hh"
+#include <seastar/http/matcher.hh>
#include <iostream>
diff --git a/http/mime_types.cc b/src/http/mime_types.cc
similarity index 96%
rename from http/mime_types.cc
rename to src/http/mime_types.cc
index 73c66429..a9f5e6e9 100644
--- a/http/mime_types.cc
+++ b/src/http/mime_types.cc
@@ -8,7 +8,7 @@
// file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
//
-#include "mime_types.hh"
+#include <seastar/http/mime_types.hh>
namespace seastar {
diff --git a/http/reply.cc b/src/http/reply.cc
similarity index 98%
rename from http/reply.cc
rename to src/http/reply.cc
index 8849e044..18278417 100644
--- a/http/reply.cc
+++ b/src/http/reply.cc
@@ -28,9 +28,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
//
-#include "reply.hh"
-#include "core/print.hh"
-#include "httpd.hh"
+#include <seastar/http/reply.hh>
+#include <seastar/core/print.hh>
+#include <seastar/http/httpd.hh>
namespace seastar {
diff --git a/http/routes.cc b/src/http/routes.cc
similarity index 97%
rename from http/routes.cc
rename to src/http/routes.cc
index e1fc3852..41cac318 100644
--- a/http/routes.cc
+++ b/src/http/routes.cc
@@ -19,10 +19,10 @@
* Copyright 2015 Cloudius Systems
*/
-#include "routes.hh"
-#include "reply.hh"
-#include "exception.hh"
-#include "json_path.hh"
+#include <seastar/http/routes.hh>
+#include <seastar/http/reply.hh>
+#include <seastar/http/exception.hh>
+#include <seastar/http/json_path.hh>
namespace seastar {
diff --git a/http/transformers.cc b/src/http/transformers.cc
similarity index 99%
rename from http/transformers.cc
rename to src/http/transformers.cc
index 37af7c52..c8f01fdf 100644
--- a/http/transformers.cc
+++ b/src/http/transformers.cc
@@ -20,7 +20,7 @@
*/
#include <boost/algorithm/string/replace.hpp>
-#include "transformers.hh"
+#include <seastar/http/transformers.hh>
#include <experimental/string_view>
#include <list>
diff --git a/json/formatter.cc b/src/json/formatter.cc
similarity index 96%
rename from json/formatter.cc
rename to src/json/formatter.cc
index 7f42c06a..10e3ec48 100644
--- a/json/formatter.cc
+++ b/src/json/formatter.cc
@@ -19,8 +19,8 @@
* Copyright 2015 Cloudius Systems
*/
-#include "formatter.hh"
-#include "json_elements.hh"
+#include <seastar/json/formatter.hh>
+#include <seastar/json/json_elements.hh>
#include <cmath>
namespace seastar {
diff --git a/json/json_elements.cc b/src/json/json_elements.cc
similarity index 99%
rename from json/json_elements.cc
rename to src/json/json_elements.cc
index 9b7d5fb5..2d3afaaa 100644
--- a/json/json_elements.cc
+++ b/src/json/json_elements.cc
@@ -19,7 +19,7 @@
* Copyright 2015 Cloudius Systems
*/
-#include "json_elements.hh"
+#include <seastar/json/json_elements.hh>
#include <string.h>
#include <string>
#include <vector>
diff --git a/net/arp.cc b/src/net/arp.cc
similarity index 98%
rename from net/arp.cc
rename to src/net/arp.cc
index 9b8dc86a..aaed6f77 100644
--- a/net/arp.cc
+++ b/src/net/arp.cc
@@ -19,7 +19,7 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "arp.hh"
+#include <seastar/net/arp.hh>
namespace seastar {
diff --git a/net/config.cc b/src/net/config.cc
similarity index 98%
rename from net/config.cc
rename to src/net/config.cc
index db64081e..2437199d 100644
--- a/net/config.cc
+++ b/src/net/config.cc
@@ -19,8 +19,8 @@
* Copyright 2017 Marek Waszkiewicz (
marek.was...@gmail.com )
*/
-#include "net/config.hh"
-#include "core/print.hh"
+#include <seastar/net/config.hh>
+#include <seastar/core/print.hh>
#include <boost/algorithm/cxx11/all_of.hpp>
#include <boost/algorithm/cxx11/none_of.hpp>
#include <yaml-cpp/yaml.h>
diff --git a/net/dhcp.cc b/src/net/dhcp.cc
similarity index 99%
rename from net/dhcp.cc
rename to src/net/dhcp.cc
index f1340913..a1a52ab7 100644
--- a/net/dhcp.cc
+++ b/src/net/dhcp.cc
@@ -24,10 +24,10 @@
#include <array>
#include <random>
-#include "dhcp.hh"
-#include "ip.hh"
-#include "udp.hh"
-#include "stack.hh"
+#include <seastar/net/dhcp.hh>
+#include <seastar/net/ip.hh>
+#include <seastar/net/udp.hh>
+#include <seastar/net/stack.hh>
namespace seastar {
diff --git a/net/dns.cc b/src/net/dns.cc
similarity index 99%
rename from net/dns.cc
rename to src/net/dns.cc
index 4fe23b91..4a4e520e 100644
--- a/net/dns.cc
+++ b/src/net/dns.cc
@@ -22,16 +22,16 @@
#include <chrono>
#include <experimental/string_view>
-#include <c-ares/ares.h>
-
-#include "ip.hh"
-#include "api.hh"
-#include "dns.hh"
-#include "core/sstring.hh"
-#include "core/timer.hh"
-#include "core/reactor.hh"
-#include "core/gate.hh"
-#include "util/log.hh"
+#include <ares.h>
+
+#include <seastar/net/ip.hh>
+#include <seastar/net/api.hh>
+#include <seastar/net/dns.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/timer.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/gate.hh>
+#include <seastar/util/log.hh>
namespace seastar {
diff --git a/net/dpdk.cc b/src/net/dpdk.cc
similarity index 99%
rename from net/dpdk.cc
rename to src/net/dpdk.cc
index b1af6f39..97e09853 100644
--- a/net/dpdk.cc
+++ b/src/net/dpdk.cc
@@ -21,28 +21,28 @@
#ifdef SEASTAR_HAVE_DPDK
#include <cinttypes>
-#include "core/posix.hh"
-#include "core/vla.hh"
-#include "virtio-interface.hh"
-#include "core/reactor.hh"
-#include "core/stream.hh"
-#include "core/circular_buffer.hh"
-#include "core/align.hh"
-#include "core/sstring.hh"
-#include "core/memory.hh"
-#include "core/metrics.hh"
-#include "util/function_input_iterator.hh"
-#include "util/transform_iterator.hh"
+#include <seastar/core/posix.hh>
+#include <seastar/core/vla.hh>
+#include <seastar/net/virtio-interface.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/stream.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/memory.hh>
+#include <seastar/core/metrics.hh>
+#include <seastar/util/function_input_iterator.hh>
+#include <seastar/util/transform_iterator.hh>
#include <atomic>
#include <vector>
#include <queue>
#include <experimental/optional>
#include <boost/preprocessor.hpp>
-#include "ip.hh"
-#include "const.hh"
-#include "core/dpdk_rte.hh"
-#include "dpdk.hh"
-#include "toeplitz.hh"
+#include <seastar/net/ip.hh>
+#include <seastar/net/const.hh>
+#include <seastar/core/dpdk_rte.hh>
+#include <seastar/net/dpdk.hh>
+#include <seastar/net/toeplitz.hh>
#include <getopt.h>
#include <malloc.h>
diff --git a/net/ethernet.cc b/src/net/ethernet.cc
similarity index 97%
rename from net/ethernet.cc
rename to src/net/ethernet.cc
index c1dfa399..bbffeec0 100644
--- a/net/ethernet.cc
+++ b/src/net/ethernet.cc
@@ -19,7 +19,7 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "ethernet.hh"
+#include <seastar/net/ethernet.hh>
#include <boost/algorithm/string.hpp>
#include <string>
diff --git a/net/inet_address.cc b/src/net/inet_address.cc
similarity index 96%
rename from net/inet_address.cc
rename to src/net/inet_address.cc
index 6bc12b90..d34f0f7c 100644
--- a/net/inet_address.cc
+++ b/src/net/inet_address.cc
@@ -22,10 +22,10 @@
#include <ostream>
#include <arpa/inet.h>
-#include "inet_address.hh"
-#include "socket_defs.hh"
-#include "dns.hh"
-#include "ip.hh"
+#include <seastar/net/inet_address.hh>
+#include <seastar/net/socket_defs.hh>
+#include <seastar/net/dns.hh>
+#include <seastar/net/ip.hh>
namespace seastar {
diff --git a/net/ip.cc b/src/net/ip.cc
similarity index 98%
rename from net/ip.cc
rename to src/net/ip.cc
index e3d9e61f..e9e668f4 100644
--- a/net/ip.cc
+++ b/src/net/ip.cc
@@ -20,12 +20,12 @@
*
*/
-#include "ip.hh"
-#include "core/print.hh"
-#include "core/future-util.hh"
-#include "core/shared_ptr.hh"
-#include "toeplitz.hh"
-#include "core/metrics.hh"
+#include <seastar/net/ip.hh>
+#include <seastar/core/print.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/net/toeplitz.hh>
+#include <seastar/core/metrics.hh>
namespace seastar {
diff --git a/net/ip_checksum.cc b/src/net/ip_checksum.cc
similarity index 96%
rename from net/ip_checksum.cc
rename to src/net/ip_checksum.cc
index 3bee20ad..d2112f28 100644
--- a/net/ip_checksum.cc
+++ b/src/net/ip_checksum.cc
@@ -19,8 +19,8 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "ip_checksum.hh"
-#include "net.hh"
+#include <seastar/net/ip_checksum.hh>
+#include <seastar/net/net.hh>
#include <arpa/inet.h>
namespace seastar {
diff --git a/net/native-stack-impl.hh b/src/net/native-stack-impl.hh
similarity index 99%
rename from net/native-stack-impl.hh
rename to src/net/native-stack-impl.hh
index 13167f5e..60a9d1e1 100644
--- a/net/native-stack-impl.hh
+++ b/src/net/native-stack-impl.hh
@@ -22,8 +22,8 @@
#ifndef NET_NATIVE_STACK_IMPL_HH_
#define NET_NATIVE_STACK_IMPL_HH_
-#include "core/reactor.hh"
-#include "stack.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/net/stack.hh>
namespace seastar {
diff --git a/net/native-stack.cc b/src/net/native-stack.cc
similarity index 96%
rename from net/native-stack.cc
rename to src/net/native-stack.cc
index 8e346422..678e96e4 100644
--- a/net/native-stack.cc
+++ b/src/net/native-stack.cc
@@ -19,18 +19,18 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "native-stack.hh"
-#include "native-stack-impl.hh"
-#include "net.hh"
-#include "ip.hh"
-#include "tcp-stack.hh"
-#include "tcp.hh"
-#include "udp.hh"
-#include "virtio.hh"
-#include "dpdk.hh"
-#include "proxy.hh"
-#include "dhcp.hh"
-#include "config.hh"
+#include <seastar/net/native-stack.hh>
+#include "net/native-stack-impl.hh"
+#include <seastar/net/net.hh>
+#include <seastar/net/ip.hh>
+#include <seastar/net/tcp-stack.hh>
+#include <seastar/net/tcp.hh>
+#include <seastar/net/udp.hh>
+#include <seastar/net/virtio.hh>
+#include <seastar/net/dpdk.hh>
+#include <seastar/net/proxy.hh>
+#include <seastar/net/dhcp.hh>
+#include <seastar/net/config.hh>
#include <memory>
#include <queue>
#include <fstream>
diff --git a/net/net.cc b/src/net/net.cc
similarity index 98%
rename from net/net.cc
rename to src/net/net.cc
index 8ba2ca92..67dac427 100644
--- a/net/net.cc
+++ b/src/net/net.cc
@@ -22,11 +22,11 @@
#include <boost/asio/ip/address_v4.hpp>
#include <boost/algorithm/string.hpp>
-#include "net.hh"
+#include <seastar/net/net.hh>
#include <utility>
-#include "toeplitz.hh"
-#include "core/metrics.hh"
-#include "inet_address.hh"
+#include <seastar/net/toeplitz.hh>
+#include <seastar/core/metrics.hh>
+#include <seastar/net/inet_address.hh>
namespace seastar {
diff --git a/net/packet.cc b/src/net/packet.cc
similarity index 98%
rename from net/packet.cc
rename to src/net/packet.cc
index 312e070b..e348e9a4 100644
--- a/net/packet.cc
+++ b/src/net/packet.cc
@@ -19,8 +19,8 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/reactor.hh"
-#include "packet.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/net/packet.hh>
#include <iostream>
#include <algorithm>
#include <cctype>
diff --git a/net/posix-stack.cc b/src/net/posix-stack.cc
similarity index 99%
rename from net/posix-stack.cc
rename to src/net/posix-stack.cc
index 0baad9fc..cf7480dc 100644
--- a/net/posix-stack.cc
+++ b/src/net/posix-stack.cc
@@ -19,10 +19,10 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "posix-stack.hh"
-#include "net.hh"
-#include "packet.hh"
-#include "api.hh"
+#include <seastar/net/posix-stack.hh>
+#include <seastar/net/net.hh>
+#include <seastar/net/packet.hh>
+#include <seastar/net/api.hh>
#include <netinet/tcp.h>
#include <netinet/sctp.h>
diff --git a/net/proxy.cc b/src/net/proxy.cc
similarity index 97%
rename from net/proxy.cc
rename to src/net/proxy.cc
index 32ef9c72..be85fe92 100644
--- a/net/proxy.cc
+++ b/src/net/proxy.cc
@@ -15,8 +15,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-#include "core/reactor.hh"
-#include "proxy.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/net/proxy.hh>
#include <utility>
namespace seastar {
diff --git a/net/stack.cc b/src/net/stack.cc
similarity index 98%
rename from net/stack.cc
rename to src/net/stack.cc
index 1820f35b..0193d579 100644
--- a/net/stack.cc
+++ b/src/net/stack.cc
@@ -19,8 +19,8 @@
* Copyright 2015 Cloudius Systems
*/
-#include "stack.hh"
-#include "core/reactor.hh"
+#include <seastar/net/stack.hh>
+#include <seastar/core/reactor.hh>
namespace seastar {
diff --git a/net/tcp.cc b/src/net/tcp.cc
similarity index 96%
rename from net/tcp.cc
rename to src/net/tcp.cc
index 8d0edcb8..0f6d8724 100644
--- a/net/tcp.cc
+++ b/src/net/tcp.cc
@@ -19,12 +19,12 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "tcp.hh"
-#include "tcp-stack.hh"
-#include "ip.hh"
-#include "core/align.hh"
-#include "core/future.hh"
-#include "native-stack-impl.hh"
+#include <seastar/net/tcp.hh>
+#include <seastar/net/tcp-stack.hh>
+#include <seastar/net/ip.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/future.hh>
+#include "net/native-stack-impl.hh"
namespace seastar {
diff --git a/net/tls.cc b/src/net/tls.cc
similarity index 99%
rename from net/tls.cc
rename to src/net/tls.cc
index 94b4feb9..6fa0b5b1 100644
--- a/net/tls.cc
+++ b/src/net/tls.cc
@@ -25,13 +25,13 @@
#include <experimental/optional>
#include <system_error>
-#include "core/reactor.hh"
-#include "core/thread.hh"
-#include "core/sstring.hh"
-#include "core/semaphore.hh"
-#include "core/timer.hh"
-#include "tls.hh"
-#include "stack.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/thread.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/timer.hh>
+#include <seastar/net/tls.hh>
+#include <seastar/net/stack.hh>
namespace seastar {
diff --git a/net/udp.cc b/src/net/udp.cc
similarity index 99%
rename from net/udp.cc
rename to src/net/udp.cc
index 5e96d76e..48ab7c1b 100644
--- a/net/udp.cc
+++ b/src/net/udp.cc
@@ -19,8 +19,8 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "ip.hh"
-#include "stack.hh"
+#include <seastar/net/ip.hh>
+#include <seastar/net/stack.hh>
namespace seastar {
diff --git a/net/virtio.cc b/src/net/virtio.cc
similarity index 98%
rename from net/virtio.cc
rename to src/net/virtio.cc
index fc9d9c6a..ae3e47b2 100644
--- a/net/virtio.cc
+++ b/src/net/virtio.cc
@@ -19,27 +19,27 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "virtio.hh"
-#include "core/posix.hh"
-#include "core/future-util.hh"
-#include "core/vla.hh"
-#include "virtio-interface.hh"
-#include "core/reactor.hh"
-#include "core/stream.hh"
-#include "core/circular_buffer.hh"
-#include "core/align.hh"
-#include "core/metrics.hh"
-#include "util/function_input_iterator.hh"
-#include "util/transform_iterator.hh"
+#include <seastar/net/virtio.hh>
+#include <seastar/core/posix.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/vla.hh>
+#include <seastar/net/virtio-interface.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/stream.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/align.hh>
+#include <seastar/core/metrics.hh>
+#include <seastar/util/function_input_iterator.hh>
+#include <seastar/util/transform_iterator.hh>
#include <atomic>
#include <vector>
#include <queue>
#include <fcntl.h>
#include <linux/vhost.h>
#include <linux/if_tun.h>
-#include "ip.hh"
-#include "const.hh"
-#include "net/native-stack.hh"
+#include <seastar/net/ip.hh>
+#include <seastar/net/const.hh>
+#include <seastar/net/native-stack.hh>
#ifdef HAVE_OSV
#include <osv/virtio-assign.hh>
diff --git a/rpc/lz4_compressor.cc b/src/rpc/lz4_compressor.cc
similarity index 97%
rename from rpc/lz4_compressor.cc
rename to src/rpc/lz4_compressor.cc
index 2cca3b9e..2089c399 100644
--- a/rpc/lz4_compressor.cc
+++ b/src/rpc/lz4_compressor.cc
@@ -19,8 +19,8 @@
* Copyright (C) 2016 Scylladb, Ltd.
*/
-#include "lz4_compressor.hh"
-#include "core/byteorder.hh"
+#include <seastar/rpc/lz4_compressor.hh>
+#include <seastar/core/byteorder.hh>
namespace seastar {
diff --git a/rpc/rpc.cc b/src/rpc/rpc.cc
similarity index 99%
rename from rpc/rpc.cc
rename to src/rpc/rpc.cc
index f4a1de1e..a8e0067c 100644
--- a/rpc/rpc.cc
+++ b/src/rpc/rpc.cc
@@ -1,4 +1,4 @@
-#include "rpc.hh"
+#include <seastar/rpc/rpc.hh>
#include <boost/range/adaptor/map.hpp>
namespace seastar {
diff --git a/util/alloc_failure_injector.cc b/src/util/alloc_failure_injector.cc
similarity index 90%
rename from util/alloc_failure_injector.cc
rename to src/util/alloc_failure_injector.cc
index 8d551dc1..36b7a03a 100644
--- a/util/alloc_failure_injector.cc
+++ b/src/util/alloc_failure_injector.cc
@@ -19,10 +19,10 @@
* Copyright 2017 ScyllaDB
*/
-#include "util/alloc_failure_injector.hh"
-#include "util/backtrace.hh"
-#include "util/log.hh"
-#include "util/defer.hh"
+#include <seastar/util/alloc_failure_injector.hh>
+#include <seastar/util/backtrace.hh>
+#include <seastar/util/log.hh>
+#include <seastar/util/defer.hh>
namespace seastar {
namespace memory {
diff --git a/util/backtrace.cc b/src/util/backtrace.cc
similarity index 97%
rename from util/backtrace.cc
rename to src/util/backtrace.cc
index 4d8b6f1e..33e4fc79 100644
--- a/util/backtrace.cc
+++ b/src/util/backtrace.cc
@@ -18,7 +18,7 @@
/*
* Copyright 2017 ScyllaDB
*/
-#include "backtrace.hh"
+#include <seastar/util/backtrace.hh>
#include <link.h>
#include <sys/types.h>
@@ -27,7 +27,7 @@
#include <errno.h>
#include <string.h>
-#include "core/print.hh"
+#include <seastar/core/print.hh>
namespace seastar {
diff --git a/util/conversions.cc b/src/util/conversions.cc
similarity index 95%
rename from util/conversions.cc
rename to src/util/conversions.cc
index 94310d0d..62abdc1d 100644
--- a/util/conversions.cc
+++ b/src/util/conversions.cc
@@ -22,8 +22,8 @@
#ifndef CONVERSIONS_CC_
#define CONVERSIONS_CC_
-#include "conversions.hh"
-#include "core/print.hh"
+#include <seastar/util/conversions.hh>
+#include <seastar/core/print.hh>
#include <boost/lexical_cast.hpp>
#include <cctype>
diff --git a/util/log.cc b/src/util/log.cc
similarity index 98%
rename from util/log.cc
rename to src/util/log.cc
index 9280252d..4d6d48fa 100644
--- a/util/log.cc
+++ b/src/util/log.cc
@@ -19,13 +19,13 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "fmt/time.h"
+#include <fmt/time.h>
-#include "log.hh"
-#include "log-cli.hh"
+#include <seastar/util/log.hh>
+#include <seastar/util/log-cli.hh>
-#include "core/array_map.hh"
-#include "core/reactor.hh"
+#include <seastar/core/array_map.hh>
+#include <seastar/core/reactor.hh>
#include <boost/any.hpp>
#include <boost/lexical_cast.hpp>
diff --git a/util/program-options.cc b/src/util/program-options.cc
similarity index 98%
rename from util/program-options.cc
rename to src/util/program-options.cc
index e3e868c8..db297363 100644
--- a/util/program-options.cc
+++ b/src/util/program-options.cc
@@ -20,7 +20,7 @@
* Copyright (C) 2017 ScyllaDB
*/
-#include "program-options.hh"
+#include <seastar/util/program-options.hh>
#include <regex>
diff --git a/test.py b/test.py
deleted file mode 100755
index 3cbba412..00000000
--- a/test.py
+++ /dev/null
@@ -1,232 +0,0 @@
-#!/usr/bin/env python3
-#
-# This file is open source software, licensed to you under the terms
-# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
-# distributed with this work for additional information regarding copyright
-# ownership. You may not use this file except in compliance with the License.
-#
-# You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-import os
-import sys
-import argparse
-import subprocess
-import signal
-import re
-import seastar_cmake
-
-boost_tests = [
- 'alloc_test',
- 'futures_test',
- 'thread_test',
- 'memcached/memcached_ascii_parser_test',
- 'sstring_test',
- 'unwind_test',
- 'defer_test',
- 'output_stream_test',
- 'httpd_test',
- 'fstream_test',
- 'foreign_ptr_test',
- 'semaphore_test',
- 'expiring_fifo_test',
- 'shared_ptr_test',
- 'weak_ptr_test',
- 'file_io_test',
- 'packet_test',
- 'tls_test',
- 'rpc_test',
- 'connect_test',
- 'json_formatter_test',
- 'execution_stage_test',
- 'lowres_clock_test',
- 'program_options_test',
- 'tuple_utils_test',
- 'noncopyable_function_test',
- 'abort_source_test',
-]
-
-other_tests = [
- 'smp_test',
- 'timer_test',
- 'directory_test',
- 'thread_context_switch_test',
- 'fair_queue_test',
- 'alien_test',
-]
-
-last_len = 0
-
-def print_status_short(msg):
- global last_len
- print('\r' + ' '*last_len, end='')
- last_len = len(msg)
- print('\r' + msg, end='')
-
-print_status_verbose = print
-
-class Alarm(Exception):
- pass
-def alarm_handler(signum, frame):
- raise Alarm
-
-def make_build_path(mode, *suffixes):
- return os.path.join('build', mode, *suffixes)
-
-if __name__ == "__main__":
- all_modes = ['debug', 'release']
-
- parser = argparse.ArgumentParser(description="Seastar test runner")
- parser.add_argument('--fast', action="store_true", help="Run only fast tests")
- parser.add_argument('--name', action="store", help="Run only test whose name contains given string")
- parser.add_argument('--mode', choices=all_modes, help="Run only tests for given build mode")
- parser.add_argument('--timeout', action="store",default="300",type=int, help="timeout value for test execution")
- parser.add_argument('--jenkins', action="store",help="jenkins output file prefix")
- parser.add_argument('--verbose', '-v', action = 'store_true', default = False,
- help = 'Verbose reporting')
- parser.add_argument('--cmake', action='store_true', help='Use the CMake test-runner (CTest)')
- args = parser.parse_args()
-
- # Forwarding to CMake.
- if args.cmake:
- MODES = [args.mode] if args.mode else seastar_cmake.SUPPORTED_MODES
-
- def run_tests(mode):
- BUILD_PATH = seastar_cmake.BUILD_PATHS[mode]
-
- # For convenience.
- tr = seastar_cmake.translate_arg
-
- TRANSLATED_CMAKE_ARGS = [
- tr(args.fast, 'EXECUTE_ONLY_FAST_TESTS'),
- tr(args.jenkins, 'JENKINS', value_when_none=''),
- ]
-
- # Modify the existing build by pointing to the build directory.
- CMAKE_ARGS = seastar_cmake.CMAKE_BASIC_ARGS + [BUILD_PATH] + TRANSLATED_CMAKE_ARGS
- print(CMAKE_ARGS)
- subprocess.check_call(CMAKE_ARGS, shell=False, cwd=BUILD_PATH)
-
- TRANSLATED_CTEST_ARGS = [
- '--timeout', args.timeout
- ] + ['--verbose'] if args.verbose else [
- ] + ['-R',
args.name] if
args.name else [
- ]
-
- CTEST_ARGS = ['ctest', BUILD_PATH] + TRANSLATED_CTEST_ARGS
- print(CTEST_ARGS)
- subprocess.check_call(CTEST_ARGS, shell=False, cwd=BUILD_PATH)
-
- for mode in MODES:
- run_tests(mode)
-
- sys.exit(0)
-
- print_status = print_status_verbose if args.verbose else print_status_short
-
- # Run on 2 shard - it should be enough
- cpu_count = 2
-
- test_to_run = []
- modes_to_run = all_modes if not args.mode else [args.mode]
- for mode in modes_to_run:
- prefix = os.path.join('build', mode, 'tests')
- for test in other_tests:
- test_to_run.append((os.path.join(prefix, test),'other'))
- for test in boost_tests:
- test_to_run.append((os.path.join(prefix, test),'boost'))
- memcached_path = make_build_path(mode, 'apps', 'memcached', 'memcached')
- test_to_run.append(('tests/memcached/test.py --memcached ' + memcached_path + (' --fast' if args.fast else ''),'other'))
- test_to_run.append((os.path.join(prefix, 'distributed_test'),'other'))
-
-
- allocator_test_path = os.path.join(prefix, 'allocator_test')
- if args.fast:
- if mode == 'debug':
- test_to_run.append((allocator_test_path + ' --iterations 5','other'))
- else:
- test_to_run.append((allocator_test_path + ' --time 0.1','other'))
- else:
- test_to_run.append((allocator_test_path,'other'))
-
- if
args.name:
- test_to_run = [t for t in test_to_run if
args.name in t[0]]
-
-
- all_ok = True
-
- n_total = len(test_to_run)
- env = os.environ
- # disable false positive due to new (with_alignment(...)) ...
- env['ASAN_OPTIONS'] = 'alloc_dealloc_mismatch=0'
- for n, test in enumerate(test_to_run):
- path = test[0]
- prefix = '[%d/%d]' % (n + 1, n_total)
- print_status('%s RUNNING %s' % (prefix, path))
- signal.signal(signal.SIGALRM, alarm_handler)
- if args.jenkins and test[1] == 'boost':
- mode = 'release'
- if test[0].startswith(os.path.join('build','debug')):
- mode = 'debug'
- xmlout = args.jenkins+"."+mode+"."+os.path.basename(test[0])+".boost.xml"
- path = path + " --output_format=XML --log_level=all --report_level=no --log_sink=" + xmlout
- print(path)
- if os.path.isfile('tmp.out'):
- os.remove('tmp.out')
- outf=open('tmp.out','w')
-
- # Limit shards count
- if test[1] == 'boost':
- path = path + " -- --smp={}".format(cpu_count)
- else:
- if not re.search("tests/memcached/test.py", path):
- if re.search("allocator_test", path) or re.search("fair_queue_test", path):
- path = path + " -- --smp={}".format(cpu_count)
- else:
- path = path + " --smp={}".format(cpu_count)
-
- proc = subprocess.Popen(path.split(' '), stdout=outf, stderr=subprocess.PIPE, env=env,preexec_fn=os.setsid)
- signal.alarm(args.timeout)
- err = None
- out = None
- try:
- out,err = proc.communicate()
- signal.alarm(0)
- except:
- os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
- proc.kill()
- proc.returncode = -1
- finally:
- outf.close();
- if proc.returncode:
- print_status('FAILED: %s\n' % (path))
- if proc.returncode == -1:
- print_status('TIMED OUT\n')
- else:
- print_status(' with error code {code}\n'.format(code=proc.returncode))
- print('=== stdout START ===')
- with open('tmp.out') as outf:
- for line in outf:
- print(line)
- print('=== stdout END ===')
- if err:
- print('=== stderr START ===')
- print(err.decode())
- print('=== stderr END ===')
- all_ok = False
- else:
- print_status('%s PASSED %s' % (prefix, path))
-
- if all_ok:
- print('\nOK.')
- else:
- print_status('')
- sys.exit(1)
diff --git a/cmake-tools/query_link_pool_depth.py b/test/CMakeLists.txt
old mode 100755
new mode 100644
similarity index 63%
copy from cmake-tools/query_link_pool_depth.py
copy to test/CMakeLists.txt
index 0084c934..84fcfb82
--- a/cmake-tools/query_link_pool_depth.py
+++ b/test/CMakeLists.txt
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
@@ -22,13 +20,28 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-import os
+add_library (seastar_testing
+ exchanger.hh
+ test-utils.hh
+ test-utils.cc
+ test_runner.hh
+ test_runner.cc)
+
+target_include_directories (seastar_testing
+ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+target_link_libraries (seastar_testing
+ PUBLIC
+ Boost::unit_test_framework
+ seastar)
-MEMORY_PER_LINK_PROCESS = 7e9
+# Distribution tests.
+if (Seastar_INSTALL)
+ add_subdirectory (dist)
+endif ()
-def query_physical_memory():
- return os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
+# Performance tests.
+add_subdirectory (perf)
-if __name__ == '__main__':
- link_depth = max(1, int(query_physical_memory() / MEMORY_PER_LINK_PROCESS))
- print(link_depth)
+# Unit tests.
+add_subdirectory (unit)
diff --git a/test/dist/CMakeLists.txt b/test/dist/CMakeLists.txt
new file mode 100644
index 00000000..e8368741
--- /dev/null
+++ b/test/dist/CMakeLists.txt
@@ -0,0 +1,54 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/consumer
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
+ ${CMAKE_CURRENT_SOURCE_DIR}/consumer/CMakeLists.txt
+ ${CMAKE_CURRENT_SOURCE_DIR}/consumer/Makefile
+ ${CMAKE_CURRENT_SOURCE_DIR}/consumer/cmake_consumer.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/consumer/pkgconfig_consumer.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/consumer/recipe/test_dist.cmake
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/consumer ${CMAKE_CURRENT_BINARY_DIR}/consumer)
+
+configure_file (
+ ${Seastar_SOURCE_DIR}/cooking.sh
+ ${CMAKE_CURRENT_BINARY_DIR}/consumer/cooking.sh
+ COPYONLY)
+
+add_custom_target (test_dist_consumer_test_run
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/consumer
+ COMMAND
+ ${CMAKE_COMMAND} -E env
+ CONSUMER_SOURCE_DIR=${CMAKE_CURRENT_BINARY_DIR}/consumer
+ SEASTAR_SOURCE_DIR=${Seastar_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/consumer_test.sh
+ USES_TERMINAL)
+
+add_test (
+ NAME Seastar.dist.consumer
+ COMMAND ${CMAKE_COMMAND} --build ${Seastar_BINARY_DIR} --target test_dist_consumer_test_run)
+
+add_custom_target (test_dist
+ COMMAND ctest --verbose -R Seastar.dist
+ USES_TERMINAL)
diff --git a/cmake-tools/query_link_pool_depth.py b/test/dist/consumer/CMakeLists.txt
old mode 100755
new mode 100644
similarity index 70%
copy from cmake-tools/query_link_pool_depth.py
copy to test/dist/consumer/CMakeLists.txt
index 0084c934..50572485
--- a/cmake-tools/query_link_pool_depth.py
+++ b/test/dist/consumer/CMakeLists.txt
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
@@ -22,13 +20,17 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-import os
+cmake_minimum_required (VERSION 3.10)
+
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+include (Cooking OPTIONAL)
+
+project (SeastarConsumer)
-MEMORY_PER_LINK_PROCESS = 7e9
+find_package (Seastar 18.7.0 REQUIRED)
-def query_physical_memory():
- return os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
+add_executable (cmake_consumer
+ cmake_consumer.cc)
-if __name__ == '__main__':
- link_depth = max(1, int(query_physical_memory() / MEMORY_PER_LINK_PROCESS))
- print(link_depth)
+target_link_libraries (cmake_consumer
+ PRIVATE Seastar::seastar)
diff --git a/apps/httpd/CMakeLists.txt b/test/dist/consumer/Makefile
similarity index 75%
rename from apps/httpd/CMakeLists.txt
rename to test/dist/consumer/Makefile
index 193cd814..d9587e0f 100644
--- a/apps/httpd/CMakeLists.txt
+++ b/test/dist/consumer/Makefile
@@ -20,5 +20,16 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-seastar_swagger_generate (demo.json httpd_swagger_sources)
-add_seastar_app (httpd main.cc "${httpd_swagger_sources}")
+# Required environmental variables:
+#
+# BUILD_DIR
+
+source=pkgconfig_consumer.cc
+
+.PHONY: prepare
+
+pkgconfig_consumer: $(source) prepare
+ $(CXX) $< `pkg-config seastar --cflags --libs --static` -o $(BUILD_DIR)/$@
+
+prepare:
+ mkdir -p $(BUILD_DIR)
diff --git a/test/dist/consumer/cmake_consumer.cc b/test/dist/consumer/cmake_consumer.cc
new file mode 100644
index 00000000..ebdc060d
--- /dev/null
+++ b/test/dist/consumer/cmake_consumer.cc
@@ -0,0 +1,15 @@
+#include <iostream>
+
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future.hh>
+
+namespace sr = seastar;
+
+int main(int argc, char** argv) {
+ sr::app_template app;
+
+ return app.run(argc, argv, [] {
+ std::cout << "\"Hello\" from the Seastar CMake consumer!\n";
+ return sr::make_ready_future<>();
+ });
+}
diff --git a/test/dist/consumer/pkgconfig_consumer.cc b/test/dist/consumer/pkgconfig_consumer.cc
new file mode 100644
index 00000000..a0cce755
--- /dev/null
+++ b/test/dist/consumer/pkgconfig_consumer.cc
@@ -0,0 +1,15 @@
+#include <iostream>
+
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future.hh>
+
+namespace sr = seastar;
+
+int main(int argc, char** argv) {
+ sr::app_template app;
+
+ return app.run(argc, argv, [] {
+ std::cout << "\"Hello\" from the Seastar pkg-config consumer!\n";
+ return sr::make_ready_future<>();
+ });
+}
diff --git a/test/dist/consumer/recipe/test_dist.cmake b/test/dist/consumer/recipe/test_dist.cmake
new file mode 100644
index 00000000..83ba07a4
--- /dev/null
+++ b/test/dist/consumer/recipe/test_dist.cmake
@@ -0,0 +1,10 @@
+cooking_ingredient (Seastar
+ SOURCE_DIR $ENV{SEASTAR_SOURCE_DIR}
+ COOKING_RECIPE dev
+ CMAKE_ARGS
+ # Not `lib64`.
+ -DCMAKE_INSTALL_LIBDIR=lib
+ -DSeastar_APPS=OFF
+ -DSeastar_DEMOS=OFF
+ -DSeastar_DOCS=OFF
+ -DSeastar_TESTING=OFF)
diff --git a/cmake-tools/query_link_pool_depth.py b/test/dist/consumer_test.sh
similarity index 57%
rename from cmake-tools/query_link_pool_depth.py
rename to test/dist/consumer_test.sh
index 0084c934..5f412343 100755
--- a/cmake-tools/query_link_pool_depth.py
+++ b/test/dist/consumer_test.sh
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
@@ -22,13 +20,30 @@
# Copyright (C) 2018 Scylladb, Ltd.
#
-import os
+# This test expects the following environmental variables to be defined:
+#
+# CONSUMER_SOURCE_DIR
+# SEASTAR_SOURCE_DIR
+#
+
+set -e
+
+cd "${CONSUMER_SOURCE_DIR}"
+./cooking.sh -r test_dist
-MEMORY_PER_LINK_PROCESS = 7e9
+#
+# Consume from CMake.
+#
+
+cmake --build build
+build/cmake_consumer
-def query_physical_memory():
- return os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
+#
+# Consume from pkg-config.
+#
-if __name__ == '__main__':
- link_depth = max(1, int(query_physical_memory() / MEMORY_PER_LINK_PROCESS))
- print(link_depth)
+ingredients_dir="build/_cooking/installed"
+library_path="${ingredients_dir}"/lib
+pkg_config_path="${library_path}"/pkgconfig
+make BUILD_DIR=build LD_LIBRARY_PATH="${library_path}" PKG_CONFIG_PATH="${pkg_config_path}"
+LD_LIBRARY_PATH="${library_path}" build/pkgconfig_consumer
diff --git a/tests/exchanger.hh b/test/exchanger.hh
similarity index 100%
rename from tests/exchanger.hh
rename to test/exchanger.hh
diff --git a/test/perf/CMakeLists.txt b/test/perf/CMakeLists.txt
new file mode 100644
index 00000000..1cfabd12
--- /dev/null
+++ b/test/perf/CMakeLists.txt
@@ -0,0 +1,77 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+add_library (seastar_perf_testing
+ perf_tests.hh
+ perf_tests.cc)
+
+target_link_libraries (seastar_perf_testing
+ PUBLIC
+ fmt::fmt
+ seastar)
+
+# Logical target for all perf tests.
+add_custom_target (perf_tests)
+
+macro (seastar_add_test name)
+ set (args ${ARGN})
+
+ cmake_parse_arguments (
+ parsed_args
+ "NO_SEASTAR_PERF_TESTING_LIBRARY"
+ ""
+ "SOURCES"
+ ${args})
+
+ set (target test_perf_${name})
+ add_executable (${target} ${parsed_args_SOURCES})
+
+ if (parsed_args_NO_SEASTAR_PERF_TESTING_LIBRARY)
+ set (libraries seastar)
+ else ()
+ set (libraries
+ seastar
+ seastar_perf_testing)
+ endif ()
+
+ target_link_libraries (${target}
+ PRIVATE ${libraries})
+
+ target_include_directories (${target}
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${Seastar_SOURCE_DIR}/src)
+
+ set_target_properties (${target}
+ PROPERTIES
+ OUTPUT_NAME ${name})
+
+ add_dependencies (perf_tests ${target})
+ set (${name}_test ${target})
+endmacro ()
+
+seastar_add_test (fstream
+ SOURCES fstream_perf.cc
+ NO_SEASTAR_PERF_TESTING_LIBRARY)
+
+seastar_add_test (future_util
+ SOURCES future_util_perf.cc)
diff --git a/tests/perf/perf_fstream.cc b/test/perf/fstream_perf.cc
similarity index 96%
rename from tests/perf/perf_fstream.cc
rename to test/perf/fstream_perf.cc
index 19fc8318..7e8cd6f1 100644
--- a/tests/perf/perf_fstream.cc
+++ b/test/perf/fstream_perf.cc
@@ -19,10 +19,10 @@
* Copyright (C) 2016 ScyllaDB
*/
-#include "../../core/reactor.hh"
-#include "../../core/fstream.hh"
-#include "../../core/file.hh"
-#include "../../core/app-template.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/fstream.hh>
+#include <seastar/core/file.hh>
+#include <seastar/core/app-template.hh>
using namespace seastar;
using namespace std::chrono_literals;
diff --git a/tests/perf/perf_future_util.cc b/test/perf/future_util_perf.cc
similarity index 100%
rename from tests/perf/perf_future_util.cc
rename to test/perf/future_util_perf.cc
diff --git a/tests/perf/perf-tests.md b/test/perf/perf-tests.md
similarity index 100%
rename from tests/perf/perf-tests.md
rename to test/perf/perf-tests.md
diff --git a/tests/perf/perf_tests.cc b/test/perf/perf_tests.cc
similarity index 99%
rename from tests/perf/perf_tests.cc
rename to test/perf/perf_tests.cc
index bd6e56a4..3a24a332 100644
--- a/tests/perf/perf_tests.cc
+++ b/test/perf/perf_tests.cc
@@ -29,8 +29,8 @@
#include <fmt/ostream.h>
-#include "core/app-template.hh"
-#include "core/thread.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/thread.hh>
namespace perf_tests {
namespace internal {
diff --git a/tests/perf/perf_tests.hh b/test/perf/perf_tests.hh
similarity index 98%
rename from tests/perf/perf_tests.hh
rename to test/perf/perf_tests.hh
index 729b78f6..643ec236 100644
--- a/tests/perf/perf_tests.hh
+++ b/test/perf/perf_tests.hh
@@ -26,8 +26,8 @@
#include <fmt/format.h>
-#include "core/future.hh"
-#include "core/future-util.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/future-util.hh>
using namespace seastar;
diff --git a/tests/test-utils.cc b/test/test-utils.cc
similarity index 87%
rename from tests/test-utils.cc
rename to test/test-utils.cc
index 958b86ed..052f3d25 100644
--- a/tests/test-utils.cc
+++ b/test/test-utils.cc
@@ -28,9 +28,9 @@
#include <thread>
-#include "tests/test-utils.hh"
-#include "core/future.hh"
-#include "core/app-template.hh"
+#include "test-utils.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/app-template.hh>
#include <boost/test/included/unit_test.hpp>
namespace seastar {
@@ -81,5 +81,8 @@ bool init_unit_test_suite() {
}
int main(int ac, char** av) {
- return ::boost::unit_test::unit_test_main(&seastar::init_unit_test_suite, ac, av);
+ // return ::boost::unit_test::unit_test_main(&seastar::init_unit_test_suite, ac, av);
+ const int exit_code = ::boost::unit_test::unit_test_main(&seastar::init_unit_test_suite, ac, av);
+ seastar::global_test_runner().finalize();
+ return exit_code;
}
diff --git a/tests/test-utils.hh b/test/test-utils.hh
similarity index 98%
rename from tests/test-utils.hh
rename to test/test-utils.hh
index 4448bad0..de5e4b0e 100644
--- a/tests/test-utils.hh
+++ b/test/test-utils.hh
@@ -25,7 +25,7 @@
#include <boost/test/unit_test.hpp>
-#include "core/future.hh"
+#include <seastar/core/future.hh>
#include "test_runner.hh"
namespace seastar {
diff --git a/tests/test_runner.cc b/test/test_runner.cc
similarity index 93%
rename from tests/test_runner.cc
rename to test/test_runner.cc
index 6b9b8bcf..54230b62 100644
--- a/tests/test_runner.cc
+++ b/test/test_runner.cc
@@ -21,9 +21,9 @@
#include <iostream>
-#include "core/app-template.hh"
-#include "core/future-util.hh"
-#include "core/reactor.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/reactor.hh>
#include "test_runner.hh"
namespace seastar {
@@ -33,10 +33,7 @@ static test_runner instance;
struct stop_execution : public std::exception {};
test_runner::~test_runner() {
- if (_thread) {
- _task.interrupt(stop_execution());
- _thread->join();
- }
+ finalize();
}
void
@@ -92,6 +89,14 @@ test_runner::run_sync(std::function<future<>()> task) {
}
}
+void test_runner::finalize() {
+ if (_thread) {
+ _task.interrupt(stop_execution());
+ _thread->join();
+ _thread = nullptr;
+ }
+}
+
test_runner& global_test_runner() {
return instance;
}
diff --git a/tests/test_runner.hh b/test/test_runner.hh
similarity index 93%
rename from tests/test_runner.hh
rename to test/test_runner.hh
index 55f6c439..3c492eb5 100644
--- a/tests/test_runner.hh
+++ b/test/test_runner.hh
@@ -24,8 +24,8 @@
#include <memory>
#include <functional>
#include <atomic>
-#include "core/future.hh"
-#include "core/posix.hh"
+#include <seastar/core/future.hh>
+#include <seastar/core/posix.hh>
#include "exchanger.hh"
namespace seastar {
@@ -42,6 +42,7 @@ class test_runner {
void start(int argc, char** argv);
~test_runner();
void run_sync(std::function<future<>()> task);
+ void finalize();
};
test_runner& global_test_runner();
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
new file mode 100644
index 00000000..9f73d3d0
--- /dev/null
+++ b/test/unit/CMakeLists.txt
@@ -0,0 +1,260 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+# Logical target for all unit tests.
+add_custom_target (unit_tests)
+
+macro (seastar_add_test name)
+ set (args ${ARGN})
+
+ cmake_parse_arguments (parsed_args
+ "NO_SEASTAR_TESTING_LIBRARY"
+ ""
+ "RUN_ARGS;SOURCES"
+ ${args})
+
+ set (command_args "")
+ set (depends_args "")
+
+ if (parsed_args_SOURCES)
+ if (parsed_args_NO_SEASTAR_TESTING_LIBRARY)
+ set (libraries seastar)
+ set (run_args -c 2)
+ else ()
+ set (libraries
+ seastar
+ seastar_testing)
+
+ set (run_args -- -c 2)
+ endif ()
+
+ list (APPEND run_args ${parsed_args_RUN_ARGS})
+ set (executable_target test_unit_${name})
+ add_executable (${executable_target} ${parsed_args_SOURCES})
+
+ target_link_libraries (${executable_target}
+ PRIVATE ${libraries})
+
+ target_include_directories (${executable_target}
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${Seastar_SOURCE_DIR}/src)
+
+ set_target_properties (${executable_target}
+ PROPERTIES
+ OUTPUT_NAME ${name})
+
+ add_dependencies (unit_tests ${executable_target})
+ list (APPEND depends_args DEPENDS ${executable_target})
+ list (APPEND command_args COMMAND ${executable_target} ${run_args})
+ endif ()
+
+ set (target test_unit_${name}_run)
+
+ add_custom_target (${target}
+ ${command_args}
+ ${parsed_args_UNPARSED_ARGUMENTS}
+ USES_TERMINAL)
+
+ add_test (
+ NAME Seastar.unit.${name}
+ COMMAND ${CMAKE_COMMAND} --build ${Seastar_BINARY_DIR} --target ${target})
+endmacro ()
+
+function (prepend_each var prefix)
+ set (result "")
+
+ foreach (x ${ARGN})
+ list (APPEND result ${prefix}/${x})
+ endforeach ()
+
+ set (${var} ${result} PARENT_SCOPE)
+endfunction ()
+
+add_custom_target (test_unit
+ COMMAND ctest --verbose -R Seastar.unit
+ USES_TERMINAL)
+
+seastar_add_test (abort_source
+ SOURCES abort_source_test.cc)
+
+seastar_add_test (alloc
+ SOURCES alloc_test.cc)
+
+seastar_add_test (allocator
+ SOURCES allocator_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+seastar_add_test (alien
+ SOURCES alien_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+seastar_add_test (checked_ptr
+ SOURCES checked_ptr_test.cc)
+
+seastar_add_test (chunked_fifo
+ SOURCES chunked_fifo_test.cc)
+
+seastar_add_test (circular_buffer
+ SOURCES circular_buffer_test.cc)
+
+seastar_add_test (circular_buffer_fixed_capacity
+ SOURCES circular_buffer_fixed_capacity_test.cc)
+
+seastar_add_test (connect
+ SOURCES connect_test.cc)
+
+seastar_add_test (defer
+ SOURCES defer_test.cc)
+
+seastar_add_test (directory
+ SOURCES directory_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+seastar_add_test (distributed
+ SOURCES distributed_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+seastar_add_test (dns
+ SOURCES dns_test.cc)
+
+seastar_add_test (execution_stage
+ SOURCES execution_stage_test.cc)
+
+seastar_add_test (expiring_fifo
+ SOURCES expiring_fifo_test.cc)
+
+seastar_add_test (fair_queue
+ SOURCES fair_queue_test.cc)
+
+seastar_add_test (file_io
+ SOURCES file_io_test.cc)
+
+seastar_add_test (foreign_ptr
+ SOURCES foreign_ptr_test.cc)
+
+seastar_add_test (fstream
+ SOURCES
+ fstream_test.cc
+ mock_file.hh)
+
+seastar_add_test (futures
+ SOURCES futures_test.cc)
+
+seastar_add_test (httpd
+ SOURCES
+ httpd_test.cc
+ loopback_socket.hh)
+
+seastar_add_test (json_formatter
+ SOURCES json_formatter_test.cc)
+
+seastar_add_test (lowres_clock
+ SOURCES lowres_clock_test.cc)
+
+seastar_add_test (netconfig
+ SOURCES netconfig_test.cc)
+
+seastar_add_test (noncopyable_function
+ SOURCES noncopyable_function_test.cc)
+
+seastar_add_test (output_stream
+ SOURCES output_stream_test.cc)
+
+seastar_add_test (packet
+ SOURCES packet_test.cc)
+
+seastar_add_test (program_options
+ SOURCES program_options_test.cc)
+
+seastar_add_test (queue
+ SOURCES queue_test.cc)
+
+seastar_add_test (rpc
+ SOURCES
+ loopback_socket.hh
+ rpc_test.cc)
+
+seastar_add_test (semaphore
+ SOURCES semaphore_test.cc)
+
+seastar_add_test (shared_ptr
+ SOURCES shared_ptr_test.cc)
+
+seastar_add_test (slab
+ SOURCES slab_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+seastar_add_test (smp
+ SOURCES smp_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+seastar_add_test (sstring
+ SOURCES sstring_test.cc)
+
+seastar_add_test (thread
+ SOURCES thread_test.cc)
+
+seastar_add_test (thread_context_switch
+ SOURCES thread_context_switch_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+seastar_add_test (timer
+ SOURCES timer_test.cc
+ NO_SEASTAR_TESTING_LIBRARY)
+
+set (tls_certificate_files
+ catest.key
+ catest.pem
+ tls-ca-bundle.pem
+ test.crl
+ test.crt
+ test.csr
+ test.key)
+
+prepend_each (
+ in_tls_certificate_files
+ ${CMAKE_CURRENT_SOURCE_DIR}/
+ ${tls_certificate_files})
+
+prepend_each (
+ out_tls_certificate_files
+ ${CMAKE_CURRENT_BINARY_DIR}/
+ ${tls_certificate_files})
+
+add_custom_command (
+ DEPENDS ${in_tls_certificate_files}
+ OUTPUT ${out_tls_certificate_files}
+ COMMAND ${CMAKE_COMMAND} -E copy ${in_tls_certificate_files} ${CMAKE_CURRENT_BINARY_DIR})
+
+seastar_add_test (tls
+ DEPENDS ${out_tls_certificate_files}
+ SOURCES tls_test.cc)
+
+seastar_add_test (tuple_utils
+ SOURCES tuple_utils_test.cc)
+
+seastar_add_test (unwind
+ SOURCES unwind_test.cc)
+
+seastar_add_test (weak_ptr
+ SOURCES weak_ptr_test.cc)
diff --git a/tests/abort_source_test.cc b/test/unit/abort_source_test.cc
similarity index 96%
rename from tests/abort_source_test.cc
rename to test/unit/abort_source_test.cc
index 275f35c7..6164f3d2 100644
--- a/tests/abort_source_test.cc
+++ b/test/unit/abort_source_test.cc
@@ -19,10 +19,10 @@
* Copyright (C) 2017 ScyllaDB
*/
-#include "tests/test-utils.hh"
+#include "test-utils.hh"
-#include "core/gate.hh"
-#include "core/sleep.hh"
+#include <seastar/core/gate.hh>
+#include <seastar/core/sleep.hh>
using namespace seastar;
using namespace std::chrono_literals;
@@ -74,4 +74,4 @@ SEASTAR_TEST_CASE(test_sleep_abortable) {
});
as->request_abort();
return f.finally([as = std::move(as)] { });
-}
\ No newline at end of file
+}
diff --git a/tests/alien_test.cc b/test/unit/alien_test.cc
similarity index 96%
rename from tests/alien_test.cc
rename to test/unit/alien_test.cc
index ef91cf8d..0026d2c2 100644
--- a/tests/alien_test.cc
+++ b/test/unit/alien_test.cc
@@ -22,10 +22,10 @@
#include <future>
#include <numeric>
-#include "core/alien.hh"
-#include "core/app-template.hh"
-#include "core/posix.hh"
-#include "core/reactor.hh"
+#include <seastar/core/alien.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/posix.hh>
+#include <seastar/core/reactor.hh>
using namespace seastar;
diff --git a/tests/alloc_test.cc b/test/unit/alloc_test.cc
similarity index 95%
rename from tests/alloc_test.cc
rename to test/unit/alloc_test.cc
index 3216c6a9..d881fa08 100644
--- a/tests/alloc_test.cc
+++ b/test/unit/alloc_test.cc
@@ -19,9 +19,9 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "tests/test-utils.hh"
-#include "core/memory.hh"
-#include "core/reactor.hh"
+#include "test-utils.hh"
+#include <seastar/core/memory.hh>
+#include <seastar/core/reactor.hh>
#include <vector>
using namespace seastar;
diff --git a/tests/allocator_test.cc b/test/unit/allocator_test.cc
similarity index 99%
rename from tests/allocator_test.cc
rename to test/unit/allocator_test.cc
index 052c9d14..ca5be72a 100644
--- a/tests/allocator_test.cc
+++ b/test/unit/allocator_test.cc
@@ -19,8 +19,8 @@
* Copyright 2014 Cloudius Systems
*/
-#include "core/memory.hh"
-#include "core/timer.hh"
+#include <seastar/core/memory.hh>
+#include <seastar/core/timer.hh>
#include <random>
#include <cmath>
#include <iostream>
diff --git a/tests/catest.key b/test/unit/catest.key
similarity index 100%
rename from tests/catest.key
rename to test/unit/catest.key
diff --git a/tests/catest.pem b/test/unit/catest.pem
similarity index 100%
rename from tests/catest.pem
rename to test/unit/catest.pem
diff --git a/tests/checked_ptr_test.cc b/test/unit/checked_ptr_test.cc
similarity index 97%
rename from tests/checked_ptr_test.cc
rename to test/unit/checked_ptr_test.cc
index 43aa378d..d4de8908 100644
--- a/tests/checked_ptr_test.cc
+++ b/test/unit/checked_ptr_test.cc
@@ -23,8 +23,8 @@
#define BOOST_TEST_MODULE core
#include <boost/test/included/unit_test.hpp>
-#include "core/checked_ptr.hh"
-#include "core/weak_ptr.hh"
+#include <seastar/core/checked_ptr.hh>
+#include <seastar/core/weak_ptr.hh>
using namespace seastar;
diff --git a/tests/chunked_fifo_test.cc b/test/unit/chunked_fifo_test.cc
similarity index 99%
rename from tests/chunked_fifo_test.cc
rename to test/unit/chunked_fifo_test.cc
index 8acac062..036ca44b 100644
--- a/tests/chunked_fifo_test.cc
+++ b/test/unit/chunked_fifo_test.cc
@@ -23,11 +23,11 @@
#define BOOST_TEST_MODULE core
#include <boost/test/included/unit_test.hpp>
-#include "core/chunked_fifo.hh"
+#include <seastar/core/chunked_fifo.hh>
#include <stdlib.h>
#include <chrono>
#include <deque>
-#include "core/circular_buffer.hh"
+#include <seastar/core/circular_buffer.hh>
using namespace seastar;
diff --git a/tests/circular_buffer_fixed_capacity_test.cc b/test/unit/circular_buffer_fixed_capacity_test.cc
similarity index 98%
rename from tests/circular_buffer_fixed_capacity_test.cc
rename to test/unit/circular_buffer_fixed_capacity_test.cc
index febda07c..3b86b5d7 100644
--- a/tests/circular_buffer_fixed_capacity_test.cc
+++ b/test/unit/circular_buffer_fixed_capacity_test.cc
@@ -25,7 +25,7 @@
#include <boost/test/included/unit_test.hpp>
#include <deque>
#include <random>
-#include "../core/circular_buffer_fixed_capacity.hh"
+#include <seastar/core/circular_buffer_fixed_capacity.hh>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/algorithm/equal.hpp>
diff --git a/tests/circular_buffer_test.cc b/test/unit/circular_buffer_test.cc
similarity index 98%
rename from tests/circular_buffer_test.cc
rename to test/unit/circular_buffer_test.cc
index d8fe6ab4..9de0af36 100644
--- a/tests/circular_buffer_test.cc
+++ b/test/unit/circular_buffer_test.cc
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <chrono>
#include <deque>
-#include "core/circular_buffer.hh"
+#include <seastar/core/circular_buffer.hh>
using namespace seastar;
diff --git a/tests/connect_test.cc b/test/unit/connect_test.cc
similarity index 97%
rename from tests/connect_test.cc
rename to test/unit/connect_test.cc
index 10c6acc2..9d62c75c 100644
--- a/tests/connect_test.cc
+++ b/test/unit/connect_test.cc
@@ -1,6 +1,6 @@
-#include "tests/test-utils.hh"
+#include "test-utils.hh"
-#include "net/ip.hh"
+#include <seastar/net/ip.hh>
#include <random>
diff --git a/tests/defer_test.cc b/test/unit/defer_test.cc
similarity index 98%
rename from tests/defer_test.cc
rename to test/unit/defer_test.cc
index 1f21c2d9..b7924569 100644
--- a/tests/defer_test.cc
+++ b/test/unit/defer_test.cc
@@ -22,7 +22,7 @@
#define BOOST_TEST_MODULE core
#include <boost/test/included/unit_test.hpp>
-#include "util/defer.hh"
+#include <seastar/util/defer.hh>
using namespace seastar;
diff --git a/tests/directory_test.cc b/test/unit/directory_test.cc
similarity index 91%
rename from tests/directory_test.cc
rename to test/unit/directory_test.cc
index cc6d71d2..b76dae67 100644
--- a/tests/directory_test.cc
+++ b/test/unit/directory_test.cc
@@ -20,10 +20,10 @@
*/
-#include "core/reactor.hh"
-#include "core/app-template.hh"
-#include "core/print.hh"
-#include "core/shared_ptr.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/print.hh>
+#include <seastar/core/shared_ptr.hh>
using namespace seastar;
diff --git a/tests/distributed_test.cc b/test/unit/distributed_test.cc
similarity index 96%
rename from tests/distributed_test.cc
rename to test/unit/distributed_test.cc
index bc0a1e4f..4c1a14c3 100644
--- a/tests/distributed_test.cc
+++ b/test/unit/distributed_test.cc
@@ -20,11 +20,11 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "core/app-template.hh"
-#include "core/distributed.hh"
-#include "core/future-util.hh"
-#include "core/sleep.hh"
-#include "core/thread.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/distributed.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sleep.hh>
+#include <seastar/core/thread.hh>
using namespace seastar;
diff --git a/tests/dns_test.cc b/test/unit/dns_test.cc
similarity index 92%
rename from tests/dns_test.cc
rename to test/unit/dns_test.cc
index 2999d0ea..3811b4a6 100644
--- a/tests/dns_test.cc
+++ b/test/unit/dns_test.cc
@@ -22,14 +22,14 @@
#include <vector>
#include <algorithm>
-#include "core/do_with.hh"
+#include <seastar/core/do_with.hh>
#include "test-utils.hh"
-#include "core/sstring.hh"
-#include "core/reactor.hh"
-#include "core/do_with.hh"
-#include "core/future-util.hh"
-#include "net/dns.hh"
-#include "net/inet_address.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/net/dns.hh>
+#include <seastar/net/inet_address.hh>
using namespace seastar;
using namespace seastar::net;
diff --git a/tests/execution_stage_test.cc b/test/unit/execution_stage_test.cc
similarity index 98%
rename from tests/execution_stage_test.cc
rename to test/unit/execution_stage_test.cc
index 2677a154..911399d7 100644
--- a/tests/execution_stage_test.cc
+++ b/test/unit/execution_stage_test.cc
@@ -24,10 +24,10 @@
#include <vector>
#include <chrono>
-#include "core/thread.hh"
+#include <seastar/core/thread.hh>
#include "test-utils.hh"
-#include "core/execution_stage.hh"
-#include "../core/sleep.hh"
+#include <seastar/core/execution_stage.hh>
+#include <seastar/core/sleep.hh>
using namespace std::chrono_literals;
diff --git a/tests/expiring_fifo_test.cc b/test/unit/expiring_fifo_test.cc
similarity index 97%
rename from tests/expiring_fifo_test.cc
rename to test/unit/expiring_fifo_test.cc
index 473f36d3..e8604f80 100644
--- a/tests/expiring_fifo_test.cc
+++ b/test/unit/expiring_fifo_test.cc
@@ -20,10 +20,10 @@
* Copyright (C) 2016 ScyllaDB
*/
-#include "core/thread.hh"
+#include <seastar/core/thread.hh>
#include "test-utils.hh"
-#include "core/future-util.hh"
-#include "core/expiring_fifo.hh"
+#include <seastar/core/future-util.hh>
+#include <seastar/core/expiring_fifo.hh>
#include <boost/range/irange.hpp>
using namespace seastar;
diff --git a/tests/fair_queue_test.cc b/test/unit/fair_queue_test.cc
similarity index 97%
rename from tests/fair_queue_test.cc
rename to test/unit/fair_queue_test.cc
index 29460bb0..8514fd75 100644
--- a/tests/fair_queue_test.cc
+++ b/test/unit/fair_queue_test.cc
@@ -20,15 +20,15 @@
* Copyright (C) 2016 ScyllaDB
*/
-#include "core/thread.hh"
-#include "core/do_with.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/core/do_with.hh>
#include "test-utils.hh"
-#include "core/sstring.hh"
-#include "core/reactor.hh"
-#include "core/fair_queue.hh"
-#include "core/do_with.hh"
-#include "core/future-util.hh"
-#include "core/sleep.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/fair_queue.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sleep.hh>
#include <boost/range/irange.hpp>
#include <random>
#include <chrono>
diff --git a/tests/fileiotest.cc b/test/unit/file_io_test.cc
similarity index 95%
rename from tests/fileiotest.cc
rename to test/unit/file_io_test.cc
index da6efd58..1d2d630e 100644
--- a/tests/fileiotest.cc
+++ b/test/unit/file_io_test.cc
@@ -19,14 +19,14 @@
* Copyright (C) 2014-2015 Cloudius Systems, Ltd.
*/
-#include "tests/test-utils.hh"
+#include "test-utils.hh"
-#include "core/semaphore.hh"
-#include "core/condition-variable.hh"
-#include "core/file.hh"
-#include "core/reactor.hh"
-#include "core/thread.hh"
-#include "core/stall_sampler.hh"
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/condition-variable.hh>
+#include <seastar/core/file.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/thread.hh>
+#include <seastar/core/stall_sampler.hh>
using namespace seastar;
diff --git a/tests/foreign_ptr_test.cc b/test/unit/foreign_ptr_test.cc
similarity index 94%
rename from tests/foreign_ptr_test.cc
rename to test/unit/foreign_ptr_test.cc
index 82d17198..0f28db13 100644
--- a/tests/foreign_ptr_test.cc
+++ b/test/unit/foreign_ptr_test.cc
@@ -19,12 +19,12 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "tests/test-utils.hh"
+#include "test-utils.hh"
-#include "core/distributed.hh"
-#include "core/shared_ptr.hh"
-#include "core/thread.hh"
-#include "core/sleep.hh"
+#include <seastar/core/distributed.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/thread.hh>
+#include <seastar/core/sleep.hh>
using namespace seastar;
diff --git a/tests/fstream_test.cc b/test/unit/fstream_test.cc
similarity index 98%
rename from tests/fstream_test.cc
rename to test/unit/fstream_test.cc
index a43bc7bc..e687abbb 100644
--- a/tests/fstream_test.cc
+++ b/test/unit/fstream_test.cc
@@ -22,15 +22,15 @@
#include <algorithm>
#include <iostream>
#include <numeric>
-#include "core/reactor.hh"
-#include "core/fstream.hh"
-#include "core/shared_ptr.hh"
-#include "core/app-template.hh"
-#include "core/do_with.hh"
-#include "core/seastar.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/fstream.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/seastar.hh>
#include "test-utils.hh"
-#include "core/thread.hh"
-#include "util/defer.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/util/defer.hh>
#include <random>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/algorithm/cxx11/any_of.hpp>
diff --git a/tests/futures_test.cc b/test/unit/futures_test.cc
similarity index 99%
rename from tests/futures_test.cc
rename to test/unit/futures_test.cc
index 9e2f1a94..fa59fd77 100644
--- a/tests/futures_test.cc
+++ b/test/unit/futures_test.cc
@@ -19,14 +19,14 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "tests/test-utils.hh"
-
-#include "core/shared_ptr.hh"
-#include "core/future-util.hh"
-#include "core/sleep.hh"
-#include "core/do_with.hh"
-#include "core/shared_future.hh"
-#include "core/thread.hh"
+#include "test-utils.hh"
+
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sleep.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/shared_future.hh>
+#include <seastar/core/thread.hh>
#include <boost/iterator/counting_iterator.hpp>
using namespace seastar;
diff --git a/tests/httpd.cc b/test/unit/httpd_test.cc
similarity index 98%
rename from tests/httpd.cc
rename to test/unit/httpd_test.cc
index 2aa17bf4..a544346c 100644
--- a/tests/httpd.cc
+++ b/test/unit/httpd_test.cc
@@ -2,21 +2,21 @@
* Copyright 2015 Cloudius Systems
*/
-#include "http/httpd.hh"
-#include "http/handlers.hh"
-#include "http/matcher.hh"
-#include "http/matchrules.hh"
-#include "json/formatter.hh"
-#include "http/routes.hh"
-#include "http/exception.hh"
-#include "http/transformers.hh"
-#include "core/future-util.hh"
-#include "tests/test-utils.hh"
+#include <seastar/http/httpd.hh>
+#include <seastar/http/handlers.hh>
+#include <seastar/http/matcher.hh>
+#include <seastar/http/matchrules.hh>
+#include <seastar/json/formatter.hh>
+#include <seastar/http/routes.hh>
+#include <seastar/http/exception.hh>
+#include <seastar/http/transformers.hh>
+#include <seastar/core/future-util.hh>
+#include "test-utils.hh"
#include "loopback_socket.hh"
#include <boost/algorithm/string.hpp>
-#include "core/thread.hh"
-#include "util/noncopyable_function.hh"
-#include "http/json_path.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/util/noncopyable_function.hh>
+#include <seastar/http/json_path.hh>
#include <sstream>
using namespace seastar;
diff --git a/tests/json_formatter_test.cc b/test/unit/json_formatter_test.cc
similarity index 89%
rename from tests/json_formatter_test.cc
rename to test/unit/json_formatter_test.cc
index 5c272b06..f4834f8e 100644
--- a/tests/json_formatter_test.cc
+++ b/test/unit/json_formatter_test.cc
@@ -21,13 +21,13 @@
*/
#include <vector>
-#include "core/do_with.hh"
+#include <seastar/core/do_with.hh>
#include "test-utils.hh"
-#include "core/sstring.hh"
-#include "core/reactor.hh"
-#include "core/do_with.hh"
-#include "core/future-util.hh"
-#include "json/formatter.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/json/formatter.hh>
using namespace seastar;
using namespace json;
diff --git a/tests/loopback_socket.hh b/test/unit/loopback_socket.hh
similarity index 96%
rename from tests/loopback_socket.hh
rename to test/unit/loopback_socket.hh
index 87e4a5bb..888b0692 100644
--- a/tests/loopback_socket.hh
+++ b/test/unit/loopback_socket.hh
@@ -22,15 +22,15 @@
#pragma once
#include <system_error>
-#include "core/iostream.hh"
-#include "core/circular_buffer.hh"
-#include "core/shared_ptr.hh"
-#include "core/queue.hh"
-#include "core/future-util.hh"
-#include "core/do_with.hh"
-#include "net/stack.hh"
-#include "core/reactor.hh"
-#include "core/sharded.hh"
+#include <seastar/core/iostream.hh>
+#include <seastar/core/circular_buffer.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/queue.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/net/stack.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/sharded.hh>
namespace seastar {
diff --git a/tests/lowres_clock_test.cc b/test/unit/lowres_clock_test.cc
similarity index 97%
rename from tests/lowres_clock_test.cc
rename to test/unit/lowres_clock_test.cc
index af95b423..eb6542ee 100644
--- a/tests/lowres_clock_test.cc
+++ b/test/unit/lowres_clock_test.cc
@@ -21,9 +21,9 @@
#include "test-utils.hh"
-#include <core/do_with.hh>
-#include <core/lowres_clock.hh>
-#include <core/sleep.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/lowres_clock.hh>
+#include <seastar/core/sleep.hh>
#include <ctime>
diff --git a/tests/mkcert.gmk b/test/unit/mkcert.gmk
similarity index 100%
rename from tests/mkcert.gmk
rename to test/unit/mkcert.gmk
diff --git a/tests/mock_file.hh b/test/unit/mock_file.hh
similarity index 99%
rename from tests/mock_file.hh
rename to test/unit/mock_file.hh
index 248e4b43..de9d5297 100644
--- a/tests/mock_file.hh
+++ b/test/unit/mock_file.hh
@@ -24,7 +24,7 @@
#include <boost/range/numeric.hpp>
#include "test-utils.hh"
-#include "core/file.hh"
+#include <seastar/core/file.hh>
namespace seastar {
diff --git a/tests/netconfig_test.cc b/test/unit/netconfig_test.cc
similarity index 99%
rename from tests/netconfig_test.cc
rename to test/unit/netconfig_test.cc
index 92c00833..ccf85a19 100644
--- a/tests/netconfig_test.cc
+++ b/test/unit/netconfig_test.cc
@@ -21,7 +21,7 @@
#define BOOST_TEST_MODULE core
-#include "net/config.hh"
+#include <seastar/net/config.hh>
#include <boost/test/included/unit_test.hpp>
#include <exception>
#include <sstream>
diff --git a/tests/noncopyable_function_test.cc b/test/unit/noncopyable_function_test.cc
similarity index 98%
rename from tests/noncopyable_function_test.cc
rename to test/unit/noncopyable_function_test.cc
index eb523aae..e5073297 100644
--- a/tests/noncopyable_function_test.cc
+++ b/test/unit/noncopyable_function_test.cc
@@ -23,7 +23,7 @@
#define BOOST_TEST_MODULE core
#include <boost/test/included/unit_test.hpp>
-#include "util/noncopyable_function.hh"
+#include <seastar/util/noncopyable_function.hh>
using namespace seastar;
diff --git a/tests/output_stream_test.cc b/test/unit/output_stream_test.cc
similarity index 95%
rename from tests/output_stream_test.cc
rename to test/unit/output_stream_test.cc
index e2e43950..ddb61acd 100644
--- a/tests/output_stream_test.cc
+++ b/test/unit/output_stream_test.cc
@@ -19,13 +19,13 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/app-template.hh"
-#include "core/shared_ptr.hh"
-#include "core/reactor.hh"
-#include "core/vector-data-sink.hh"
-#include "core/future-util.hh"
-#include "core/sstring.hh"
-#include "net/packet.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/shared_ptr.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/vector-data-sink.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sstring.hh>
+#include <seastar/net/packet.hh>
#include "test-utils.hh"
#include <vector>
diff --git a/tests/packet_test.cc b/test/unit/packet_test.cc
similarity index 98%
rename from tests/packet_test.cc
rename to test/unit/packet_test.cc
index 30961542..3b78e63d 100644
--- a/tests/packet_test.cc
+++ b/test/unit/packet_test.cc
@@ -23,7 +23,7 @@
#define BOOST_TEST_MODULE core
#include <boost/test/included/unit_test.hpp>
-#include "net/packet.hh"
+#include <seastar/net/packet.hh>
#include <array>
using namespace seastar;
diff --git a/tests/program_options_test.cc b/test/unit/program_options_test.cc
similarity index 97%
rename from tests/program_options_test.cc
rename to test/unit/program_options_test.cc
index b47f057f..408752d5 100644
--- a/tests/program_options_test.cc
+++ b/test/unit/program_options_test.cc
@@ -21,7 +21,7 @@
#define BOOST_TEST_MODULE core
-#include "util/program-options.hh"
+#include <seastar/util/program-options.hh>
#include <boost/program_options.hpp>
#include <boost/test/included/unit_test.hpp>
diff --git a/tests/queue_test.cc b/test/unit/queue_test.cc
similarity index 95%
rename from tests/queue_test.cc
rename to test/unit/queue_test.cc
index 0072b9f0..82762992 100644
--- a/tests/queue_test.cc
+++ b/test/unit/queue_test.cc
@@ -20,9 +20,9 @@
*/
#include "test-utils.hh"
-#include "core/queue.hh"
-#include "core/thread.hh"
-#include "core/sleep.hh"
+#include <seastar/core/queue.hh>
+#include <seastar/core/thread.hh>
+#include <seastar/core/sleep.hh>
using namespace seastar;
using namespace std::chrono_literals;
diff --git a/tests/rpc_test.cc b/test/unit/rpc_test.cc
similarity index 98%
rename from tests/rpc_test.cc
rename to test/unit/rpc_test.cc
index 3eadffa9..8735b084 100644
--- a/tests/rpc_test.cc
+++ b/test/unit/rpc_test.cc
@@ -21,13 +21,13 @@
#include "loopback_socket.hh"
-#include "rpc/rpc.hh"
-#include "rpc/rpc_types.hh"
-#include "rpc/lz4_compressor.hh"
-#include "rpc/multi_algo_compressor_factory.hh"
+#include <seastar/rpc/rpc.hh>
+#include <seastar/rpc/rpc_types.hh>
+#include <seastar/rpc/lz4_compressor.hh>
+#include <seastar/rpc/multi_algo_compressor_factory.hh>
#include "test-utils.hh"
-#include "core/thread.hh"
-#include "core/sleep.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/core/sleep.hh>
using namespace seastar;
diff --git a/tests/semaphore_test.cc b/test/unit/semaphore_test.cc
similarity index 95%
rename from tests/semaphore_test.cc
rename to test/unit/semaphore_test.cc
index 72177173..6c37b266 100644
--- a/tests/semaphore_test.cc
+++ b/test/unit/semaphore_test.cc
@@ -20,16 +20,16 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "core/thread.hh"
-#include "core/do_with.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/core/do_with.hh>
#include "test-utils.hh"
-#include "core/sstring.hh"
-#include "core/reactor.hh"
-#include "core/semaphore.hh"
-#include "core/do_with.hh"
-#include "core/future-util.hh"
-#include "core/sleep.hh"
-#include "core/shared_mutex.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sleep.hh>
+#include <seastar/core/shared_mutex.hh>
#include <boost/range/irange.hpp>
using namespace seastar;
diff --git a/tests/shared_ptr_test.cc b/test/unit/shared_ptr_test.cc
similarity index 98%
rename from tests/shared_ptr_test.cc
rename to test/unit/shared_ptr_test.cc
index c5308328..8de9d296 100644
--- a/tests/shared_ptr_test.cc
+++ b/test/unit/shared_ptr_test.cc
@@ -25,8 +25,8 @@
#include <boost/test/included/unit_test.hpp>
#include <set>
#include <unordered_map>
-#include "core/sstring.hh"
-#include "core/shared_ptr.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/shared_ptr.hh>
using namespace seastar;
diff --git a/tests/slab_test.cc b/test/unit/slab_test.cc
similarity index 99%
rename from tests/slab_test.cc
rename to test/unit/slab_test.cc
index fc44efc3..7588dd79 100644
--- a/tests/slab_test.cc
+++ b/test/unit/slab_test.cc
@@ -23,7 +23,7 @@
#include <iostream>
#include <assert.h>
-#include "core/slab.hh"
+#include <seastar/core/slab.hh>
using namespace seastar;
diff --git a/tests/smp_test.cc b/test/unit/smp_test.cc
similarity index 95%
rename from tests/smp_test.cc
rename to test/unit/smp_test.cc
index 7a374e59..eef1e6bd 100644
--- a/tests/smp_test.cc
+++ b/test/unit/smp_test.cc
@@ -19,9 +19,9 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/reactor.hh"
-#include "core/app-template.hh"
-#include "core/print.hh"
+#include <seastar/core/reactor.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/print.hh>
using namespace seastar;
diff --git a/tests/sstring_test.cc b/test/unit/sstring_test.cc
similarity index 99%
rename from tests/sstring_test.cc
rename to test/unit/sstring_test.cc
index d69438d2..18664c07 100644
--- a/tests/sstring_test.cc
+++ b/test/unit/sstring_test.cc
@@ -22,7 +22,7 @@
#define BOOST_TEST_MODULE core
#include <boost/test/included/unit_test.hpp>
-#include "core/sstring.hh"
+#include <seastar/core/sstring.hh>
#include <list>
using namespace seastar;
diff --git a/tests/test.crl b/test/unit/test.crl
similarity index 100%
rename from tests/test.crl
rename to test/unit/test.crl
diff --git a/tests/test.crt b/test/unit/test.crt
similarity index 100%
rename from tests/test.crt
rename to test/unit/test.crt
diff --git a/tests/test.csr b/test/unit/test.csr
similarity index 100%
rename from tests/test.csr
rename to test/unit/test.csr
diff --git a/tests/test.key b/test/unit/test.key
similarity index 100%
rename from tests/test.key
rename to test/unit/test.key
diff --git a/tests/thread_context_switch.cc b/test/unit/thread_context_switch_test.cc
similarity index 92%
rename from tests/thread_context_switch.cc
rename to test/unit/thread_context_switch_test.cc
index 9f786698..40380dd1 100644
--- a/tests/thread_context_switch.cc
+++ b/test/unit/thread_context_switch_test.cc
@@ -21,12 +21,12 @@
*/
#include <experimental/optional>
-#include "core/thread.hh"
-#include "core/semaphore.hh"
-#include "core/app-template.hh"
-#include "core/do_with.hh"
-#include "core/distributed.hh"
-#include "core/sleep.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/app-template.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/distributed.hh>
+#include <seastar/core/sleep.hh>
using namespace seastar;
using namespace std::chrono_literals;
@@ -94,3 +94,4 @@ int main(int ac, char** av) {
});
});
}
+
diff --git a/tests/thread_test.cc b/test/unit/thread_test.cc
similarity index 94%
rename from tests/thread_test.cc
rename to test/unit/thread_test.cc
index 43e7965e..cf7198cb 100644
--- a/tests/thread_test.cc
+++ b/test/unit/thread_test.cc
@@ -20,15 +20,15 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "core/thread.hh"
-#include "core/do_with.hh"
+#include <seastar/core/thread.hh>
+#include <seastar/core/do_with.hh>
#include "test-utils.hh"
-#include "core/sstring.hh"
-#include "core/reactor.hh"
-#include "core/semaphore.hh"
-#include "core/do_with.hh"
-#include "core/future-util.hh"
-#include "core/sleep.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/semaphore.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sleep.hh>
using namespace seastar;
using namespace std::chrono_literals;
diff --git a/tests/timertest.cc b/test/unit/timer_test.cc
similarity index 96%
rename from tests/timertest.cc
rename to test/unit/timer_test.cc
index 3a898906..dfd43841 100644
--- a/tests/timertest.cc
+++ b/test/unit/timer_test.cc
@@ -19,9 +19,9 @@
* Copyright (C) 2014 Cloudius Systems, Ltd.
*/
-#include "core/app-template.hh"
-#include "core/reactor.hh"
-#include "core/print.hh"
+#include <seastar/core/app-template.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/print.hh>
#include <chrono>
using namespace seastar;
diff --git a/tests/tls-ca-bundle.pem b/test/unit/tls-ca-bundle.pem
similarity index 100%
rename from tests/tls-ca-bundle.pem
rename to test/unit/tls-ca-bundle.pem
diff --git a/tests/tls_test.cc b/test/unit/tls_test.cc
similarity index 91%
rename from tests/tls_test.cc
rename to test/unit/tls_test.cc
index 09723332..b46fb307 100644
--- a/tests/tls_test.cc
+++ b/test/unit/tls_test.cc
@@ -20,16 +20,16 @@
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
-#include "core/do_with.hh"
+#include <seastar/core/do_with.hh>
#include "test-utils.hh"
-#include "core/sstring.hh"
-#include "core/reactor.hh"
-#include "core/do_with.hh"
-#include "core/future-util.hh"
-#include "core/sharded.hh"
-#include "core/thread.hh"
-#include "core/gate.hh"
-#include "net/tls.hh"
+#include <seastar/core/sstring.hh>
+#include <seastar/core/reactor.hh>
+#include <seastar/core/do_with.hh>
+#include <seastar/core/future-util.hh>
+#include <seastar/core/sharded.hh>
+#include <seastar/core/thread.hh>
+#include <seastar/core/gate.hh>
+#include <seastar/net/tls.hh>
#if 0
#include <gnutls/gnutls.h>
@@ -84,7 +84,7 @@ static future<> connect_to_ssl_google(::shared_ptr<tls::certificate_credentials>
SEASTAR_TEST_CASE(test_simple_x509_client) {
auto certs = ::make_shared<tls::certificate_credentials>();
- return certs->set_x509_trust_file("tests/tls-ca-bundle.pem", tls::x509_crt_format::PEM).then([certs]() {
+ return certs->set_x509_trust_file("tls-ca-bundle.pem", tls::x509_crt_format::PEM).then([certs]() {
return connect_to_ssl_google(certs);
});
}
@@ -184,7 +184,7 @@ SEASTAR_TEST_CASE(test_non_tls) {
SEASTAR_TEST_CASE(test_abort_accept_before_handshake) {
auto certs = ::make_shared<tls::server_credentials>(::make_shared<tls::dh_params>());
- return certs->set_x509_key_file("tests/test.crt", "tests/test.key", tls::x509_crt_format::PEM).then([certs] {
+ return certs->set_x509_key_file("test.crt", "test.key", tls::x509_crt_format::PEM).then([certs] {
::listen_options opts;
opts.reuse_address = true;
auto addr = ::make_ipv4_address( {0x7f000001, 4712});
@@ -203,7 +203,7 @@ SEASTAR_TEST_CASE(test_abort_accept_before_handshake) {
SEASTAR_TEST_CASE(test_abort_accept_after_handshake) {
return async([] {
auto certs = ::make_shared<tls::server_credentials>(::make_shared<tls::dh_params>());
- certs->set_x509_key_file("tests/test.crt", "tests/test.key", tls::x509_crt_format::PEM).get();
+ certs->set_x509_key_file("test.crt", "test.key", tls::x509_crt_format::PEM).get();
::listen_options opts;
opts.reuse_address = true;
@@ -212,7 +212,7 @@ SEASTAR_TEST_CASE(test_abort_accept_after_handshake) {
auto sa = server.accept();
tls::credentials_builder b;
- b.set_x509_trust_file("tests/catest.pem", tls::x509_crt_format::PEM).get();
+ b.set_x509_trust_file("catest.pem", tls::x509_crt_format::PEM).get();
auto c = tls::connect(b.build_certificate_credentials(), addr).get0();
server.abort_accept(); // should not affect the socket we got.
@@ -241,7 +241,7 @@ SEASTAR_TEST_CASE(test_abort_accept_on_server_before_handshake) {
auto sa = server.accept();
tls::credentials_builder b;
- b.set_x509_trust_file("tests/catest.pem", tls::x509_crt_format::PEM).get();
+ b.set_x509_trust_file("catest.pem", tls::x509_crt_format::PEM).get();
auto creds = b.build_certificate_credentials();
auto f = tls::connect(creds, addr);
@@ -355,8 +355,8 @@ static future<> run_echo_test(sstring message,
int loops,
sstring trust,
sstring name,
- sstring crt = "tests/test.crt",
- sstring key = "tests/test.key",
+ sstring crt = "test.crt",
+ sstring key = "test.key",
tls::client_auth ca = tls::client_auth::NONE,
sstring client_crt = {},
sstring client_key = {},
@@ -440,17 +440,17 @@ SEASTAR_TEST_CASE(test_simple_x509_client_server) {
// will not validate
// Must match expected name with cert CA or give empty name to ignore
// server name
- return run_echo_test(message, 20, "tests/catest.pem", "
test.scylladb.org");
+ return run_echo_test(message, 20, "catest.pem", "
test.scylladb.org");
}
SEASTAR_TEST_CASE(test_simple_x509_client_server_again) {
- return run_echo_test(message, 20, "tests/catest.pem", "
test.scylladb.org");
+ return run_echo_test(message, 20, "catest.pem", "
test.scylladb.org");
}
SEASTAR_TEST_CASE(test_x509_client_server_cert_validation_fail) {
// Load a real trust authority here, which out certs are _not_ signed with.
- return run_echo_test(message, 1, "tests/tls-ca-bundle.pem", {}).then([] {
+ return run_echo_test(message, 1, "tls-ca-bundle.pem", {}).then([] {
BOOST_FAIL("Should have gotten validation error");
}).handle_exception([](auto ep) {
try {
@@ -465,7 +465,7 @@ SEASTAR_TEST_CASE(test_x509_client_server_cert_validation_fail) {
SEASTAR_TEST_CASE(test_x509_client_server_cert_validation_fail_name) {
// Use trust store with our signer, but wrong host name
- return run_echo_test(message, 1, "tests/tls-ca-bundle.pem", "
nils.holgersson.gov").then([] {
+ return run_echo_test(message, 1, "tls-ca-bundle.pem", "
nils.holgersson.gov").then([] {
BOOST_FAIL("Should have gotten validation error");
}).handle_exception([](auto ep) {
try {
@@ -487,7 +487,7 @@ SEASTAR_TEST_CASE(test_large_message_x509_client_server) {
for (size_t i = 0; i < msg.size(); ++i) {
msg[i] = '0' + char(i % 30);
}
- return run_echo_test(std::move(msg), 20, "tests/catest.pem", "
test.scylladb.org");
+ return run_echo_test(std::move(msg), 20, "catest.pem", "
test.scylladb.org");
}
SEASTAR_TEST_CASE(test_simple_x509_client_server_fail_client_auth) {
@@ -496,7 +496,7 @@ SEASTAR_TEST_CASE(test_simple_x509_client_server_fail_client_auth) {
// Must match expected name with cert CA or give empty name to ignore
// server name
// Server will require certificate auth. We supply none, so should fail connection
- return run_echo_test(message, 20, "tests/catest.pem", "
test.scylladb.org", "tests/test.crt", "tests/test.key", tls::client_auth::REQUIRE).then([] {
+ return run_echo_test(message, 20, "catest.pem", "
test.scylladb.org", "test.crt", "test.key", tls::client_auth::REQUIRE).then([] {
BOOST_FAIL("Expected exception");
}).handle_exception([](auto ep) {
// ok.
@@ -509,7 +509,7 @@ SEASTAR_TEST_CASE(test_simple_x509_client_server_client_auth) {
// Must match expected name with cert CA or give empty name to ignore
// server name
// Server will require certificate auth. We supply one, so should succeed with connection
- return run_echo_test(message, 20, "tests/catest.pem", "
test.scylladb.org", "tests/test.crt", "tests/test.key", tls::client_auth::REQUIRE, "tests/test.crt", "tests/test.key");
+ return run_echo_test(message, 20, "catest.pem", "
test.scylladb.org", "test.crt", "test.key", tls::client_auth::REQUIRE, "test.crt", "test.key");
}
SEASTAR_TEST_CASE(test_many_large_message_x509_client_server) {
@@ -526,7 +526,7 @@ SEASTAR_TEST_CASE(test_many_large_message_x509_client_server) {
// machine.
auto range = boost::irange(0, 20);
return do_for_each(range, [msg = std::move(msg)](auto) {
- return run_echo_test(std::move(msg), 1, "tests/catest.pem", "
test.scylladb.org", "tests/test.crt", "tests/test.key", tls::client_auth::NONE, {}, {}, false);
+ return run_echo_test(std::move(msg), 1, "catest.pem", "
test.scylladb.org", "test.crt", "test.key", tls::client_auth::NONE, {}, {}, false);
});
}
diff --git a/tests/tuple_utils_test.cc b/test/unit/tuple_utils_test.cc
similarity index 98%
rename from tests/tuple_utils_test.cc
rename to test/unit/tuple_utils_test.cc
index ebf878a0..6a278f01 100644
--- a/tests/tuple_utils_test.cc
+++ b/test/unit/tuple_utils_test.cc
@@ -21,7 +21,7 @@
#define BOOST_TEST_MODULE core
-#include <util/tuple_utils.hh>
+#include <seastar/util/tuple_utils.hh>
#include <boost/test/included/unit_test.hpp>
diff --git a/tests/unwind_test.cc b/test/unit/unwind_test.cc
similarity index 94%
rename from tests/unwind_test.cc
rename to test/unit/unwind_test.cc
index b79a3e3b..b2f2e7f5 100644
--- a/tests/unwind_test.cc
+++ b/test/unit/unwind_test.cc
@@ -23,9 +23,9 @@
#include <boost/test/included/unit_test.hpp>
#include <pthread.h>
-#include "util/defer.hh"
-#include "core/posix.hh"
-#include "util/backtrace.hh"
+#include <seastar/util/defer.hh>
+#include <seastar/core/posix.hh>
+#include <seastar/util/backtrace.hh>
using namespace seastar;
diff --git a/tests/weak_ptr_test.cc b/test/unit/weak_ptr_test.cc
similarity index 99%
rename from tests/weak_ptr_test.cc
rename to test/unit/weak_ptr_test.cc
index 04e4a26d..98fdee18 100644
--- a/tests/weak_ptr_test.cc
+++ b/test/unit/weak_ptr_test.cc
@@ -23,7 +23,7 @@
#define BOOST_TEST_MODULE core
#include <boost/test/included/unit_test.hpp>
-#include "core/weak_ptr.hh"
+#include <seastar/core/weak_ptr.hh>
using namespace seastar;
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
deleted file mode 100644
index 70da55ce..00000000
--- a/tests/CMakeLists.txt
+++ /dev/null
@@ -1,311 +0,0 @@
-#
-# This file is open source software, licensed to you under the terms
-# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
-# distributed with this work for additional information regarding copyright
-# ownership. You may not use this file except in compliance with the License.
-#
-# You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Copyright (C) 2018 Scylladb, Ltd.
-#
-
-add_library (seastar-testing
- test-utils.cc
- test_runner.cc)
-
-target_include_directories (seastar-testing PUBLIC
- $<TARGET_PROPERTY:seastar,INCLUDE_DIRECTORIES>)
-
-if (NOT ${SEASTAR_LINK_STATIC_BOOST})
- target_compile_definitions (seastar-testing PUBLIC
- BOOST_TEST_DYN_LINK)
-endif ()
-
-# Logical target for all tests.
-add_custom_target (tests)
-# Logical target for all tests with debugging symbols.
-add_custom_target (tests_debug)
-set_target_properties (tests_debug PROPERTIES EXCLUDE_FROM_ALL ON)
-
-# ADD_SEASTAR_TEST NAME $name [CUSTOM] [SUITE] SOURCES $source_1 $source_2 ... $source_n ARGS $arg_1 $arg_2 ... $arg_n)
-#
-# Define a unit test with name `name`. This defines a build target with `name`.
-#
-# If CUSTOM is included, then the test doesn't link against the Seastar testing libraries.
-#
-# if SUITE is included, the test is automatically run as part of the test suite (and in Jenkins).
-#
-# SOURCES are the source files necessary for the test.
-#
-# ARGS are additional arguments that the executable should be invoked with when the test is run.
-function (add_seastar_test)
- set (options CUSTOM SUITE)
- set (one_value_args NAME)
- set (multi_value_args SOURCES ARGS)
- cmake_parse_arguments (args "${options}" "${one_value_args}" "${multi_value_args}" "${ARGN}")
-
- macro (prepare name)
- add_executable (${name} "${args_SOURCES}")
-
- target_link_libraries (${name} PUBLIC
- -Wl,--whole-archive seastar -Wl,--no-whole-archive
- Boost::unit_test_framework)
-
- if (NOT "${args_CUSTOM}")
- target_link_libraries (${name} PUBLIC
- -Wl,--whole-archive seastar-testing -Wl,--no-whole-archive)
- endif ()
- endmacro ()
-
- prepare (${args_NAME})
- add_dependencies (tests ${args_NAME})
- # Strip symbols.
- target_link_libraries (${args_NAME} PUBLIC -s)
-
- if ("${args_SUITE}")
- if ((NOT ("${SEASTAR_JENKINS}" STREQUAL "")) AND (NOT "${args_CUSTOM}"))
- string (TOLOWER ${CMAKE_BUILD_TYPE} jenkins_mode)
- set (jenkins_file_name "${SEASTAR_JENKINS}.${jenkins_mode}.${args_NAME}.boost.xml")
- set (jenkins_args --output_format=XML --log_level=all --report_level=no --log_sink=${jenkins_file_name})
- set (args_ARGS -- "${args_ARGS}")
- endif ()
-
- add_test (
- NAME ${args_NAME}
- COMMAND ${args_NAME} ${jenkins_args} ${args_ARGS}
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/..")
- endif ()
-
- set (name_with_symbols "${args_NAME}_g")
- prepare (${name_with_symbols})
- add_dependencies (tests_debug ${name_with_symbols})
- set_target_properties (${name_with_symbols} PROPERTIES EXCLUDE_FROM_ALL ON)
-endfunction ()
-
-#
-# Certificates for TLS tests.
-#
-
-configure_file (catest.key . COPYONLY)
-configure_file (catest.pem . COPYONLY)
-configure_file (tls-ca-bundle.pem . COPYONLY)
-configure_file (test.crl . COPYONLY)
-configure_file (test.crt . COPYONLY)
-configure_file (test.csr . COPYONLY)
-configure_file (test.key . COPYONLY)
-
-add_seastar_test (NAME abort_source_test
- SUITE
- SOURCES abort_source_test.cc)
-
-add_seastar_test (NAME alloc_test
- SUITE
- SOURCES alloc_test.cc)
-
-add_seastar_test (NAME alien_test
- SUITE
- CUSTOM
- SOURCES alien_test.cc)
-
-if (${SEASTAR_EXECUTE_ONLY_FAST_TESTS})
- if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
- set (allocator_test_args --iterations 5)
- else ()
- set (allocator_test_args --time 0.1)
- endif ()
-endif ()
-add_seastar_test (NAME allocator_test
- ARGS "${allocator_test_args}"
- SUITE
- CUSTOM
- SOURCES allocator_test.cc)
-
-add_seastar_test (NAME blkdiscard_test
- CUSTOM
- SOURCES blkdiscard_test.cc)
-
-add_seastar_test (NAME checked_ptr_test
- CUSTOM
- SOURCES checked_ptr_test.cc)
-
-add_seastar_test (NAME chunked_fifo_test
- CUSTOM SOURCES
- chunked_fifo_test.cc)
-
-add_seastar_test (NAME circular_buffer_test
- CUSTOM
- SOURCES circular_buffer_test.cc)
-
-add_seastar_test (NAME connect_test
- SUITE
- SOURCES connect_test.cc)
-
-add_seastar_test (NAME defer_test
- SUITE
- CUSTOM
- SOURCES defer_test.cc)
-
-add_seastar_test (NAME directory_test
- SUITE
- CUSTOM
- SOURCES directory_test.cc)
-
-add_seastar_test (NAME distributed_test
- ARGS -c 2
- SUITE
- CUSTOM
- SOURCES distributed_test.cc)
-
-add_seastar_test (NAME dns_test
- SOURCES dns_test.cc)
-
-add_seastar_test (NAME echo_test
- CUSTOM
- SOURCES echotest.cc)
-
-add_seastar_test (NAME execution_stage_test
- SUITE
- SOURCES execution_stage_test.cc)
-
-add_seastar_test (NAME expiring_fifo_test
- SUITE
- SOURCES expiring_fifo_test.cc)
-
-add_seastar_test (NAME fair_queue_test
- SUITE
- SOURCES fair_queue_test.cc)
-
-add_seastar_test (NAME file_io_test
- SOURCES fileiotest.cc)
-
-add_seastar_test (NAME foreign_ptr_test
- SUITE SOURCES foreign_ptr_test.cc)
-
-add_seastar_test (NAME fstream_test
- SUITE
- SOURCES fstream_test.cc)
-
-add_seastar_test (NAME futures_test
- SUITE
- SOURCES futures_test.cc)
-
-add_seastar_test (NAME httpd_test
- SUITE
- SOURCES httpd.cc)
-
-add_seastar_test (NAME ip_test
- CUSTOM
- SOURCES ip_test.cc)
-
-add_seastar_test (NAME json_formatter_test
- SUITE
- SOURCES json_formatter_test.cc)
-
-add_seastar_test (NAME l3_test
- CUSTOM
- SOURCES l3_test.cc)
-
-add_seastar_test (NAME lowres_clock_test
- SUITE
- SOURCES lowres_clock_test.cc)
-
-add_seastar_test (NAME noncopyable_function_test
- SUITE
- CUSTOM
- SOURCES noncopyable_function_test.cc)
-
-add_seastar_test (NAME output_stream_test
- SOURCES output_stream_test.cc)
-
-add_seastar_test (NAME packet_test
- SUITE
- CUSTOM SOURCES packet_test.cc)
-
-add_seastar_test (NAME program_options_test
- SUITE
- CUSTOM
- SOURCES program_options_test.cc)
-
-add_seastar_test (NAME rpc_test
- SUITE
- SOURCES rpc_test.cc)
-
-add_seastar_test (NAME scheduling_group_demo
- CUSTOM
- SOURCES scheduling_group_demo.cc)
-
-add_seastar_test (NAME semaphore_test
- SUITE
- SOURCES semaphore_test.cc)
-
-add_seastar_test (NAME shared_ptr_test
- SUITE
- CUSTOM
- SOURCES shared_ptr_test.cc)
-
-add_seastar_test (NAME slab_test
- CUSTOM
- SOURCES slab_test.cc)
-
-add_seastar_test (NAME smp_test
- SUITE
- CUSTOM
- SOURCES smp_test.cc)
-
-add_seastar_test (NAME sstring_test
- SUITE
- CUSTOM
- SOURCES sstring_test.cc)
-
-add_seastar_test (NAME tcp_test
- CUSTOM
- SOURCES tcp_test.cc)
-
-add_seastar_test (NAME thread_test
- SUITE
- SOURCES thread_test.cc)
-
-add_seastar_test (NAME thread_context_switch_test
- SUITE
- CUSTOM
- SOURCES thread_context_switch.cc)
-
-add_seastar_test (NAME timer_test
- SUITE
- CUSTOM
- SOURCES timertest.cc)
-
-add_seastar_test (NAME tls_test SUITE
- SOURCES tls_test.cc)
-
-add_seastar_test (NAME tuple_utils_test
- SUITE
- CUSTOM
- SOURCES tuple_utils_test)
-
-add_seastar_test (NAME unwind_test
- CUSTOM
- SOURCES unwind_test.cc)
-
-add_seastar_test (NAME weak_ptr_test
- SUITE
- CUSTOM
- SOURCES weak_ptr_test.cc)
-
-# Disable false positive due to new (with_alignment(...)).
-set (CTEST_ENVIRONMENT
- ASAN_OPTIONS='alloc_dealloc_mismatch=0')
-
-add_subdirectory (perf)
-add_subdirectory (memcached)
diff --git a/tests/perf/CMakeLists.txt b/tests/perf/CMakeLists.txt
deleted file mode 100644
index 17d4b7b6..00000000
--- a/tests/perf/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-add_library (seastar-perf-testing
- perf_tests.hh perf_tests.cc)
-
-target_include_directories (seastar-perf-testing PUBLIC
- $<TARGET_PROPERTY:seastar,INCLUDE_DIRECTORIES>)
-
-if (NOT ${SEASTAR_LINK_STATIC_BOOST})
- target_compile_definitions (seastar-perf-testing PUBLIC
- BOOST_TEST_DYN_LINK)
-endif ()
-
-# ADD_SEASTAR_PERF_TEST NAME $name SOURCES $source_1 $source_2 ... $source_n)
-function (add_seastar_perf_test)
- set (options "")
- set (one_value_args NAME)
- set (multi_value_args SOURCES)
- cmake_parse_arguments (args "${options}" "${one_value_args}" "${multi_value_args}" "${ARGN}")
-
- add_executable (${args_NAME} "${args_SOURCES}")
-
- target_link_libraries (${args_NAME} PUBLIC
- -Wl,--whole-archive seastar seastar-perf-testing -Wl,--no-whole-archive
- # Strip symbols.
- -s)
-endfunction ()
-
-add_seastar_perf_test (NAME perf_future_util
- SOURCES perf_future_util.cc)
--
2.14.3