aboutsummaryrefslogtreecommitdiff
path: root/build2/cli/rule.cxx
AgeCommit message (Collapse)AuthorFilesLines
2023-04-13Move cli module to libbuild2-cli libraryBoris Kolpackov1-340/+0
This is a temporary measure (until we unboundle this module) needed for in-process configure support in bpkg.
2022-11-18Complete low verbosity diagnostics reworkBoris Kolpackov1-1/+1
2022-11-08Make process exit diagnostics consistentBoris Kolpackov1-1/+1
In particular, we now always print error message on non-0 exit except in cases where such exit is ignored.
2022-11-08More work on child process diagnostics bufferingBoris Kolpackov1-2/+4
2022-04-07Rename {match,execute}() to *_sync(), add *_complete()Boris Kolpackov1-1/+1
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-04-06Add support for rule hintsBoris Kolpackov1-1/+1
A rule hint is a target attribute, for example: [rule_hint=cxx] exe{hello}: c{hello} Rule hints can be used to resolve ambiguity when multiple rules match the same target as well as to override an unambiguous match.
2022-03-07Add support for update=unmatch|match to ad hoc recipesBoris Kolpackov1-1/+3
2020-05-27Initial support for ad hoc recipes (still work in progress)Boris Kolpackov1-1/+2
2020-04-27Rework tool importation along with cli moduleBoris Kolpackov1-12/+13
Specifically, now config.<tool> (like config.cli) is handled by the import machinery (it is like a shorter alias for config.import.<tool>.<tool>.exe that we already had). And the cli module now uses that instead of custom logic. This also adds support for uniform tool metadata extraction that is handled by the import machinery. As a result, a tool that follows the "build2 way" can be imported with metadata by the buildfile and/or corresponding module without any tool-specific code or brittleness associated with parsing --version or similar outputs. See the cli tool/module for details. Finally, two new flavors of the import directive are now supported: import! triggers immediate importation skipping any rule-specific logic while import? is optional import (analogous to using?). Note that optional import is always immediate. There is also the import-specific metadata attribute which can be specified for these two import flavors in order to trigger metadata importation. For example: import? [metadata] cli = cli%exe{cli} if ($cli != [null]) info "cli version $($cli:cli.version)"
2020-02-07Drop copyright notice from source codeKaren Arutyunov1-1/+0
2019-10-14Implement MSVC installation discovery for version 15 (2017) and laterKaren Arutyunov1-1/+1
In particular, this removes the requirement to build from the Visual Studio command prompt. Note that since MSVC compiler binaries are target-specific (i.e., there are no -m32/-m64 options nor something like /MACHINE), in this case we default to a 64-bit build (a 32-bit build can still be achieved by running from a suitable command prompt). Finally, this mechanism is also used to find Clang bundled with MSVC.
2019-08-23Introduce notion of build contextBoris Kolpackov1-3/+3
All non-const global state is now in class context and we can now have multiple independent builds going on at the same time.
2019-07-01Split build system into library and driverBoris Kolpackov1-7/+7
2019-04-08Support for --dry-run|-n mode, perform update partBoris Kolpackov1-3/+5
2019-01-16Update copyright yearKaren Arutyunov1-1/+1
2018-11-28Add --[no-]mtime-check options to control this behavior at runtimeBoris Kolpackov1-1/+1
By default the checks are enabled only for the staged toolchain.
2018-11-22Make backwards modification time check permanent, add another experimentBoris Kolpackov1-8/+9
2018-11-19Finalize workaround for backwards modification time issueBoris Kolpackov1-1/+1
2018-06-29Use depdb to track changes to cli compiler, options, etcBoris Kolpackov1-16/+61
2018-06-28Implement support for excluded and ad hoc prerequisitesBoris Kolpackov1-41/+36
The inclusion/exclusion is controlled via the 'include' prerequisite-specific variable. Valid values are: false - exclude true - include adhoc - include but treat as an ad hoc input For example: lib{foo}: cxx{win32-utility}: include = ($cxx.targe.class == 'windows') exe{bar}: libs{plugin}: include = adhoc
2018-05-19Update copyright yearKaren Arutyunov1-1/+1
2018-02-07Initial work for default update outer operationBoris Kolpackov1-3/+3
While update still uses the old "all update rules update all their prerequisites" assumption, test and install have been fixed not to rely on this.
2018-02-03Get rid of action rule override semanticsBoris Kolpackov1-4/+4
Instead we now have two more or less separate match states for outer and inner parts of an action.
2017-12-16Improve process execution diagnostics by reusing run_*() APIBoris Kolpackov1-18/+2
2017-08-23Add perform_clean_group(), use instead of ad hoc implementation in cli ruleBoris Kolpackov1-30/+1
2017-05-01Add hxx extension for headersKaren Arutyunov1-8/+8
2017-04-28Implement support for pre-processing version headers (or other files)Boris Kolpackov1-14/+14
Also implement the build system version check.
2017-04-27Pass target to prerequisite searchBoris Kolpackov1-3/+6
2017-04-10Adapt to process_error changeKaren Arutyunov1-1/+1
2017-03-02Implement parallel matchBoris Kolpackov1-55/+38
2017-02-13Tighten target constness furtherBoris Kolpackov1-1/+1
2017-02-13Use target:as<> instead of static_cast for target castingBoris Kolpackov1-3/+3
2017-02-13Pass const target& to recipesBoris Kolpackov1-6/+6
2017-02-13Implement target_set locking, including extension updateBoris Kolpackov1-7/+5
2017-02-13Store extension in target map key rather than in targetBoris Kolpackov1-4/+7
This is in preparation for locking its modification/access.
2017-02-13Pass const scope& where modification should not happenBoris Kolpackov1-1/+1
2017-02-13Add model mutex, make var_pool const by defaultBoris Kolpackov1-8/+8
2017-01-23Go back to storing scope instead of target in prerequisiteBoris Kolpackov1-1/+1
Turns out this was semantically the right way to do it.
2017-01-20Remove prerequisite caching in scopeBoris Kolpackov1-1/+1
We don't share them often and those that are shared (e.g., cxx{} in obja/objs{}) are lightweight (SOO).
2017-01-19Get rid of extension_poolBoris Kolpackov1-4/+4
2017-01-18Ignore prerequisite mtimes that are not linker inputsBoris Kolpackov1-4/+10
This makes sure, for example, that we don't unnecessarily re-link an executable when its testscript prerequisite is changes.
2017-01-09Make use of operator<<(ostream, exception)Karen Arutyunov1-1/+1
2017-01-05Update copyright yearBoris Kolpackov1-1/+1
2016-12-17Add support for specifying individual paths of imported targetsBoris Kolpackov1-1/+1
The new config.import.* variable format is: config.import.<proj>.<name>[.<type>] For example: b config.import.build2.b=/opt/build2/bin/b b config.import.build2.b.exe=b-boot
2016-11-04Cleanup match_result messBoris Kolpackov1-7/+7
2016-09-17Audit all print_process()/process ctor for path_search()Karen Arutyunov1-3/+4
2016-07-08Add dependency on fsdir{} in alias rulesBoris Kolpackov1-1/+1
This makes sure that a directory with only dir{} target gets cleaned up.
2016-07-08Move filesystem-related functions from context to new filesystem filesBoris Kolpackov1-0/+3
2016-04-21Implement short-circuiting to group stateBoris Kolpackov1-5/+5
This is necessary to get rid of bogus restarts in inject_prerequisites() where it think a group member was updated since its state changed from unknown to (group's) changed.
2016-04-19Redesign src/out scopingBoris Kolpackov1-5/+5
We no longer enter paths from the src tree into scope map. Instead, targets from the src tree now include their out tree directory (in essence their "configuration"). This is then used to find a target's scope. See the comment in class target for details. The result of this change is that we can now again build multiple configurations (out trees) for same project at once.