public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bob Feng" <bob.c.feng@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"pierre.gondois@arm.com" <pierre.gondois@arm.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>,
	Tomas Pilar <Tomas.Pilar@arm.com>,
	"Gao, Liming" <liming.gao@intel.com>, nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file
Date: Wed, 1 Jul 2020 01:03:20 +0000	[thread overview]
Message-ID: <BN6PR11MB00683FDFCADA1C7853C54EF1C96C0@BN6PR11MB0068.namprd11.prod.outlook.com> (raw)
In-Reply-To: <DB7PR08MB3113EE32FF5500451DFD96178B6F0@DB7PR08MB3113.eurprd08.prod.outlook.com>

Hi Pierre,

Yes. if the patch set can't pass CI, it can't be merged.

I think we can add a check for the file path. The scripts under BinWrappers\PosixLike are all linux shell scripts.

Thanks,
Bob 

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of PierreGondois
Sent: Tuesday, June 30, 2020 9:56 PM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; Gao, Liming <liming.gao@intel.com>; nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file

I agree that PatchCheck.py needs to be updated. However, this is difficult for PatchCheck.py to know whether a file should be allowed to have LF line endings or not. Some files currently in edk2 have LF line endings and:
 - have a ".sh" extension (EmulatorPkg/build.sh), some other don't (BaseTools/BinWrappers/PosixLike/GenFv);
 - start with "#!/usr/bin/env bash" (BaseTools/BinWrappers/PosixLike/GenFv), some other don't (edksetup.sh); I don't see any criteria that would allow to identify whether a file is supposed to have LF line endings or not. This is why I think creating a ".gitattribute" file in edk2 would help. In this file, people could identify files/folders being allowed to have LF line endings. PatchCheck.py would parse this file to exclude them from the CRLF check. Plus it would enforce the line ending on local copies of edk2, thus preventing mistakes like I did when sending a bash script with CRLF line endings.
Do you agree with this solution?

Another question: does the CRLF error triggered by PatchCheck.py imply delaying this current patch set? Indeed I'm scared trying to add a ".gitattribute" file might start long discussions.

Regards,
Pierre

-----Original Message-----
From: Feng, Bob C <bob.c.feng@intel.com>
Sent: 30 June 2020 11:59
To: devel@edk2.groups.io; Pierre Gondois <Pierre.Gondois@arm.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; Gao, Liming <liming.gao@intel.com>; nd <nd@arm.com>
Subject: RE: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file

Hi Pierre,

I think we need to update the PatchCheck.py script. The comments says, "Do not enforce CR/LF line endings for linux shell scripts.", but that only check the file ext is .sh is not enough.

if self.filename.endswith('.sh'):
                    #
                    # Do not enforce CR/LF line endings for linux shell scripts.
                    #
                    self.force_crlf = False

Thanks,
Bob

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of PierreGondois
Sent: Monday, June 29, 2020 10:33 PM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; Gao, Liming <liming.gao@intel.com>; nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file

Hello Bob,
I actually found more files having a LF line ending by running the following command:
for file in `git ls-files`; do if [ "${file##*.}" != bin ] && [ "${file##*.}" != bmp ] && [ "${file##*.}" != a ] && [ "${file##*.}" != lib ] && [ "${file##*.}" != cer ] && [ "${file##*.}" != pyd ] &&[ "${file##*.}" != pem ] && [ "${file##*.}" != raw ]; then file $file | grep -v "CRLF" | grep -v ": directory"; fi; done The command list files referenced in git, then excludes files with specific extensions, excludes directories, and excludes files with CRLF line endings.

I believe some of them should have CRLF line endings if this is the default in edk2. I am mainly thinking about the ".rtf", ".py" and ".txt" files. For the actual bash scripts, maybe a ".gitattributes" file can be created in edk2 to explicitly make them use LF line endings. This can be done by setting this attribute: "eol=lf".
This ".gitattributes" file would then be parsed by the PatchCHeck.py script not to trigger an error for files having the later attribute.

Regards,
Pierre

List of files obtained by running the command above, (maybe it needs some more filters):
BaseTools/Bin/CYGWIN_NT-5.1-i686/BootSectImage: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/BuildEnv: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiLdrImage: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiRom: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenCrc32: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFfs: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFv: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFw: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenPage: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenSec: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GenVtf: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/GnuGenBootSector: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaCompress: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaF86Compress: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/RunBinToolFromBuildDir: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/RunToolFromSource: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/Split: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/TianoCompress: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/VfrCompile: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/VolInfo: Bourne-Again shell script, ASCII text executable
BaseTools/Bin/CYGWIN_NT-5.1-i686/build: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/BPDG: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/Brotli: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/BrotliCompress: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/DevicePath: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/Ecc: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/EfiRom: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenCrc32: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenDepex: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenFds: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenFfs: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenFv: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenFw: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenPatchPcdTable: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenSec: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/GenerateCapsule: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/LzmaCompress: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/LzmaF86Compress: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/PatchPcdValue: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/Pkcs7Sign: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/Split: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/TargetTool: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/TianoCompress: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/Trim: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/UPT: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/VfrCompile: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/VolInfo: Bourne-Again shell script, ASCII text executable
BaseTools/BinWrappers/PosixLike/build: Bourne-Again shell script, ASCII text executable
BaseTools/BuildEnv: ASCII text
BaseTools/Source/C/VfrCompile/Pccts/KNOWN_PROBLEMS.txt: data
BaseTools/Source/C/VfrCompile/Pccts/history.ps: PostScript document text conforming DSC level 3.0
BaseTools/Source/Python/Ecc/CParser3/__init__.py: empty
BaseTools/Source/Python/Ecc/CParser4/__init__.py: empty
BaseTools/Source/Python/Eot/CParser3/__init__.py: empty
BaseTools/Source/Python/Eot/CParser4/__init__.py: empty
BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gEfiSecurityPkgTokenSpaceGuid.PcdPkcs7CertBuffer.inc: ASCII text, with very long lines, with no line terminators
BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc: ASCII text, with very long lines, with no line terminators
BaseTools/UserManuals/Build_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/EfiRom_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenCrc32_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenDepex_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenFds_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenFfs_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenFv_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenPatchPcdTable_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/GenSec_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/Intel_UEFI_Packaging_Tool_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/LzmaCompress_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/PatchPcdValue_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/SplitFile_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/TargetTool_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/TianoCompress_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/Trim_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/UtilityManPage_template.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
BaseTools/UserManuals/VolInfo_Utility_Man_Page.rtf: Rich Text Format data, version 1, unknown character set
CryptoPkg/Library/Include/internal/dso_conf.h: C source, ASCII text
CryptoPkg/Library/OpensslLib/process_files.pl: Perl script text executable
EmbeddedPkg/Library/FdtLib/TODO: ASCII text
EmbeddedPkg/Library/FdtLib/fdt_overlay.c: C source, ASCII text
EmulatorPkg/Unix/.gdbinit: ASCII text
EmulatorPkg/Unix/GdbRun.sh: ASCII text
EmulatorPkg/Unix/Host/X11IncludeHack: ASCII text, with no line terminators
EmulatorPkg/Unix/Xcode/xcode_project32/XcodeBuild.sh: Bourne-Again shell script, ASCII text executable
EmulatorPkg/Unix/Xcode/xcode_project32/xcode_project.xcodeproj/default.pbxuser: ASCII text
EmulatorPkg/Unix/Xcode/xcode_project32/xcode_project.xcodeproj/project.pbxproj: ASCII text
EmulatorPkg/Unix/Xcode/xcode_project64/XcodeBuild.sh: Bourne-Again shell script, ASCII text executable
EmulatorPkg/Unix/Xcode/xcode_project64/xcode_project.xcodeproj/default.pbxuser: ASCII text
EmulatorPkg/Unix/Xcode/xcode_project64/xcode_project.xcodeproj/project.pbxproj: ASCII text
EmulatorPkg/Unix/lldbinit: ASCII text
EmulatorPkg/build.sh: Bourne-Again shell script, ASCII text executable
OvmfPkg/QemuVideoDxe/VbeShim.sh: POSIX shell script, ASCII text executable
OvmfPkg/build.sh: Bourne-Again shell script, ASCII text executable
edksetup.sh: ASCII text


-----Original Message-----
From: Feng, Bob C <bob.c.feng@intel.com>
Sent: 28 June 2020 08:34
To: devel@edk2.groups.io; Pierre Gondois <Pierre.Gondois@arm.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; Gao, Liming <liming.gao@intel.com>; nd <nd@arm.com>
Subject: RE: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file

Hi Pierre,

I met a problem when I push your patch set.

If I change the CRLF to a unix format EOL, the patch can't pass PatchCheck.py.
If I don't change the CRLF, The build on Linux will fail.
So I can't make the patch set pass the CI.

Could you share me how did you do to make your PR 729 pass?

Thanks,
Bob

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of PierreGondois
Sent: Thursday, June 25, 2020 5:31 PM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; Gao, Liming <liming.gao@intel.com>; nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file

Hello Bob,
I believe the line endings of the BaseTools/BinWrappers/PosixLike/AmlToC script have been modified to CRLF when I sent the patch. I created a pull request from the linked github branch noted in the patches. It is available at https://github.com/PierreARM/edk2/commits/803_Compile_AML_bytecode_array_into_OBJ_file_v3 . The pull request is available here (to show the result of the CI tests) https://github.com/tianocore/edk2/pull/729 .
Do you want a v4 or is it possible to pull the patches from the github repository?
Sorry for the inconvenience.

Regards,
Pierre

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob Feng via groups.io
Sent: 24 June 2020 16:16
To: devel@edk2.groups.io; Pierre Gondois <Pierre.Gondois@arm.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Tomas Pilar <Tomas.Pilar@arm.com>; Gao, Liming <liming.gao@intel.com>; nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file

Hi Pierre,

There are some build failed in OpenCI. Would you please check it?
https://github.com/tianocore/edk2/pull/727

Thanks,
Bob

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of PierreGondois
Sent: Wednesday, June 24, 2020 5:09 PM
To: devel@edk2.groups.io
Cc: Pierre Gondois <Pierre.Gondois@arm.com>; sami.mujawar@arm.com; tomas.pilar@arm.com; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; nd@arm.com
Subject: [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file

Following the BZ at https://bugzilla.tianocore.org/show_bug.cgi?id=2425
This patch serie is a another way to solve the dependency of C files over ASL files. With this new method, the dependency is resolved at the linking stage.

The last method to solve this dependency was to add the possibility to modify INF files to depict such a dependency. This method was not accepted. The discussion is available at https://edk2.groups.io/g/devel/topic/72655342#56658

The last patch modifying the INF specification and INF parsing are available at:
https://edk2.groups.io/g/devel/topic/72655342#56658
https://edk2.groups.io/g/devel/topic/72656060#56662

Pierre Gondois (4):
  BaseTools: Generate multiple rules when multiple output files
  BaseTools: Rename AmlToHex script to AmlToC
  BaseTools: Compile AML bytecode arrays into .obj file
  BaseTools: Fix string concatenation

 BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC}               | 28 +++----
 BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat}     |  0
 BaseTools/Conf/build_rule.template                                 | 15 +++-
 BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} | 82 ++++++++------------
 BaseTools/Source/Python/AutoGen/BuildEngine.py                     |  2 +-
 BaseTools/Source/Python/AutoGen/GenMake.py                         |  6 ++
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py                   | 38 +++++----
 7 files changed, 89 insertions(+), 82 deletions(-)  rename BaseTools/BinWrappers/PosixLike/{AmlToHex => AmlToC} (97%)  rename BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat => AmlToC.bat} (100%)  rename BaseTools/Source/Python/{AmlToHex/AmlToHex.py => AmlToC/AmlToC.py} (52%)

--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'

















      reply	other threads:[~2020-07-01  1:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24  9:08 [PATCH v3 0/4] Compile AML bytecode array into OBJ file PierreGondois
2020-06-24  9:08 ` [PATCH v3 1/4] BaseTools: Generate multiple rules when multiple output files PierreGondois
2020-06-24  9:08 ` [PATCH v3 2/4] BaseTools: Rename AmlToHex script to AmlToC PierreGondois
2020-06-24  9:08 ` [PATCH v3 3/4] BaseTools: Compile AML bytecode arrays into .obj file PierreGondois
2020-06-24  9:08 ` [PATCH v3 4/4] BaseTools: Fix string concatenation PierreGondois
2020-06-24 15:16 ` [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file Bob Feng
2020-06-25  9:30   ` PierreGondois
2020-06-25 11:51     ` Bob Feng
2020-06-28  7:34     ` Bob Feng
2020-06-28 22:12       ` PierreGondois
2020-06-29 14:32       ` PierreGondois
2020-06-30 10:58         ` Bob Feng
2020-06-30 13:55           ` PierreGondois
2020-07-01  1:03             ` Bob Feng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN6PR11MB00683FDFCADA1C7853C54EF1C96C0@BN6PR11MB0068.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox