Sorry Hot, I actually  saw your CRLF changes in EDK2 yesterday. But I missed 
the one in BaseTools.
As the page I quoted before says and Andrew also confirmed, Python scripts set 
as executable (ie: you could run it from the shell) must have the LF (not CRLF) 
line endings on their first line.
I can see you changed the line endings to CRLF for this file 
'trunk/BaseTools/gcc/mingw-gcc-build.py'. Have you tested this change?
________________________________________
From: Tian, Hot [[email protected]]
Sent: 24 January 2014 00:01
To: Andrew Fish; Olivier Martin
Cc: [email protected]
Subject: RE: [edk2-buildtools] BaseTools Coding Style - Line Endings

I think the long term perfect solution is using eol-style attribute. But I’m  
not sure whether souceforge support this feature. And for short term, I’ve 
fixed the mixed use of CR and CRLF. The recommendation is CRLF for all sources 
except .sh scripts. You can also find similar recommendation in Build spec 
section 4.1.

Thanks,
Hot

From: Andrew Fish [mailto:[email protected]]
Sent: Friday, January 24, 2014 1:08 AM
To: Olivier Martin
Cc: [email protected]
Subject: Re: [edk2-buildtools] BaseTools Coding Style - Line Endings


On Jan 23, 2014, at 2:47 AM, Olivier Martin 
<[email protected]<mailto:[email protected]>> wrote:


Do you confirm the EDK2 BaseTools coding style apply to BaseTools too?

It would mean C sources must have CRLF line endings.

What about Python source files? It looks there is no requirement on the line 
endings in Python source files. The Python Coding style in 
EDK2:https://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Code_Style/Python
 refers to 
http://www.python.org/dev/peps/pep-0008/.<http://www.python.org/dev/peps/pep-0008/>
 But there is no reference to the line endings.

On this page 
'http://docs.python.org/3/tutorial/interpreter.html#executable-python-scripts',<http://docs.python.org/3/tutorial/interpreter.html#executable-python-scripts%27,>
 you can also read:
On BSD’ish Unix systems, Python scripts can be made directly executable, like 
shell scripts (...) On some platforms, this first line must end with a 
Unix-style line ending ('\n'), not a Windows ('\r\n') line ending.

But we do not directly call the Python BaseTools script from the shell. We go 
through $EDK2_ROOT/BaseTools/BinWrappers/PosixLike/ scripts.

Some files in BaseTools have mixed line endings. Control Version Systems 
complain about it. Example:
-          BaseTools\Source\C\GenFw\elf_common.h: mixed CR & CRLF
-          BaseTools\Source\Python\GenFds\Fv.py: mixed CR & CRLF
-          BaseTools\Source\Python\GenFds\GenFdsGlobalVariable.py: mixed CR & 
CRLF

What is the recommended line endings for Python sources?


I would point out that subversion can help with this. A property of 
svn:eol-style of native will cause Subversion to store all files internally 
with LF, If you checkout from windows you get CRLF and if you checkout from 
Unix you get LF.

Bash scripts with CRLF crash on Mach OS X. So they need to be LF to function.


In general it seems there are a lot of editors that get confused with a mixed 
scheme, so cleaning up the miss matches is a good idea. But to me it seems the 
requirement should be to commit in native line endings and setup svn to 
automatically convert.

Thanks,

Andrew Fish


Thanks,
Olivier
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk_______________________________________________
edk2-buildtools-devel mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-devel


-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered 
in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
Registered in England & Wales, Company No:  2548782


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
edk2-buildtools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-devel

Reply via email to