aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.hxx
AgeCommit message (Collapse)AuthorFilesLines
2024-02-14Add search_prerequisite*() variants of match_prerequisite*() versionsBoris Kolpackov1-0/+23
2024-02-14Avoid duplicate fsdir{} in inject_fsdir(), match_prerequisite*() call sequencesBoris Kolpackov1-2/+7
2024-02-13Add ability to omit matching in inject_fsdir()Boris Kolpackov1-3/+10
2024-01-16Add add_adhoc_member_identity(), use to fix ad hoc pattern rule logicBoris Kolpackov1-2/+24
2024-01-11Properly split injected ad hoc group member name in regex pattern ruleBoris Kolpackov1-2/+4
2023-12-12Work around unexecuted member for installed libraries issueBoris Kolpackov1-2/+4
See comment for the long-term plan.
2023-12-04Clarify commentBoris Kolpackov1-4/+4
2023-12-03Reimplement search_existing() functions via target_type::searchBoris Kolpackov1-6/+4
This allows us to automatically get the target type-specific behavior with regards to the out_only semantics (added in the previous commit) instead of passing it explicitly from each call site.
2023-11-07Account for match options re-locking when checking if target is matchedBoris Kolpackov1-1/+1
2023-11-01Tighten/optimize cleaning of fsdir{} during matchBoris Kolpackov1-0/+5
2023-11-01Add notion of match optionsBoris Kolpackov1-14/+74
Now, when matching a rule, the caller may request a subset of the full functionality of performing an operation on a target. This is achieved with match options.
2023-10-26Add inject_fsdir_direct(), fsdir_rule::perform_clean_direct() functionsBoris Kolpackov1-3/+9
2023-10-26Add clean_during_match*() functionsBoris Kolpackov1-1/+16
2023-10-06Handle 0 mask in update_during_match_prerequisites()Boris Kolpackov1-1/+1
2023-10-04Add match_direct_complete() to support async direct matchesBoris Kolpackov1-6/+11
2023-07-20Change inner rule/prerequisites match order in install::file_ruleBoris Kolpackov1-0/+7
The old order messed up the for-install signaling logic. See the long comment in install::file_rule::apply_impl() for background and details.
2023-06-12Hack around GCC 13 -Wdangling-reference false positivesBoris Kolpackov1-1/+1
See GCC bugs 107532, 110213.
2023-06-01Add inner_recipe for expressivenessBoris Kolpackov1-2/+4
2023-06-01Resolve (but disable for now) target_count issue in resolve_members()Boris Kolpackov1-3/+3
2022-12-15Add noexcept to move constructors and move assignment operatorsKaren Arutyunov1-2/+2
2022-11-29Fix backlink logic for target groupsBoris Kolpackov1-2/+2
We used to backlink ad hoc group members both via the group and as individual members. And for explicit groups it was done only via individual members, which means it only works correctly if every member is individually updated. Now both types of groups are backlinked from the group target.
2022-11-18Complete low verbosity diagnostics reworkBoris Kolpackov1-18/+28
2022-11-16Initial low verbosity diagnostics reworkBoris Kolpackov1-0/+6
2022-10-19Add support for post hoc prerequisitesBoris Kolpackov1-5/+14
Unlike normal and ad hoc prerequisites, a post hoc prerequisite is built after the target, not before. It may also form a dependency cycle together with normal/ad hoc prerequisites. In other words, all this form of dependency guarantees is that a post hoc prerequisite will be built if its dependent target is built. See the NEWS file for details and an example.
2022-09-19Add target_lock::first to distinguish first lock of targetBoris Kolpackov1-1/+3
2022-09-07Fix fsdir{} handling corner cases in ad hoc buildscript recipes/rulesdist-remapBoris Kolpackov1-5/+5
2022-06-29Make sure we generate common pkg-config file for only liba{}/libs{}Boris Kolpackov1-0/+3
2022-06-24Allow ad hoc rules not to list targets that are updated during matchBoris Kolpackov1-1/+4
For example, this allows a Qt moc rule not to list generated headers from libQtCore since they are pre-generated by the library.
2022-06-23Minor enhancements to algorithmsBoris Kolpackov1-10/+18
2022-04-19Use target recipe for auxiliary data storage during match-applyBoris Kolpackov1-3/+2
In particular, we now have separate auxiliary data storage for inner and outer operations.
2022-04-07Rename {match,execute}() to *_sync(), add *_complete()Boris Kolpackov1-35/+50
In particular, the match() rename makes sure it doesn't clash with rule::match() which, after removal of the hint argument in simple_rule, has exactly the same signature, thus making it error-prone to calling recursively.
2022-03-10Add reverse_execute_prerequisites() variantBoris Kolpackov1-2/+14
2022-03-09Rename execute_wait() to execute()Boris Kolpackov1-14/+7
The old half-way semantics of execute() wasn't useful.
2022-03-09Parallel implementation of update_during_match_prerequisites()Boris Kolpackov1-7/+9
2022-03-08Improve performance of update during match for multiple targetsBoris Kolpackov1-0/+13
2022-03-02Add update operation-specific variable with unmatch|match additional valuesBoris Kolpackov1-0/+14
Note that the unmatch (match but do not update) and match (update during match) values are only supported by certain rules (and potentially only for certain prerequisite types). Additionally: - All operation-specific variables are now checked for false as an override for the prerequisite-specific include value. In particular, this can now be used to disable a prerequisite for update, for example: ./: exe{test}: update = false - The cc::link_rule now supports the update=match value for headers and ad hoc prerequisites. In particular, this can be used to make sure all the library headers are updated before matching any of its (or dependent's) object files.
2022-02-09Add perform_clean_group_extra()Boris Kolpackov1-0/+14
2022-02-07Make match_inc_dependents() part of public APIBoris Kolpackov1-0/+5
2022-01-21Add search_new() and search_new_locked() variants of search()Boris Kolpackov1-8/+44
2022-01-06Add depdb-dyndep --update-{include,exclude} optionsBoris Kolpackov1-2/+2
These options specify prerequisite targets/patterns to include/exclude (from the static prerequisite set) for update during match as part of dynamic dependency extraction (those excluded will be updated during execute). For example: depdb dyndep ... --update-exclude libue{hello-meta} ... depdb dyndep ... --update-exclude libue{*} ... depdb dyndep ... --update-include $moc --update-include hxx{*} ... The order in which these options are specified is significant with the first target/pattern that matches determining the result. If only the --update-include options are specified, then only the explicitly included prerequisites will be updated. Otherwise, all prerequisites that are not explicitly excluded will be updated. If none of these options is specified, then all the static prerequisites are updated during match. Note also that these options do not apply to ad hoc prerequisites which are always updated during match.
2021-09-20Add support for disabling clean through target-prerequisite relationshipBoris Kolpackov1-2/+14
Our current semantics is to clean any prerequisites that are in the same project (root scope) as the target and it may seem more natural to rather only clean prerequisites that are in the same base scope. While it's often true for simple projects, in more complex cases it's not unusual to have common intermediate build results (object files, utility libraries, etc) reside in the parent and/or sibling directories. With such arrangements, cleaning only in base (even from the project root) may leave such intermediate build results laying around (since there is no reason to list them as prerequisites of any directory aliases). So we clean in the root scope by default but now any target-prerequisite relationship can be marked not to trigger a clean with the clean=false prerequisite-specific value.
2021-06-08Implement ad hoc regex pattern rule supportBoris Kolpackov1-4/+6
An ad hoc pattern rule consists of a pattern that mimics a dependency declaration followed by one or more recipes. For example: exe{~'/(.*)/'}: cxx{~'/\1/'} {{ $cxx.path -o $path($>) $path($<[0]) }} If a pattern matches a dependency declaration of a target, then the recipe is used to perform the corresponding operation on this target. For example, the following dependency declaration matches the above pattern which means the rule's recipe will be used to update this target: exe{hello}: cxx{hello} While the following declarations do not match the above pattern: exe{hello}: c{hello} # Type mismatch. exe{hello}: cxx{howdy} # Name mismatch. On the left hand side of `:` in the pattern we can have a single target or an ad hoc target group. The single target or the first (primary) ad hoc group member must be a regex pattern (~). The rest of the ad hoc group members can be patterns or substitutions (^). For example: <exe{~'/(.*)/'} file{^'/\1.map/'}>: cxx{~'/\1/'} {{ $cxx.path -o $path($>[0]) "-Wl,-Map=$path($>[1])" $path($<[0]) }} On the left hand side of `:` in the pattern we have prerequisites which can be patterns, substitutions, or non-patterns. For example: <exe{~'/(.*)/'} file{^'/\1.map/'}>: cxx{~'/\1/'} hxx{^'/\1/'} hxx{common} {{ $cxx.path -o $path($>[0]) "-Wl,-Map=$path($>[1])" $path($<[0]) }} Substitutions on the left hand side of `:` and substitutions and non-patterns on the right hand side are added to the dependency declaration. For example, given the above rule and dependency declaration, the effective dependency is going to be: <exe{hello} file{hello.map>: cxx{hello} hxx{hello} hxx{common}
2021-03-16Define intermediate build results file cache interfaceBoris Kolpackov1-1/+1
2020-12-11Add search_locked() versions of search() functionsBoris Kolpackov1-0/+18
2020-12-03Add match_rule() in addition to match_recipe()Boris Kolpackov1-7/+15
2020-07-10Relax prerequisite filtering semantics of aliases for clean operationBoris Kolpackov1-2/+3
This is analogous to what has been done to test and install a couple of commits before.
2020-06-25Add more instrumentation for unassigned path raceBoris Kolpackov1-4/+4
2020-05-28Allow calling certain search_existing() versions during load phaseBoris Kolpackov1-3/+7
This is necessary for $target.path() implementation.
2020-04-30Factor recipe to separate header/source filesBoris Kolpackov1-2/+9
2020-04-27Add another search_existing() overloadBoris Kolpackov1-0/+3