Skip to content

Commit

Permalink
fix usage of configure.get-relevant-features (#375)
Browse files Browse the repository at this point in the history
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 <link> 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.
  • Loading branch information
grisumbras authored Apr 23, 2024
1 parent 6f383e2 commit 33de696
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/build/ac.jam
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ class ac-library : basic-target
library-path ?= [ os.environ $(name:U)_LIBPATH ] ;
}

local relevant = [ property.select [ configure.get-relevant-features ] <link> :
local relevant = [ configure.get-relevant-features
[ $(property-set).raw ] ] ;
relevant = [ property.select $(relevant) <link> :
[ $(property-set).raw ] ] ;
local min = [ property.as-path [ SORT [ feature.minimize $(relevant) ] ] ] ;

Expand Down Expand Up @@ -321,6 +323,5 @@ rule check-library ( target : true-properties * : false-properties * )
$(true-properties) : $(false-properties) ] ;
return <conditional>@$(instance).check
[ property.evaluate-conditional-relevance
$(true-properties) $(false-properties)
: [ configure.get-relevant-features ] <link> ] ;
$(true-properties) $(false-properties) : <link> ] ;
}
12 changes: 9 additions & 3 deletions src/build/configure.jam
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ] ;
Expand All @@ -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 ] ;
Expand All @@ -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 ] ;
Expand Down

0 comments on commit 33de696

Please sign in to comment.