From 89c75656275a0212e13ea0e47bcb9a965eb7dce0 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 21 Aug 2024 13:59:17 +0200 Subject: rules: add and forward lint information in all cases ... provided the configuration variable "LINT" is set. --- CC/EXPRESSIONS | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS index 7d5310e..3ca2bee 100644 --- a/CC/EXPRESSIONS +++ b/CC/EXPRESSIONS @@ -1087,6 +1087,7 @@ , "deps-transition" , "compile-args" , "defaults-transition" + , "modified-transitions" ] , "imports": { "objects": "objects" @@ -1262,7 +1263,17 @@ { "type": "let*" , "bindings": [ ["provider", "lint"] - , ["transition", {"type": "var", "name": "deps-transition"}] + , [ "transition" + , { "type": "lookup" + , "map": + { "type": "var" + , "name": "modified-transitions" + , "default": {"type": "empty_map"} + } + , "key": {"type": "var", "name": "fieldname"} + , "default": {"type": "var", "name": "deps-transition"} + } + ] ] , "body": {"type": "CALL_EXPRESSION", "name": "list_provider"} } @@ -1700,7 +1711,7 @@ ] , ["link-deps", {"type": "CALL_EXPRESSION", "name": "link-deps"}] , ["lib", {"type": "CALL_EXPRESSION", "name": "lib artifact"}] - , ["lint-deps fieldnames", ["deps", "private-deps"]] + , ["lint-deps fieldnames", ["deps", "private-deps", "components"]] , [ "lint" , { "type": "if" , "cond": {"type": "var", "name": "LINT"} @@ -1805,6 +1816,7 @@ , "package" , "debug-srcs" , "debug-hdrs" + , "lint" ] } , { "type": "var" @@ -2036,6 +2048,7 @@ , "ADD_LDFLAGS" , "ENV" , "DEBUG" + , "LINT" , "name" , "pure C" , "srcs" @@ -2066,6 +2079,7 @@ , "ldflags-files-deps": "ldflags-files-deps" , "shared artifact": "shared artifact" , "debug-deps": "debug-deps" + , "lint": "lint information" } , "expression": { "type": "let*" @@ -2124,6 +2138,13 @@ , "else": {"type": "empty_map"} } ] + , ["lint-deps fieldnames", ["deps", "private-deps", "components"]] + , [ "lint" + , { "type": "if" + , "cond": {"type": "var", "name": "LINT"} + , "then": {"type": "CALL_EXPRESSION", "name": "lint"} + } + ] , [ "debug-hdrs" , { "type": "if" , "cond": {"type": "var", "name": "DEBUG"} @@ -2222,6 +2243,7 @@ , "package" , "debug-srcs" , "debug-hdrs" + , "lint" ] } , { "type": "var" @@ -2345,6 +2367,7 @@ , "BUILD_POSITION_INDEPENDENT" , "BUILD_OBJECT_ONLY_DROP_OBJECT_LINKING" , "DEBUG" + , "LINT" , "name" , "pure C" , "srcs" @@ -2375,6 +2398,7 @@ , "ldflags-files-deps": "ldflags-files-deps" , "object artifacts": "object artifacts" , "debug-deps": "debug-deps" + , "lint": "lint information" } , "expression": { "type": "let*" @@ -2398,6 +2422,13 @@ ] , ["link-deps", {"type": "CALL_EXPRESSION", "name": "link-deps"}] , ["objects", {"type": "CALL_EXPRESSION", "name": "object artifacts"}] + , ["lint-deps fieldnames", ["deps", "private-deps", "components"]] + , [ "lint" + , { "type": "if" + , "cond": {"type": "var", "name": "LINT"} + , "then": {"type": "CALL_EXPRESSION", "name": "lint"} + } + ] , [ "link-args" , { "type": "nub_right" , "$1": -- cgit v1.2.3 From 730a716da983853a1dab253e2f59dbf0277f80b4 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 29 Aug 2024 10:16:49 +0200 Subject: ["CC", "library"]: document additional providers --- CC/RULES | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CC/RULES b/CC/RULES index 7e527f7..51b2578 100644 --- a/CC/RULES +++ b/CC/RULES @@ -597,6 +597,20 @@ ] , "debug-srcs": ["Map of all sources needed for debugging."] , "debug-hdrs": ["Map of all additional headers needed for debugging."] + , "run-libs": + [ "Map of artifacts specifying libraries that have to be present at" + , "runtime (as well as during linking)." + ] + , "run-libs-args": + [ "Additional arguments for linking that are related to the run-libs." + , "Those are added on the linker command line after the regular link-args." + ] + , "package": + [ "Information related to packaging the library. This provider is a map," + , "specifying \"name\" and \"version\" of the package, as well as" + , "additional stages \"cflags-files\" and \"ldflags-files\" for files" + , "with compile-flags or link-flags, respctively." + ] } , "anonymous": { "proto-deps": -- cgit v1.2.3 From 9681806e4f2f9f58d1efeb3262784220a7f4305a Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 30 Aug 2024 11:03:48 +0200 Subject: Drop expressions for first/last element of a list entirely ... as using the built-in "[]" directly is cleaner and equally readable. --- CC/auto/EXPRESSIONS | 12 --- CC/auto/RULES | 263 +++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 197 insertions(+), 78 deletions(-) delete mode 100644 CC/auto/EXPRESSIONS diff --git a/CC/auto/EXPRESSIONS b/CC/auto/EXPRESSIONS deleted file mode 100644 index 9520975..0000000 --- a/CC/auto/EXPRESSIONS +++ /dev/null @@ -1,12 +0,0 @@ -{ "last_list_entry": - { "vars": ["list"] - , "expression": - {"type": "[]", "index": -1, "list": {"type": "var", "name": "list"}} - } -, "first_list_entry": - { "vars": ["list"] - , "imports": {"last": "last_list_entry"} - , "expression": - {"type": "[]", "index": 0, "list": {"type": "var", "name": "list"}} - } -} diff --git a/CC/auto/RULES b/CC/auto/RULES index debae9c..6ad967f 100644 --- a/CC/auto/RULES +++ b/CC/auto/RULES @@ -149,9 +149,7 @@ , "size_cxxtype" ] , "imports": - { "first": "first_list_entry" - , "last": "last_list_entry" - , "artifacts": ["./", "../..", "field_artifacts"] + { "artifacts": ["./", "../..", "field_artifacts"] , "compile-deps": ["./", "..", "compile-deps"] , "compiler-cc": ["./", "..", "compiler-cc"] , "compiler-cxx": ["./", "..", "compiler-cxx"] @@ -490,14 +488,22 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'defines' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "val" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} } ] - , ["val", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "join" @@ -538,14 +544,22 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'defines1' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "val" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} } ] - , ["val", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "join" @@ -575,14 +589,22 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'defines01' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "val" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} } ] - , ["val", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "join" @@ -609,14 +631,22 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'have_cfile' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "val" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} } ] - , ["val", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -653,14 +683,22 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'have_cxxfile' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "val" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} } ] - , ["val", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -697,14 +735,22 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'have_ctype' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "type" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} } ] - , ["type", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -741,14 +787,22 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'have_cxxtype' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "type" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} } ] - , ["type", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -785,16 +839,34 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" , "msg": "Define name in 'have_csymbol' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "sym, hdrs" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} + } + ] + , [ "sym" + , { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "sym, hdrs"} + } + ] + , [ "hdrs" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "sym, hdrs"} } ] - , ["list", {"type": "CALL_EXPRESSION", "name": "last"}] - , ["sym", {"type": "CALL_EXPRESSION", "name": "first"}] - , ["hdrs", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -836,16 +908,34 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" - , "msg": "Define name in 'have_cxxsymbol' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "msg": "Define name in 'have_csymbol' may not be empty" + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "sym, hdrs" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} + } + ] + , [ "sym" + , { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "sym, hdrs"} + } + ] + , [ "hdrs" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "sym, hdrs"} } ] - , ["list", {"type": "CALL_EXPRESSION", "name": "last"}] - , ["sym", {"type": "CALL_EXPRESSION", "name": "first"}] - , ["hdrs", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -887,16 +977,34 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" - , "msg": "Define name in 'size_ctype' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "msg": "Define name in 'have_csymbol' may not be empty" + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "type, sizes" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} + } + ] + , [ "type" + , { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "type, sizes"} + } + ] + , [ "sizes" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "type, sizes"} } ] - , ["list", {"type": "CALL_EXPRESSION", "name": "last"}] - , ["type", {"type": "CALL_EXPRESSION", "name": "first"}] - , ["sizes", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -945,16 +1053,34 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , [ "def" + [ [ "def" , { "type": "assert_non_empty" - , "msg": "Define name in 'size_cxxtype' may not be empty" - , "$1": {"type": "CALL_EXPRESSION", "name": "first"} + , "msg": "Define name in 'have_csymbol' may not be empty" + , "$1": + { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + } + ] + , [ "type, sizes" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} + } + ] + , [ "type" + , { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "type, sizes"} + } + ] + , [ "sizes" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "type, sizes"} } ] - , ["list", {"type": "CALL_EXPRESSION", "name": "last"}] - , ["type", {"type": "CALL_EXPRESSION", "name": "first"}] - , ["sizes", {"type": "CALL_EXPRESSION", "name": "last"}] ] , "body": { "type": "lookup" @@ -1112,11 +1238,7 @@ , "string_fields": ["magic_string", "@only", "output"] , "target_fields": ["input"] , "config_vars": ["defines"] - , "imports": - { "first": "first_list_entry" - , "last": "last_list_entry" - , "stage_singleton_field": ["", "stage_singleton_field"] - } + , "imports": {"stage_singleton_field": ["", "stage_singleton_field"]} , "implicit": {"runner": ["runner"]} , "expression": { "type": "let*" @@ -1137,9 +1259,18 @@ , "body": { "type": "let*" , "bindings": - [ ["list", {"type": "var", "name": "pair"}] - , ["key", {"type": "CALL_EXPRESSION", "name": "first"}] - , ["val", {"type": "CALL_EXPRESSION", "name": "last"}] + [ [ "key" + , { "type": "[]" + , "index": 0 + , "list": {"type": "var", "name": "pair"} + } + ] + , [ "val" + , { "type": "[]" + , "index": -1 + , "list": {"type": "var", "name": "pair"} + } + ] ] , "body": { "type": "singleton_map" -- cgit v1.2.3