Clean up find_typedefs and add support for Mac

From: "Tristan Partin" <tristan(at)neon(dot)tech>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Clean up find_typedefs and add support for Mac
Date: 2023-12-12 21:16:10
Message-ID: CXMO0W1VX6GZ.NGSL94S57W1Z@neon.tech
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The script was using a few deprecated things according to POSIX:

- -o instead of ||
- egrep
- `` instead of $()

I removed those for their "modern" equivalents. Hopefully no buildfarm
member complains. I can remove any of those patches though. I did go
ahead and remove egrep usage from the entire codebase while I was at it.
There is still a configure check though. I'm thinking that could also be
removed?

I moved system detection to use uname -s. I hope that isn't a big deal.
Not sure the best way to identify Mac otherwise.

The big patch here is adding support for Mac. objdump -W doesn't work on
Mac. So, I used dsymutil and dwarfdump to achieve the same result. I am
not someone who ever uses awk, so someone should definitely check my
work there. I can only confirm this works on the latest version of Mac,
and have no clue how backward compatible it is. I also wrote this
without having a Mac. I had to ping a coworker with a Mac for help.

My goal with the Mac support is to enable use of find_typedef for
extension developers, where using a Mac might be more prominent than
upstream Postgres development, but that is just a guess.

--
Tristan Partin
Neon (https://neon.tech)

Attachment Content-Type Size
v1-0001-Replace-egrep-with-grep-E.patch text/x-patch 4.1 KB
v1-0002-Remove-use-of-test-o-in-find_typedef.patch text/x-patch 1.5 KB
v1-0003-Remove-use-of-backticks-for-running-processes-in-.patch text/x-patch 1.3 KB
v1-0004-Use-uname-s-for-determining-the-system-in-find_ty.patch text/x-patch 1.4 KB
v1-0005-Add-Mac-support-to-find_typedef.patch text/x-patch 1.0 KB
v1-0006-Use-grep-F-instead-of-E-in-find_typedef.patch text/x-patch 945 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-12-12 21:39:55 Re: encoding affects ICU regex character classification
Previous Message Jeremy Schneider 2023-12-12 21:14:23 Re: Built-in CTYPE provider