summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-10-24 16:46:39 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-10-25 16:48:13 +0200
commita61f95ba14f0550662a343662c06382bac643540 (patch)
treebe2e6ab842db849aad202abc17f3842bc078fcf4
parent5ecbbe4a538ca8a5933b5944f0eb87307fdfb12d (diff)
downloadjustbuild-a61f95ba14f0550662a343662c06382bac643540.tar.gz
["lint", "targets"]: Also have a metadata file
... containing the names of artifacts (files or directories) that are from the target itself of the runfiles of direct dependencies. This allows tools to check some form of strict dependency structure.
-rw-r--r--rules/lint/RULES23
-rwxr-xr-xrules/lint/call_lint1
2 files changed, 24 insertions, 0 deletions
diff --git a/rules/lint/RULES b/rules/lint/RULES
index fef578ac..04ad2301 100644
--- a/rules/lint/RULES
+++ b/rules/lint/RULES
@@ -63,6 +63,10 @@
, " by the field \"config\", and"
, "- OUT pointing to a directory to which files with the lint result"
, " can be written."
+ , "- META pointing to a json file contaning"
+ , " - at key \"direct deps artifact names\" a list of all input"
+ , " artifacts that come from the target itself or are runfiles of a"
+ , " direct dependency."
, "It is supposed to indicate by the exit code whether the file to lint"
, "complies with the given linting policy, with 0 meaning"
, "compliant."
@@ -152,6 +156,12 @@
, "dep": {"type": "var", "name": "_"}
}
]
+ , [ "direct deps artifact names"
+ , { "type": "DEP_PROVIDES"
+ , "dep": {"type": "var", "name": "_"}
+ , "provider": "direct deps artifact names"
+ }
+ ]
]
, "body":
{ "type": "TREE"
@@ -170,6 +180,19 @@
, "subdir": "config"
, "$1": {"type": "var", "name": "config"}
}
+ , { "type": "singleton_map"
+ , "key": "meta.json"
+ , "value":
+ { "type": "BLOB"
+ , "data":
+ { "type": "json_encode"
+ , "$1":
+ { "type": "env"
+ , "vars": ["direct deps artifact names"]
+ }
+ }
+ }
+ }
]
}
, "cmd":
diff --git a/rules/lint/call_lint b/rules/lint/call_lint
index ab9c2b8f..ca7e4ef3 100755
--- a/rules/lint/call_lint
+++ b/rules/lint/call_lint
@@ -23,6 +23,7 @@ echo "${RESULT}" > result
export OUT="$(pwd)/out"
mkdir -p config
export CONFIG="$(pwd)/config"
+export META="$(pwd)/meta.json"
cd work