summaryrefslogtreecommitdiff
path: root/rules/CC/EXPRESSIONS
AgeCommit message (Collapse)Author
2025-04-23rules CC: Extend install-wih-deps to stage DWARF package filesPaul Cristian Sarbu
2025-04-23rules CC: Libraries and binaries provide DWARF package filesPaul Cristian Sarbu
The "library" and "binary" rules are modified to generate, if needed, the appropriate DWARF package from the DWARF objects of their compilation units and the DWARF package files of their link dependencies, if any. The resulting artifact is made available to consumers in the provides map.
2025-04-23expressions CC: Add expression generating DWARF packagesPaul Cristian Sarbu
2025-04-23expressions CC: Small refactoringPaul Cristian Sarbu
Allow the expressions running the actions producing the library and binary artifacts to pass along more information to consumers if needed by extending their return values to maps. Ensure the changes do not affect other consumers of the current expressions, such as the test rules, which do not expect extra information besides the single action artifact.
2025-04-23rules CC: Support debug fission in lintingPaul Cristian Sarbu
As the command passed to the linter can produce additional outputs if debug fission is enabled, pass those artifact paths in a new variable "extra outs", which the ["lint", "targets"] rule can then make it available in the meta.json file expected by the linter.
2025-04-23rules CC: Support debug fission in objectsPaul Cristian Sarbu
For this purpose, the DEBUG configuration variable is updated to expect a map with at least the USE_DEBUG_FISSION flag field. If set, compilation of source files is expected to produce besides the regular object file also a DWARF file.
2025-04-23rules CC: Make DEBUG variable a mapPaul Cristian Sarbu
It expects now the key 'USE_DEBUG_FISSION', which enables debug fission, but does not add any flags on its own. For this, the 'FISSION_CONFIG' key is expected with certain entries that provide the compile and/or link flags that configure debug fission. The flags are added only where needed, i.e., before running or storing the respective compile or link actions.
2025-04-23rules CC: Use the -g flag as fallback in debug mode...Paul Cristian Sarbu
...if no flags are otherwise configured (by toolchain or rule-specific configuration variables).
2025-04-23expressions CC: Remove unused importPaul Cristian Sarbu
2025-03-20rules CC lint information: Fix missing inherited variablesPaul Cristian Sarbu
...and unset TOOLCHAIN and TOOLCHAIN_DIR.
2024-11-06Use "cwd" property of actionsKlaus Aehlig
... instead of composing a shell command doing a cd first.
2024-10-25lint information: also provide the direct-deps artifacts separatelyKlaus Aehlig
2024-09-12Rules CC: Deduplicate args returned by expressions collecting args from ↵Sascha Roloff
dependencies
2024-08-20["CC", "test"]: support providing lint informationKlaus Aehlig
While there, also properly transition "srcs" and "private-hdrs" to the host version.
2024-08-14Make CC binary and library support providing information for lintingKlaus Aehlig
If the configuration variable "LINT" is set, also provide information on compile actions and header files (with preprocessing as described command, in particular also providing the correct flags) in correct dependency context. In this way, lint rules can request the needed information for performing their checks.
2024-08-07Add field to ["CC", "defaults"] to specify arguments for arKlaus Aehlig
... instead of hard-coding ["cqs"].
2024-07-29["CC", "binary"] stage link actionKlaus Aehlig
... to avoid staging conflicts with the toolchain
2024-07-29["CC", "libary"] properly stage ar actionKlaus Aehlig
In this action we support a user provided toolchain, hence all the components of the library need to go into a subdirectory to avoid staiging conflicts.
2024-06-19rules-cc: Binaries should keep the compile dependency headers for debuggingv1.4.0-alpha+20240619Paul Cristian Sarbu
2024-06-03debug rule: Fix staging of headersPaul Cristian Sarbu
For libraries the headers of private dependencies were wrongly skipped from staging. For binaries, no headers were passed at all in the provides map. To fix these issues, an additional field is added in the provides map to ensure we collect, and then properly stage, all needed headers for both libraries and binaries.
2024-06-03debug rule: Add flag field to skip installing extra debug artifactsPaul Cristian Sarbu
This is useful when we want to install targets built in debug mode, but do not want to stage all the additional source and header files if no debugging is being performed, e.g., in tests.
2024-05-27CC: if no CC/CXX/AR is provided via the toolchain, default to cc/c++/arKlaus Aehlig
... instead of defaulting to "". In this way, an empty default target can be used as toolchain defaults for systems with default names.
2024-05-13rules: Support staging debug artifacts in install-with-deps rulePaul Cristian Sarbu
The existing rule is extended to also stage source files if in debug mode, in order for a debugger to be able to find all needed symbols. Conflicting paths are allowed; in case of conflicts, the file from the closest target in the dependency chain wins.
2024-05-13install-with-deps result: Remove unneeded importsPaul Cristian Sarbu
2024-02-15Remove unnecessarily quadratic expressionsKlaus Aehlig
... not that everyone has updated to 1.2 or later we can use the built-in expressions "reverse" and "set".
2023-11-20rules: Fix flag inheritanceOliver Reiche
... which should accumulate values from all base targets unless the flag type (CFLAGS, CXXFLAGS, or LDFLAGS) is explicity overwritten by the inheritor.
2023-09-26pkg-config files: properly terminate last lineKlaus Aehlig
2023-08-16rules: Propagate PATH list from defaultsOliver Reiche
... instead of creating an ENV from it and propagating this. The idea is to keep PATH entries separate and only join them with ":" when we need it. In this way, we can accumulate PATHs from multiple defaults later, and perform a deduplication ("nub_left") to shorten the final string length.
2023-08-16rules: Expression to get base providers as listOliver Reiche
2023-08-16rules: Remove pointless defaultsOliver Reiche
2023-05-30rules: Support for external toolchainsOliver Reiche
2023-05-30rules: Use field_map_provider for default-ENVOliver Reiche
2023-04-18rules: Support protoc/grpc_cpp_plugin from defaultsOliver Reiche
2023-04-18rules: Support hdrs-only for install-with-deps ruleOliver Reiche
2023-04-18rules: Move install-with-deps to EXPRESSIONSOliver Reiche
2023-04-18rules: Support install-with-deps ruleOliver Reiche
Backport of commits a382b308b9011606e7d07376808812d51631d558 and 5ae5134804b6edaaffec593868f133dd840ef7df from the rules-cc repository.
2023-04-18rules: Support reading flags from files for existing rulesOliver Reiche
Backport of commit 4a8579a2a4ef252644df0c29893e70ad8438ae82 from the rules-cc repository.
2022-12-09rules: ldflags have precedence over transitive link argsOliver Reiche
2022-12-09rules: Create library in stage directoryOliver Reiche
2022-12-09rules: Refactoring and minor improvementsOliver Reiche
Compared to the previous commit, the action graphs for just and its unit tests are unchanged. - Git hash of action graph for ["",""]: c6e75f17abd7ffaab6ff9bb725ad67ec0bf6c973 - Git hash of action graph for ["test/buildtool","TESTS"]: 8063dfb3dd7daa9ae01d95c177e14946f785c57e Refactor: - "local cflags" to "private-cflags" - "local defines" to "private-defines" - "link externals" to "private-ldflags" - "deps" to "private-deps" for (test) binaries - "proto" to "private-proto" for binaries Improvements: - consistent variable declaration order: OS, ARCH, HOST_ARCH, TARGET_ARCH, CC, CXX, CFLAGS, CXXFLAGS, ADD_CFLAGS, ADD_CXXFLAGS, AR, ENV, PATH - use fields close to their definition (in RULES) - use common expression for binaries and test binaries - split expression "flags" and "compiler" ... to separate ones for CC and CXX. - rename "transition" to "deps-transition" ... to avoid conflicts with other transitions. - support "defaults-transition" for CC expressions Implement: - "cflags" for libraries - "private-cflags" for (test) binaries - "private-defines" for test binaries - "private-ldflags" for test binaries - (public) "defines" for libraries
2022-11-21support the concept of private depsKlaus Aehlig
i.e., libraries that are used only in the implementation without use in the public header files. In this way, the set of headers exposed to dependencies can be reduced leading potentially to better incrementality.
2022-11-21rules/CC/EXPRESSIONS: drop unused local defineKlaus Aehlig
2022-11-02rules: don't always use the default archiverAlberto Sartori
2022-10-10rules: Use new 'env' expressionOliver Reiche
2022-10-10rules: Remove CC/configure ruleOliver Reiche
2022-09-14rules: Fix ar binary not taken from defaultsOliver Reiche
2022-09-13Rules: Implement setting ADD_{C,CXX}FLAGS via variablesOliver Reiche
2022-09-13Rules: Implement hierarchical defaultsOliver Reiche
2022-09-13Rules: Extend configure rule by 'compiler_family'Oliver Reiche
2022-08-16rules/CC: fix duplicated staging for libraryAlberto Sartori