Skip to contentSkip to conversation

configure: improve error for ucontext coroutine backend

PATCH In review Paolo Bonzini 3 participants 3 messages Aug 19, 2022 – Aug 25, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: improve error for ucontext coroutine backend

Instead of using feature_not_found(), which is not a good match because there is no "remedy" to fix the lack of makecontext(), just print a custom error.

This happens to remove the last use of feature_not_found(), so remove the definition and the documentation.

---
 configure                   | 11 +----------
 docs/devel/build-system.rst |  5 -----
 2 files changed, 1 insertion(+), 15 deletions(-)
configure +1 -10
index 72ab03f11a..575dde1c1f 100755
@@ -1468,15 +1468,6 @@ if test "$tcg" = "enabled"; then
     git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
 fi
 
-feature_not_found() {
-  feature=$1
-  remedy=$2
-
-  error_exit "User requested feature $feature" \
-      "configure was not able to find it." \
-      "$remedy"
-}
-
 # ---
 # big/little endian test
 cat > $TMPC << EOF
@@ -1639,7 +1630,7 @@ else
     ;;
   ucontext)
     if test "$ucontext_works" != "yes"; then
-      feature_not_found "ucontext"
+      error_exit "'ucontext' backend requested but makecontext not available"
     fi
     ;;
   sigaltstack)
docs/devel/build-system.rst +0 -5
index 431caba7aa..1894721743 100644
@@ -99,11 +99,6 @@ developers in checking for system features:
    Write a minimal C program main() function to the temporary file
    indicated by $TMPC
 
-``feature_not_found $NAME $REMEDY``
-   Print a message to stderr that the feature $NAME was not available
-   on the system, suggesting the user try $REMEDY to address the
-   problem.
-
 ``error_exit $MESSAGE $MORE...``
    Print $MESSAGE to stderr, followed by $MORE... and then exit from the
    configure script with non-zero status
Signature · 1 line
2.37.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Paolo Bonzini

Instead of using feature_not_found(), which is not a good match because there is no "remedy" to fix the lack of makecontext(), just print a custom error.

Quoted 8 lines

This happens to remove the last use of feature_not_found(), so remove the definition and the documentation.

---
  configure                   | 11 +----------
  docs/devel/build-system.rst |  5 -----
  2 files changed, 1 insertion(+), 15 deletions(-)

r~

Reviewed-by Philippe Mathieu-Daudé on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 4 lines · Paolo Bonzini

Instead of using feature_not_found(), which is not a good match because there is no "remedy" to fix the lack of makecontext(), just print a custom error.

Quoted 8 lines

This happens to remove the last use of feature_not_found(), so remove the definition and the documentation.

---
  configure                   | 11 +----------
  docs/devel/build-system.rst |  5 -----
  2 files changed, 1 insertion(+), 15 deletions(-)