[edk2-devel] [PATCH v5 0/6] jansson edk2 port

Abner Chang posted 6 patches 3 years, 4 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
.gitmodules                                   |    3 +
.pytool/CISettings.py                         |    2 +
ReadMe.rst                                    |    1 +
RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
RedfishPkg/Include/Library/CrtLib.h           |  195 +++
RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
.../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
.../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
RedfishPkg/Library/JsonLib/assert.h           |   16 +
RedfishPkg/Library/JsonLib/errno.h            |   16 +
RedfishPkg/Library/JsonLib/jansson            |    1 +
RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
.../Library/JsonLib/jansson_private_config.h  |   19 +
RedfishPkg/Library/JsonLib/limits.h           |   16 +
RedfishPkg/Library/JsonLib/load.c             | 1111 +++++++++++++++++
RedfishPkg/Library/JsonLib/math.h             |   16 +
RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
RedfishPkg/Library/JsonLib/stddef.h           |   16 +
RedfishPkg/Library/JsonLib/stdio.h            |   15 +
RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
RedfishPkg/Library/JsonLib/string.h           |   16 +
RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
RedfishPkg/Library/JsonLib/time.h             |   15 +
RedfishPkg/RedfishLibs.dsc.inc                |    3 +
RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
RedfishPkg/RedfishPkg.dec                     |   15 +
RedfishPkg/RedfishPkg.dsc                     |    3 +
34 files changed, 4811 insertions(+)
create mode 100644 RedfishPkg/Include/JanssonJsonMapping.h
create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
create mode 100644 RedfishPkg/Include/Library/CrtLib.h
create mode 100644 RedfishPkg/Include/Library/JsonLib.h
create mode 100644 RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
create mode 100644 RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
create mode 100644 RedfishPkg/Library/JsonLib/assert.h
create mode 100644 RedfishPkg/Library/JsonLib/errno.h
create mode 160000 RedfishPkg/Library/JsonLib/jansson
create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
create mode 100644 RedfishPkg/Library/JsonLib/jansson_private_config.h
create mode 100644 RedfishPkg/Library/JsonLib/limits.h
create mode 100644 RedfishPkg/Library/JsonLib/load.c
create mode 100644 RedfishPkg/Library/JsonLib/math.h
create mode 100644 RedfishPkg/Library/JsonLib/stdarg.h
create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
create mode 100644 RedfishPkg/Library/JsonLib/string.h
create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
create mode 100644 RedfishPkg/Library/JsonLib/time.h
[edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago
In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
In v4,
       - Address review comments
       - Seperate CRT functions to a individule library CrtLib under
         RedfishPkg.
       - Seperate UCS2-UTF8 functions to a individule library
         BaseUcs2Utf8Lib under MdeModulePkg.

In v3, Add jansson library as the required submoudle in
       CiSettings.py for CI test.
In v2, JsonLib is moved to under RedfishPkg.

edk2 JSON library is based on jansson open source
(https://github.com/akheron/jansson) and wrapped as an edk2
library. edk2 JsonLib will be used by edk2 Redfish feature
drivers (not contributed yet) and the edk2 port of libredfish
library (not contributed yet) based on DMTF GitHub
(https://github.com/DMTF/libredfish).

Jansson is licensed under the MIT license(refer to ReadMe.rst under edk2).
It is used in production and its API is stable. In UEFI/EDKII environment,
Redfish project consumes jansson to achieve JSON operations.

* Jansson version on edk2: 2.13.1

* EDKII jansson library wrapper:
   - JsonLib.h:
     This is the denifitions of EDKII JSON APIs which are mapped to
     jannson funcitons accordingly.

   - JanssonJsonLibMapping.h:
     This is the wrapper file to map funcitons and definitions used in
     native jannson applications to edk2 JsonLib. This avoids the
     modifications on native jannson applications to be built under
     edk2 environment.

*Known issue:
  Build fail with jansson/src/load.c, overrride and add code in load.c
  to conditionally use stdin according to HAVE_UNISTD_H macro.
  The PR is submitted to jansson open source community.
  https://github.com/akheron/jansson/pull/558

Signed-off-by: Abner Chang <abner.chang@hpe.com>

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nickle.wang@hpe.com>
Cc: Peter O'Hanley <peter.ohanley@hpe.com>

Abner Chang (6):
  RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
  edk2: jansson submodule for edk2 JSON library
  RedfishPkg/CrtLib: C runtime library
  RedfishPkg/library: EDK2 port of jansson library
  RedfishPkg: Add EDK2 port of jansson library to build
  .pytool: Add required submodule for JsonLib

 .gitmodules                                   |    3 +
 .pytool/CISettings.py                         |    2 +
 ReadMe.rst                                    |    1 +
 RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
 RedfishPkg/Include/Library/CrtLib.h           |  195 +++
 RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
 .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
 .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
 RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
 RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
 RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
 RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
 RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
 RedfishPkg/Library/JsonLib/assert.h           |   16 +
 RedfishPkg/Library/JsonLib/errno.h            |   16 +
 RedfishPkg/Library/JsonLib/jansson            |    1 +
 RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
 .../Library/JsonLib/jansson_private_config.h  |   19 +
 RedfishPkg/Library/JsonLib/limits.h           |   16 +
 RedfishPkg/Library/JsonLib/load.c             | 1111 +++++++++++++++++
 RedfishPkg/Library/JsonLib/math.h             |   16 +
 RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
 RedfishPkg/Library/JsonLib/stddef.h           |   16 +
 RedfishPkg/Library/JsonLib/stdio.h            |   15 +
 RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
 RedfishPkg/Library/JsonLib/string.h           |   16 +
 RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
 RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
 RedfishPkg/Library/JsonLib/time.h             |   15 +
 RedfishPkg/RedfishLibs.dsc.inc                |    3 +
 RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
 RedfishPkg/RedfishPkg.dec                     |   15 +
 RedfishPkg/RedfishPkg.dsc                     |    3 +
 34 files changed, 4811 insertions(+)
 create mode 100644 RedfishPkg/Include/JanssonJsonMapping.h
 create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
 create mode 100644 RedfishPkg/Include/Library/CrtLib.h
 create mode 100644 RedfishPkg/Include/Library/JsonLib.h
 create mode 100644 RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
 create mode 100644 RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
 create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
 create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
 create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
 create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
 create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
 create mode 100644 RedfishPkg/Library/JsonLib/assert.h
 create mode 100644 RedfishPkg/Library/JsonLib/errno.h
 create mode 160000 RedfishPkg/Library/JsonLib/jansson
 create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
 create mode 100644 RedfishPkg/Library/JsonLib/jansson_private_config.h
 create mode 100644 RedfishPkg/Library/JsonLib/limits.h
 create mode 100644 RedfishPkg/Library/JsonLib/load.c
 create mode 100644 RedfishPkg/Library/JsonLib/math.h
 create mode 100644 RedfishPkg/Library/JsonLib/stdarg.h
 create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
 create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
 create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
 create mode 100644 RedfishPkg/Library/JsonLib/string.h
 create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
 create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
 create mode 100644 RedfishPkg/Library/JsonLib/time.h

-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68426): https://edk2.groups.io/g/devel/message/68426
Mute This Topic: https://groups.io/mt/78795511/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by gaoliming 3 years, 4 months ago
Abner:
  I have minor comments on the library header file. 

1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include the additional
header files, such as Uefi.h and BaseLib.h, because the library header file
doesn't depend on the definitions from BaseLib.
2. CrtLib.inf needs to list the required library class: BaseMemoryLib &
PrintLib.

Thanks
Liming
> -----邮件原件-----
> 发件人: bounce+27952+68426+4905953+8761045@groups.io
> <bounce+27952+68426+4905953+8761045@groups.io> 代表 Abner Chang
> 发送时间: 2020年12月8日 10:11
> 收件人: devel@edk2.groups.io
> 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>; Andrew Fish <afish@apple.com>; Laszlo
> Ersek <lersek@redhat.com>; Leif Lindholm <leif@nuviainc.com>; Michael D
> Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Nickle Wang <nickle.wang@hpe.com>; Peter
> O'Hanley <peter.ohanley@hpe.com>
> 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> In v4,
>        - Address review comments
>        - Seperate CRT functions to a individule library CrtLib under
>          RedfishPkg.
>        - Seperate UCS2-UTF8 functions to a individule library
>          BaseUcs2Utf8Lib under MdeModulePkg.
> 
> In v3, Add jansson library as the required submoudle in
>        CiSettings.py for CI test.
> In v2, JsonLib is moved to under RedfishPkg.
> 
> edk2 JSON library is based on jansson open source
> (https://github.com/akheron/jansson) and wrapped as an edk2
> library. edk2 JsonLib will be used by edk2 Redfish feature
> drivers (not contributed yet) and the edk2 port of libredfish
> library (not contributed yet) based on DMTF GitHub
> (https://github.com/DMTF/libredfish).
> 
> Jansson is licensed under the MIT license(refer to ReadMe.rst under edk2).
> It is used in production and its API is stable. In UEFI/EDKII environment,
> Redfish project consumes jansson to achieve JSON operations.
> 
> * Jansson version on edk2: 2.13.1
> 
> * EDKII jansson library wrapper:
>    - JsonLib.h:
>      This is the denifitions of EDKII JSON APIs which are mapped to
>      jannson funcitons accordingly.
> 
>    - JanssonJsonLibMapping.h:
>      This is the wrapper file to map funcitons and definitions used in
>      native jannson applications to edk2 JsonLib. This avoids the
>      modifications on native jannson applications to be built under
>      edk2 environment.
> 
> *Known issue:
>   Build fail with jansson/src/load.c, overrride and add code in load.c
>   to conditionally use stdin according to HAVE_UNISTD_H macro.
>   The PR is submitted to jansson open source community.
>   https://github.com/akheron/jansson/pull/558
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> 
> Abner Chang (6):
>   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
>   edk2: jansson submodule for edk2 JSON library
>   RedfishPkg/CrtLib: C runtime library
>   RedfishPkg/library: EDK2 port of jansson library
>   RedfishPkg: Add EDK2 port of jansson library to build
>   .pytool: Add required submodule for JsonLib
> 
>  .gitmodules                                   |    3 +
>  .pytool/CISettings.py                         |    2 +
>  ReadMe.rst                                    |    1 +
>  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
>  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
>  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
>  RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
>  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
>  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
>  RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
>  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
>  RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
>  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
>  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
>  RedfishPkg/Library/JsonLib/assert.h           |   16 +
>  RedfishPkg/Library/JsonLib/errno.h            |   16 +
>  RedfishPkg/Library/JsonLib/jansson            |    1 +
>  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
>  .../Library/JsonLib/jansson_private_config.h  |   19 +
>  RedfishPkg/Library/JsonLib/limits.h           |   16 +
>  RedfishPkg/Library/JsonLib/load.c             | 1111
> +++++++++++++++++
>  RedfishPkg/Library/JsonLib/math.h             |   16 +
>  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
>  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
>  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
>  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
>  RedfishPkg/Library/JsonLib/string.h           |   16 +
>  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
>  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
>  RedfishPkg/Library/JsonLib/time.h             |   15 +
>  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
>  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
>  RedfishPkg/RedfishPkg.dec                     |   15 +
>  RedfishPkg/RedfishPkg.dsc                     |    3 +
>  34 files changed, 4811 insertions(+)
>  create mode 100644 RedfishPkg/Include/JanssonJsonMapping.h
>  create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
>  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
>  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
>  create mode 100644
> RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
>  create mode 100644
> RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
>  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
>  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
>  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
>  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
>  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
>  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
>  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
>  create mode 160000 RedfishPkg/Library/JsonLib/jansson
>  create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
>  create mode 100644 RedfishPkg/Library/JsonLib/jansson_private_config.h
>  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
>  create mode 100644 RedfishPkg/Library/JsonLib/load.c
>  create mode 100644 RedfishPkg/Library/JsonLib/math.h
>  create mode 100644 RedfishPkg/Library/JsonLib/stdarg.h
>  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
>  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
>  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
>  create mode 100644 RedfishPkg/Library/JsonLib/string.h
>  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
>  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
>  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> 
> --
> 2.17.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68444): https://edk2.groups.io/g/devel/message/68444
Mute This Topic: https://groups.io/mt/78798394/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> gaoliming
> Sent: Tuesday, December 8, 2020 2:40 PM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; 'Michael
> D Kinney' <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> <nickle.wang@hpe.com>; O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> Abner:
>   I have minor comments on the library header file.
> 
> 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include the additional
> header files, such as Uefi.h and BaseLib.h, because the library header file
> doesn't depend on the definitions from BaseLib.
> 2. CrtLib.inf needs to list the required library class: BaseMemoryLib & PrintLib.

OK, I will wait couple days for other comments and address that all together.

Thanks
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > <bounce+27952+68426+4905953+8761045@groups.io> 代表 Abner Chang
> > 发送时间: 2020年12月8日 10:11
> > 收件人: devel@edk2.groups.io
> > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> > <Bret.Barkelew@microsoft.com>; Andrew Fish <afish@apple.com>; Laszlo
> > Ersek <lersek@redhat.com>; Leif Lindholm <leif@nuviainc.com>; Michael
> > D Kinney <michael.d.kinney@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; Nickle Wang <nickle.wang@hpe.com>;
> Peter
> > O'Hanley <peter.ohanley@hpe.com>
> > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > In v4,
> >        - Address review comments
> >        - Seperate CRT functions to a individule library CrtLib under
> >          RedfishPkg.
> >        - Seperate UCS2-UTF8 functions to a individule library
> >          BaseUcs2Utf8Lib under MdeModulePkg.
> >
> > In v3, Add jansson library as the required submoudle in
> >        CiSettings.py for CI test.
> > In v2, JsonLib is moved to under RedfishPkg.
> >
> > edk2 JSON library is based on jansson open source
> > (https://github.com/akheron/jansson) and wrapped as an edk2 library.
> > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > contributed yet) and the edk2 port of libredfish library (not
> > contributed yet) based on DMTF GitHub
> > (https://github.com/DMTF/libredfish).
> >
> > Jansson is licensed under the MIT license(refer to ReadMe.rst under edk2).
> > It is used in production and its API is stable. In UEFI/EDKII
> > environment, Redfish project consumes jansson to achieve JSON
> operations.
> >
> > * Jansson version on edk2: 2.13.1
> >
> > * EDKII jansson library wrapper:
> >    - JsonLib.h:
> >      This is the denifitions of EDKII JSON APIs which are mapped to
> >      jannson funcitons accordingly.
> >
> >    - JanssonJsonLibMapping.h:
> >      This is the wrapper file to map funcitons and definitions used in
> >      native jannson applications to edk2 JsonLib. This avoids the
> >      modifications on native jannson applications to be built under
> >      edk2 environment.
> >
> > *Known issue:
> >   Build fail with jansson/src/load.c, overrride and add code in load.c
> >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> >   The PR is submitted to jansson open source community.
> >   https://github.com/akheron/jansson/pull/558
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> >
> > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > Cc: Andrew Fish <afish@apple.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Nickle Wang <nickle.wang@hpe.com>
> > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> >
> > Abner Chang (6):
> >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> >   edk2: jansson submodule for edk2 JSON library
> >   RedfishPkg/CrtLib: C runtime library
> >   RedfishPkg/library: EDK2 port of jansson library
> >   RedfishPkg: Add EDK2 port of jansson library to build
> >   .pytool: Add required submodule for JsonLib
> >
> >  .gitmodules                                   |    3 +
> >  .pytool/CISettings.py                         |    2 +
> >  ReadMe.rst                                    |    1 +
> >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> >  RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
> >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
> >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
> >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
> >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > +++++++++++++++++
> >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> >  RedfishPkg/RedfishPkg.dec                     |   15 +
> >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> >  34 files changed, 4811 insertions(+)
> >  create mode 100644 RedfishPkg/Include/JanssonJsonMapping.h
> >  create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> >  create mode 100644
> > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> >  create mode 100644
> > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> >  create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
> >  create mode 100644
> > RedfishPkg/Library/JsonLib/jansson_private_config.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/load.c  create mode
> > 100644 RedfishPkg/Library/JsonLib/math.h  create mode 100644
> > RedfishPkg/Library/JsonLib/stdarg.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> >
> > --
> > 2.17.1
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68619): https://edk2.groups.io/g/devel/message/68619
Mute This Topic: https://groups.io/mt/78845733/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Michael D Kinney 3 years, 4 months ago
Abner,

Some questions included below.

Mike


> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Wednesday, December 9, 2020 6:14 PM
> To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew' <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> 
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > gaoliming
> > Sent: Tuesday, December 8, 2020 2:40 PM
> > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > <abner.chang@hpe.com>
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> > Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; 'Michael
> > D Kinney' <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> > Abner:
> >   I have minor comments on the library header file.
> >
> > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include the additional
> > header files, such as Uefi.h and BaseLib.h, because the library header file
> > doesn't depend on the definitions from BaseLib.
> > 2. CrtLib.inf needs to list the required library class: BaseMemoryLib & PrintLib.
> 
> OK, I will wait couple days for other comments and address that all together.
> 
> Thanks
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > <bounce+27952+68426+4905953+8761045@groups.io> 代表 Abner Chang
> > > 发送时间: 2020年12月8日 10:11
> > > 收件人: devel@edk2.groups.io
> > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> > > <Bret.Barkelew@microsoft.com>; Andrew Fish <afish@apple.com>; Laszlo
> > > Ersek <lersek@redhat.com>; Leif Lindholm <leif@nuviainc.com>; Michael
> > > D Kinney <michael.d.kinney@intel.com>; Liming Gao
> > > <gaoliming@byosoft.com.cn>; Nickle Wang <nickle.wang@hpe.com>;
> > Peter
> > > O'Hanley <peter.ohanley@hpe.com>
> > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > In v4,
> > >        - Address review comments
> > >        - Seperate CRT functions to a individule library CrtLib under
> > >          RedfishPkg.
> > >        - Seperate UCS2-UTF8 functions to a individule library
> > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > >
> > > In v3, Add jansson library as the required submoudle in
> > >        CiSettings.py for CI test.
> > > In v2, JsonLib is moved to under RedfishPkg.
> > >
> > > edk2 JSON library is based on jansson open source
> > > (https://github.com/akheron/jansson) and wrapped as an edk2 library.
> > > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > > contributed yet) and the edk2 port of libredfish library (not
> > > contributed yet) based on DMTF GitHub
> > > (https://github.com/DMTF/libredfish).
> > >
> > > Jansson is licensed under the MIT license(refer to ReadMe.rst under edk2).
> > > It is used in production and its API is stable. In UEFI/EDKII
> > > environment, Redfish project consumes jansson to achieve JSON
> > operations.
> > >
> > > * Jansson version on edk2: 2.13.1
> > >
> > > * EDKII jansson library wrapper:
> > >    - JsonLib.h:
> > >      This is the denifitions of EDKII JSON APIs which are mapped to
> > >      jannson funcitons accordingly.
> > >
> > >    - JanssonJsonLibMapping.h:
> > >      This is the wrapper file to map funcitons and definitions used in
> > >      native jannson applications to edk2 JsonLib. This avoids the
> > >      modifications on native jannson applications to be built under
> > >      edk2 environment.

Can you explain the use case for this in more detail?
What are these native jannson applications and why do we need to build them in edk2?
If we have the jannson submodule, why can't these apps just use the standard jannson services?

I ask because this is a new concept for edk2 and I want to make sure it is really required.

> > >
> > > *Known issue:
> > >   Build fail with jansson/src/load.c, overrride and add code in load.c
> > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > >   The PR is submitted to jansson open source community.
> > >   https://github.com/akheron/jansson/pull/558
> > >
> > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > >
> > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > Cc: Andrew Fish <afish@apple.com>
> > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > >
> > > Abner Chang (6):
> > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > >   edk2: jansson submodule for edk2 JSON library
> > >   RedfishPkg/CrtLib: C runtime library
> > >   RedfishPkg/library: EDK2 port of jansson library
> > >   RedfishPkg: Add EDK2 port of jansson library to build
> > >   .pytool: Add required submodule for JsonLib
> > >
> > >  .gitmodules                                   |    3 +
> > >  .pytool/CISettings.py                         |    2 +
> > >  ReadMe.rst                                    |    1 +
> > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > >  RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
> > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
> > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
> > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
> > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > +++++++++++++++++
> > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > >  34 files changed, 4811 insertions(+)
> > >  create mode 100644 RedfishPkg/Include/JanssonJsonMapping.h
> > >  create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > >  create mode 100644
> > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > >  create mode 100644
> > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > >  create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
> > >  create mode 100644
> > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c  create mode
> > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode 100644
> > > RedfishPkg/Library/JsonLib/stdarg.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > >
> > > --
> > > 2.17.1
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> > 
> >
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68621): https://edk2.groups.io/g/devel/message/68621
Mute This Topic: https://groups.io/mt/78845733/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago

> -----Original Message-----
> From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> Sent: Thursday, December 10, 2020 10:33 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> Abner,
> 
> Some questions included below.
> 
> Mike
> 
> 
> > -----Original Message-----
> > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > Sent: Wednesday, December 9, 2020 6:14 PM
> > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > <leif@nuviainc.com>; Kinney, Michael D <michael.d.kinney@intel.com>;
> > Wang, Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > <peter.ohanley@hpe.com>
> > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> >
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > Of gaoliming
> > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > <abner.chang@hpe.com>
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > > Abner:
> > >   I have minor comments on the library header file.
> > >
> > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include the
> > > additional header files, such as Uefi.h and BaseLib.h, because the
> > > library header file doesn't depend on the definitions from BaseLib.
> > > 2. CrtLib.inf needs to list the required library class: BaseMemoryLib &
> PrintLib.
> >
> > OK, I will wait couple days for other comments and address that all
> together.
> >
> > Thanks
> > >
> > > Thanks
> > > Liming
> > > > -----邮件原件-----
> > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表 Abner
> Chang
> > > > 发送时间: 2020年12月8日 10:11
> > > > 收件人: devel@edk2.groups.io
> > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> > > > <Bret.Barkelew@microsoft.com>; Andrew Fish <afish@apple.com>;
> > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > <leif@nuviainc.com>; Michael D Kinney
> > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > <gaoliming@byosoft.com.cn>; Nickle Wang <nickle.wang@hpe.com>;
> > > Peter
> > > > O'Hanley <peter.ohanley@hpe.com>
> > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > In v4,
> > > >        - Address review comments
> > > >        - Seperate CRT functions to a individule library CrtLib under
> > > >          RedfishPkg.
> > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > >
> > > > In v3, Add jansson library as the required submoudle in
> > > >        CiSettings.py for CI test.
> > > > In v2, JsonLib is moved to under RedfishPkg.
> > > >
> > > > edk2 JSON library is based on jansson open source
> > > > (https://github.com/akheron/jansson) and wrapped as an edk2 library.
> > > > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > > > contributed yet) and the edk2 port of libredfish library (not
> > > > contributed yet) based on DMTF GitHub
> > > > (https://github.com/DMTF/libredfish).
> > > >
> > > > Jansson is licensed under the MIT license(refer to ReadMe.rst under
> edk2).
> > > > It is used in production and its API is stable. In UEFI/EDKII
> > > > environment, Redfish project consumes jansson to achieve JSON
> > > operations.
> > > >
> > > > * Jansson version on edk2: 2.13.1
> > > >
> > > > * EDKII jansson library wrapper:
> > > >    - JsonLib.h:
> > > >      This is the denifitions of EDKII JSON APIs which are mapped to
> > > >      jannson funcitons accordingly.
> > > >
> > > >    - JanssonJsonLibMapping.h:
> > > >      This is the wrapper file to map funcitons and definitions used in
> > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > >      modifications on native jannson applications to be built under
> > > >      edk2 environment.
> 
> Can you explain the use case for this in more detail?
> What are these native jannson applications and why do we need to build
> them in edk2?
> If we have the jannson submodule, why can't these apps just use the
> standard jannson services?
> 
> I ask because this is a new concept for edk2 and I want to make sure it is
> really required.

The users of jannson library are LibRedfish open source (https://github.com/DMTF/libredfish) and the Edk2 Redfish features drivers (WIP) to communicate with Redfish service. EDK2 port of Libredfish will be sent for review after this one.
Libredfish use "jansson.h" in its source code and uses the native jansson functions directly. I think most of open source projects use the same way to leverage jansson open source project.
However, "jansson.h" is defined in the source code directory that edk2 module can't refer to it in edk2 metafiles.
Thus we need an wrapper for these jansson applications. That JanssonJsonMapping.h defines the EDK2 style API for mapping native jansson functions. For those edk2 based JSON applications, they can just use edk2 style APIs. Such as the edk2 Redfish feature drivers, those can use the EDK2 coding style compliant API to invoke jansson functions by using JsonLib.h.
For those native jansson applications, we can just use JanssonJsonMapping.h to map the native jansson API to EDK2 style API provided by JsonLib.lib. JanssonJsonMapping.h is not just map the functions, it also gives edk2 style prototype for jansson variables such as json_t. These edk2 style prototypes are used in EDK2 Redfish drivers or other edk2 based application as well.

> 
> > > >
> > > > *Known issue:
> > > >   Build fail with jansson/src/load.c, overrride and add code in load.c
> > > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > > >   The PR is submitted to jansson open source community.
> > > >   https://github.com/akheron/jansson/pull/558
> > > >
> > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > >
> > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > Cc: Andrew Fish <afish@apple.com>
> > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > >
> > > > Abner Chang (6):
> > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > >   edk2: jansson submodule for edk2 JSON library
> > > >   RedfishPkg/CrtLib: C runtime library
> > > >   RedfishPkg/library: EDK2 port of jansson library
> > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > >   .pytool: Add required submodule for JsonLib
> > > >
> > > >  .gitmodules                                   |    3 +
> > > >  .pytool/CISettings.py                         |    2 +
> > > >  ReadMe.rst                                    |    1 +
> > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > >  RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
> > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
> > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
> > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
> > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > +++++++++++++++++
> > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > >  34 files changed, 4811 insertions(+)  create mode 100644
> > > > RedfishPkg/Include/JanssonJsonMapping.h
> > > >  create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > >  create mode 100644
> > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > >  create mode 100644
> > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
> > > >  create mode 100644
> > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c  create mode
> > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode 100644
> > > > RedfishPkg/Library/JsonLib/stdarg.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > >
> > > > --
> > > > 2.17.1
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > 
> > >
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68631): https://edk2.groups.io/g/devel/message/68631
Mute This Topic: https://groups.io/mt/78845733/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Michael D Kinney 3 years, 4 months ago
Abner,

Feedback below.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Abner Chang
> Sent: Wednesday, December 9, 2020 8:02 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; gaoliming@byosoft.com.cn
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew' <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> <nickle.wang@hpe.com>; O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> 
> 
> > -----Original Message-----
> > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > Sent: Thursday, December 10, 2020 10:33 AM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D
> > <michael.d.kinney@intel.com>
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> > Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> > Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > <peter.ohanley@hpe.com>
> > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> > Abner,
> >
> > Some questions included below.
> >
> > Mike
> >
> >
> > > -----Original Message-----
> > > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; Kinney, Michael D <michael.d.kinney@intel.com>;
> > > Wang, Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > <peter.ohanley@hpe.com>
> > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > > Of gaoliming
> > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > > <abner.chang@hpe.com>
> > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > <peter.ohanley@hpe.com>
> > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > > Abner:
> > > >   I have minor comments on the library header file.
> > > >
> > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include the
> > > > additional header files, such as Uefi.h and BaseLib.h, because the
> > > > library header file doesn't depend on the definitions from BaseLib.
> > > > 2. CrtLib.inf needs to list the required library class: BaseMemoryLib &
> > PrintLib.
> > >
> > > OK, I will wait couple days for other comments and address that all
> > together.
> > >
> > > Thanks
> > > >
> > > > Thanks
> > > > Liming
> > > > > -----邮件原件-----
> > > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表 Abner
> > Chang
> > > > > 发送时间: 2020年12月8日 10:11
> > > > > 收件人: devel@edk2.groups.io
> > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish <afish@apple.com>;
> > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > <gaoliming@byosoft.com.cn>; Nickle Wang <nickle.wang@hpe.com>;
> > > > Peter
> > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > In v4,
> > > > >        - Address review comments
> > > > >        - Seperate CRT functions to a individule library CrtLib under
> > > > >          RedfishPkg.
> > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > >
> > > > > In v3, Add jansson library as the required submoudle in
> > > > >        CiSettings.py for CI test.
> > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > >
> > > > > edk2 JSON library is based on jansson open source
> > > > > (https://github.com/akheron/jansson) and wrapped as an edk2 library.
> > > > > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > > > > contributed yet) and the edk2 port of libredfish library (not
> > > > > contributed yet) based on DMTF GitHub
> > > > > (https://github.com/DMTF/libredfish).
> > > > >
> > > > > Jansson is licensed under the MIT license(refer to ReadMe.rst under
> > edk2).
> > > > > It is used in production and its API is stable. In UEFI/EDKII
> > > > > environment, Redfish project consumes jansson to achieve JSON
> > > > operations.
> > > > >
> > > > > * Jansson version on edk2: 2.13.1
> > > > >
> > > > > * EDKII jansson library wrapper:
> > > > >    - JsonLib.h:
> > > > >      This is the denifitions of EDKII JSON APIs which are mapped to
> > > > >      jannson funcitons accordingly.
> > > > >
> > > > >    - JanssonJsonLibMapping.h:
> > > > >      This is the wrapper file to map funcitons and definitions used in
> > > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > > >      modifications on native jannson applications to be built under
> > > > >      edk2 environment.
> >
> > Can you explain the use case for this in more detail?
> > What are these native jannson applications and why do we need to build
> > them in edk2?
> > If we have the jannson submodule, why can't these apps just use the
> > standard jannson services?
> >
> > I ask because this is a new concept for edk2 and I want to make sure it is
> > really required.
> 
> The users of jannson library are LibRedfish open source (https://github.com/DMTF/libredfish) and the Edk2 Redfish features
> drivers (WIP) to communicate with Redfish service. EDK2 port of Libredfish will be sent for review after this one.
> Libredfish use "jansson.h" in its source code and uses the native jansson functions directly. I think most of open source
> projects use the same way to leverage jansson open source project.
> However, "jansson.h" is defined in the source code directory that edk2 module can't refer to it in edk2 metafiles.

Why not?  The package DEC file can list include paths.

For example, the RedFishPkg DEC file currently has the following [Includes] section:

    [Includes]
      Include

I could be updated to:

    [Includes]
      Include
      Library\JsonLib\jansson\src

This would allow libs/modules that want to directly use the jansson services to use

    #include <janson.h>

If you wanted to limit the use of <janson.h> to only libs/modules in the RedfishPkg, then you
could use the private include feature:

    [Includes]
      Include

    [Includes.Common.Private]
      Library\JsonLib\jansson\src

In fact, this exact pattern is used in the UnitTestFrameworkPkg to allow comonponents
to use the standard includes from the cmocka submodule:

    [Includes]
      Library/CmockaLib/cmocka/include

    [Includes.Common.Private]
      PrivateInclude
      Library/CmockaLib/cmocka/include/cmockery


Please evaluate this approach and see of the JassonJsoonMapping.h file can be removed.

> Thus we need an wrapper for these jansson applications. That JanssonJsonMapping.h defines the EDK2 style API for mapping
> native jansson functions. For those edk2 based JSON applications, they can just use edk2 style APIs. Such as the edk2
> Redfish feature drivers, those can use the EDK2 coding style compliant API to invoke jansson functions by using JsonLib.h.
> For those native jansson applications, we can just use JanssonJsonMapping.h to map the native jansson API to EDK2 style
> API provided by JsonLib.lib. JanssonJsonMapping.h is not just map the functions, it also gives edk2 style prototype for
> jansson variables such as json_t. These edk2 style prototypes are used in EDK2 Redfish drivers or other edk2 based
> application as well.
> 
> >
> > > > >
> > > > > *Known issue:
> > > > >   Build fail with jansson/src/load.c, overrride and add code in load.c
> > > > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > > > >   The PR is submitted to jansson open source community.
> > > > >   https://github.com/akheron/jansson/pull/558
> > > > >
> > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > >
> > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > >
> > > > > Abner Chang (6):
> > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > > >   edk2: jansson submodule for edk2 JSON library
> > > > >   RedfishPkg/CrtLib: C runtime library
> > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > >   .pytool: Add required submodule for JsonLib
> > > > >
> > > > >  .gitmodules                                   |    3 +
> > > > >  .pytool/CISettings.py                         |    2 +
> > > > >  ReadMe.rst                                    |    1 +
> > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
> > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
> > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
> > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
> > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > +++++++++++++++++
> > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > >  34 files changed, 4811 insertions(+)  create mode 100644
> > > > > RedfishPkg/Include/JanssonJsonMapping.h
> > > > >  create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > > >  create mode 100644
> > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > >  create mode 100644
> > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h
> > > > >  create mode 100644
> > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c  create mode
> > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode 100644
> > > > > RedfishPkg/Library/JsonLib/stdarg.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> > > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > > >
> > > > > --
> > > > > 2.17.1
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68721): https://edk2.groups.io/g/devel/message/68721
Mute This Topic: https://groups.io/mt/78845733/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago
V6 Sent, JanssonJsonMapping.h is removed.

Thanks
Abner
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Michael D Kinney
> Sent: Saturday, December 12, 2020 3:23 AM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>; gaoliming@byosoft.com.cn; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> Abner,
> 
> Feedback below.
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Abner
> > Chang
> > Sent: Wednesday, December 9, 2020 8:02 PM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> >
> >
> > > -----Original Message-----
> > > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > > Sent: Thursday, December 10, 2020 10:33 AM
> > > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D
> > > <michael.d.kinney@intel.com>
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > > Abner,
> > >
> > > Some questions included below.
> > >
> > > Mike
> > >
> > >
> > > > -----Original Message-----
> > > > From: Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> > > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> Lindholm'
> > > > <leif@nuviainc.com>; Kinney, Michael D
> > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > <peter.ohanley@hpe.com>
> > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > > > Behalf Of gaoliming
> > > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > > > <abner.chang@hpe.com>
> > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > <peter.ohanley@hpe.com>
> > > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > > Abner:
> > > > >   I have minor comments on the library header file.
> > > > >
> > > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include
> > > > > the additional header files, such as Uefi.h and BaseLib.h,
> > > > > because the library header file doesn't depend on the definitions
> from BaseLib.
> > > > > 2. CrtLib.inf needs to list the required library class:
> > > > > BaseMemoryLib &
> > > PrintLib.
> > > >
> > > > OK, I will wait couple days for other comments and address that
> > > > all
> > > together.
> > > >
> > > > Thanks
> > > > >
> > > > > Thanks
> > > > > Liming
> > > > > > -----邮件原件-----
> > > > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表 Abner
> > > Chang
> > > > > > 发送时间: 2020年12月8日 10:11
> > > > > > 收件人: devel@edk2.groups.io
> > > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> > > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish <afish@apple.com>;
> > > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > > <gaoliming@byosoft.com.cn>; Nickle Wang
> <nickle.wang@hpe.com>;
> > > > > Peter
> > > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > >
> > > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > > In v4,
> > > > > >        - Address review comments
> > > > > >        - Seperate CRT functions to a individule library CrtLib under
> > > > > >          RedfishPkg.
> > > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > > >
> > > > > > In v3, Add jansson library as the required submoudle in
> > > > > >        CiSettings.py for CI test.
> > > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > > >
> > > > > > edk2 JSON library is based on jansson open source
> > > > > > (https://github.com/akheron/jansson) and wrapped as an edk2
> library.
> > > > > > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > > > > > contributed yet) and the edk2 port of libredfish library (not
> > > > > > contributed yet) based on DMTF GitHub
> > > > > > (https://github.com/DMTF/libredfish).
> > > > > >
> > > > > > Jansson is licensed under the MIT license(refer to ReadMe.rst
> > > > > > under
> > > edk2).
> > > > > > It is used in production and its API is stable. In UEFI/EDKII
> > > > > > environment, Redfish project consumes jansson to achieve JSON
> > > > > operations.
> > > > > >
> > > > > > * Jansson version on edk2: 2.13.1
> > > > > >
> > > > > > * EDKII jansson library wrapper:
> > > > > >    - JsonLib.h:
> > > > > >      This is the denifitions of EDKII JSON APIs which are mapped to
> > > > > >      jannson funcitons accordingly.
> > > > > >
> > > > > >    - JanssonJsonLibMapping.h:
> > > > > >      This is the wrapper file to map funcitons and definitions used in
> > > > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > > > >      modifications on native jannson applications to be built under
> > > > > >      edk2 environment.
> > >
> > > Can you explain the use case for this in more detail?
> > > What are these native jannson applications and why do we need to
> > > build them in edk2?
> > > If we have the jannson submodule, why can't these apps just use the
> > > standard jannson services?
> > >
> > > I ask because this is a new concept for edk2 and I want to make sure
> > > it is really required.
> >
> > The users of jannson library are LibRedfish open source
> > (https://github.com/DMTF/libredfish) and the Edk2 Redfish features
> drivers (WIP) to communicate with Redfish service. EDK2 port of Libredfish
> will be sent for review after this one.
> > Libredfish use "jansson.h" in its source code and uses the native
> > jansson functions directly. I think most of open source projects use the
> same way to leverage jansson open source project.
> > However, "jansson.h" is defined in the source code directory that edk2
> module can't refer to it in edk2 metafiles.
> 
> Why not?  The package DEC file can list include paths.
> 
> For example, the RedFishPkg DEC file currently has the following [Includes]
> section:
> 
>     [Includes]
>       Include
> 
> I could be updated to:
> 
>     [Includes]
>       Include
>       Library\JsonLib\jansson\src
> 
> This would allow libs/modules that want to directly use the jansson services
> to use
> 
>     #include <janson.h>
> 
> If you wanted to limit the use of <janson.h> to only libs/modules in the
> RedfishPkg, then you could use the private include feature:
> 
>     [Includes]
>       Include
> 
>     [Includes.Common.Private]
>       Library\JsonLib\jansson\src
> 
> In fact, this exact pattern is used in the UnitTestFrameworkPkg to allow
> comonponents to use the standard includes from the cmocka submodule:
> 
>     [Includes]
>       Library/CmockaLib/cmocka/include
> 
>     [Includes.Common.Private]
>       PrivateInclude
>       Library/CmockaLib/cmocka/include/cmockery
> 
> 
> Please evaluate this approach and see of the JassonJsoonMapping.h file can
> be removed.
> 
> > Thus we need an wrapper for these jansson applications. That
> > JanssonJsonMapping.h defines the EDK2 style API for mapping native
> > jansson functions. For those edk2 based JSON applications, they can just
> use edk2 style APIs. Such as the edk2 Redfish feature drivers, those can use
> the EDK2 coding style compliant API to invoke jansson functions by using
> JsonLib.h.
> > For those native jansson applications, we can just use
> > JanssonJsonMapping.h to map the native jansson API to EDK2 style API
> > provided by JsonLib.lib. JanssonJsonMapping.h is not just map the
> > functions, it also gives edk2 style prototype for jansson variables such as
> json_t. These edk2 style prototypes are used in EDK2 Redfish drivers or other
> edk2 based application as well.
> >
> > >
> > > > > >
> > > > > > *Known issue:
> > > > > >   Build fail with jansson/src/load.c, overrride and add code in load.c
> > > > > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > > > > >   The PR is submitted to jansson open source community.
> > > > > >   https://github.com/akheron/jansson/pull/558
> > > > > >
> > > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > > >
> > > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > > >
> > > > > > Abner Chang (6):
> > > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > > > >   edk2: jansson submodule for edk2 JSON library
> > > > > >   RedfishPkg/CrtLib: C runtime library
> > > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > > >   .pytool: Add required submodule for JsonLib
> > > > > >
> > > > > >  .gitmodules                                   |    3 +
> > > > > >  .pytool/CISettings.py                         |    2 +
> > > > > >  ReadMe.rst                                    |    1 +
> > > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
> > > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
> > > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
> > > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
> > > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > > +++++++++++++++++
> > > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > > >  34 files changed, 4811 insertions(+)  create mode 100644
> > > > > > RedfishPkg/Include/JanssonJsonMapping.h
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/JsonLib/jansson_config.h
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c  create
> > > > > > mode
> > > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode 100644
> > > > > > RedfishPkg/Library/JsonLib/stdarg.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > > > >
> > > > > > --
> > > > > > 2.17.1
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68794): https://edk2.groups.io/g/devel/message/68794
Mute This Topic: https://groups.io/mt/78845733/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Michael D Kinney
> Sent: Saturday, December 12, 2020 3:23 AM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>; gaoliming@byosoft.com.cn; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> Abner,
> 
> Feedback below.
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Abner
> > Chang
> > Sent: Wednesday, December 9, 2020 8:02 PM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> >
> >
> > > -----Original Message-----
> > > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > > Sent: Thursday, December 10, 2020 10:33 AM
> > > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D
> > > <michael.d.kinney@intel.com>
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > > Abner,
> > >
> > > Some questions included below.
> > >
> > > Mike
> > >
> > >
> > > > -----Original Message-----
> > > > From: Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> > > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> Lindholm'
> > > > <leif@nuviainc.com>; Kinney, Michael D
> > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > <peter.ohanley@hpe.com>
> > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > > > Behalf Of gaoliming
> > > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > > > <abner.chang@hpe.com>
> > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > <peter.ohanley@hpe.com>
> > > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > > Abner:
> > > > >   I have minor comments on the library header file.
> > > > >
> > > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include
> > > > > the additional header files, such as Uefi.h and BaseLib.h,
> > > > > because the library header file doesn't depend on the definitions
> from BaseLib.
> > > > > 2. CrtLib.inf needs to list the required library class:
> > > > > BaseMemoryLib &
> > > PrintLib.
> > > >
> > > > OK, I will wait couple days for other comments and address that
> > > > all
> > > together.
> > > >
> > > > Thanks
> > > > >
> > > > > Thanks
> > > > > Liming
> > > > > > -----邮件原件-----
> > > > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表 Abner
> > > Chang
> > > > > > 发送时间: 2020年12月8日 10:11
> > > > > > 收件人: devel@edk2.groups.io
> > > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> > > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish <afish@apple.com>;
> > > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > > <gaoliming@byosoft.com.cn>; Nickle Wang
> <nickle.wang@hpe.com>;
> > > > > Peter
> > > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > >
> > > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > > In v4,
> > > > > >        - Address review comments
> > > > > >        - Seperate CRT functions to a individule library CrtLib under
> > > > > >          RedfishPkg.
> > > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > > >
> > > > > > In v3, Add jansson library as the required submoudle in
> > > > > >        CiSettings.py for CI test.
> > > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > > >
> > > > > > edk2 JSON library is based on jansson open source
> > > > > > (https://github.com/akheron/jansson) and wrapped as an edk2
> library.
> > > > > > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > > > > > contributed yet) and the edk2 port of libredfish library (not
> > > > > > contributed yet) based on DMTF GitHub
> > > > > > (https://github.com/DMTF/libredfish).
> > > > > >
> > > > > > Jansson is licensed under the MIT license(refer to ReadMe.rst
> > > > > > under
> > > edk2).
> > > > > > It is used in production and its API is stable. In UEFI/EDKII
> > > > > > environment, Redfish project consumes jansson to achieve JSON
> > > > > operations.
> > > > > >
> > > > > > * Jansson version on edk2: 2.13.1
> > > > > >
> > > > > > * EDKII jansson library wrapper:
> > > > > >    - JsonLib.h:
> > > > > >      This is the denifitions of EDKII JSON APIs which are mapped to
> > > > > >      jannson funcitons accordingly.
> > > > > >
> > > > > >    - JanssonJsonLibMapping.h:
> > > > > >      This is the wrapper file to map funcitons and definitions used in
> > > > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > > > >      modifications on native jannson applications to be built under
> > > > > >      edk2 environment.
> > >
> > > Can you explain the use case for this in more detail?
> > > What are these native jannson applications and why do we need to
> > > build them in edk2?
> > > If we have the jannson submodule, why can't these apps just use the
> > > standard jannson services?
> > >
> > > I ask because this is a new concept for edk2 and I want to make sure
> > > it is really required.
> >
> > The users of jannson library are LibRedfish open source
> > (https://github.com/DMTF/libredfish) and the Edk2 Redfish features
> drivers (WIP) to communicate with Redfish service. EDK2 port of Libredfish
> will be sent for review after this one.
> > Libredfish use "jansson.h" in its source code and uses the native
> > jansson functions directly. I think most of open source projects use the
> same way to leverage jansson open source project.
> > However, "jansson.h" is defined in the source code directory that edk2
> module can't refer to it in edk2 metafiles.
> 
> Why not?  The package DEC file can list include paths.
Mike, I thought we are recommended to not referring to the header file in the source code or the private header files in the module. My memory may out of date but I remember that the package's "Include/" directory should contains all public headers files that are exposed to other packages or this package. Is this still valid in the edk2 driver writer's guide? I can't find any similar sentence which restrict to use the header files out of "Include/" directory in UEFI driver writer's guide.
But any way, that's why we use a wrapper  header file and put it under Include/.

> 
> For example, the RedFishPkg DEC file currently has the following [Includes]
> section:
> 
>     [Includes]
>       Include
> 
> I could be updated to:
> 
>     [Includes]
>       Include
>       Library\JsonLib\jansson\src
> 
> This would allow libs/modules that want to directly use the jansson services
> to use
> 
>     #include <janson.h>
> 
> If you wanted to limit the use of <janson.h> to only libs/modules in the
> RedfishPkg, then you could use the private include feature:
> 
>     [Includes]
>       Include
> 
>     [Includes.Common.Private]
>       Library\JsonLib\jansson\src
> 
> In fact, this exact pattern is used in the UnitTestFrameworkPkg to allow
> comonponents to use the standard includes from the cmocka submodule:
> 
>     [Includes]
>       Library/CmockaLib/cmocka/include
> 
>     [Includes.Common.Private]
>       PrivateInclude
>       Library/CmockaLib/cmocka/include/cmockery
> 
> 
> Please evaluate this approach and see of the JassonJsoonMapping.h file can
> be removed.
> 
> > Thus we need an wrapper for these jansson applications. That
> > JanssonJsonMapping.h defines the EDK2 style API for mapping native
> > jansson functions. For those edk2 based JSON applications, they can just
> use edk2 style APIs. Such as the edk2 Redfish feature drivers, those can use
> the EDK2 coding style compliant API to invoke jansson functions by using
> JsonLib.h.
> > For those native jansson applications, we can just use
> > JanssonJsonMapping.h to map the native jansson API to EDK2 style API
> > provided by JsonLib.lib. JanssonJsonMapping.h is not just map the
> > functions, it also gives edk2 style prototype for jansson variables such as
> json_t. These edk2 style prototypes are used in EDK2 Redfish drivers or other
> edk2 based application as well.
> >
> > >
> > > > > >
> > > > > > *Known issue:
> > > > > >   Build fail with jansson/src/load.c, overrride and add code in load.c
> > > > > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > > > > >   The PR is submitted to jansson open source community.
> > > > > >   https://github.com/akheron/jansson/pull/558
> > > > > >
> > > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > > >
> > > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > > >
> > > > > > Abner Chang (6):
> > > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > > > >   edk2: jansson submodule for edk2 JSON library
> > > > > >   RedfishPkg/CrtLib: C runtime library
> > > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > > >   .pytool: Add required submodule for JsonLib
> > > > > >
> > > > > >  .gitmodules                                   |    3 +
> > > > > >  .pytool/CISettings.py                         |    2 +
> > > > > >  ReadMe.rst                                    |    1 +
> > > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768 ++++++++++++
> > > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417 +++++++
> > > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705 +++++++++++
> > > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961 ++++++++++++++
> > > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > > +++++++++++++++++
> > > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > > >  34 files changed, 4811 insertions(+)  create mode 100644
> > > > > > RedfishPkg/Include/JanssonJsonMapping.h
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/JsonLib/jansson_config.h
> > > > > >  create mode 100644
> > > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c  create
> > > > > > mode
> > > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode 100644
> > > > > > RedfishPkg/Library/JsonLib/stdarg.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > > > >
> > > > > > --
> > > > > > 2.17.1
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68741): https://edk2.groups.io/g/devel/message/68741
Mute This Topic: https://groups.io/mt/78845733/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by gaoliming 3 years, 4 months ago
Abner:

> -----邮件原件-----
> 发件人: bounce+27952+68741+4905953+8761045@groups.io
> <bounce+27952+68741+4905953+8761045@groups.io> 代表 Abner Chang
> 发送时间: 2020年12月13日 12:02
> 收件人: devel@edk2.groups.io; michael.d.kinney@intel.com;
> gaoliming@byosoft.com.cn
> 抄送: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> 主题: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> 
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Michael D Kinney
> > Sent: Saturday, December 12, 2020 3:23 AM
> > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > <abner.chang@hpe.com>; gaoliming@byosoft.com.cn; Kinney, Michael D
> > <michael.d.kinney@intel.com>
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> 'Laszlo
> > Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> > Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > <peter.ohanley@hpe.com>
> > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> > Abner,
> >
> > Feedback below.
> >
> > Mike
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Abner
> > > Chang
> > > Sent: Wednesday, December 9, 2020 8:02 PM
> > > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > > devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > > > Sent: Thursday, December 10, 2020 10:33 AM
> > > > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D
> > > > <michael.d.kinney@intel.com>
> > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > > Abner,
> > > >
> > > > Some questions included below.
> > > >
> > > > Mike
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Chang, Abner (HPS SW/FW Technologist)
> > <abner.chang@hpe.com>
> > > > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > Lindholm'
> > > > > <leif@nuviainc.com>; Kinney, Michael D
> > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > <peter.ohanley@hpe.com>
> > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > > > > Behalf Of gaoliming
> > > > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > > > > <abner.chang@hpe.com>
> > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> <afish@apple.com>;
> > > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > <peter.ohanley@hpe.com>
> > > > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > >
> > > > > > Abner:
> > > > > >   I have minor comments on the library header file.
> > > > > >
> > > > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to include
> > > > > > the additional header files, such as Uefi.h and BaseLib.h,
> > > > > > because the library header file doesn't depend on the definitions
> > from BaseLib.
> > > > > > 2. CrtLib.inf needs to list the required library class:
> > > > > > BaseMemoryLib &
> > > > PrintLib.
> > > > >
> > > > > OK, I will wait couple days for other comments and address that
> > > > > all
> > > > together.
> > > > >
> > > > > Thanks
> > > > > >
> > > > > > Thanks
> > > > > > Liming
> > > > > > > -----邮件原件-----
> > > > > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表
> Abner
> > > > Chang
> > > > > > > 发送时间: 2020年12月8日 10:11
> > > > > > > 收件人: devel@edk2.groups.io
> > > > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> > > > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish
> <afish@apple.com>;
> > > > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > > > <gaoliming@byosoft.com.cn>; Nickle Wang
> > <nickle.wang@hpe.com>;
> > > > > > Peter
> > > > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > >
> > > > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > > > In v4,
> > > > > > >        - Address review comments
> > > > > > >        - Seperate CRT functions to a individule library CrtLib
> under
> > > > > > >          RedfishPkg.
> > > > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > > > >
> > > > > > > In v3, Add jansson library as the required submoudle in
> > > > > > >        CiSettings.py for CI test.
> > > > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > > > >
> > > > > > > edk2 JSON library is based on jansson open source
> > > > > > > (https://github.com/akheron/jansson) and wrapped as an edk2
> > library.
> > > > > > > edk2 JsonLib will be used by edk2 Redfish feature drivers (not
> > > > > > > contributed yet) and the edk2 port of libredfish library (not
> > > > > > > contributed yet) based on DMTF GitHub
> > > > > > > (https://github.com/DMTF/libredfish).
> > > > > > >
> > > > > > > Jansson is licensed under the MIT license(refer to ReadMe.rst
> > > > > > > under
> > > > edk2).
> > > > > > > It is used in production and its API is stable. In UEFI/EDKII
> > > > > > > environment, Redfish project consumes jansson to achieve JSON
> > > > > > operations.
> > > > > > >
> > > > > > > * Jansson version on edk2: 2.13.1
> > > > > > >
> > > > > > > * EDKII jansson library wrapper:
> > > > > > >    - JsonLib.h:
> > > > > > >      This is the denifitions of EDKII JSON APIs which are mapped
> to
> > > > > > >      jannson funcitons accordingly.
> > > > > > >
> > > > > > >    - JanssonJsonLibMapping.h:
> > > > > > >      This is the wrapper file to map funcitons and definitions
> used in
> > > > > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > > > > >      modifications on native jannson applications to be built
> under
> > > > > > >      edk2 environment.
> > > >
> > > > Can you explain the use case for this in more detail?
> > > > What are these native jannson applications and why do we need to
> > > > build them in edk2?
> > > > If we have the jannson submodule, why can't these apps just use the
> > > > standard jannson services?
> > > >
> > > > I ask because this is a new concept for edk2 and I want to make sure
> > > > it is really required.
> > >
> > > The users of jannson library are LibRedfish open source
> > > (https://github.com/DMTF/libredfish) and the Edk2 Redfish features
> > drivers (WIP) to communicate with Redfish service. EDK2 port of Libredfish
> > will be sent for review after this one.
> > > Libredfish use "jansson.h" in its source code and uses the native
> > > jansson functions directly. I think most of open source projects use the
> > same way to leverage jansson open source project.
> > > However, "jansson.h" is defined in the source code directory that edk2
> > module can't refer to it in edk2 metafiles.
> >
> > Why not?  The package DEC file can list include paths.
> Mike, I thought we are recommended to not referring to the header file in the
> source code or the private header files in the module. My memory may out of
> date but I remember that the package's "Include/" directory should contains
> all public headers files that are exposed to other packages or this package. Is
> this still valid in the edk2 driver writer's guide? I can't find any similar
> sentence which restrict to use the header files out of "Include/" directory in
> UEFI driver writer's guide.
> But any way, that's why we use a wrapper  header file and put it under
> Include/.
> 
This is true for the normal module. But, submodule code is the different. 
Submodule code is in module directory. To access its header file, its directory is 
Required to be specified in [Includes] section of Package.dec file. 

Thanks
Liming
> >
> > For example, the RedFishPkg DEC file currently has the following [Includes]
> > section:
> >
> >     [Includes]
> >       Include
> >
> > I could be updated to:
> >
> >     [Includes]
> >       Include
> >       Library\JsonLib\jansson\src
> >
> > This would allow libs/modules that want to directly use the jansson services
> > to use
> >
> >     #include <janson.h>
> >
> > If you wanted to limit the use of <janson.h> to only libs/modules in the
> > RedfishPkg, then you could use the private include feature:
> >
> >     [Includes]
> >       Include
> >
> >     [Includes.Common.Private]
> >       Library\JsonLib\jansson\src
> >
> > In fact, this exact pattern is used in the UnitTestFrameworkPkg to allow
> > comonponents to use the standard includes from the cmocka submodule:
> >
> >     [Includes]
> >       Library/CmockaLib/cmocka/include
> >
> >     [Includes.Common.Private]
> >       PrivateInclude
> >       Library/CmockaLib/cmocka/include/cmockery
> >
> >
> > Please evaluate this approach and see of the JassonJsoonMapping.h file can
> > be removed.
> >
> > > Thus we need an wrapper for these jansson applications. That
> > > JanssonJsonMapping.h defines the EDK2 style API for mapping native
> > > jansson functions. For those edk2 based JSON applications, they can just
> > use edk2 style APIs. Such as the edk2 Redfish feature drivers, those can use
> > the EDK2 coding style compliant API to invoke jansson functions by using
> > JsonLib.h.
> > > For those native jansson applications, we can just use
> > > JanssonJsonMapping.h to map the native jansson API to EDK2 style API
> > > provided by JsonLib.lib. JanssonJsonMapping.h is not just map the
> > > functions, it also gives edk2 style prototype for jansson variables such as
> > json_t. These edk2 style prototypes are used in EDK2 Redfish drivers or
> other
> > edk2 based application as well.
> > >
> > > >
> > > > > > >
> > > > > > > *Known issue:
> > > > > > >   Build fail with jansson/src/load.c, overrride and add code in
> load.c
> > > > > > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > > > > > >   The PR is submitted to jansson open source community.
> > > > > > >   https://github.com/akheron/jansson/pull/558
> > > > > > >
> > > > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > > > >
> > > > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > > > >
> > > > > > > Abner Chang (6):
> > > > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > > > > >   edk2: jansson submodule for edk2 JSON library
> > > > > > >   RedfishPkg/CrtLib: C runtime library
> > > > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > > > >   .pytool: Add required submodule for JsonLib
> > > > > > >
> > > > > > >  .gitmodules                                   |    3 +
> > > > > > >  .pytool/CISettings.py                         |    2 +
> > > > > > >  ReadMe.rst                                    |    1
> +
> > > > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768
> ++++++++++++
> > > > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417
> +++++++
> > > > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705
> +++++++++++
> > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961
> ++++++++++++++
> > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > > > +++++++++++++++++
> > > > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > > > >  34 files changed, 4811 insertions(+)  create mode 100644
> > > > > > > RedfishPkg/Include/JanssonJsonMapping.h
> > > > > > >  create mode 100644
> > > > > > > RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > > > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > > > > >  create mode 100644
> > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > > > >  create mode 100644
> > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > > > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > > > > >  create mode 100644
> > > > > > > RedfishPkg/Library/JsonLib/jansson_config.h
> > > > > > >  create mode 100644
> > > > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c  create
> > > > > > > mode
> > > > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode 100644
> > > > > > > RedfishPkg/Library/JsonLib/stdarg.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > > > > >
> > > > > > > --
> > > > > > > 2.17.1
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68745): https://edk2.groups.io/g/devel/message/68745
Mute This Topic: https://groups.io/mt/78941669/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> gaoliming
> Sent: Monday, December 14, 2020 9:30 AM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>; michael.d.kinney@intel.com
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> Abner:
> 
> > -----邮件原件-----
> > 发件人: bounce+27952+68741+4905953+8761045@groups.io
> > <bounce+27952+68741+4905953+8761045@groups.io> 代表 Abner Chang
> > 发送时间: 2020年12月13日 12:02
> > 收件人: devel@edk2.groups.io; michael.d.kinney@intel.com;
> > gaoliming@byosoft.com.cn
> > 抄送: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > 主题: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> >
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > Of Michael D Kinney
> > > Sent: Saturday, December 12, 2020 3:23 AM
> > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > <abner.chang@hpe.com>; gaoliming@byosoft.com.cn; Kinney, Michael D
> > > <michael.d.kinney@intel.com>
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > 'Laszlo
> > > Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>;
> > > Wang, Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > <peter.ohanley@hpe.com>
> > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > > Abner,
> > >
> > > Feedback below.
> > >
> > > Mike
> > >
> > > > -----Original Message-----
> > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > > Abner Chang
> > > > Sent: Wednesday, December 9, 2020 8:02 PM
> > > > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> Lindholm'
> > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > > > > Sent: Thursday, December 10, 2020 10:33 AM
> > > > > To: Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>;
> > > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael
> > > > > D <michael.d.kinney@intel.com>
> > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > <peter.ohanley@hpe.com>
> > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > > Abner,
> > > > >
> > > > > Some questions included below.
> > > > >
> > > > > Mike
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Chang, Abner (HPS SW/FW Technologist)
> > > <abner.chang@hpe.com>
> > > > > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > > > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > > Lindholm'
> > > > > > <leif@nuviainc.com>; Kinney, Michael D
> > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > <peter.ohanley@hpe.com>
> > > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > >
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > > > > > Behalf Of gaoliming
> > > > > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW
> > > > > > > Technologist) <abner.chang@hpe.com>
> > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > <afish@apple.com>;
> > > > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > <peter.ohanley@hpe.com>
> > > > > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > >
> > > > > > > Abner:
> > > > > > >   I have minor comments on the library header file.
> > > > > > >
> > > > > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to
> > > > > > > include the additional header files, such as Uefi.h and
> > > > > > > BaseLib.h, because the library header file doesn't depend on
> > > > > > > the definitions
> > > from BaseLib.
> > > > > > > 2. CrtLib.inf needs to list the required library class:
> > > > > > > BaseMemoryLib &
> > > > > PrintLib.
> > > > > >
> > > > > > OK, I will wait couple days for other comments and address
> > > > > > that all
> > > > > together.
> > > > > >
> > > > > > Thanks
> > > > > > >
> > > > > > > Thanks
> > > > > > > Liming
> > > > > > > > -----邮件原件-----
> > > > > > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表
> > Abner
> > > > > Chang
> > > > > > > > 发送时间: 2020年12月8日 10:11
> > > > > > > > 收件人: devel@edk2.groups.io
> > > > > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret
> Barkelew
> > > > > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish
> > <afish@apple.com>;
> > > > > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > > > > <gaoliming@byosoft.com.cn>; Nickle Wang
> > > <nickle.wang@hpe.com>;
> > > > > > > Peter
> > > > > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > >
> > > > > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > > > > In v4,
> > > > > > > >        - Address review comments
> > > > > > > >        - Seperate CRT functions to a individule library
> > > > > > > > CrtLib
> > under
> > > > > > > >          RedfishPkg.
> > > > > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > > > > >
> > > > > > > > In v3, Add jansson library as the required submoudle in
> > > > > > > >        CiSettings.py for CI test.
> > > > > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > > > > >
> > > > > > > > edk2 JSON library is based on jansson open source
> > > > > > > > (https://github.com/akheron/jansson) and wrapped as an
> > > > > > > > edk2
> > > library.
> > > > > > > > edk2 JsonLib will be used by edk2 Redfish feature drivers
> > > > > > > > (not contributed yet) and the edk2 port of libredfish
> > > > > > > > library (not contributed yet) based on DMTF GitHub
> > > > > > > > (https://github.com/DMTF/libredfish).
> > > > > > > >
> > > > > > > > Jansson is licensed under the MIT license(refer to
> > > > > > > > ReadMe.rst under
> > > > > edk2).
> > > > > > > > It is used in production and its API is stable. In
> > > > > > > > UEFI/EDKII environment, Redfish project consumes jansson
> > > > > > > > to achieve JSON
> > > > > > > operations.
> > > > > > > >
> > > > > > > > * Jansson version on edk2: 2.13.1
> > > > > > > >
> > > > > > > > * EDKII jansson library wrapper:
> > > > > > > >    - JsonLib.h:
> > > > > > > >      This is the denifitions of EDKII JSON APIs which are
> > > > > > > > mapped
> > to
> > > > > > > >      jannson funcitons accordingly.
> > > > > > > >
> > > > > > > >    - JanssonJsonLibMapping.h:
> > > > > > > >      This is the wrapper file to map funcitons and
> > > > > > > > definitions
> > used in
> > > > > > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > > > > > >      modifications on native jannson applications to be
> > > > > > > > built
> > under
> > > > > > > >      edk2 environment.
> > > > >
> > > > > Can you explain the use case for this in more detail?
> > > > > What are these native jannson applications and why do we need to
> > > > > build them in edk2?
> > > > > If we have the jannson submodule, why can't these apps just use
> > > > > the standard jannson services?
> > > > >
> > > > > I ask because this is a new concept for edk2 and I want to make
> > > > > sure it is really required.
> > > >
> > > > The users of jannson library are LibRedfish open source
> > > > (https://github.com/DMTF/libredfish) and the Edk2 Redfish features
> > > drivers (WIP) to communicate with Redfish service. EDK2 port of
> > > Libredfish will be sent for review after this one.
> > > > Libredfish use "jansson.h" in its source code and uses the native
> > > > jansson functions directly. I think most of open source projects
> > > > use the
> > > same way to leverage jansson open source project.
> > > > However, "jansson.h" is defined in the source code directory that
> > > > edk2
> > > module can't refer to it in edk2 metafiles.
> > >
> > > Why not?  The package DEC file can list include paths.
> > Mike, I thought we are recommended to not referring to the header file
> > in the source code or the private header files in the module. My
> > memory may out of date but I remember that the package's "Include/"
> > directory should contains all public headers files that are exposed to
> > other packages or this package. Is this still valid in the edk2 driver
> > writer's guide? I can't find any similar sentence which restrict to
> > use the header files out of "Include/" directory in UEFI driver writer's guide.
> > But any way, that's why we use a wrapper  header file and put it under
> > Include/.
> >
> This is true for the normal module. But, submodule code is the different.
> Submodule code is in module directory. To access its header file, its directory
> is Required to be specified in [Includes] section of Package.dec file.

Liming,  do we mention this special usage in edk2 module writer's guide? I still can see in 2.1.2, it says 
"Each package has a unified directory structure that separate the different source files.
 The root directories in each package are: Include, Library, Application and Drivers.
 The include directory contains all public header files that are exposed by this package and are used by this package and other packages..." 

However, this spec is kept at v0.7 since 2010 and was converted to GitBook in 2018.
That is convenient if we are allowed to use header files from other source code for the open source project.

Thanks

> 
> Thanks
> Liming
> > >
> > > For example, the RedFishPkg DEC file currently has the following
> > > [Includes]
> > > section:
> > >
> > >     [Includes]
> > >       Include
> > >
> > > I could be updated to:
> > >
> > >     [Includes]
> > >       Include
> > >       Library\JsonLib\jansson\src
> > >
> > > This would allow libs/modules that want to directly use the jansson
> > > services to use
> > >
> > >     #include <janson.h>
> > >
> > > If you wanted to limit the use of <janson.h> to only libs/modules in
> > > the RedfishPkg, then you could use the private include feature:
> > >
> > >     [Includes]
> > >       Include
> > >
> > >     [Includes.Common.Private]
> > >       Library\JsonLib\jansson\src
> > >
> > > In fact, this exact pattern is used in the UnitTestFrameworkPkg to
> > > allow comonponents to use the standard includes from the cmocka
> submodule:
> > >
> > >     [Includes]
> > >       Library/CmockaLib/cmocka/include
> > >
> > >     [Includes.Common.Private]
> > >       PrivateInclude
> > >       Library/CmockaLib/cmocka/include/cmockery
> > >
> > >
> > > Please evaluate this approach and see of the JassonJsoonMapping.h
> > > file can be removed.
> > >
> > > > Thus we need an wrapper for these jansson applications. That
> > > > JanssonJsonMapping.h defines the EDK2 style API for mapping native
> > > > jansson functions. For those edk2 based JSON applications, they
> > > > can just
> > > use edk2 style APIs. Such as the edk2 Redfish feature drivers, those
> > > can use the EDK2 coding style compliant API to invoke jansson
> > > functions by using JsonLib.h.
> > > > For those native jansson applications, we can just use
> > > > JanssonJsonMapping.h to map the native jansson API to EDK2 style
> > > > API provided by JsonLib.lib. JanssonJsonMapping.h is not just map
> > > > the functions, it also gives edk2 style prototype for jansson
> > > > variables such as
> > > json_t. These edk2 style prototypes are used in EDK2 Redfish drivers
> > > or
> > other
> > > edk2 based application as well.
> > > >
> > > > >
> > > > > > > >
> > > > > > > > *Known issue:
> > > > > > > >   Build fail with jansson/src/load.c, overrride and add
> > > > > > > > code in
> > load.c
> > > > > > > >   to conditionally use stdin according to HAVE_UNISTD_H macro.
> > > > > > > >   The PR is submitted to jansson open source community.
> > > > > > > >   https://github.com/akheron/jansson/pull/558
> > > > > > > >
> > > > > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > > > > >
> > > > > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > > > > >
> > > > > > > > Abner Chang (6):
> > > > > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > > > > > >   edk2: jansson submodule for edk2 JSON library
> > > > > > > >   RedfishPkg/CrtLib: C runtime library
> > > > > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > > > > >   .pytool: Add required submodule for JsonLib
> > > > > > > >
> > > > > > > >  .gitmodules                                   |    3 +
> > > > > > > >  .pytool/CISettings.py                         |    2 +
> > > > > > > >  ReadMe.rst                                    |    1
> > +
> > > > > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768
> > ++++++++++++
> > > > > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417
> > +++++++
> > > > > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705
> > +++++++++++
> > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961
> > ++++++++++++++
> > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > > > > +++++++++++++++++
> > > > > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > > > > >  34 files changed, 4811 insertions(+)  create mode 100644
> > > > > > > > RedfishPkg/Include/JanssonJsonMapping.h
> > > > > > > >  create mode 100644
> > > > > > > > RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > > > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > > > > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > > > > > >  create mode 100644
> > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > > > > >  create mode 100644
> > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > > > > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > > > > > >  create mode 100644
> > > > > > > > RedfishPkg/Library/JsonLib/jansson_config.h
> > > > > > > >  create mode 100644
> > > > > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c
> > > > > > > > create mode
> > > > > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode
> > > > > > > > 100644 RedfishPkg/Library/JsonLib/stdarg.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h
> > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > > > > > >
> > > > > > > > --
> > > > > > > > 2.17.1
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68752): https://edk2.groups.io/g/devel/message/68752
Mute This Topic: https://groups.io/mt/78942303/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago
Mike and Liming,
I think we should clarify the usage of [Include] sections in DEC for the external open source projects. That seems to me that against to what it mentioned in edk2 module writer's guide section 2.1.2.

Abner

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist)
> Sent: Monday, December 14, 2020 9:59 AM
> To: devel@edk2.groups.io; gaoliming@byosoft.com.cn;
> michael.d.kinney@intel.com
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> 
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > gaoliming
> > Sent: Monday, December 14, 2020 9:30 AM
> > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > <abner.chang@hpe.com>; michael.d.kinney@intel.com
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> > Abner:
> >
> > > -----邮件原件-----
> > > 发件人: bounce+27952+68741+4905953+8761045@groups.io
> > > <bounce+27952+68741+4905953+8761045@groups.io> 代表 Abner Chang
> > > 发送时间: 2020年12月13日 12:02
> > > 收件人: devel@edk2.groups.io; michael.d.kinney@intel.com;
> > > gaoliming@byosoft.com.cn
> > > 抄送: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > 主题: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > > Of Michael D Kinney
> > > > Sent: Saturday, December 12, 2020 3:23 AM
> > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > > <abner.chang@hpe.com>; gaoliming@byosoft.com.cn; Kinney, Michael
> D
> > > > <michael.d.kinney@intel.com>
> > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > 'Laszlo
> > > > Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>;
> > > > Wang, Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > <peter.ohanley@hpe.com>
> > > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > > Abner,
> > > >
> > > > Feedback below.
> > > >
> > > > Mike
> > > >
> > > > > -----Original Message-----
> > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > > > Abner Chang
> > > > > Sent: Wednesday, December 9, 2020 8:02 PM
> > > > > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > Lindholm'
> > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > <peter.ohanley@hpe.com>
> > > > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > > > > > Sent: Thursday, December 10, 2020 10:33 AM
> > > > > > To: Chang, Abner (HPS SW/FW Technologist)
> > <abner.chang@hpe.com>;
> > > > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney,
> > > > > > Michael D <michael.d.kinney@intel.com>
> > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> Lindholm'
> > > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > <peter.ohanley@hpe.com>
> > > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > >
> > > > > > Abner,
> > > > > >
> > > > > > Some questions included below.
> > > > > >
> > > > > > Mike
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Chang, Abner (HPS SW/FW Technologist)
> > > > <abner.chang@hpe.com>
> > > > > > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > > > > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > > > Lindholm'
> > > > > > > <leif@nuviainc.com>; Kinney, Michael D
> > > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > <peter.ohanley@hpe.com>
> > > > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
> > > > > > > > On Behalf Of gaoliming
> > > > > > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW
> > > > > > > > Technologist) <abner.chang@hpe.com>
> > > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret
> Barkelew'
> > > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > <afish@apple.com>;
> > > > > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > <peter.ohanley@hpe.com>
> > > > > > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > >
> > > > > > > > Abner:
> > > > > > > >   I have minor comments on the library header file.
> > > > > > > >
> > > > > > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to
> > > > > > > > include the additional header files, such as Uefi.h and
> > > > > > > > BaseLib.h, because the library header file doesn't depend
> > > > > > > > on the definitions
> > > > from BaseLib.
> > > > > > > > 2. CrtLib.inf needs to list the required library class:
> > > > > > > > BaseMemoryLib &
> > > > > > PrintLib.
> > > > > > >
> > > > > > > OK, I will wait couple days for other comments and address
> > > > > > > that all
> > > > > > together.
> > > > > > >
> > > > > > > Thanks
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > > Liming
> > > > > > > > > -----邮件原件-----
> > > > > > > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > > > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表
> > > Abner
> > > > > > Chang
> > > > > > > > > 发送时间: 2020年12月8日 10:11
> > > > > > > > > 收件人: devel@edk2.groups.io
> > > > > > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret
> > Barkelew
> > > > > > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish
> > > <afish@apple.com>;
> > > > > > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > > > > > <gaoliming@byosoft.com.cn>; Nickle Wang
> > > > <nickle.wang@hpe.com>;
> > > > > > > > Peter
> > > > > > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > > >
> > > > > > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > > > > > In v4,
> > > > > > > > >        - Address review comments
> > > > > > > > >        - Seperate CRT functions to a individule library
> > > > > > > > > CrtLib
> > > under
> > > > > > > > >          RedfishPkg.
> > > > > > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > > > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > > > > > >
> > > > > > > > > In v3, Add jansson library as the required submoudle in
> > > > > > > > >        CiSettings.py for CI test.
> > > > > > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > > > > > >
> > > > > > > > > edk2 JSON library is based on jansson open source
> > > > > > > > > (https://github.com/akheron/jansson) and wrapped as an
> > > > > > > > > edk2
> > > > library.
> > > > > > > > > edk2 JsonLib will be used by edk2 Redfish feature
> > > > > > > > > drivers (not contributed yet) and the edk2 port of
> > > > > > > > > libredfish library (not contributed yet) based on DMTF
> > > > > > > > > GitHub (https://github.com/DMTF/libredfish).
> > > > > > > > >
> > > > > > > > > Jansson is licensed under the MIT license(refer to
> > > > > > > > > ReadMe.rst under
> > > > > > edk2).
> > > > > > > > > It is used in production and its API is stable. In
> > > > > > > > > UEFI/EDKII environment, Redfish project consumes jansson
> > > > > > > > > to achieve JSON
> > > > > > > > operations.
> > > > > > > > >
> > > > > > > > > * Jansson version on edk2: 2.13.1
> > > > > > > > >
> > > > > > > > > * EDKII jansson library wrapper:
> > > > > > > > >    - JsonLib.h:
> > > > > > > > >      This is the denifitions of EDKII JSON APIs which
> > > > > > > > > are mapped
> > > to
> > > > > > > > >      jannson funcitons accordingly.
> > > > > > > > >
> > > > > > > > >    - JanssonJsonLibMapping.h:
> > > > > > > > >      This is the wrapper file to map funcitons and
> > > > > > > > > definitions
> > > used in
> > > > > > > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > > > > > > >      modifications on native jannson applications to be
> > > > > > > > > built
> > > under
> > > > > > > > >      edk2 environment.
> > > > > >
> > > > > > Can you explain the use case for this in more detail?
> > > > > > What are these native jannson applications and why do we need
> > > > > > to build them in edk2?
> > > > > > If we have the jannson submodule, why can't these apps just
> > > > > > use the standard jannson services?
> > > > > >
> > > > > > I ask because this is a new concept for edk2 and I want to
> > > > > > make sure it is really required.
> > > > >
> > > > > The users of jannson library are LibRedfish open source
> > > > > (https://github.com/DMTF/libredfish) and the Edk2 Redfish
> > > > > features
> > > > drivers (WIP) to communicate with Redfish service. EDK2 port of
> > > > Libredfish will be sent for review after this one.
> > > > > Libredfish use "jansson.h" in its source code and uses the
> > > > > native jansson functions directly. I think most of open source
> > > > > projects use the
> > > > same way to leverage jansson open source project.
> > > > > However, "jansson.h" is defined in the source code directory
> > > > > that
> > > > > edk2
> > > > module can't refer to it in edk2 metafiles.
> > > >
> > > > Why not?  The package DEC file can list include paths.
> > > Mike, I thought we are recommended to not referring to the header
> > > file in the source code or the private header files in the module.
> > > My memory may out of date but I remember that the package's
> "Include/"
> > > directory should contains all public headers files that are exposed
> > > to other packages or this package. Is this still valid in the edk2
> > > driver writer's guide? I can't find any similar sentence which
> > > restrict to use the header files out of "Include/" directory in UEFI driver
> writer's guide.
> > > But any way, that's why we use a wrapper  header file and put it
> > > under Include/.
> > >
> > This is true for the normal module. But, submodule code is the different.
> > Submodule code is in module directory. To access its header file, its
> > directory is Required to be specified in [Includes] section of Package.dec
> file.
> 
> Liming,  do we mention this special usage in edk2 module writer's guide? I still
> can see in 2.1.2, it says "Each package has a unified directory structure that
> separate the different source files.
>  The root directories in each package are: Include, Library, Application and
> Drivers.
>  The include directory contains all public header files that are exposed by this
> package and are used by this package and other packages..."
> 
> However, this spec is kept at v0.7 since 2010 and was converted to GitBook in
> 2018.
> That is convenient if we are allowed to use header files from other source
> code for the open source project.
> 
> Thanks
> 
> >
> > Thanks
> > Liming
> > > >
> > > > For example, the RedFishPkg DEC file currently has the following
> > > > [Includes]
> > > > section:
> > > >
> > > >     [Includes]
> > > >       Include
> > > >
> > > > I could be updated to:
> > > >
> > > >     [Includes]
> > > >       Include
> > > >       Library\JsonLib\jansson\src
> > > >
> > > > This would allow libs/modules that want to directly use the
> > > > jansson services to use
> > > >
> > > >     #include <janson.h>
> > > >
> > > > If you wanted to limit the use of <janson.h> to only libs/modules
> > > > in the RedfishPkg, then you could use the private include feature:
> > > >
> > > >     [Includes]
> > > >       Include
> > > >
> > > >     [Includes.Common.Private]
> > > >       Library\JsonLib\jansson\src
> > > >
> > > > In fact, this exact pattern is used in the UnitTestFrameworkPkg to
> > > > allow comonponents to use the standard includes from the cmocka
> > submodule:
> > > >
> > > >     [Includes]
> > > >       Library/CmockaLib/cmocka/include
> > > >
> > > >     [Includes.Common.Private]
> > > >       PrivateInclude
> > > >       Library/CmockaLib/cmocka/include/cmockery
> > > >
> > > >
> > > > Please evaluate this approach and see of the JassonJsoonMapping.h
> > > > file can be removed.
> > > >
> > > > > Thus we need an wrapper for these jansson applications. That
> > > > > JanssonJsonMapping.h defines the EDK2 style API for mapping
> > > > > native jansson functions. For those edk2 based JSON
> > > > > applications, they can just
> > > > use edk2 style APIs. Such as the edk2 Redfish feature drivers,
> > > > those can use the EDK2 coding style compliant API to invoke
> > > > jansson functions by using JsonLib.h.
> > > > > For those native jansson applications, we can just use
> > > > > JanssonJsonMapping.h to map the native jansson API to EDK2 style
> > > > > API provided by JsonLib.lib. JanssonJsonMapping.h is not just
> > > > > map the functions, it also gives edk2 style prototype for
> > > > > jansson variables such as
> > > > json_t. These edk2 style prototypes are used in EDK2 Redfish
> > > > drivers or
> > > other
> > > > edk2 based application as well.
> > > > >
> > > > > >
> > > > > > > > >
> > > > > > > > > *Known issue:
> > > > > > > > >   Build fail with jansson/src/load.c, overrride and add
> > > > > > > > > code in
> > > load.c
> > > > > > > > >   to conditionally use stdin according to HAVE_UNISTD_H
> macro.
> > > > > > > > >   The PR is submitted to jansson open source community.
> > > > > > > > >   https://github.com/akheron/jansson/pull/558
> > > > > > > > >
> > > > > > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > > > > > >
> > > > > > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > > > > > >
> > > > > > > > > Abner Chang (6):
> > > > > > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > > > > > > >   edk2: jansson submodule for edk2 JSON library
> > > > > > > > >   RedfishPkg/CrtLib: C runtime library
> > > > > > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > > > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > > > > > >   .pytool: Add required submodule for JsonLib
> > > > > > > > >
> > > > > > > > >  .gitmodules                                   |    3 +
> > > > > > > > >  .pytool/CISettings.py                         |    2 +
> > > > > > > > >  ReadMe.rst                                    |    1
> > > +
> > > > > > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > > > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > > > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > > > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768
> > > ++++++++++++
> > > > > > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417
> > > +++++++
> > > > > > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705
> > > +++++++++++
> > > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961
> > > ++++++++++++++
> > > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > > > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > > > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > > > > > +++++++++++++++++
> > > > > > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > > > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > > > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > > > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > > > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > > > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > > > > > >  34 files changed, 4811 insertions(+)  create mode
> > > > > > > > > 100644 RedfishPkg/Include/JanssonJsonMapping.h
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > > > > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > > > > > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/JsonLib/Readme.rst
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > > > > > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/JsonLib/jansson_config.h
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c
> > > > > > > > > create mode
> > > > > > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode
> > > > > > > > > 100644 RedfishPkg/Library/JsonLib/stdarg.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/JsonLib/sys/time.h
> > > > > > > > >  create mode 100644
> > > > > > > > > RedfishPkg/Library/JsonLib/sys/types.h
> > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > 2.17.1
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68926): https://edk2.groups.io/g/devel/message/68926
Mute This Topic: https://groups.io/mt/78942303/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Michael D Kinney 3 years, 4 months ago
Hi Abner,

The private includes feature has been added since that document was updated.

Please enter TianoCore Bugzillas for the document changes you would
like to see.

Thanks,

Mike

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Tuesday, December 15, 2020 6:08 PM
> To: devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew' <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> <nickle.wang@hpe.com>; O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> Mike and Liming,
> I think we should clarify the usage of [Include] sections in DEC for the external open source projects. That seems to me
> that against to what it mentioned in edk2 module writer's guide section 2.1.2.
> 
> Abner
> 
> > -----Original Message-----
> > From: Chang, Abner (HPS SW/FW Technologist)
> > Sent: Monday, December 14, 2020 9:59 AM
> > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn;
> > michael.d.kinney@intel.com
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> > Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> > Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > <peter.ohanley@hpe.com>
> > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> >
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > > gaoliming
> > > Sent: Monday, December 14, 2020 9:30 AM
> > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > <abner.chang@hpe.com>; michael.d.kinney@intel.com
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > > Abner:
> > >
> > > > -----邮件原件-----
> > > > 发件人: bounce+27952+68741+4905953+8761045@groups.io
> > > > <bounce+27952+68741+4905953+8761045@groups.io> 代表 Abner Chang
> > > > 发送时间: 2020年12月13日 12:02
> > > > 收件人: devel@edk2.groups.io; michael.d.kinney@intel.com;
> > > > gaoliming@byosoft.com.cn
> > > > 抄送: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > > 主题: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > > > Of Michael D Kinney
> > > > > Sent: Saturday, December 12, 2020 3:23 AM
> > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > > > <abner.chang@hpe.com>; gaoliming@byosoft.com.cn; Kinney, Michael
> > D
> > > > > <michael.d.kinney@intel.com>
> > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > 'Laszlo
> > > > > Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>;
> > > > > Wang, Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > <peter.ohanley@hpe.com>
> > > > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > > Abner,
> > > > >
> > > > > Feedback below.
> > > > >
> > > > > Mike
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > > > > Abner Chang
> > > > > > Sent: Wednesday, December 9, 2020 8:02 PM
> > > > > > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > > > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > > Lindholm'
> > > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > <peter.ohanley@hpe.com>
> > > > > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > >
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > > > > > > Sent: Thursday, December 10, 2020 10:33 AM
> > > > > > > To: Chang, Abner (HPS SW/FW Technologist)
> > > <abner.chang@hpe.com>;
> > > > > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney,
> > > > > > > Michael D <michael.d.kinney@intel.com>
> > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > Lindholm'
> > > > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > <peter.ohanley@hpe.com>
> > > > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > >
> > > > > > > Abner,
> > > > > > >
> > > > > > > Some questions included below.
> > > > > > >
> > > > > > > Mike
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Chang, Abner (HPS SW/FW Technologist)
> > > > > <abner.chang@hpe.com>
> > > > > > > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > > > > > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > > > > Lindholm'
> > > > > > > > <leif@nuviainc.com>; Kinney, Michael D
> > > > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > > <peter.ohanley@hpe.com>
> > > > > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
> > > > > > > > > On Behalf Of gaoliming
> > > > > > > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > > > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW
> > > > > > > > > Technologist) <abner.chang@hpe.com>
> > > > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret
> > Barkelew'
> > > > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > <afish@apple.com>;
> > > > > > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > > > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > <peter.ohanley@hpe.com>
> > > > > > > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > > >
> > > > > > > > > Abner:
> > > > > > > > >   I have minor comments on the library header file.
> > > > > > > > >
> > > > > > > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to
> > > > > > > > > include the additional header files, such as Uefi.h and
> > > > > > > > > BaseLib.h, because the library header file doesn't depend
> > > > > > > > > on the definitions
> > > > > from BaseLib.
> > > > > > > > > 2. CrtLib.inf needs to list the required library class:
> > > > > > > > > BaseMemoryLib &
> > > > > > > PrintLib.
> > > > > > > >
> > > > > > > > OK, I will wait couple days for other comments and address
> > > > > > > > that all
> > > > > > > together.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > > Liming
> > > > > > > > > > -----邮件原件-----
> > > > > > > > > > 发件人: bounce+27952+68426+4905953+8761045@groups.io
> > > > > > > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代表
> > > > Abner
> > > > > > > Chang
> > > > > > > > > > 发送时间: 2020年12月8日 10:11
> > > > > > > > > > 收件人: devel@edk2.groups.io
> > > > > > > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret
> > > Barkelew
> > > > > > > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish
> > > > <afish@apple.com>;
> > > > > > > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > > > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > > > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > > > > > > <gaoliming@byosoft.com.cn>; Nickle Wang
> > > > > <nickle.wang@hpe.com>;
> > > > > > > > > Peter
> > > > > > > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > > > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > > > >
> > > > > > > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > > > > > > In v4,
> > > > > > > > > >        - Address review comments
> > > > > > > > > >        - Seperate CRT functions to a individule library
> > > > > > > > > > CrtLib
> > > > under
> > > > > > > > > >          RedfishPkg.
> > > > > > > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > > > > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > > > > > > >
> > > > > > > > > > In v3, Add jansson library as the required submoudle in
> > > > > > > > > >        CiSettings.py for CI test.
> > > > > > > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > > > > > > >
> > > > > > > > > > edk2 JSON library is based on jansson open source
> > > > > > > > > > (https://github.com/akheron/jansson) and wrapped as an
> > > > > > > > > > edk2
> > > > > library.
> > > > > > > > > > edk2 JsonLib will be used by edk2 Redfish feature
> > > > > > > > > > drivers (not contributed yet) and the edk2 port of
> > > > > > > > > > libredfish library (not contributed yet) based on DMTF
> > > > > > > > > > GitHub (https://github.com/DMTF/libredfish).
> > > > > > > > > >
> > > > > > > > > > Jansson is licensed under the MIT license(refer to
> > > > > > > > > > ReadMe.rst under
> > > > > > > edk2).
> > > > > > > > > > It is used in production and its API is stable. In
> > > > > > > > > > UEFI/EDKII environment, Redfish project consumes jansson
> > > > > > > > > > to achieve JSON
> > > > > > > > > operations.
> > > > > > > > > >
> > > > > > > > > > * Jansson version on edk2: 2.13.1
> > > > > > > > > >
> > > > > > > > > > * EDKII jansson library wrapper:
> > > > > > > > > >    - JsonLib.h:
> > > > > > > > > >      This is the denifitions of EDKII JSON APIs which
> > > > > > > > > > are mapped
> > > > to
> > > > > > > > > >      jannson funcitons accordingly.
> > > > > > > > > >
> > > > > > > > > >    - JanssonJsonLibMapping.h:
> > > > > > > > > >      This is the wrapper file to map funcitons and
> > > > > > > > > > definitions
> > > > used in
> > > > > > > > > >      native jannson applications to edk2 JsonLib. This avoids the
> > > > > > > > > >      modifications on native jannson applications to be
> > > > > > > > > > built
> > > > under
> > > > > > > > > >      edk2 environment.
> > > > > > >
> > > > > > > Can you explain the use case for this in more detail?
> > > > > > > What are these native jannson applications and why do we need
> > > > > > > to build them in edk2?
> > > > > > > If we have the jannson submodule, why can't these apps just
> > > > > > > use the standard jannson services?
> > > > > > >
> > > > > > > I ask because this is a new concept for edk2 and I want to
> > > > > > > make sure it is really required.
> > > > > >
> > > > > > The users of jannson library are LibRedfish open source
> > > > > > (https://github.com/DMTF/libredfish) and the Edk2 Redfish
> > > > > > features
> > > > > drivers (WIP) to communicate with Redfish service. EDK2 port of
> > > > > Libredfish will be sent for review after this one.
> > > > > > Libredfish use "jansson.h" in its source code and uses the
> > > > > > native jansson functions directly. I think most of open source
> > > > > > projects use the
> > > > > same way to leverage jansson open source project.
> > > > > > However, "jansson.h" is defined in the source code directory
> > > > > > that
> > > > > > edk2
> > > > > module can't refer to it in edk2 metafiles.
> > > > >
> > > > > Why not?  The package DEC file can list include paths.
> > > > Mike, I thought we are recommended to not referring to the header
> > > > file in the source code or the private header files in the module.
> > > > My memory may out of date but I remember that the package's
> > "Include/"
> > > > directory should contains all public headers files that are exposed
> > > > to other packages or this package. Is this still valid in the edk2
> > > > driver writer's guide? I can't find any similar sentence which
> > > > restrict to use the header files out of "Include/" directory in UEFI driver
> > writer's guide.
> > > > But any way, that's why we use a wrapper  header file and put it
> > > > under Include/.
> > > >
> > > This is true for the normal module. But, submodule code is the different.
> > > Submodule code is in module directory. To access its header file, its
> > > directory is Required to be specified in [Includes] section of Package.dec
> > file.
> >
> > Liming,  do we mention this special usage in edk2 module writer's guide? I still
> > can see in 2.1.2, it says "Each package has a unified directory structure that
> > separate the different source files.
> >  The root directories in each package are: Include, Library, Application and
> > Drivers.
> >  The include directory contains all public header files that are exposed by this
> > package and are used by this package and other packages..."
> >
> > However, this spec is kept at v0.7 since 2010 and was converted to GitBook in
> > 2018.
> > That is convenient if we are allowed to use header files from other source
> > code for the open source project.
> >
> > Thanks
> >
> > >
> > > Thanks
> > > Liming
> > > > >
> > > > > For example, the RedFishPkg DEC file currently has the following
> > > > > [Includes]
> > > > > section:
> > > > >
> > > > >     [Includes]
> > > > >       Include
> > > > >
> > > > > I could be updated to:
> > > > >
> > > > >     [Includes]
> > > > >       Include
> > > > >       Library\JsonLib\jansson\src
> > > > >
> > > > > This would allow libs/modules that want to directly use the
> > > > > jansson services to use
> > > > >
> > > > >     #include <janson.h>
> > > > >
> > > > > If you wanted to limit the use of <janson.h> to only libs/modules
> > > > > in the RedfishPkg, then you could use the private include feature:
> > > > >
> > > > >     [Includes]
> > > > >       Include
> > > > >
> > > > >     [Includes.Common.Private]
> > > > >       Library\JsonLib\jansson\src
> > > > >
> > > > > In fact, this exact pattern is used in the UnitTestFrameworkPkg to
> > > > > allow comonponents to use the standard includes from the cmocka
> > > submodule:
> > > > >
> > > > >     [Includes]
> > > > >       Library/CmockaLib/cmocka/include
> > > > >
> > > > >     [Includes.Common.Private]
> > > > >       PrivateInclude
> > > > >       Library/CmockaLib/cmocka/include/cmockery
> > > > >
> > > > >
> > > > > Please evaluate this approach and see of the JassonJsoonMapping.h
> > > > > file can be removed.
> > > > >
> > > > > > Thus we need an wrapper for these jansson applications. That
> > > > > > JanssonJsonMapping.h defines the EDK2 style API for mapping
> > > > > > native jansson functions. For those edk2 based JSON
> > > > > > applications, they can just
> > > > > use edk2 style APIs. Such as the edk2 Redfish feature drivers,
> > > > > those can use the EDK2 coding style compliant API to invoke
> > > > > jansson functions by using JsonLib.h.
> > > > > > For those native jansson applications, we can just use
> > > > > > JanssonJsonMapping.h to map the native jansson API to EDK2 style
> > > > > > API provided by JsonLib.lib. JanssonJsonMapping.h is not just
> > > > > > map the functions, it also gives edk2 style prototype for
> > > > > > jansson variables such as
> > > > > json_t. These edk2 style prototypes are used in EDK2 Redfish
> > > > > drivers or
> > > > other
> > > > > edk2 based application as well.
> > > > > >
> > > > > > >
> > > > > > > > > >
> > > > > > > > > > *Known issue:
> > > > > > > > > >   Build fail with jansson/src/load.c, overrride and add
> > > > > > > > > > code in
> > > > load.c
> > > > > > > > > >   to conditionally use stdin according to HAVE_UNISTD_H
> > macro.
> > > > > > > > > >   The PR is submitted to jansson open source community.
> > > > > > > > > >   https://github.com/akheron/jansson/pull/558
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > > > > > > >
> > > > > > > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > > > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > > > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > > > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > > > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > > > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > > > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > > > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > > > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > > > > > > >
> > > > > > > > > > Abner Chang (6):
> > > > > > > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library
> > > > > > > > > >   edk2: jansson submodule for edk2 JSON library
> > > > > > > > > >   RedfishPkg/CrtLib: C runtime library
> > > > > > > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > > > > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > > > > > > >   .pytool: Add required submodule for JsonLib
> > > > > > > > > >
> > > > > > > > > >  .gitmodules                                   |    3 +
> > > > > > > > > >  .pytool/CISettings.py                         |    2 +
> > > > > > > > > >  ReadMe.rst                                    |    1
> > > > +
> > > > > > > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > > > > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > > > > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > > > > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768
> > > > ++++++++++++
> > > > > > > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |  417
> > > > +++++++
> > > > > > > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705
> > > > +++++++++++
> > > > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961
> > > > ++++++++++++++
> > > > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > > > > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > > > > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > > > > > > +++++++++++++++++
> > > > > > > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > > > > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > > > > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > > > > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > > > > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > > > > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > > > > > > >  34 files changed, 4811 insertions(+)  create mode
> > > > > > > > > > 100644 RedfishPkg/Include/JanssonJsonMapping.h
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Include/Library/CrtLib.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Include/Library/JsonLib.h
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/JsonLib/Readme.rst
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/assert.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/errno.h
> > > > > > > > > >  create mode 160000 RedfishPkg/Library/JsonLib/jansson
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/JsonLib/jansson_config.h
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/limits.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/load.c
> > > > > > > > > > create mode
> > > > > > > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create mode
> > > > > > > > > > 100644 RedfishPkg/Library/JsonLib/stdarg.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stddef.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdio.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/string.h
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/JsonLib/sys/time.h
> > > > > > > > > >  create mode 100644
> > > > > > > > > > RedfishPkg/Library/JsonLib/sys/types.h
> > > > > > > > > >  create mode 100644 RedfishPkg/Library/JsonLib/time.h
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > 2.17.1
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > 
> > >
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68931): https://edk2.groups.io/g/devel/message/68931
Mute This Topic: https://groups.io/mt/78942303/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
Posted by Abner Chang 3 years, 4 months ago
Yes, I will. That is regardless to the private include feature. That is the header file in the open source project which is exposed to other packages, that against to the edk2 module writer's guide.

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Michael D Kinney
> Sent: Wednesday, December 16, 2020 10:58 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>; 'Laszlo
> Ersek' <lersek@redhat.com>; 'Leif Lindholm' <leif@nuviainc.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> <peter.ohanley@hpe.com>
> Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> 
> Hi Abner,
> 
> The private includes feature has been added since that document was
> updated.
> 
> Please enter TianoCore Bugzillas for the document changes you would like to
> see.
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > Sent: Tuesday, December 15, 2020 6:08 PM
> > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney, Michael D
> > <michael.d.kinney@intel.com>
> > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> >
> > Mike and Liming,
> > I think we should clarify the usage of [Include] sections in DEC for
> > the external open source projects. That seems to me that against to what it
> mentioned in edk2 module writer's guide section 2.1.2.
> >
> > Abner
> >
> > > -----Original Message-----
> > > From: Chang, Abner (HPS SW/FW Technologist)
> > > Sent: Monday, December 14, 2020 9:59 AM
> > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn;
> > > michael.d.kinney@intel.com
> > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > > Of gaoliming
> > > > Sent: Monday, December 14, 2020 9:30 AM
> > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> > > > <abner.chang@hpe.com>; michael.d.kinney@intel.com
> > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com>;
> > > > O'Hanley, Peter (EXL) <peter.ohanley@hpe.com>
> > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > >
> > > > Abner:
> > > >
> > > > > -----邮件原件-----
> > > > > 发件人: bounce+27952+68741+4905953+8761045@groups.io
> > > > > <bounce+27952+68741+4905953+8761045@groups.io> 代表 Abner
> Chang
> > > > > 发送时间: 2020年12月13日 12:02
> > > > > 收件人: devel@edk2.groups.io; michael.d.kinney@intel.com;
> > > > > gaoliming@byosoft.com.cn
> > > > > 抄送: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish' <afish@apple.com>;
> > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > <peter.ohanley@hpe.com>
> > > > > 主题: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > > > > Behalf Of Michael D Kinney
> > > > > > Sent: Saturday, December 12, 2020 3:23 AM
> > > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW
> > > > > > Technologist) <abner.chang@hpe.com>;
> gaoliming@byosoft.com.cn;
> > > > > > Kinney, Michael
> > > D
> > > > > > <michael.d.kinney@intel.com>
> > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > <afish@apple.com>;
> > > > > 'Laszlo
> > > > > > Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > <peter.ohanley@hpe.com>
> > > > > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > >
> > > > > > Abner,
> > > > > >
> > > > > > Feedback below.
> > > > > >
> > > > > > Mike
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf
> > > > > > > Of Abner Chang
> > > > > > > Sent: Wednesday, December 9, 2020 8:02 PM
> > > > > > > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > > > > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret Barkelew'
> > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>; 'Leif
> > > > Lindholm'
> > > > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > <peter.ohanley@hpe.com>
> > > > > > > Subject: Re: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Kinney, Michael D
> > > > > > > > [mailto:michael.d.kinney@intel.com]
> > > > > > > > Sent: Thursday, December 10, 2020 10:33 AM
> > > > > > > > To: Chang, Abner (HPS SW/FW Technologist)
> > > > <abner.chang@hpe.com>;
> > > > > > > > devel@edk2.groups.io; gaoliming@byosoft.com.cn; Kinney,
> > > > > > > > Michael D <michael.d.kinney@intel.com>
> > > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret
> Barkelew'
> > > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>;
> > > > > > > > 'Leif
> > > Lindholm'
> > > > > > > > <leif@nuviainc.com>; Wang, Nickle (HPS SW)
> > > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > > <peter.ohanley@hpe.com>
> > > > > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > >
> > > > > > > > Abner,
> > > > > > > >
> > > > > > > > Some questions included below.
> > > > > > > >
> > > > > > > > Mike
> > > > > > > >
> > > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: Chang, Abner (HPS SW/FW Technologist)
> > > > > > <abner.chang@hpe.com>
> > > > > > > > > Sent: Wednesday, December 9, 2020 6:14 PM
> > > > > > > > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret
> Barkelew'
> > > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > > > > > <afish@apple.com>; 'Laszlo Ersek' <lersek@redhat.com>;
> > > > > > > > > 'Leif
> > > > > > Lindholm'
> > > > > > > > > <leif@nuviainc.com>; Kinney, Michael D
> > > > > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > > > <peter.ohanley@hpe.com>
> > > > > > > > > Subject: RE: [edk2-devel] [PATCH v5 0/6] jansson edk2
> > > > > > > > > port
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > -----Original Message-----
> > > > > > > > > > From: devel@edk2.groups.io
> > > > > > > > > > [mailto:devel@edk2.groups.io] On Behalf Of gaoliming
> > > > > > > > > > Sent: Tuesday, December 8, 2020 2:40 PM
> > > > > > > > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW
> > > > > > > > > > Technologist) <abner.chang@hpe.com>
> > > > > > > > > > Cc: 'Sean Brogan' <sean.brogan@microsoft.com>; 'Bret
> > > Barkelew'
> > > > > > > > > > <Bret.Barkelew@microsoft.com>; 'Andrew Fish'
> > > > > <afish@apple.com>;
> > > > > > > > > > 'Laszlo Ersek' <lersek@redhat.com>; 'Leif Lindholm'
> > > > > > > > > > <leif@nuviainc.com>; 'Michael D Kinney'
> > > > > > > > > > <michael.d.kinney@intel.com>; Wang, Nickle (HPS SW)
> > > > > > > > > > <nickle.wang@hpe.com>; O'Hanley, Peter (EXL)
> > > > > > > > <peter.ohanley@hpe.com>
> > > > > > > > > > Subject: 回复: [edk2-devel] [PATCH v5 0/6] jansson edk2
> > > > > > > > > > port
> > > > > > > > > >
> > > > > > > > > > Abner:
> > > > > > > > > >   I have minor comments on the library header file.
> > > > > > > > > >
> > > > > > > > > > 1. JasonLib.h & BaseUcs2Utf8Lib.h. They don't need to
> > > > > > > > > > include the additional header files, such as Uefi.h
> > > > > > > > > > and BaseLib.h, because the library header file doesn't
> > > > > > > > > > depend on the definitions
> > > > > > from BaseLib.
> > > > > > > > > > 2. CrtLib.inf needs to list the required library class:
> > > > > > > > > > BaseMemoryLib &
> > > > > > > > PrintLib.
> > > > > > > > >
> > > > > > > > > OK, I will wait couple days for other comments and
> > > > > > > > > address that all
> > > > > > > > together.
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > > >
> > > > > > > > > > Thanks
> > > > > > > > > > Liming
> > > > > > > > > > > -----邮件原件-----
> > > > > > > > > > > 发件人:
> bounce+27952+68426+4905953+8761045@groups.io
> > > > > > > > > > > <bounce+27952+68426+4905953+8761045@groups.io> 代
> 表
> > > > > Abner
> > > > > > > > Chang
> > > > > > > > > > > 发送时间: 2020年12月8日 10:11
> > > > > > > > > > > 收件人: devel@edk2.groups.io
> > > > > > > > > > > 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret
> > > > Barkelew
> > > > > > > > > > > <Bret.Barkelew@microsoft.com>; Andrew Fish
> > > > > <afish@apple.com>;
> > > > > > > > > > > Laszlo Ersek <lersek@redhat.com>; Leif Lindholm
> > > > > > > > > > > <leif@nuviainc.com>; Michael D Kinney
> > > > > > > > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > > > > > > > > > <gaoliming@byosoft.com.cn>; Nickle Wang
> > > > > > <nickle.wang@hpe.com>;
> > > > > > > > > > Peter
> > > > > > > > > > > O'Hanley <peter.ohanley@hpe.com>
> > > > > > > > > > > 主题: [edk2-devel] [PATCH v5 0/6] jansson edk2 port
> > > > > > > > > > >
> > > > > > > > > > > In v5, move BaseUcs2Utf8Lib to under RedfishPkg.
> > > > > > > > > > > In v4,
> > > > > > > > > > >        - Address review comments
> > > > > > > > > > >        - Seperate CRT functions to a individule
> > > > > > > > > > > library CrtLib
> > > > > under
> > > > > > > > > > >          RedfishPkg.
> > > > > > > > > > >        - Seperate UCS2-UTF8 functions to a individule library
> > > > > > > > > > >          BaseUcs2Utf8Lib under MdeModulePkg.
> > > > > > > > > > >
> > > > > > > > > > > In v3, Add jansson library as the required submoudle in
> > > > > > > > > > >        CiSettings.py for CI test.
> > > > > > > > > > > In v2, JsonLib is moved to under RedfishPkg.
> > > > > > > > > > >
> > > > > > > > > > > edk2 JSON library is based on jansson open source
> > > > > > > > > > > (https://github.com/akheron/jansson) and wrapped as
> > > > > > > > > > > an
> > > > > > > > > > > edk2
> > > > > > library.
> > > > > > > > > > > edk2 JsonLib will be used by edk2 Redfish feature
> > > > > > > > > > > drivers (not contributed yet) and the edk2 port of
> > > > > > > > > > > libredfish library (not contributed yet) based on
> > > > > > > > > > > DMTF GitHub (https://github.com/DMTF/libredfish).
> > > > > > > > > > >
> > > > > > > > > > > Jansson is licensed under the MIT license(refer to
> > > > > > > > > > > ReadMe.rst under
> > > > > > > > edk2).
> > > > > > > > > > > It is used in production and its API is stable. In
> > > > > > > > > > > UEFI/EDKII environment, Redfish project consumes
> > > > > > > > > > > jansson to achieve JSON
> > > > > > > > > > operations.
> > > > > > > > > > >
> > > > > > > > > > > * Jansson version on edk2: 2.13.1
> > > > > > > > > > >
> > > > > > > > > > > * EDKII jansson library wrapper:
> > > > > > > > > > >    - JsonLib.h:
> > > > > > > > > > >      This is the denifitions of EDKII JSON APIs
> > > > > > > > > > > which are mapped
> > > > > to
> > > > > > > > > > >      jannson funcitons accordingly.
> > > > > > > > > > >
> > > > > > > > > > >    - JanssonJsonLibMapping.h:
> > > > > > > > > > >      This is the wrapper file to map funcitons and
> > > > > > > > > > > definitions
> > > > > used in
> > > > > > > > > > >      native jannson applications to edk2 JsonLib. This avoids
> the
> > > > > > > > > > >      modifications on native jannson applications to
> > > > > > > > > > > be built
> > > > > under
> > > > > > > > > > >      edk2 environment.
> > > > > > > >
> > > > > > > > Can you explain the use case for this in more detail?
> > > > > > > > What are these native jannson applications and why do we
> > > > > > > > need to build them in edk2?
> > > > > > > > If we have the jannson submodule, why can't these apps
> > > > > > > > just use the standard jannson services?
> > > > > > > >
> > > > > > > > I ask because this is a new concept for edk2 and I want to
> > > > > > > > make sure it is really required.
> > > > > > >
> > > > > > > The users of jannson library are LibRedfish open source
> > > > > > > (https://github.com/DMTF/libredfish) and the Edk2 Redfish
> > > > > > > features
> > > > > > drivers (WIP) to communicate with Redfish service. EDK2 port
> > > > > > of Libredfish will be sent for review after this one.
> > > > > > > Libredfish use "jansson.h" in its source code and uses the
> > > > > > > native jansson functions directly. I think most of open
> > > > > > > source projects use the
> > > > > > same way to leverage jansson open source project.
> > > > > > > However, "jansson.h" is defined in the source code directory
> > > > > > > that
> > > > > > > edk2
> > > > > > module can't refer to it in edk2 metafiles.
> > > > > >
> > > > > > Why not?  The package DEC file can list include paths.
> > > > > Mike, I thought we are recommended to not referring to the
> > > > > header file in the source code or the private header files in the
> module.
> > > > > My memory may out of date but I remember that the package's
> > > "Include/"
> > > > > directory should contains all public headers files that are
> > > > > exposed to other packages or this package. Is this still valid
> > > > > in the edk2 driver writer's guide? I can't find any similar
> > > > > sentence which restrict to use the header files out of
> > > > > "Include/" directory in UEFI driver
> > > writer's guide.
> > > > > But any way, that's why we use a wrapper  header file and put it
> > > > > under Include/.
> > > > >
> > > > This is true for the normal module. But, submodule code is the different.
> > > > Submodule code is in module directory. To access its header file,
> > > > its directory is Required to be specified in [Includes] section of
> > > > Package.dec
> > > file.
> > >
> > > Liming,  do we mention this special usage in edk2 module writer's
> > > guide? I still can see in 2.1.2, it says "Each package has a unified
> > > directory structure that separate the different source files.
> > >  The root directories in each package are: Include, Library,
> > > Application and Drivers.
> > >  The include directory contains all public header files that are
> > > exposed by this package and are used by this package and other
> packages..."
> > >
> > > However, this spec is kept at v0.7 since 2010 and was converted to
> > > GitBook in 2018.
> > > That is convenient if we are allowed to use header files from other
> > > source code for the open source project.
> > >
> > > Thanks
> > >
> > > >
> > > > Thanks
> > > > Liming
> > > > > >
> > > > > > For example, the RedFishPkg DEC file currently has the
> > > > > > following [Includes]
> > > > > > section:
> > > > > >
> > > > > >     [Includes]
> > > > > >       Include
> > > > > >
> > > > > > I could be updated to:
> > > > > >
> > > > > >     [Includes]
> > > > > >       Include
> > > > > >       Library\JsonLib\jansson\src
> > > > > >
> > > > > > This would allow libs/modules that want to directly use the
> > > > > > jansson services to use
> > > > > >
> > > > > >     #include <janson.h>
> > > > > >
> > > > > > If you wanted to limit the use of <janson.h> to only
> > > > > > libs/modules in the RedfishPkg, then you could use the private
> include feature:
> > > > > >
> > > > > >     [Includes]
> > > > > >       Include
> > > > > >
> > > > > >     [Includes.Common.Private]
> > > > > >       Library\JsonLib\jansson\src
> > > > > >
> > > > > > In fact, this exact pattern is used in the
> > > > > > UnitTestFrameworkPkg to allow comonponents to use the standard
> > > > > > includes from the cmocka
> > > > submodule:
> > > > > >
> > > > > >     [Includes]
> > > > > >       Library/CmockaLib/cmocka/include
> > > > > >
> > > > > >     [Includes.Common.Private]
> > > > > >       PrivateInclude
> > > > > >       Library/CmockaLib/cmocka/include/cmockery
> > > > > >
> > > > > >
> > > > > > Please evaluate this approach and see of the
> > > > > > JassonJsoonMapping.h file can be removed.
> > > > > >
> > > > > > > Thus we need an wrapper for these jansson applications. That
> > > > > > > JanssonJsonMapping.h defines the EDK2 style API for mapping
> > > > > > > native jansson functions. For those edk2 based JSON
> > > > > > > applications, they can just
> > > > > > use edk2 style APIs. Such as the edk2 Redfish feature drivers,
> > > > > > those can use the EDK2 coding style compliant API to invoke
> > > > > > jansson functions by using JsonLib.h.
> > > > > > > For those native jansson applications, we can just use
> > > > > > > JanssonJsonMapping.h to map the native jansson API to EDK2
> > > > > > > style API provided by JsonLib.lib. JanssonJsonMapping.h is
> > > > > > > not just map the functions, it also gives edk2 style
> > > > > > > prototype for jansson variables such as
> > > > > > json_t. These edk2 style prototypes are used in EDK2 Redfish
> > > > > > drivers or
> > > > > other
> > > > > > edk2 based application as well.
> > > > > > >
> > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > *Known issue:
> > > > > > > > > > >   Build fail with jansson/src/load.c, overrride and
> > > > > > > > > > > add code in
> > > > > load.c
> > > > > > > > > > >   to conditionally use stdin according to
> > > > > > > > > > > HAVE_UNISTD_H
> > > macro.
> > > > > > > > > > >   The PR is submitted to jansson open source community.
> > > > > > > > > > >   https://github.com/akheron/jansson/pull/558
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > > > > > > > > > >
> > > > > > > > > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > > > > > > > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > > > > > > > > > Cc: Andrew Fish <afish@apple.com>
> > > > > > > > > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > > > > > > > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > > > > > > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > > > > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > > > > > > > Cc: Nickle Wang <nickle.wang@hpe.com>
> > > > > > > > > > > Cc: Peter O'Hanley <peter.ohanley@hpe.com>
> > > > > > > > > > >
> > > > > > > > > > > Abner Chang (6):
> > > > > > > > > > >   RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation
> library
> > > > > > > > > > >   edk2: jansson submodule for edk2 JSON library
> > > > > > > > > > >   RedfishPkg/CrtLib: C runtime library
> > > > > > > > > > >   RedfishPkg/library: EDK2 port of jansson library
> > > > > > > > > > >   RedfishPkg: Add EDK2 port of jansson library to build
> > > > > > > > > > >   .pytool: Add required submodule for JsonLib
> > > > > > > > > > >
> > > > > > > > > > >  .gitmodules                                   |    3 +
> > > > > > > > > > >  .pytool/CISettings.py                         |    2 +
> > > > > > > > > > >  ReadMe.rst                                    |    1
> > > > > +
> > > > > > > > > > >  RedfishPkg/Include/JanssonJsonMapping.h       |   63 +
> > > > > > > > > > >  RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h  |   69 +
> > > > > > > > > > >  RedfishPkg/Include/Library/CrtLib.h           |  195 +++
> > > > > > > > > > >  RedfishPkg/Include/Library/JsonLib.h          |  768
> > > > > ++++++++++++
> > > > > > > > > > >  .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c |
> > > > > > > > > > > 417
> > > > > +++++++
> > > > > > > > > > >  .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf       |   31 +
> > > > > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.c            |  705
> > > > > +++++++++++
> > > > > > > > > > >  RedfishPkg/Library/CrtLib/CrtLib.inf          |   37 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.c          |  961
> > > > > ++++++++++++++
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/JsonLib.inf        |  101 ++
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/Readme.rst         |   40 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/assert.h           |   16 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/errno.h            |   16 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/jansson            |    1 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/jansson_config.h   |   46 +
> > > > > > > > > > >  .../Library/JsonLib/jansson_private_config.h  |   19 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/limits.h           |   16 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/load.c             | 1111
> > > > > > > > > > > +++++++++++++++++
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/math.h             |   16 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/stdarg.h           |   15 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/stddef.h           |   16 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/stdio.h            |   15 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/stdlib.h           |   16 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/string.h           |   16 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/sys/time.h         |   15 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/sys/types.h        |   15 +
> > > > > > > > > > >  RedfishPkg/Library/JsonLib/time.h             |   15 +
> > > > > > > > > > >  RedfishPkg/RedfishLibs.dsc.inc                |    3 +
> > > > > > > > > > >  RedfishPkg/RedfishPkg.ci.yaml                 |   33 +
> > > > > > > > > > >  RedfishPkg/RedfishPkg.dec                     |   15 +
> > > > > > > > > > >  RedfishPkg/RedfishPkg.dsc                     |    3 +
> > > > > > > > > > >  34 files changed, 4811 insertions(+)  create mode
> > > > > > > > > > > 100644 RedfishPkg/Include/JanssonJsonMapping.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Include/Library/CrtLib.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Include/Library/JsonLib.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.i
> > > > > > > > > > > nf  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/CrtLib/CrtLib.c
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/CrtLib/CrtLib.inf
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/JsonLib.c
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/JsonLib.inf
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/Readme.rst
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/assert.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/errno.h
> > > > > > > > > > >  create mode 160000
> > > > > > > > > > > RedfishPkg/Library/JsonLib/jansson
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/jansson_config.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/jansson_private_config.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/limits.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/load.c create mode
> > > > > > > > > > > 100644 RedfishPkg/Library/JsonLib/math.h  create
> > > > > > > > > > > mode
> > > > > > > > > > > 100644 RedfishPkg/Library/JsonLib/stdarg.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/stddef.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/stdio.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/stdlib.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/string.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/sys/time.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/sys/types.h
> > > > > > > > > > >  create mode 100644
> > > > > > > > > > > RedfishPkg/Library/JsonLib/time.h
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > 2.17.1
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68967): https://edk2.groups.io/g/devel/message/68967
Mute This Topic: https://groups.io/mt/78942303/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-