unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / Atom feed
* [PATCH] test/T360-symbol-hiding.sh: trim extra output from readelf
@ 2020-12-15 20:45 David Bremner
  2020-12-25 18:37 ` David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: David Bremner @ 2020-12-15 20:45 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

readelf on (at least) ppc64le generates symbol versioning (sometimes)
at the end of the line inside '()' and some extension to the Ndx name
inside '[]'. Remove this output to allow our simple column based
parsing to work.
---
 test/T360-symbol-hiding.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I dislike this feeling of playing whack-a-mole parsing ill-defined
output, but here we are. I looked into alternatives a bit, but nothing
grabbed me. abi-dumper is a perl script wrapping readelf, so if we
wanted we could delegate the hacks to a third party tool.

I also thought about combining the sed into the awk call, but it
seemed like too much work to me, probably because I am not an awk
expert.

We could also just drop the test. In Debian we have dpkg-gensymbols
that manages more or less the same task; I'm not sure if other
environments have something similar.

diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh
index 3f00dd38..b2a5694a 100755
--- a/test/T360-symbol-hiding.sh
+++ b/test/T360-symbol-hiding.sh
@@ -26,7 +26,7 @@ test_begin_subtest 'checking output'
 test_expect_equal "$result" "$output"
 
 test_begin_subtest 'comparing existing to exported symbols'
-readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | \
+readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | sed -e 's/\[[^]]*\]//' -e 's/([^)]*)$//' |\
     awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $8}' | sort -u > ACTUAL
 sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort -u > EXPORTED
 test_expect_equal_file EXPORTED ACTUAL
-- 
2.29.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] test/T360-symbol-hiding.sh: trim extra output from readelf
  2020-12-15 20:45 [PATCH] test/T360-symbol-hiding.sh: trim extra output from readelf David Bremner
@ 2020-12-25 18:37 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2020-12-25 18:37 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> readelf on (at least) ppc64le generates symbol versioning (sometimes)
> at the end of the line inside '()' and some extension to the Ndx name
> inside '[]'. Remove this output to allow our simple column based
> parsing to work.

Simplified version (thanks Tomi) applied.

d

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-25 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 20:45 [PATCH] test/T360-symbol-hiding.sh: trim extra output from readelf David Bremner
2020-12-25 18:37 ` David Bremner

unofficial mirror of notmuch@notmuchmail.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/notmuch/0 notmuch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 notmuch notmuch/ https://yhetil.org/notmuch \
		notmuch@notmuchmail.org
	public-inbox-index notmuch

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.mail.notmuch.general
	nntp://news.gmane.io/gmane.mail.notmuch.general


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git