devtools: fix check symbol change script
PATCH 1/1 devtools: fix check symbol change script
Fix check symbol change script to detect new diff file when it is in between "--- /dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result if in_map was '1' earlier, it will not be changed to '0' and we get check patch errors which are not true as the non version.map files get interpreted as version map file.
---
Note: We have two examples where checkpatch errors are because of this because the version.map file change comes earlier in the diff. Because of this bug, any new file change that comes after version.map file diff as "/dev/null" to "b/.." gets misdetected as version.map file.
* http://patches.dpdk.org/patch/66878/
* https://patchwork.dpdk.org/patch/66900/
devtools/check-symbol-change.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
devtools/check-symbol-change.sh +2 -2
@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is
Signature · 1 line
2.8.4
Quoted 9 lines · Nithin Dabilpuram
Fix check symbol change script to detect new diff file when it is in between "---
/dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result ifin_mapwas '1' earlier, it will not be changed to '0' and we get check patch errors which are not true as the non version.map files get interpreted as version map file.
Quoted 3 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
There was a previous attempt at fixing this that did not get a review.
http://patchwork.dpdk.org/patch/56303/
I prefer the last submitted patch as it is simpler, but maybe I missed something in Bing patch.
Neil, wdyt?
Signature · 1 line
David Marchand
Quoted 35 lines
Signed-off-by Nithin Dabilpuram <[email protected]>---
Note: We have two examples where checkpatch errors are because of this because the version.map file change comes earlier in the diff. Because of this bug, any new file change that comes after version.map file diff as "/dev/null" to "b/.." gets misdetected as version.map file.
* http://patches.dpdk.org/patch/66878/
* https://patchwork.dpdk.org/patch/66900/devtools/check-symbol-change.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)devtools/check-symbol-change.sh +2
-3@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is --2.8.4
Quoted 15 lines · David Marchand
Quoted 9 lines · Nithin Dabilpuram
Fix check symbol change script to detect new diff file when it is in between "---
/dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result ifin_mapwas '1' earlier, it will not be changed to '0' and we get check patch errors which are not true as the non version.map files get interpreted as version map file.Quoted 3 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
Quoted 8 lines
There was a previous attempt at fixing this that did not get a review.
http://patchwork.dpdk.org/patch/56303/I prefer the last submitted patch as it is simpler, but maybe I missed something in Bing patch.
Neil, wdyt?
I'm not sure why I didn't review the previous patch you refrenced, apologies for that.
That said, I'm not sure how this patch detects /dev/null patterns. It looks like you still expect all lines to start with [+-] [ab]...
Neil
Quoted 42 lines
Signature · 2 lines
-- David MarchandQuoted 35 lines
Signed-off-by Nithin Dabilpuram <[email protected]>---
Note: We have two examples where checkpatch errors are because of this because the version.map file change comes earlier in the diff. Because of this bug, any new file change that comes after version.map file diff as "/dev/null" to "b/.." gets misdetected as version.map file.
* http://patches.dpdk.org/patch/66878/
* https://patchwork.dpdk.org/patch/66900/devtools/check-symbol-change.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)devtools/check-symbol-change.sh +2
-3@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is --2.8.4
Quoted 25 lines · Neil Horman
External Email
----------------------------------------------------------------------
Quoted 21 lines · David Marchand
Quoted 9 lines · Nithin Dabilpuram
Fix check symbol change script to detect new diff file when it is in between "---
/dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result ifin_mapwas '1' earlier, it will not be changed to '0' and we get check patch errors which are not true as the non version.map files get interpreted as version map file.Quoted 3 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")There was a previous attempt at fixing this that did not get a review.
https://urldefense.proofpoint.com/v2/url?u=http-3A__patchwork.dpdk.org_patch_56303_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=HnuykZkNgy_2cx1i0_QuR-C_vdVYLTJ9rSUA1dCM7WI&s=TW-ZZ_dYy8x6EcvJHtYrv9vaIHSmd0GshvClMwiWPi4&e=I prefer the last submitted patch as it is simpler, but maybe I missed something in Bing patch.
Quoted 7 lines
Quoted 2 lines
Neil, wdyt?
I'm not sure why I didn't review the previous patch you refrenced, apologies for that.
That said, I'm not sure how this patch detects
/dev/nullpatterns. It looks like you still expect all lines to start with [+-] [ab]...
It doesn't detect /dev/null but the line following /dev/null will start with "b/...". So this checks for .map in that line as well.
Quoted 45 lines
Neil
Quoted 42 lines
Signature · 2 lines
-- David MarchandQuoted 35 lines
Signed-off-by Nithin Dabilpuram <[email protected]>---
Note: We have two examples where checkpatch errors are because of this
because the version.map file change comes earlier in the diff. Because of
this bug, any new file change that comes after version.map file diff
as "/dev/null" to "b/.." gets misdetected as version.map file.
* https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org_patch_66878_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=HnuykZkNgy_2cx1i0_QuR-C_vdVYLTJ9rSUA1dCM7WI&s=0szl1YpYLwfb1OF-R5H4_ci3f5XjBUHFrHVp-LdROFI&e=
* https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.dpdk.org_patch_66900_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=HnuykZkNgy_2cx1i0_QuR-C_vdVYLTJ9rSUA1dCM7WI&s=ugH7B1XKoFQEEopU0sJgqKGwjDJS9Kl9OsijSazmyRc&e=devtools/check-symbol-change.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)devtools/check-symbol-change.sh +2
-3@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is --2.8.4
Neil Horman
Acked-byQuoted 28 lines · Nithin Dabilpuram
Quoted 27 lines · Neil Horman
External Email
----------------------------------------------------------------------
Quoted 23 lines · David Marchand
Quoted 9 lines · Nithin Dabilpuram
Fix check symbol change script to detect new diff file when it is in between "---
/dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result ifin_mapwas '1' earlier, it will not be changed to '0' and we get check patch errors which are not true as the non version.map files get interpreted as version map file.Quoted 3 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")There was a previous attempt at fixing this that did not get a review.
https://urldefense.proofpoint.com/v2/url?u=http-3A__patchwork.dpdk.org_patch_56303_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=HnuykZkNgy_2cx1i0_QuR-C_vdVYLTJ9rSUA1dCM7WI&s=TW-ZZ_dYy8x6EcvJHtYrv9vaIHSmd0GshvClMwiWPi4&e=I prefer the last submitted patch as it is simpler, but maybe I missed something in Bing patch.
Neil, wdyt?
Quoted 9 lines
Quoted 5 lines
I'm not sure why I didn't review the previous patch you refrenced, apologies for that.
That said, I'm not sure how this patch detects
/dev/nullpatterns. It looks like you still expect all lines to start with [+-] [ab]...It doesn't detect
/dev/nullbut the line following/dev/nullwill start with "b/...". So this checks for .map in that line as well.
Ah, in that case, I'd really be fine with either fix.
Quoted 46 lines
Quoted 45 lines
Neil
Quoted 42 lines
Signature · 2 lines
-- David MarchandQuoted 35 lines
Signed-off-by Nithin Dabilpuram <[email protected]>---
Note: We have two examples where checkpatch errors are because of this
because the version.map file change comes earlier in the diff. Because of
this bug, any new file change that comes after version.map file diff
as "/dev/null" to "b/.." gets misdetected as version.map file.
* https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org_patch_66878_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=HnuykZkNgy_2cx1i0_QuR-C_vdVYLTJ9rSUA1dCM7WI&s=0szl1YpYLwfb1OF-R5H4_ci3f5XjBUHFrHVp-LdROFI&e=
* https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.dpdk.org_patch_66900_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=HnuykZkNgy_2cx1i0_QuR-C_vdVYLTJ9rSUA1dCM7WI&s=ugH7B1XKoFQEEopU0sJgqKGwjDJS9Kl9OsijSazmyRc&e=devtools/check-symbol-change.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)devtools/check-symbol-change.sh +2
-3@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is --2.8.4
Quoted 47 lines
-----Original Message-----
From: Neil Horman <[email protected]>
Sent: Thursday, March 19, 2020 11:41 PM
To: David Marchand <[email protected]>
Cc: Thomas Monjalon <[email protected]>; dev <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Nithin Dabilpuram <[email protected]>; dpdk stable <[email protected]>; Bing Zhao <[email protected]>
Subject: Re: [PATCH] devtools: fix check symbol change scriptQuoted 11 lines · David Marchand
Quoted 9 lines · Nithin Dabilpuram
Fix check symbol change script to detect new diff file when it is in between "---
/dev/null" to "b/lib/...".
Current awk line expects line to start with "a/..."
which is not always true for all diffs.
As a result ifin_mapwas '1' earlier, it will not be changed to '0' and we get check patch errors which are not true as the non version.map files get interpreted as version map file.Quoted 1 line
Quoted 1 line
Fixes 4bec48184e33 ("devtools: add checks for ABI symboladdition")
Quoted 5 lines
Quoted 2 lines
There was a previous attempt at fixing this that did not get a review.
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2F
patchQuoted 1 line
work.dpdk.org%2Fpatch%2F56303%2F&data=02%7C01%7Cbingz %40mellanox.c
Quoted 1 line
om%7C19a838a81f4f4649f40f08d7cc1be78a%7Ca652971c7d2e4d9ba6
a4d149256f46Quoted 1 line
1b%7C0%7C0%7C637202292556475544&sdata=wgz8LssuucgrWlY xsf978%2ByRVg
Quoted 7 lines
83btxZIm9aD56nekY%3D&reserved=0
I prefer the last submitted patch as it is simpler, but maybe I missed something in Bing patch.
Neil, wdyt?
Quoted 7 lines
I'm not sure why I didn't review the previous patch you refrenced, apologies for that.
That said, I'm not sure how this patch detects
/dev/nullpatterns. It looks like you still expect all lines to start with [+-] [ab]...Neil
Hi David & Neil,
The cause and the fixing are almost the same for the two patches. Nithin's is simpler.
When matching on "/dev/null", it just needs to continue.
While in my patch, I think I also fix the [^map] matching even though it works. The behavior of RE in awk does not work as expected, .c and .h files don't match on the "NOT map" at the end of the line, but match on the signle letter not among the "m/a/p". (Correct me if anything wrong).
Thanks
Bing
Quoted 72 lines
Quoted 10 lines
--
David MarchandQuoted 4 lines
Signed-off-by Nithin Dabilpuram <[email protected]>---
Note: We have two examples where checkpatch errors are becauseof
Quoted 3 lines
Quoted 3 lines
this because the version.map file change comes earlier in the diff. Because of this bug, any new file change that comes after version.map file diff as "
/dev/null" to "b/.." gets misdetected asversion.map file.
Quoted 2 lines
Quoted 2 lines
*
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2F
patQuoted 1 line
Quoted 1 line
ches.dpdk.org%2Fpatch%2F66878%2F&data=02%7C01%7Cbingz% 40mellanox
Quoted 1 line
Quoted 1 line
.com%7C19a838a81f4f4649f40f08d7cc1be78a%7Ca652971c7d2e4d
9ba6a4d14925Quoted 1 line
Quoted 1 line
6f461b%7C0%7C0%7C637202292556475544&sdata=ElLbgB9IJ7B6 kuNTAjKAFr
Quoted 3 lines
Quoted 3 lines
WpNy8Jdq5%2BmfoRTxN72tI%3D&reserved=0
*https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2F
paQuoted 1 line
Quoted 1 line
tchwork.dpdk.org%2Fpatch%2F66900%2F&data=02%7C01%7Cbin gz%40mella
Quoted 1 line
Quoted 1 line
nox.com%7C19a838a81f4f4649f40f08d7cc1be78a%7Ca652971c7d2e4d
9ba6a4d14Quoted 1 line
Quoted 1 line
9256f461b%7C0%7C0%7C637202292556475544&sdata=iT%2Ft9os A4HFTQ2kh3
Quoted 15 lines
Quoted 15 lines
baWClvD3B%2FFdGzIrQgTvB5SfqU%3D&reserved=0
devtools/check-symbol-change.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/devtools/check-symbol-change.shindex c5434f3..19ce82f 100755devtools/check-symbol-change.sh +1
-1@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1}Quoted 2 lines
devtools/check-symbol-change.sh build_map_changes() · line 23
Quoted 2 lines
devtools/check-symbol-change.sh +0
-0# Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the mapchunk.
Quoted 13 lines
Quoted 11 lines
devtools/check-symbol-change.sh +1
-1# When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. Thesection name is
--
2.8.4
Quoted 9 lines · Nithin Dabilpuram
Fix check symbol change script to detect new diff file when it is in between "---
/dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result ifin_mapwas '1' earlier, it will not be changed to '0' and we get check patch errors which are not true as the non version.map files get interpreted as version map file.
Quoted 5 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")Signed-off-by Nithin Dabilpuram <[email protected]>
Quoted 33 lines
---
Note: We have two examples where checkpatch errors are because of this because the version.map file change comes earlier in the diff. Because of this bug, any new file change that comes after version.map file diff as "/dev/null" to "b/.." gets misdetected as version.map file.
* http://patches.dpdk.org/patch/66878/
* https://patchwork.dpdk.org/patch/66900/devtools/check-symbol-change.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)devtools/check-symbol-change.sh +2
-3@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is --2.8.4
Quoted 7 lines · Nithin Dabilpuram
devtools/check-symbol-change.sh +0
-0@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the
devtools/check-symbol-change.sh build_map_changes() · line 26
Quoted 10 lines
devtools/check-symbol-change.sh +2
-2# next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0}
[^map] does not mean "not word map" but actually "none of the character m, a or p".
So potentially, any file extension starting with m, a or p could trigger an issue.
For example, a change in .mk files, .py files and ./devtools/check-forbidden-tokens.awk ./devtools/libabigail.abignore could lead to incorrect symbol check.
How about the following change:
devtools/check-symbol-change.sh +4 -6
@@ -17,13 +17,11 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} - # Same pattern as above, only it matches on anything that - # does not end in 'map', indicating we have left the map chunk. - # When we hit this, turn off the in_map variable, which - # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + # The previous rule catches all .map files, anything else + # indicates we left the map chunk. + /[-+] [ab]\// {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is
Signature · 1 line
David Marchand
Quoted 48 lines · David Marchand
External Email
----------------------------------------------------------------------
Quoted 7 lines · Nithin Dabilpuram
devtools/check-symbol-change.sh +0
-0@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and thedevtools/check-symbol-change.sh build_map_changes() · line 26
Quoted 10 lines
devtools/check-symbol-change.sh +2
-2# next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0}[^map] does not mean "not word map" but actually "none of the character m, a or p".
So potentially, any file extension starting with m, a or p could trigger an issue.
For example, a change in .mk files, .py files and./devtools/check-forbidden-tokens.awk./devtools/libabigail.abignore could lead to incorrect symbol check.How about the following change:
devtools/check-symbol-change.sh +1
-2@@ -17,13 +17,11 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} - # Same pattern as above, only it matches on anything that
devtools/check-symbol-change.sh build_map_changes() · line 27
Quoted 10 lines
devtools/check-symbol-change.sh +3
-4- # does not end in 'map', indicating we have left the map chunk. - # When we hit this, turn off the in_map variable, which - # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + # The previous rule catches all .map files, anything else + # indicates we left the map chunk. + /[-+] [ab]\// {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is
Agreed. I tested and it works fine for me. I can send a V2 with this change if it is fine.
Quoted 3 lines
Signature · 1 line
David Marchand
Quoted 53 lines · Nithin Dabilpuram
Quoted 52 lines · David Marchand
----------------------------------------------------------------------
Quoted 7 lines · Nithin Dabilpuram
devtools/check-symbol-change.sh +0
-0@@ -17,13 +17,13 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and thedevtools/check-symbol-change.sh build_map_changes() · line 26
Quoted 10 lines
devtools/check-symbol-change.sh +2
-2# next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1} # Same pattern as above, only it matches on anything that # does not end in 'map', indicating we have left the map chunk. # When we hit this, turn off the in_map variable, which # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + /[-+] [ab]\/.*\.[^map]/ {in_map=0}[^map] does not mean "not word map" but actually "none of the character m, a or p".
So potentially, any file extension starting with m, a or p could trigger an issue.
For example, a change in .mk files, .py files and./devtools/check-forbidden-tokens.awk./devtools/libabigail.abignore could lead to incorrect symbol check.How about the following change:
devtools/check-symbol-change.sh +4
-6@@ -17,13 +17,11 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} - # Same pattern as above, only it matches on anything that - # does not end in 'map', indicating we have left the map chunk. - # When we hit this, turn off the in_map variable, which - # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + # The previous rule catches all .map files, anything else + # indicates we left the map chunk. + /[-+] [ab]\// {in_map=0}
Quoted 6 lines
devtools/check-symbol-change.sh build_map_changes() · line 27
Quoted 4 lines
devtools/check-symbol-change.sh +0
-0# Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name isAgreed. I tested and it works fine for me. I can send a V2 with this change if it is fine.
Sure, thanks!
Signature · 1 line
David Marchand
PATCH v2 1/1 devtools: fix check symbol change script
In reply to Nithin DabilpuramFix check symbol change script to detect new diff file when it is in between "--- /dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result if in_map was '1' earlier, it will not be changed to '0' and we get check patch errors which are not true.
---
v2:
- Updated logic from David to fix "not map" check
devtools/check-symbol-change.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
devtools/check-symbol-change.sh +4 -6
@@ -17,13 +17,11 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} - # Same pattern as above, only it matches on anything that - # does not end in 'map', indicating we have left the map chunk. - # When we hit this, turn off the in_map variable, which - # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + # The previous rule catches all .map files, anything else + # indicates we left the map chunk. + /[-+] [ab]\// {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is
Signature · 1 line
2.8.4
Quoted 8 lines · Nithin Dabilpuram
Fix check symbol change script to detect new diff file when it is in between "---
/dev/null" to "b/lib/...". Current awk line expects line to start with "a/..." which is not always true for all diffs.
As a result ifin_mapwas '1' earlier, it will not be changed to '0' and we get check patch errors which are not true.
Quoted 7 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")Signed-off-by David Marchand <[email protected]>Signed-off-by Nithin Dabilpuram <[email protected]>Acked-by Neil Horman <[email protected]>Tested-by Jerin Jacob <[email protected]>
Thanks Nithin, applied.
Signature · 1 line
David Marchand