-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Project-specified srcmap file #10389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The heuristics in this script don't match all possible projects, and in particular the west tool used by sound-open-firmware doesn't conform to its expectations (and can provide this info in a more authoritative way regardless). Allow the project to emit a "$SRC/srcmap.json" file in its build image, and use that where present instead of trying to guess. Signed-off-by: Andy Ross <andyross@google.com>
West knows the source layout authoritatively, but doesn't quite match the rules expected by srcmap. Generate the JSON for it instead. Signed-off-by: Andy Ross <andyross@google.com>
|
Do we need this to support your project? Sorry if I wasn't clear in past discussions, but I want to avoid modifying our infra, even if it means forcing a few users to do the same hack in the future. |
|
I really appreciate your willingness to help though! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this to support your project?
This PR looks like a smart way to support ANY project where the git structure is anything slightly off the most basic "git clone http://project".
Sorry if I wasn't clear in past discussions, but I want to avoid modifying our infra, even if it means forcing a few users to do the same hack in the future.
Letting projects emit their own SRCMAP looks to me like the best way to "avoid infra modifications" by "forcing users" to adjust to oss-fuzz / SRCMAP expectations.
Moreover it seems very reliable, killing all risk of false negatives. Either the SRCMAP is there and then the information is correct, or SRCMAP is missing and the whole thing fails. No scanning of the wrong version because "origin" points at the wrong branch.
My 2 cents.
| echo " \"type\": \"git\"," | ||
| echo " \"url\": \"$url\"," | ||
| echo " \"rev\": \"$rev\"" | ||
| echo -n " }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cat <<EOFJSON
"$SRC/sof/$dir": {
...
}
EOFJSON| west list -f '{path} {url} {sha}' | sed 1d | while read dir url rev; do | ||
|
|
||
| # Silly logic to suppress trailing comma | ||
| if [ "$FIRST_REC" = yes ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use jq -n -f trailing_commas.json > clean.json to remove trailing commas.
As a bonus it will pretty-print.
https://github.com/stedolan/jq/wiki/FAQ#processing-not-quite-valid-json
|
close ancient PR |
[Following discussion in #10342 #10383 #10385 . The "right way" turns out to be a pretty simple change to a simple script. Note that this is only tested piecewise, as I don't know how to run the backend that actually needs srcmap and was running a copy of the script manually. Also presumably needs documentation somewhere.]
srcmap: Augment to allow project-specified repository maps
The heuristics in this script don't match all possible projects, and
in particular the west tool used by sound-open-firmware doesn't
conform to its expectations (and can provide this info in a more
authoritative way regardless).
Allow the project to emit a "$SRC/srcmap.json" file in its build
image, and use that where present instead of trying to guess.