JSON11_LIBS = $(top_builddir)/ext/json11/libjson11.la
PROBDS_LIBS = $(top_builddir)/ext/probds/libprobds.la
ARC4RANDOM_LIBS = $(top_builddir)/ext/arc4random/libarc4random.la
-RUST_LIBS = $(top_builddir)/settings/rust/libsettings.a $(LIBDL)
+RUST_LIBS = $(top_builddir)/rec-rust-lib/rust/librecrust.a $(LIBDL)
AM_CPPFLAGS = $(LUA_CFLAGS) $(YAHTTP_CFLAGS) $(BOOST_CPPFLAGS) $(LIBSODIUM_CFLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) $(SANITIZER_FLAGS) -O3 -Wall -pthread -DSYSCONFDIR=\"${sysconfdir}\" $(SYSTEMD_CFLAGS)
AM_CPPFLAGS += \
-I$(top_srcdir)/ext/json11 \
-I$(top_srcdir)/ext/protozero/include \
- -I$(top_srcdir)/settings \
- -I$(top_builddir)/settings \
- -I$(top_srcdir)/settings/rust/src \
+ -I$(top_srcdir)/rec-rust-lib \
+ -I$(top_builddir)/rec-rust-lib \
+ -I$(top_srcdir)/rec-rust-lib/rust/src \
$(YAHTTP_CFLAGS) \
$(LIBCRYPTO_INCLUDES) \
-DBOOST_CONTAINER_USE_STD_EXCEPTIONS
rec-metrics-gen%h rec-prometheus-gen%h rec-snmp-gen%h rec-oids-gen%h RECURSOR-MIB%txt: metrics.py metrics_table.py RECURSOR-MIB.in
$(PYTHON) metrics.py
-# We explicitly build settings in two steps, as settings modifies files in the settings/rust subdir
-SUBDIRS=ext settings settings/rust
+# We explicitly build rec-rust-lib in two steps, as it modifies files in the rec-rust-lib/rust subdir
+SUBDIRS=ext rec-rust-lib rec-rust-lib/rust
if LUA
AM_CPPFLAGS +=$(LUA_CFLAGS)
rec-main.hh rec-main.cc \
rec-protozero.cc rec-protozero.hh \
rec-responsestats.hh rec-responsestats.cc \
+ rec-rust-lib/cxxsupport.cc \
rec-snmp.hh rec-snmp.cc \
rec-system-resolve.hh rec-system-resolve.cc \
rec-taskqueue.cc rec-taskqueue.hh \
rpzloader.cc rpzloader.hh \
secpoll-recursor.cc secpoll-recursor.hh \
secpoll.cc secpoll.hh \
- settings/cxxsupport.cc \
sha.hh \
sholder.hh \
shuffle.cc shuffle.hh \
zoneparser-tng.cc zoneparser-tng.hh
nodist_pdns_recursor_SOURCES = \
- settings/cxxsettings-generated.cc
+ rec-rust-lib/cxxsettings-generated.cc
if !HAVE_LUA_HPP
BUILT_SOURCES += lua.hpp
rcpgenerator.cc \
rec-eventtrace.cc rec-eventtrace.hh \
rec-responsestats.hh rec-responsestats.cc \
+ rec-rust-lib/cxxsupport.cc \
rec-system-resolve.hh rec-system-resolve.cc \
rec-taskqueue.cc rec-taskqueue.hh \
rec-tcounters.cc rec-tcounters.hh \
root-dnssec.hh \
rpzloader.cc rpzloader.hh \
secpoll.cc \
- settings/cxxsupport.cc \
sholder.hh \
shuffle.cc shuffle.hh \
sillyrecords.cc \
zoneparser-tng.cc zoneparser-tng.hh
nodist_testrunner_SOURCES = \
- settings/cxxsettings-generated.cc
+ rec-rust-lib/cxxsettings-generated.cc
testrunner_LDFLAGS = \
$(AM_LDFLAGS) \
qtype.cc \
rcpgenerator.cc rcpgenerator.hh \
rec-lua-conf.cc rec-lua-conf.hh \
+ rec-rust-lib/cxxsupport.cc \
rec-system-resolve.cc rec-system-resolve.hh \
rec-web-stubs.hh \
rec_channel.cc rec_channel.hh \
rec_control.cc \
- settings/cxxsupport.cc \
sillyrecords.cc \
sortlist.cc sortlist.hh \
svc-records.cc svc-records.hh \
unix_utility.cc
nodist_rec_control_SOURCES = \
- settings/cxxsettings-generated.cc
+ rec-rust-lib/cxxsettings-generated.cc
dnslabeltext.cc: dnslabeltext.rl
$(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
ext/probds/Makefile
ext/yahttp/Makefile
ext/yahttp/yahttp/Makefile
- settings/Makefile
- settings/rust/Makefile])
+ rec-rust-lib/Makefile
+ rec-rust-lib/rust/Makefile])
AC_OUTPUT
subdir('meson' / 'dnstap') # DNSTAP through libfstream
subdir('meson' / 'libcurl') # Curl
-subdir('settings')
+subdir('rec-rust-lib')
common_sources = []
deps = [
dep_pdns,
dep_no_config_in_source,
- dep_rust_settings,
+ dep_rust_recrust,
dep_boost,
dep_boost_context,
dep_threads,
config_h,
dependencies: [
deps,
- dep_settings_ch,
+ dep_recrust_ch,
librec_dnslabeltext,
],
)
dep_protozero,
dep_yahttp_header_only,
dep_json11,
- dep_settings,
- dep_rust_settings,
+ dep_recrust,
+ dep_rust_recrust,
dep_systemd,
librec_signers_openssl,
librec_signers_sodium,
'manpages': ['rec_control.1'],
'deps-extra': [
dep_boost,
- dep_settings,
- dep_rust_settings,
+ dep_recrust,
+ dep_rust_recrust,
],
},
}
dep_boost_test,
dep_lua,
dep_nod,
- dep_settings,
- dep_rust_settings,
+ dep_recrust,
+ dep_rust_recrust,
librec_signers_openssl,
librec_signers_sodium,
],
#include "secpoll-recursor.hh"
#include "logging.hh"
#include "dnsseckeeper.hh"
-#include "settings/cxxsettings.hh"
+#include "rec-rust-lib/cxxsettings.hh"
#include "json.hh"
#include "rec-system-resolve.hh"
#include "root-dnssec.hh"
#include "ratelimitedlog.hh"
-#include "settings/rust/web.rs.h"
+#include "rec-rust-lib/rust/web.rs.h"
#ifdef NOD_ENABLED
#include "nod.hh"
#include "threadname.hh"
#include "iputils.hh"
#include "bridge.hh"
-#include "settings/rust/web.rs.h"
-#include "settings/rust/misc.rs.h"
+#include "rec-rust-lib/rust/web.rs.h"
+#include "rec-rust-lib/rust/misc.rs.h"
::rust::Vec<::rust::String> pdns::settings::rec::getStrings(const std::string& name)
{
python = find_program('python3')
-settings = custom_target(
- command: [python, '@INPUT0@', '@SOURCE_ROOT@/settings', '@BUILD_ROOT@/settings'],
+recrust = custom_target(
+ command: [python, '@INPUT0@', '@SOURCE_ROOT@/rec-rust-lib', '@BUILD_ROOT@/rec-rust-lib'],
input: sources,
output: generated,
)
# librec_common depends on this, so the sources get linked
-dep_settings_ch = declare_dependency(
- sources: [settings, 'cxxsupport.cc'],
+dep_recrust_ch = declare_dependency(
+ sources: [recrust, 'cxxsupport.cc'],
include_directories: [include_directories('.'), ]
)
# The rust parts depend on this, no sources listed, which avoid duplicates object files
-# In turn deps (defined in the main meson.build file, includes dep_rust_settings)
-dep_settings = declare_dependency(
+# In turn deps (defined in the main meson.build file, includes dep_rust_recrust)
+dep_recrust = declare_dependency(
include_directories: [include_directories('.'), ]
)
"proc-macro2",
]
+[[package]]
+name = "recrust"
+version = "5.3.0"
+dependencies = [
+ "base64",
+ "bytes",
+ "cxx",
+ "cxx-build",
+ "form_urlencoded",
+ "http-body-util",
+ "hyper",
+ "hyper-rustls",
+ "hyper-util",
+ "ipnet",
+ "once_cell",
+ "rustls",
+ "rustls-pemfile",
+ "rustls-pki-types",
+ "serde",
+ "serde_yml",
+ "tokio",
+ "tokio-rustls",
+ "uuid",
+]
+
[[package]]
name = "ring"
version = "0.17.8"
"version_check",
]
-[[package]]
-name = "settings"
-version = "5.2.0"
-dependencies = [
- "base64",
- "bytes",
- "cxx",
- "cxx-build",
- "form_urlencoded",
- "http-body-util",
- "hyper",
- "hyper-rustls",
- "hyper-util",
- "ipnet",
- "once_cell",
- "rustls",
- "rustls-pemfile",
- "rustls-pki-types",
- "serde",
- "serde_yml",
- "tokio",
- "tokio-rustls",
- "uuid",
-]
-
[[package]]
name = "shlex"
version = "1.3.0"
[package]
-name = "settings"
+name = "recrust"
# Convention: major/minor is equal to rec's major/minor
-version = "5.2.0"
+version = "5.3.0"
edition = "2021"
[lib]
-name = "settings"
+name = "recrust"
crate-type = ["staticlib"]
[dependencies]
CARGO ?= cargo
-all install: libsettings.a
+all install: librecrust.a
EXTRA_DIST = \
Cargo.lock \
src/web.rs
# should actually end up in a target specific dir...
-libsettings.a lib.rs.h web.rs.h misc.rs.h: \
+librecrust.a lib.rs.h web.rs.h misc.rs.h: \
Cargo.lock \
Cargo.toml \
build.rs \
src/misc.rs \
src/web.rs
SYSCONFDIR=$(sysconfdir) NODCACHEDIRNOD=$(localstatedir)/nod NODCACHEDIRUDR=$(localstatedir)/udr $(CARGO) build --release $(RUST_TARGET) --target-dir=$(builddir)/target --manifest-path ${srcdir}/Cargo.toml
- cp target/$(RUSTC_TARGET_ARCH)/release/libsettings.a libsettings.a
- cp target/$(RUSTC_TARGET_ARCH)/cxxbridge/settings/src/lib.rs.h lib.rs.h
- cp target/$(RUSTC_TARGET_ARCH)/cxxbridge/settings/src/web.rs.h web.rs.h
- cp target/$(RUSTC_TARGET_ARCH)/cxxbridge/settings/src/misc.rs.h misc.rs.h
- cp target/$(RUSTC_TARGET_ARCH)/cxxbridge/rust/cxx.h cxx.h
+ cp -pv target/$(RUSTC_TARGET_ARCH)/release/librecrust.a librecrust.a
+ cp -pv target/$(RUSTC_TARGET_ARCH)/cxxbridge/recrust/src/lib.rs.h lib.rs.h
+ cp -pv target/$(RUSTC_TARGET_ARCH)/cxxbridge/recrust/src/web.rs.h web.rs.h
+ cp -pv target/$(RUSTC_TARGET_ARCH)/cxxbridge/recrust/src/misc.rs.h misc.rs.h
+ cp -pv target/$(RUSTC_TARGET_ARCH)/cxxbridge/rust/cxx.h cxx.h
clean-local:
- rm -rf libsettings.a src/lib.rs lib.rs.h web.rs.h cxx.h misc.rs.h target
+ rm -rf librecrust.a src/lib.rs lib.rs.h web.rs.h cxx.h misc.rs.h target
--- /dev/null
+#!/bin/sh -e
+
+#echo "PWD=$PWD"
+#echo "srcdir=$srcdir"
+#echo "builddir=$builddir"
+
+$CARGO build --release $RUST_TARGET --target-dir=$builddir/target --manifest-path $srcdir/Cargo.toml
+
+cp -vp target/$RUSTC_TARGET_ARCH/release/librecrust.a $builddir/rec-rust-lib/rust/librecrust.a
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/recrust/src/lib.rs.h $srcdir/lib.rs.h
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/recrust/src/lib.rs.h $builddir/rec-rust-lib/rust/lib.rs.h
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/rust/cxx.h $srcdir/cxx.h
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/rust/cxx.h $builddir/rec-rust-lib/rust/cxx.h
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/recrust/src/web.rs.h $srcdir/web.rs.h
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/recrust/src/web.rs.h $builddir/rec-rust-lib/rust/web.rs.h
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/recrust/src/misc.rs.h $srcdir/misc.rs.h
+cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/recrust/src/misc.rs.h $builddir/rec-rust-lib/rust/misc.rs.h
-build = find_program('build_settings')
+build = find_program('build_recrust')
cargo = find_program('cargo')
infile = 'Cargo.toml'
-outfile = 'libsettings.a'
+outfile = 'librecrust.a'
env = environment()
env.append('RUST_TARGET', '')
env.append('RUSTC_TARGET_ARCH', '')
-lib_settings = custom_target('libsettings.a',
+lib_recrust = custom_target('librecrust.a',
output: [outfile, 'cxx.h'],
input: infile,
command: [build,
'src/bridge.rs',
'src/helpers.rs',
],
- depends: settings,
+ depends: recrust,
env: env,
console: true,
)
-dep_rust_settings = declare_dependency(
- link_with: lib_settings[0],
- sources: lib_settings[1],
+dep_rust_recrust = declare_dependency(
+ link_with: lib_recrust[0],
+ sources: lib_recrust[1],
include_directories: [include_directories('.'), include_directories('src')],
)
#include "rec-main.hh"
#include "rec-system-resolve.hh"
-#include "settings/cxxsettings.hh"
+#include "rec-rust-lib/cxxsettings.hh"
/* g++ defines __SANITIZE_THREAD__
clang++ supports the nice __has_feature(thread_sanitizer),
#include "credentials.hh"
#include "namespaces.hh"
#include "rec_channel.hh"
-#include "settings/cxxsettings.hh"
+#include "rec-rust-lib/cxxsettings.hh"
#include "logger.hh"
#include "logging.hh"
#include "logger.hh"
#include "syncres.hh"
#include "zoneparser-tng.hh"
-#include "settings/cxxsettings.hh"
+#include "rec-rust-lib/cxxsettings.hh"
#include "rec-system-resolve.hh"
// XXX consider including rec-main.hh?
+++ /dev/null
-#!/bin/sh -e
-
-#echo "PWD=$PWD"
-#echo "srcdir=$srcdir"
-#echo "builddir=$builddir"
-
-$CARGO build --release $RUST_TARGET --target-dir=$builddir/target --manifest-path $srcdir/Cargo.toml
-
-cp -vp target/$RUSTC_TARGET_ARCH/release/libsettings.a $builddir/settings/rust/libsettings.a
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/settings/src/lib.rs.h $srcdir/lib.rs.h
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/settings/src/lib.rs.h $builddir/settings/rust/lib.rs.h
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/rust/cxx.h $srcdir/cxx.h
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/rust/cxx.h $builddir/settings/rust/cxx.h
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/settings/src/web.rs.h $srcdir/web.rs.h
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/settings/src/web.rs.h $builddir/settings/rust/web.rs.h
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/settings/src/misc.rs.h $srcdir/misc.rs.h
-cp -vp target/$RUSTC_TARGET_ARCH/cxxbridge/settings/src/misc.rs.h $builddir/settings/rust/misc.rs.h
#include <boost/format.hpp>
#include <fstream>
-#include "settings/cxxsettings.hh"
+#include "rec-rust-lib/cxxsettings.hh"
BOOST_AUTO_TEST_SUITE(test_settings)
#include "rec-lua-conf.hh"
#include "rpzloader.hh"
#include "rec-main.hh"
-#include "settings/cxxsettings.hh" // IWYU pragma: keep, needed by included generated file
-#include "settings/rust/src/bridge.hh"
-#include "settings/rust/web.rs.h"
-#include "settings/rust/misc.rs.h"
+#include "rec-rust-lib/cxxsettings.hh" // IWYU pragma: keep, needed by included generated file
+#include "rec-rust-lib/rust/src/bridge.hh"
+#include "rec-rust-lib/rust/web.rs.h"
+#include "rec-rust-lib/rust/misc.rs.h"
using json11::Json;