From 6ea4830f8f040c90d71b559831b23a7e58495643 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 23 Aug 2021 16:42:51 +0200 Subject: [PATCH] btrfs-progs: build: add configure time option to enable experimental features Add --enable-experimental configure option that allows to merge unstable features or partially implemented features. This is supposed to help features that need time to settle, tweak output or formatting and would require constant rebases and would have limited exposure to users that could provide feedback. If this is enabled, the following may change without notice: - the whole feature may disappear in the future - new command names could change or relocate to other subcommands - parameter names - output formatting - json output Signed-off-by: David Sterba --- Documentation/Experimental.md | 32 ++++++++++++++++++++++++++++++++ configure.ac | 16 +++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 Documentation/Experimental.md diff --git a/Documentation/Experimental.md b/Documentation/Experimental.md new file mode 100644 index 00000000..d0828b2e --- /dev/null +++ b/Documentation/Experimental.md @@ -0,0 +1,32 @@ +Experimental features +===================== + +Experimental or unstable features may be enabled by + + ./configure --enable-experimental + +but as it says, the interface, command names, output formatting should be considered +unstable and not for production use. However testing is welcome and feedback or bugs +filed as issues. + +In the code use it like: + + if (EXPERIMENTAL) { + ... + } + +in case it does not interfere with other code or does not depend on an `#ifdef` +where it would break default build. + +Or: + + #if EXPERIMENTAL + ... + #endif + +for larger code blocks. + +Each feature should be tracked in an issue with label +[experimental](https://github.com/kdave/btrfs-progs/labels/experimental), with +a description and a todo list items. Individual tasks can be tracked in other +issues if needed. diff --git a/configure.ac b/configure.ac index c4fa461c..a20d04be 100644 --- a/configure.ac +++ b/configure.ac @@ -317,6 +317,20 @@ AS_IF([test "x$enable_python" = xyes], [PYTHON_BINDINGS=1], [PYTHON_BINDINGS=0]) AC_SUBST(PYTHON_BINDINGS) AC_SUBST(PYTHON) +AC_ARG_ENABLE([experimental], + AS_HELP_STRING([--enable-experimental], [allow UNSTABLE and EXPERIMENTAL features])) +AS_IF([test "x$enable_experimental" = xyes], [EXPERIMENTAL=1], [EXPERIMENTAL=0]) +AC_SUBST(EXPERIMENTAL) +AC_DEFINE_UNQUOTED([EXPERIMENTAL],[$EXPERIMENTAL],[Define to 1 if you experimental and unstable features are build]) + +experimental_msg= +if test "x$EXPERIMENTAL" = x1; then + experimental_msg=" + WARNING: experimental and unstable features are enabled, do not use this + build for production and please report issues +" +fi + # udev v190 introduced the btrfs builtin and a udev rule to use it. # Our udev rule gives us the friendly dm names but isn't required (or valid) # on earlier releases. @@ -394,6 +408,6 @@ AC_MSG_RESULT([ Python interpreter: ${PYTHON} crypto provider: ${cryptoprovider} ${cryptoproviderversion} zoned device: ${enable_zoned} - + ${experimental_msg} Type 'make' to compile. ])