From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp02.apple.com (ma1-aaemail-dr-lapp02.apple.com [17.171.2.68]) by mx.groups.io with SMTP id smtpd.web12.18457.1594914639929773858 for ; Thu, 16 Jul 2020 08:50:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=a5/eSTYx; spf=pass (domain: apple.com, ip: 17.171.2.68, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp02.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp02.apple.com (8.16.0.42/8.16.0.42) with SMTP id 06GFmq38016410; Thu, 16 Jul 2020 08:50:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=r8fiRU1SJ6GiApqeHAaIbIG/DFCDjt1bAoO8EATHzF0=; b=a5/eSTYxv+L6zDUb1t2TJiMXoHzIQ5BqNNAIqTyX+grH1AVdH8TEzUEdwyZSnLxOJ7gM jwVyI1G0bwnL6qM2joEMAbuJL6b+xNFAO/Wg4QR541LV6Yr7fdmU3bR5KWcv9YijRExA JCvRg+GzhMdLtmc8sJmc3PCgLOpddnl6BldrWSC7YLkZegjoXmWa1k1W4p1T3cWNP6hf 9G08CTvpETQ+nBW404pWA7dZc3n0Ia/jbNeJEbuffqPqNXmd1rrasB9/lOk3PHl3RE9m kGszz3wU5oddgYXla2Jh27XEgIWXaTrgzGF78Y9b9AKcp+ZY6IMm+v33gVcYpWpcoBmi nA== Received: from rn-mailsvcp-mta-lapp04.rno.apple.com (rn-mailsvcp-mta-lapp04.rno.apple.com [10.225.203.152]) by ma1-aaemail-dr-lapp02.apple.com with ESMTP id 329j4qx7n5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 16 Jul 2020 08:50:38 -0700 Received: from rn-mailsvcp-mmp-lapp04.rno.apple.com (rn-mailsvcp-mmp-lapp04.rno.apple.com [17.179.253.17]) by rn-mailsvcp-mta-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPS id <0QDK00KZ8K0D6D30@rn-mailsvcp-mta-lapp04.rno.apple.com>; Thu, 16 Jul 2020 08:50:37 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp04.rno.apple.com by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) id <0QDK00F00JCTF300@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Thu, 16 Jul 2020 08:50:37 -0700 (PDT) X-Va-A: X-Va-T-CD: a896650d2b2ee8463fb615bccff4df55 X-Va-E-CD: abc689c8dbf31225341f60396bcd51b3 X-Va-R-CD: 957f4327799c979987441c5c4157b258 X-Va-CD: 0 X-Va-ID: 383f501e-306f-4ed1-a4bd-1a1b4edb983e X-V-A: X-V-T-CD: a896650d2b2ee8463fb615bccff4df55 X-V-E-CD: abc689c8dbf31225341f60396bcd51b3 X-V-R-CD: 957f4327799c979987441c5c4157b258 X-V-CD: 0 X-V-ID: 6ca2f944-0fc8-4f2a-a0cf-9845a28550c6 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-16_07:2020-07-16,2020-07-16 signatures=0 Received: from [17.235.55.211] (unknown [17.235.55.211]) by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPSA id <0QDK000B2K0AJY00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Thu, 16 Jul 2020 08:50:36 -0700 (PDT) From: "Andrew Fish" Message-id: <279FFFCC-D049-4F77-8040-1FFA0D5AA21B@apple.com> MIME-version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [edk2-devel] File in the build question. I'm working on a smart git grep Date: Thu, 16 Jul 2020 08:50:34 -0700 In-reply-to: <39884c36-c42d-8718-f14b-d638e0cd1d69@redhat.com> Cc: devel@edk2.groups.io To: Laszlo Ersek References: <39884c36-c42d-8718-f14b-d638e0cd1d69@redhat.com> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-16_07:2020-07-16,2020-07-16 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_4371C297-86B1-4698-BE3C-8FFC64505482" --Apple-Mail=_4371C297-86B1-4698-BE3C-8FFC64505482 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 16, 2020, at 6:18 AM, Laszlo Ersek wrote: >=20 > On 07/16/20 03:41, Andrew Fish via groups.io wrote: >> I think I mentioned before on the list that I think a smart git grep th= at only scopes to a give target would be useful. For our internal repo we h= ave lots of targets and lots of generations of platforms so lots of code th= at hits in a git grep that is not in the platform.=20 >>=20 >> In thinking about this it looks to me like the Build/**/AutoGenTimeStam= p (module build files) files and the Build/**/AutoGen (global build files) = contain a list of all the files for a project. >>=20 >> I wrote some python that takes the build target (OvmfX64 for example) p= arses all the AutoGenTimeStamp and AutoGen files merges then together and = removes the workspace path. All the other arguments are passed to `git grep= ` and only lines that match the file set are displayed.=20 >>=20 >> My questions are: >> 1) Did I extract all the files? >=20 > I don't know enough of BaseTools to answer the question :) >=20 >> 2) Are people interested in this feature? >=20 > It seems useful. :) >=20 >> 3) Any ideas on how to hook it in? I just dropped in the root of the gi= t tree for development.=20 >=20 > We usually place such utilities under BaseTools/Scripts/, I think (e.g. > PatchCheck.py, SetupGit.py, GetMaintainer.py). I figured out if I rename my script to git-pgrep and move it to BaseTools/= BinWrappers/PosixLike it becomes a new git command.=20 $ git pgrep OvmfX64 CC_FLAGS -- *.dsc OvmfX64 only: git grep CC_FLAGS -- *.dsc OvmfPkg/OvmfPkgX64.dsc:73: GCC:RELEASE_*_*_CC_FLAGS =3D -DMDE= PKG_NDEBUG OvmfPkg/OvmfPkgX64.dsc:74: INTEL:RELEASE_*_*_CC_FLAGS =3D /D MD= EPKG_NDEBUG OvmfPkg/OvmfPkgX64.dsc:75: MSFT:RELEASE_*_*_CC_FLAGS =3D /D MD= EPKG_NDEBUG OvmfPkg/OvmfPkgX64.dsc:77: GCC:*_*_*_CC_FLAGS =3D -mno-= mmx -mno-sse OvmfPkg/OvmfPkgX64.dsc:88: MSFT:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEPRECA= TED_INTERFACES OvmfPkg/OvmfPkgX64.dsc:89: INTEL:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEPREC= ATED_INTERFACES OvmfPkg/OvmfPkgX64.dsc:90: GCC:*_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECAT= ED_INTERFACES I picked pgrep for platform grep.=20 I guess we could add $EDK_TOOLS_PATH/Scripts to the $PATH and then custom = git commands could get added in $EDK_TOOLS_PATH/Scripts >=20 >> 4) Any other cool ideas of what we could do with a file list of the pro= ject? >=20 > Perhaps introduce a more focused utility that only produces the file > list (on stdout) so people could pass the list to whatever commands they > desire? >=20 I added that feature. If you don=E2=80=99t pass any git-grep arguments you= get the file list for the passed in platform.=20 $ git pgrep OvmfX64 Conf/build_rule.txt Conf/tools_def.txt CryptoPkg/CryptoPkg.dec CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf =E2=80=A6 Thanks, Andrew Fish > Thanks! > Laszlo >=20 >>=20 >> Example (to give people a feel for how it works): >> $ time ./ggrep.py OvmfX64 CC_FLAGS | wc -l >> 42 >>=20 >> real 0m0.318s >> user 0m0.243s >> sys 0m0.576s >> $ time git grep CC_FLAGS | wc -l >> 479 >>=20 >> real 0m0.110s >> user 0m0.148s >> sys 0m0.525s >> $ ./ggrep.py OvmfX64 CC_FLAGS >> OvmfX64 only: git grep CC_FLAGS >> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf:96: MSFT:*_*_*_CC_FLAG= S =3D /wd4090 >> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf:100: RVCT:*_*_ARM_CC_F= LAGS =3D -JCryptoPkg/Include --diag_remark=3D1 >> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf:102: GCC:*_CLANG35_*_C= C_FLAGS =3D -std=3Dc99 >> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf:103: GCC:*_CLANG38_*_C= C_FLAGS =3D -std=3Dc99 >> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf:104: GCC:*_CLANGPDB_*_= CC_FLAGS =3D -std=3Dc99 -Wno-error=3Dincompatible-pointer-types >> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf:106: XCODE:*_*_*_CC_FL= AGS =3D -std=3Dc99 >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:55: MSFT:DEBUG_VS2003= _IA32_CC_FLAGS =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1= b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:56: MSFT:RELEASE_VS20= 03_IA32_CC_FLAGS =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1= b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:57: MSFT:DEBUG_VS2003= xASL_IA32_CC_FLAGS =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1= b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:58: MSFT:RELEASE_VS20= 03xASL_IA32_CC_FLAGS =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1= b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:59: MSFT:DEBUG_DDK379= 0_IA32_CC_FLAGS =3D=3D /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /= FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:60: MSFT:RELEASE_DDK3= 790_IA32_CC_FLAGS =3D=3D /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /= FIAutoGen.h /EHs-c- /GR- /GF >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:61: MSFT:DEBUG_DDK379= 0xASL_IA32_CC_FLAGS =3D=3D /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /= FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:62: MSFT:RELEASE_DDK3= 790xASL_IA32_CC_FLAGS =3D=3D /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /= FIAutoGen.h /EHs-c- /GR- /GF >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:63: MSFT:DEBUG_*_IA32= _CC_FLAGS =3D=3D /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O= 1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:64: MSFT:RELEASE_*_IA= 32_CC_FLAGS =3D=3D /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O= 1b2 /FIAutoGen.h /EHs-c- /GR- /GF >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:65: MSFT:DEBUG_*_X64_= CC_FLAGS =3D=3D /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE= /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:66: MSFT:RELEASE_*_X6= 4_CC_FLAGS =3D=3D /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE= /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF >> CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:67: INTEL:*_*_*_CC_FLA= GS =3D /Oi- >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:569: MSFT:*_*_IA32_C= C_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4132= /wd4244 /wd4245 /wd4267 /wd4310 /wd4389 /wd4700 /wd4702 /wd4706 /wd4819 >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:570: MSFT:*_*_X64_CC= _FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4132= /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /w= d4819 >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:572: INTEL:*_*_IA32_= CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:573: INTEL:*_*_X64_C= C_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:582: GCC:*_*_IA32_CC= _FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uniniti= alized -Wno-error=3Dunused-but-set-variable >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:583: GCC:*_*_X64_CC_= FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uniniti= alized -Wno-error=3Dformat -Wno-format -Wno-error=3Dunused-but-set-variable= -DNO_MSABI_VA_FUNCS >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:584: GCC:*_*_ARM_CC_= FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uninitialized -Wno-error= =3Dunused-but-set-variable >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:585: GCC:*_*_AARCH64= _CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uninitialized -Wno-format= -Wno-error=3Dunused-but-set-variable >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:586: GCC:*_*_RISCV64= _CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uninitialized -Wno-format= -Wno-error=3Dunused-but-set-variable >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:587: GCC:*_CLANG35_*= _CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:588: GCC:*_CLANG38_*= _CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:589: GCC:*_CLANGPDB_= *_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized -Wno-error=3Dincompati= ble-pointer-types -Wno-error=3Dpointer-sign -Wno-error=3Dimplicit-function-= declaration -Wno-error=3Dignored-pragma-optimize >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:610: RVCT:*_*_ARM_CC= _FLAGS =3D $(OPENSSL_FLAGS) --library_interface=3Daeabi_clib99 --diag_s= uppress=3D1296,1295,550,1293,111,68,177,223,144,513,188,128,546,1,3017 -JCr= yptoPkg/Include >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:611: XCODE:*_*_IA32_= CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=3Dc99= -Wno-error=3Duninitialized >> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:612: XCODE:*_*_X64_C= C_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -std=3Dc99= -Wno-error=3Duninitialized >> OvmfPkg/OvmfPkgX64.dsc:73: GCC:RELEASE_*_*_CC_FLAGS =3D -D= MDEPKG_NDEBUG >> OvmfPkg/OvmfPkgX64.dsc:74: INTEL:RELEASE_*_*_CC_FLAGS =3D /D= MDEPKG_NDEBUG >> OvmfPkg/OvmfPkgX64.dsc:75: MSFT:RELEASE_*_*_CC_FLAGS =3D /D= MDEPKG_NDEBUG >> OvmfPkg/OvmfPkgX64.dsc:77: GCC:*_*_*_CC_FLAGS =3D -m= no-mmx -mno-sse >> OvmfPkg/OvmfPkgX64.dsc:88: MSFT:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEPR= ECATED_INTERFACES >> OvmfPkg/OvmfPkgX64.dsc:89: INTEL:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEP= RECATED_INTERFACES >> OvmfPkg/OvmfPkgX64.dsc:90: GCC:*_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRE= CATED_INTERFACES >> $./ggrep.py OvmfX64 CC_FLAG -- *.dsc >> OvmfX64 only: git grep CC_FLAG -- *.dsc >> OvmfPkg/OvmfPkgX64.dsc:73: GCC:RELEASE_*_*_CC_FLAGS =3D -D= MDEPKG_NDEBUG >> OvmfPkg/OvmfPkgX64.dsc:74: INTEL:RELEASE_*_*_CC_FLAGS =3D /D= MDEPKG_NDEBUG >> OvmfPkg/OvmfPkgX64.dsc:75: MSFT:RELEASE_*_*_CC_FLAGS =3D /D= MDEPKG_NDEBUG >> OvmfPkg/OvmfPkgX64.dsc:77: GCC:*_*_*_CC_FLAGS =3D -m= no-mmx -mno-sse >> OvmfPkg/OvmfPkgX64.dsc:88: MSFT:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEPR= ECATED_INTERFACES >> OvmfPkg/OvmfPkgX64.dsc:89: INTEL:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEP= RECATED_INTERFACES >> OvmfPkg/OvmfPkgX64.dsc:90: GCC:*_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRE= CATED_INTERFACES >> $ >>=20 >> Note if we cache the combined AutoGenTimeStamp and AutoGen files into a= single file in the Build direction and use that file on the next run the t= ime goes down to: >> real 0m0.177s >> user 0m0.185s >> sys 0m0.522s >>=20 >> If you don=E2=80=99t pass any `git grep` commands you get the file list= back: >> $./ggrep.py OvmfX64 >> Conf/build_rule.txt >> Conf/tools_def.txt >> CryptoPkg/CryptoPkg.dec >> CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf >> CryptoPkg/Library/BaseCryptLib/Cipher/CryptAes.c >> =E2=80=A6 >>=20 >>=20 >> My prototype is around 135 lines of Python. >>=20 >> Thanks, >>=20 >> Andrew Fish >>=20 >>=20 >>=20 --Apple-Mail=_4371C297-86B1-4698-BE3C-8FFC64505482 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Jul 16, 2= 020, at 6:18 AM, Laszlo Ersek <lersek@redhat.com> wrote:

On 07/16/20 03:41, Andrew Fish via groups.io wrote:
I think I mentioned before on = the list that I think a smart git grep that only scopes to a give target wo= uld be useful. For our internal repo we have lots of targets and lots of ge= nerations of platforms so lots of code that hits in a git grep that is not = in the platform. 

In thinking about this it looks to me like the Build/= **/AutoGenTimeStamp (module build files) files and the Build/**/AutoGen (gl= obal build files) contain a list of all the files for a project.

I wrote some python that takes the build target (Ovmf= X64 for example) parses all the  AutoGenTimeStamp and AutoGen files me= rges then together and removes the workspace path. All the other arguments = are passed to `git grep` and only lines that match the file set are display= ed. 

My questions are:
1) Did I extract all the files?

I d= on't know enough of BaseTools to answer the question :)

2) Are people interested in this feature?

It seems useful. :)

3) Any ideas on how to hook it in? I just droppe= d in the root of the git tree for development. 

We usually place such utilities under BaseTools/Script= s/, I think (e.g.
Pat= chCheck.py, SetupGit.py, GetMaintainer.py).

I figured o= ut if I rename my script to git-pgrep and move it to BaseTools/BinWrap= pers/PosixLike it becomes a new git command. 

$&nb= sp;git pgrep OvmfX64 CC_FLAGS -- *.dsc
OvmfX64 only: git grep CC_FLAGS -- *.dsc
OvmfPkg/OvmfPkgX64.dsc:73:=   GCC:RELEASE_*_*_CC_FLAGS             = =3D -DMDEPKG_NDEBUG
Ov= mfPkg/OvmfPkgX64.dsc:74:  INTEL:RELEASE_*_*_CC_FLAGS     &nb= sp;     =3D /D MDEPKG_NDEBUG
OvmfPkg/OvmfPkgX64.dsc:75:  MSFT:RELEASE_*_*_CC_FLAGS&= nbsp;           =3D /D MDEPKG_NDEBUG
<= div style=3D"margin: 0px; font-stretch: normal; font-size: 11px; line-heigh= t: normal; font-family: Menlo;" class=3D"">OvmfPkg/OvmfPkgX64.dsc:77:  GCC= :*_*_*_CC_FLAGS                 &nb= sp; =3D -mno-mmx -mno-sse
OvmfPkg/OvmfPkgX64.dsc:88:  MSFT:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_= DEPRECATED_INTERFACES
O= vmfPkg/OvmfPkgX64.dsc:89:  INTEL:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEP= RECATED_INTERFACES
= Ovmf= Pkg/OvmfPkgX64.dsc:90:  GCC:*_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECAT= ED_INTERFACES

I picked pgrep for platform grep. 

I guess we could add $EDK_TOOLS_PATH/Scripts to the $PATH and then = custom git commands could get added in $EDK_TOOLS_PATH/Scripts
4) Any other cool i= deas of what we could do with a file list of the project?

Perhaps introduce a= more focused utility that only produces the file
list (on stdout) so people could pass the list t= o whatever commands they
desire?


I adde= d that feature. If you don=E2=80=99t pass any git-grep arguments you get th= e file list for the passed in platform. 

git pgrep OvmfX64
Conf/build_rule.txt
Conf/tools_def.txt
CryptoPkg/CryptoPkg.dec
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
= =E2=80=A6

Thanks,

Andrew Fish

Thanks!
Laszlo


Example (to give people a feel for how it works):
$ time ./g= grep.py OvmfX64 CC_FLAGS | wc -l
    &nbs= p;42

real 0m0.318s
user 0m0.243s
s= ys 0m0.57= 6s
$ time git grep CC_FLAGS | wc -l
  = ;  479

real 0m0.110s
user 0m0.148s
sys 0m0.525s
$ ./ggrep.py OvmfX64 CC_FLAGS
Ovmf= X64 only: git grep CC_FLAGS
CryptoPkg/Library/BaseCryptLib/Ba= seCryptLib.inf:96:  MSFT:*_*_*_CC_FLAGS =3D /wd4090
Cryp= toPkg/Library/BaseCryptLib/BaseCryptLib.inf:100:  RVCT:*_*_ARM_CC_FLAG= S =3D -JCryptoPkg/Include --diag_remark=3D1
CryptoPkg/Library= /BaseCryptLib/BaseCryptLib.inf:102:  GCC:*_CLANG35_*_CC_FLAGS =3D -std= = =3Dc99
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf:103: =  GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99
CryptoPkg/Libra= ry/BaseCryptLib/BaseCryptLib.inf:104:  GCC:*_CLANGPDB_*_CC_FLAGS =3D -= std=3Dc99 -Wno-error=3Dincompatible-pointer-types
CryptoPkg/L= ibrary/BaseCryptLib/BaseCryptLib.inf:106:  XCODE:*_*_*_CC_FLAGS =3D -s= td=3Dc99
CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:55: =   MSFT:DEBUG_VS2003_IA32_CC_FLAGS      &= nbsp; =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoG= en.h /EHs-c- /GR- /GF /GX- /Zi /Gm
CryptoPkg/Library/Intrinsi= cLib/IntrinsicLib.inf:56:   MSFT:RELEASE_VS2003_IA32_CC_FLAGS &nb= sp;    =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICOD= E /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX-
CryptoPkg/Library/= IntrinsicLib/IntrinsicLib.inf:57:   MSFT:DEBUG_VS2003xASL_IA32_CC= _FLAGS    =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE = /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm
CryptoPkg/Li= brary/IntrinsicLib/IntrinsicLib.inf:58:   MSFT:RELEASE_VS2003xASL= _IA32_CC_FLAGS  =3D=3D /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b= 2 /FIAutoGen.h /EHs-c- /GR- /GF /GX-
CryptoPkg/Library/Intrin= sicLib/IntrinsicLib.inf:59:   MSFT:DEBUG_DDK3790_IA32_CC_FLAGS &n= bsp;     =3D=3D /nologo /c /WX /Gy /Gs32768 /D UNI= CODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
CryptoPkg/Li= brary/IntrinsicLib/IntrinsicLib.inf:60:   MSFT:RELEASE_DDK3790_IA= 32_CC_FLAGS     =3D=3D /nologo /c /WX /Gy /Gs32768 /D U= NICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF
CryptoPkg/Library/= IntrinsicLib/IntrinsicLib.inf:61:   MSFT:DEBUG_DDK3790xASL_IA32_C= C_FLAGS   =3D=3D /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FI= AutoGen.h /EHs-c- /GR- /GF /Zi /Gm
CryptoPkg/Library/Intrinsi= cLib/IntrinsicLib.inf:62:   MSFT:RELEASE_DDK3790xASL_IA32_CC_FLAG= S =3D=3D /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- = /GR- /GF
CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:63: =   MSFT:DEBUG_*_IA32_CC_FLAGS       =       =3D=3D /nologo /c /WX /GS- /W4 /Gs32768= /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
C= ryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:64:   MSFT:RELEASE= _*_IA32_CC_FLAGS          &nbs= p;=3D=3D /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EH= s-c- /GR- /GF
CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf= :65:   MSFT:DEBUG_*_X64_CC_FLAGS      &n= bsp;       =3D=3D /nologo /c /WX /GS- /X= /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /GmCryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf:66:  &nbs= p;MSFT:RELEASE_*_X64_CC_FLAGS        &nb= sp;   =3D=3D /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE = /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF
CryptoPkg/Library/In= trinsicLib/IntrinsicLib.inf:67:  INTEL:*_*_*_CC_FLAGS   &nbs= p;            &= nbsp;   =3D  /Oi-
CryptoPkg/Library/Opens= slLib/OpensslLibCrypto.inf:569:  MSFT:*_*_IA32_CC_FLAGS   = =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 = /wd4245 /wd4267 /wd4310 /wd4389 /wd4700 /wd4702 /wd4706 /wd4819
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:570:  MSFT:*_*_X6= 4_CC_FLAGS    =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLA= GS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389= /wd4702 /wd4706 /wd4819
CryptoPkg/Library/OpensslLib/Openssl= LibCrypto.inf:572:  INTEL:*_*_IA32_CC_FLAGS  =3D -U_WIN32 -U_WIN6= 4 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w
CryptoPkg/Library/Op= ensslLib/OpensslLibCrypto.inf:573:  INTEL:*_*_X64_CC_FLAGS   = ;=3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:582:  GCC:*_*_IA32_= CC_FLAGS    =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-erro= r=3Dmaybe-uninitialized -Wno-error=3Dunused-but-set-variable
= CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:583:  GCC:*_*_X64_CC= _FLAGS     =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-= error=3Dmaybe-uninitialized -Wno-error=3Dformat -Wno-format -Wno-error=3Dun= used-but-set-variable -DNO_MSABI_VA_FUNCS
CryptoPkg/Library/O= pensslLib/OpensslLibCrypto.inf:584:  GCC:*_*_ARM_CC_FLAGS   =   =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uninitialized -Wno-erro= r=3Dunused-but-set-variable
CryptoPkg/Library/OpensslLib/Open= sslLibCrypto.inf:585:  GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -= Wno-error=3Dmaybe-uninitialized -Wno-format -Wno-error=3Dunused-but-set-var= iable
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:586: =  GCC:*_*_RISCV64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-unin= itialized -Wno-format -Wno-error=3Dunused-but-set-variable
Cr= yptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:587:  GCC:*_CLANG35_*_= CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized
CryptoPkg/= Library/OpensslLib/OpensslLibCrypto.inf:588:  GCC:*_CLANG38_*_CC_FLAGS= =3D -std=3Dc99 -Wno-error=3Duninitialized
CryptoPkg/Library/= OpensslLib/OpensslLibCrypto.inf:589:  GCC:*_CLANGPDB_*_CC_FLAGS =3D -s= td=3Dc99 -Wno-error=3Duninitialized -Wno-error=3Dincompatible-pointer-types= -Wno-error=3Dpointer-sign -Wno-error=3Dimplicit-function-declaration -Wno-= error=3Dignored-pragma-optimize
CryptoPkg/Library/OpensslLib/= OpensslLibCrypto.inf:610:  RVCT:*_*_ARM_CC_FLAGS    &nb= sp;=3D $(OPENSSL_FLAGS) --library_interface=3Daeabi_clib99 --diag_suppress= =3D1296,1295,550,1293,111,68,177,223,144,513,188,128,546,1,3017 -JCryptoPk= g/Include
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:6= 11:  XCODE:*_*_IA32_CC_FLAGS   =3D -mmmx -msse -U_WIN32 -U_W= IN64 $(OPENSSL_FLAGS) -w -std=3Dc99 -Wno-error=3Duninitialized
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf:612:  XCODE:*_*_X6= 4_CC_FLAGS    =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL= AGS) -w -std=3Dc99 -Wno-error=3Duninitialized
OvmfPkg/OvmfPkg= X64.dsc:73:  GCC:RELEASE_*_*_CC_FLAGS      &n= bsp;      =3D -DMDEPKG_NDEBUG
O= vmfPkg/OvmfPkgX64.dsc:74:  INTEL:RELEASE_*_*_CC_FLAGS   &nbs= p;       =3D /D MDEPKG_NDEBUG
OvmfPkg/OvmfPkgX64.dsc:75:  MSFT:RELEASE_*_*_CC_FLAGS  &nb= sp;         =3D /D MDEPKG_NDEB= UG
OvmfPkg/OvmfPkgX64.dsc:77:  GCC:*_*_*_CC_FLAGS  =             &nb= sp;    =3D -mno-mmx -mno-sse
OvmfPkg/Ovmf= PkgX64.dsc:88:  MSFT:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEPRECATED_INTE= RFACES
OvmfPkg/OvmfPkgX64.dsc:89:  INTEL:*_*_*_CC_FLAGS = = =3D /D DISABLE_NEW_DEPRECATED_INTERFACES
OvmfPkg/OvmfPkgX64.= dsc:90:  GCC:*_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES$./ggrep.py OvmfX64 CC_FLAG -- *.dsc
OvmfX64 onl= y: git grep CC_FLAG -- *.dsc
OvmfPkg/OvmfPkgX64.dsc:73:  = ;GCC:RELEASE_*_*_CC_FLAGS         &= nbsp;   =3D -DMDEPKG_NDEBUG
OvmfPkg/OvmfPkgX64= .dsc:74:  INTEL:RELEASE_*_*_CC_FLAGS      &nb= sp;    =3D /D MDEPKG_NDEBUG
OvmfPkg/OvmfP= kgX64.dsc:75:  MSFT:RELEASE_*_*_CC_FLAGS      = ;      =3D /D MDEPKG_NDEBUG
Ovm= fPkg/OvmfPkgX64.dsc:77:  GCC:*_*_*_CC_FLAGS     &n= bsp;            = ; =3D -mno-mmx -mno-sse
OvmfPkg/OvmfPkgX64.dsc:88:  = ;MSFT:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_DEPRECATED_INTERFACES
OvmfPkg/OvmfPkgX64.dsc:89:  INTEL:*_*_*_CC_FLAGS =3D /D DISABLE_NEW_D= EPRECATED_INTERFACES
OvmfPkg/OvmfPkgX64.dsc:90:  GCC:*_*= _*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES
$

Note if we cache the combined AutoGenTimeStamp and A= utoGen files into a single file in the Build direction and use that file on= the next run the time goes down to:
real 0m0.177s
user<= span class=3D"Apple-tab-span" style=3D"white-space: pre;">
0m0.185s<= br class=3D"">sys 0m0.522s

If you don=E2=80=99t pass an= y `git grep` commands you get the file list back:
$./ggrep.py= OvmfX64
Conf/build_rule.txt
Conf/tools_def.txt=
CryptoPkg/CryptoPkg.dec
CryptoPkg/Library/Base= CryptLib/BaseCryptLib.inf
CryptoPkg/Library/BaseCryptLib/Ciph= er/CryptAes.c
=E2=80=A6


My prototype is around 135 lines of Python.

Thanks,

Andrew Fish



--Apple-Mail=_4371C297-86B1-4698-BE3C-8FFC64505482--