diff --git a/src/build/ac.jam b/src/build/ac.jam index 09eb26ea9..db02b7288 100644 --- a/src/build/ac.jam +++ b/src/build/ac.jam @@ -1,5 +1,6 @@ # Copyright (c) 2010 Vladimir Prus. # Copyright (c) 2013 Steven Watanabe +# Copyright (c) 2021 Rene Ferdinand Rivera Morell # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE_1_0.txt or @@ -227,6 +228,7 @@ class ac-library : basic-target local relevant = [ property.select [ configure.get-relevant-features ] : [ $(property-set).raw ] ] ; + local min = [ property.as-path [ SORT [ feature.minimize $(relevant) ] ] ] ; local key = ac-library-$(name)-$(relevant:J=-) ; local lookup = [ config-cache.get $(key) ] ; @@ -235,7 +237,7 @@ class ac-library : basic-target { if $(lookup) = missing { - configure.log-library-search-result $(name) : "no (cached)" ; + configure.log-library-search-result $(name) : "no (cached)" $(min) ; return [ property-set.empty ] ; } else @@ -247,7 +249,7 @@ class ac-library : basic-target } local library = [ ac.construct-library $(lookup[2]) : [ $(property-set).refine [ property-set.create $(lookup[3]) ] ] : $(library-path) ] ; - configure.log-library-search-result $(name) : "yes (cached)" ; + configure.log-library-search-result $(name) : "yes (cached)" $(min) ; return [ $(library[1]).add-raw $(includes) ] $(library[2-]) ; } } @@ -264,13 +266,13 @@ class ac-library : basic-target } library = [ ac.construct-library $(library[1]) : [ $(property-set).refine [ property-set.create $(library[2]) ] ] : $(library-path) ] ; - configure.log-library-search-result $(name) : "yes" ; + configure.log-library-search-result $(name) : "yes" $(min) ; return [ $(library[1]).add-raw $(includes) ] $(library[2-]) ; } else { config-cache.set $(key) : missing ; - configure.log-library-search-result $(name) : "no" ; + configure.log-library-search-result $(name) : "no" $(min) ; return [ property-set.empty ] ; } } diff --git a/src/build/configure.jam b/src/build/configure.jam index 821e0082f..e1541b344 100644 --- a/src/build/configure.jam +++ b/src/build/configure.jam @@ -1,5 +1,5 @@ # Copyright (c) 2010 Vladimir Prus. -# Copyright 2017-2021 Rene Rivera. +# Copyright 2017-2021 Rene Ferdinand Rivera Morell # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE_1_0.txt or @@ -66,7 +66,12 @@ rule log-component-configuration ( component : message ) } -rule log-check-result ( result ) +.variant_index = 0 ; +.nl = "\n" ; + +.check_notes = ; + +rule log-check-result ( result variant ? ) { if ! $(.announced-checks) { @@ -74,16 +79,35 @@ rule log-check-result ( result ) .announced-checks = 1 ; } + if $(variant) + { + if $(.variant_index.$(variant)) + { + result = "$(result) [$(.variant_index.$(variant))]" ; + } + else + { + .variant_index = [ CALC $(.variant_index) + 1 ] ; + .variant_index.$(variant) = $(.variant_index) ; + result = "$(result) [$(.variant_index.$(variant))]" ; + .check_notes += "[$(.variant_index.$(variant))] $(variant)" ; + } + } + # else + # { + # result = "$(result) [?]" ; + # } + ECHO $(result) ; # FIXME: Unfinished code. Nothing seems to set .check-results at the moment. #.check-results += $(result) ; } -rule log-library-search-result ( library : result ) +rule log-library-search-result ( library : result variant ? ) { local x = [ PAD " - $(library)" : $(.width) ] ; - log-check-result "$(x) : $(result)" ; + log-check-result "$(x) : $(result)" $(variant) ; } @@ -117,6 +141,12 @@ rule print-component-configuration ( ) rule print-configure-checks-summary ( ) { + if $(.check_notes) + { + ECHO ; + for local l in $(.check_notes) { ECHO $(l) ; } + } + # FIXME: The problem with this approach is that the user sees the checks # summary when all checks are done, and has no progress reporting while the # checks are being executed. @@ -156,11 +186,11 @@ rule maybe-force-rebuild ( targets * ) # Attempts to build a set of virtual targets rule try-build ( targets * : ps : what : retry ? ) { - local cache-props = [ $(ps).raw ] ; - local cache-name = $(what) $(cache-props) ; - cache-name = $(cache-name:J=-) ; - local value = [ config-cache.get $(cache-name) ] ; - local cache-min = [ SORT [ feature.minimize $(cache-props) ] ] ; + local cache-props = [ $(ps).raw ] ; + local cache-name = $(what) $(cache-props) ; + cache-name = $(cache-name:J=-) ; + local value = [ config-cache.get $(cache-name) ] ; + local cache-min = [ property.as-path [ SORT [ feature.minimize $(cache-props) ] ] ] ; local result ; local jam-targets ; @@ -172,18 +202,19 @@ rule try-build ( targets * : ps : what : retry ? ) jam-targets += [ $(t).actualize ] ; } + local x ; if $(value) { - local x = [ PAD " - $(what)" : $(.width) ] ; + x = [ PAD " - $(what)" : $(.width) ] ; if $(value) = true { .$(what)-supported.$(ps) = yes ; result = true ; - log-check-result "$(x) : yes (cached) : $(cache-min:E=:J= )" ; + x = "$(x) : yes (cached)" ; } else { - log-check-result "$(x) : no (cached) : $(cache-min:E=:J= )" ; + x = "$(x) : no (cached)" ; } } else if ! UPDATE_NOW in [ RULENAMES ] @@ -192,19 +223,23 @@ rule try-build ( targets * : ps : what : retry ? ) } else { - local x = [ PAD " - $(what)" : $(.width) ] ; + x = [ PAD " - $(what)" : $(.width) ] ; if [ UPDATE_NOW $(jam-targets) : $(.log-fd) : ignore-minus-n : ignore-minus-q ] { .$(what)-supported.$(ps) = yes ; result = true ; - log-check-result "$(x) : yes : $(cache-min:E=:J= )" ; + x = "$(x) : yes" ; } else { - log-check-result "$(x) : no : $(cache-min:E=:J= )" ; + x = "$(x) : no" ; } } + if $(x) + { + log-check-result "$(x)" "$(cache-min:J= )" ; + } if ! $(value) { if $(result) @@ -227,9 +262,11 @@ rule try-find-build ( ps : what : * ) # The outer layer only needs to check $(what), but we # also need to check the individual elements, in case # the set of targets has changed since the last build. - local cache-name = $(what) $($(args)[1]) [ $(ps).raw ] ; + local cache-props = [ $(ps).raw ] ; + local cache-name = $(what) $($(args)[1]) $(cache-props) ; cache-name = $(cache-name:J=-) ; local value = [ config-cache.get $(cache-name) ] ; + local cache-min = [ property.as-path [ SORT [ feature.minimize $(cache-props) ] ] ] ; local result ; local jam-targets ; @@ -256,7 +293,7 @@ rule try-find-build ( ps : what : * ) local x = [ PAD " - $(what)" : $(.width) ] ; local y = [ PAD $($(name)[1]) : 3 ] ; result = $(value) ; - log-check-result "$(x) : $(y) (cached)" ; + log-check-result "$(x) : $(y) (cached)" "$(cache-min:J= )" ; } else { @@ -276,13 +313,13 @@ rule try-find-build ( ps : what : * ) $(.log-fd) : ignore-minus-n : ignore-minus-q ] { result = [ CALC $(i) - 2 ] ; - log-check-result "$(x) : $($(i)[1])" ; + log-check-result "$(x) : $($(i)[1])" "$(cache-min:J= )" ; break ; } } if ! $(result) { - log-check-result "$(x) : none" ; + log-check-result "$(x) : none" "$(cache-min:J= )" ; result = none ; } } @@ -395,8 +432,9 @@ rule get-relevant-features ( properties * ) { local ps-full = [ property-set.create $(properties) ] ; local ps-base = [ property-set.create [ $(ps-full).base ] ] ; - local ps-relevant = [ property-set.create - [ feature.expand-subfeatures [ feature.minimize [ $(ps-base).raw ] ] ] ] ; + local ps-min = [ feature.expand-subfeatures [ feature.minimize + [ $(ps-base).raw ] ] ] ; + local ps-relevant = [ property-set.create $(ps-min) ] ; return [ $(ps-relevant).raw ] ; } diff --git a/test/configure.py b/test/configure.py index ffeced3e0..b3d97520f 100644 --- a/test/configure.py +++ b/test/configure.py @@ -127,7 +127,7 @@ obj foo : foo.cpp : """) t.run_build_system() t.expect_output_lines([ - " - which one? : pass"]) + " - which one? : pass*"]) t.expect_addition("bin/$toolset/debug*/pass.obj") t.expect_addition("bin/$toolset/debug*/foo.obj") t.expect_nothing_more() @@ -135,13 +135,13 @@ obj foo : foo.cpp : # An up-to-date build should use the cache t.run_build_system() t.expect_output_lines([ - " - which one? : pass (cached)"]) + " - which one? : pass (cached)*"]) t.expect_nothing_more() # -a should re-run everything, including configuration checks t.run_build_system(["-a"]) t.expect_output_lines([ - " - which one? : pass"]) + " - which one? : pass*"]) t.expect_touch("bin/$toolset/debug*/pass.obj") t.expect_touch("bin/$toolset/debug*/foo.obj") t.expect_nothing_more() @@ -149,20 +149,20 @@ obj foo : foo.cpp : # --reconfigure should re-run configuration checks only t.run_build_system(["--reconfigure"]) t.expect_output_lines([ - " - which one? : pass"]) + " - which one? : pass*"]) t.expect_touch("bin/$toolset/debug*/pass.obj") t.expect_nothing_more() # -a -n should not rebuild configuration checks t.run_build_system(["-a", "-n"]) t.expect_output_lines([ - " - which one? : pass (cached)"]) + " - which one? : pass (cached)*"]) t.expect_nothing_more() # --clean-all should clear all configuration checks t.run_build_system(["--clean-all"]) t.expect_output_lines([ - " - which one? : pass (cached)"]) + " - which one? : pass (cached)*"]) t.expect_removal("bin/$toolset/debug*/pass.obj") t.expect_removal("bin/$toolset/debug*/foo.obj") t.expect_nothing_more() @@ -180,7 +180,7 @@ obj foo : foo.cpp : # state here. t.run_build_system() t.expect_output_lines([ - " - which one? : pass"]) + " - which one? : pass*"]) t.expect_addition("bin/$toolset/debug*/pass.obj") t.expect_addition("bin/$toolset/debug*/foo.obj") t.expect_nothing_more() @@ -252,12 +252,12 @@ obj foo : foo.cpp : """) t.run_build_system() t.expect_output_lines([ - " - which one? : none"]) + " - which one? : none*"]) # An up-to-date build should use the cache t.run_build_system() t.expect_output_lines([ - " - which one? : none (cached)"]) + " - which one? : none (cached)*"]) t.expect_nothing_more() t.cleanup()