From 33de6961820107b69e403c8fbf977646a8845985 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 24 Apr 2024 01:41:48 +0300 Subject: [PATCH] fix usage of configure.get-relevant-features (#375) The rule was misnamed, as it returned relevant properties, not features. The misnomer seems to had been the source of misuse: ac module did not consider any feature other than to be relevant when checking for library existance. That could result in incorrect config checks. The change renames the rule to get-relevant-properties, and adds back get-relevant-features that returns features. In addition, it fixes the usage of get-relevant-features in ac module (it called the rule without arguments), and removes another usage where its invocation could not result in anything meaningful. --- src/build/ac.jam | 7 ++++--- src/build/configure.jam | 12 +++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/build/ac.jam b/src/build/ac.jam index 53412ab89c..551cb7d5a1 100644 --- a/src/build/ac.jam +++ b/src/build/ac.jam @@ -226,7 +226,9 @@ class ac-library : basic-target library-path ?= [ os.environ $(name:U)_LIBPATH ] ; } - local relevant = [ property.select [ configure.get-relevant-features ] : + local relevant = [ configure.get-relevant-features + [ $(property-set).raw ] ] ; + relevant = [ property.select $(relevant) : [ $(property-set).raw ] ] ; local min = [ property.as-path [ SORT [ feature.minimize $(relevant) ] ] ] ; @@ -321,6 +323,5 @@ rule check-library ( target : true-properties * : false-properties * ) $(true-properties) : $(false-properties) ] ; return @$(instance).check [ property.evaluate-conditional-relevance - $(true-properties) $(false-properties) - : [ configure.get-relevant-features ] ] ; + $(true-properties) $(false-properties) : ] ; } diff --git a/src/build/configure.jam b/src/build/configure.jam index 5f47a1b2cc..89bf8ba1e5 100644 --- a/src/build/configure.jam +++ b/src/build/configure.jam @@ -428,7 +428,7 @@ rule find-builds-raw ( project : ps : what : * ) } } -rule get-relevant-features ( properties * ) +rule get-relevant-properties ( properties * ) { local ps-full = [ property-set.create $(properties) ] ; local ps-base = [ property-set.create [ $(ps-full).base ] ] ; @@ -439,9 +439,15 @@ rule get-relevant-features ( properties * ) return [ $(ps-relevant).raw ] ; } +rule get-relevant-features ( properties * ) +{ + local props = [ get-relevant-properties $(properties) ] ; + return $(props:G) ; +} + rule builds ( metatarget-reference : properties * : what ? : retry ? ) { - local relevant = [ get-relevant-features $(properties) ] ; + local relevant = [ get-relevant-properties $(properties) ] ; local ps = [ property-set.create $(relevant) ] ; local t = [ targets.current ] ; local p = [ $(t).project ] ; @@ -459,7 +465,7 @@ rule builds ( metatarget-reference : properties * : what ? : retry ? ) rule find-builds ( what : properties * : * ) { - local relevant = [ get-relevant-features $(properties) ] ; + local relevant = [ get-relevant-properties $(properties) ] ; local ps = [ property-set.create $(relevant) ] ; local t = [ targets.current ] ; local p = [ $(t).project ] ;