contribute/external.html · contribute/external.rst 공식 원문 ↗

Zephyr 3.7.0 · Contribute · External Code

Contributing External Components

외부 code를 Zephyr에 포함할 때 지켜야 할 open-source 경계와 TSC·board 책임을 정의합니다.

Official pathcontribute/external.html
Source filecontribute/external.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Apache-2.0과 OSI license 기준, 기술 merit, main tree와 module 세 유형, maintainer 책임, TSC·governing board 제출 절차, external tooling과 west manifest 변경 승인을 설명합니다.

License

Apache · OSI · Board

Integration

Tree · Module · Tooling

Approval

TSC · Governing Board

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 378C2CEBC5EBF7FCBB4DED0D219F062750AF209705C6290614345046AA1BB0A5
.. _external-contributions:

Contributing External Components
################################

In some cases it is desirable to leverage existing, external source code in
order to avoid re-implementing basic functionality or features that are readily
available in other open source projects.

This section describes the circumstances under which external source code can be
imported into Zephyr, and the process that governs the inclusion.

There are three main factors that will be considered during the inclusion
process in order to determine whether it will be accepted. These will be
described in the following sections.

Note that most of this page deals with external components that end up being
compiled and linked into the final image, and programmed into the target
hardware. For external tooling that is only used during compilation,
code analysis, testing or simulation please refer to the
:ref:`external-tooling` section at the end of the page.

Software License
****************

.. note::

   External source code licensed under the Apache-2.0 license is not subject to
   this section.

Integrating code into the Zephyr Project from other projects that use a license
other than the Apache 2.0 license needs to be fully understood in
context and approved by the `Zephyr governing board`_, as described in the
`Zephyr project charter`_. The board will automatically reject licenses that
have not been approved by the `Open Source Initiative (OSI)`_. See the
:ref:`external-src-process` section for more details.

.. _Zephyr governing board:
   https://www.zephyrproject.org/governance/

.. _Zephyr project charter:
   https://www.zephyrproject.org/wp-content/uploads/sites/38/2023/08/LF-Zephyr-Charter-2023.08.21.pdf

.. _Open Source Initiative (OSI):
   https://opensource.org/licenses/alphabetical

By carefully reviewing potential contributions and also enforcing a :ref:`DCO`
for contributed code, we ensure that the Zephyr community can develop products
with the Zephyr Project without concerns over patent or copyright issues.

Merit
*****

Just like with any other regular contribution, one that contains external code
needs to be evaluated for merit. However, in the particular case of code that
comes from an existing project, there are additional questions that must be
answered in order to accept the contribution.
More specifically, the following will be considered by the Technical Steering
Committee and evaluated carefully before the external source code is accepted
into the project:

- Is this the most optimal way to introduce the functionality to the project?
  Both the cost of implementing this internally and the one incurred in
  maintaining an externally developed codebase need to be evaluated.
- Is the external project being actively maintained? This is particularly
  important for source code that deals with security or cryptography.
- Have alternatives to the particular implementation proposed been considered?
  Are there other open source project that implement the same functionality?

Mode of integration
*******************

There are two ways of integrating external source code into the Zephyr Project,
and careful consideration must be taken to choose the appropriate one for each
particular case.

Integration in the main tree
============================

The first way to integrate external source code into the project is to simply
import the source code files into the main ``zephyr`` repository. This
automatically implies that the imported source code becomes part of the
"mainline" codebase, which in turn requires that:

- The code is formatted according to the Zephyr :ref:`coding_style`
- The code adheres to the project's :ref:`coding_guidelines`
- The code is subject to the same checks and verification requirements as the
  rest of the code in the main tree, including static analysis
- All files contain an SPDX tag if not already present
- If the source is not Apache 2.0 licensed,
  an entry is added to the :ref:`licensing page <zephyr_licensing>`.

This mode of integration can be applicable to both small and large external
codebases, but it is typically used more commonly with the former.

Integration as a module
=======================

The second way of integrating external source code into the project is to import
the whole or parts of the third-party open source project into a separate
repository, and then include it under the form of a :ref:`module <modules>`.
With this approach the code is considered as being developed externally, and
thus it is not automatically subject to the requirements of the previous
section.

Integration in main manifest file (west.yaml)
---------------------------------------------

Integrating external code into the main :file:`west.yml` manifest file is
limited to code that is used by a Zephyr subsystem (libraries), by a platform,
drivers (HAL) or tooling needed to test or build Zephyr components.

The integration of modules in this group is validated by the Zephyr project CI,
and verified to be working with each Zephyr release.

Integrated modules will not be removed from the tree without a detailed
migration plan.

Integration as optional modules
-------------------------------

Standalone or loose integration of modules/projects without any incoming
dependencies shall be made optional and shall be kept standalone. Optional
projects that provide value to users directly and through a Zephyr subsystem or
platform shall be added to an optional manifest file that is filtered by
default. (:file:`submanifests/optional.yml`).

Such optional projects might include samples and tests in their own repositories.

There shall not be any direct dependency added in the Zephyr code tree (Git
repository) and all sample or test code shall be maintained as part of the module.

.. note::

   This is valid for all new optional modules. Existing optional modules with
   samples and test code in the Zephyr Git repository will be transitioned out
   over time.

Integration as external modules
-------------------------------

Similar to optional modules, but added to the Zephyr project as an entry in the
documentation using a pre-defined template. This type of modules exists outside the
Zephyr project manifest with documentation instructing users and developers how
to integrate the functionality.

Ongoing maintenance
*******************

Regardless of the mode of integration, external source code that is integrated
in Zephyr requires regular ongoing maintenance. The submitter of the proposal to
integrate external source code must therefore commit to maintain the integration
of such code for the foreseeable future.
This may require adding an entry in the :file:`MAINTAINERS.yml` as part of the
process.

.. _external-src-process:

Submission and review process
*****************************

Before external source code can be included in the project, it must be reviewed
and accepted by the Technical Steering Committee (TSC) and, in some cases, by
the Zephyr governing board.

A request for external source code integration must be made by creating a new
issue in the Zephyr project issue tracking system on GitHub with details
about the source code and how it integrates into the project.

Follow the steps below to begin the submission process:

#. Make sure to read through the :ref:`external-contributions` section in
   detail, so that you are informed of the criteria used by the TSC and board in
   order to approve or reject a request
#. Use the :github:`New External Source Code Issue
   <new?assignees=&labels=RFC&template=007_ext-source.md&title=>` to open an issue
#. Fill out all required sections, making sure you provide enough detail for the
   TSC to assess the merit of the request. Optionally you can also create a Pull
   Request that demonstrates the integration of the external source code and
   link to it from the issue
#. Wait for feedback from the TSC, respond to any additional questions added as
   GitHub issue comments

If, after consideration by the TSC, the conclusion is that integrating external
source code is the best solution, and the external source code is licensed under
the Apache-2.0 license, the submission process is complete and the external
source code can be integrated.

If, however, the external source code uses a license other than Apache-2.0,
then these additional steps must be followed:

#. The TSC chair will forward the link to the GitHub issue created during the
   early submission process to the Zephyr governing board for further review

#. The Zephyr governing board has two weeks to review and ask questions:

   - If there are no objections, the matter is closed. Approval can be
     accelerated by unanimous approval of the board before the two
     weeks are up

   - If a governing board member raises an objection that cannot be resolved
     via email, the board will meet to discuss whether to override the
     TSC approval or identify other approaches that can resolve the
     objections

#. On approval of the Zephyr TSC and governing board the submission process is
   complete

The flowchart below shows an overview of the process:

.. figure:: ../../../contribute/media/ext-src-flowchart.svg
   :align: center

   Submission process

.. _external-tooling:

Contributing External Tooling
*****************************

This section deals exclusively with the inclusion of external tooling in the
Zephyr project, where tooling is defined as software that assists the
compilation, testing or simulation processes but in no case ends up being part
of the code compiled and linked into the final image. "Inclusion" in this
context means becoming part of the Zephyr default distribution either in the
main tree directly under the :file:`scripts/` folder or indirectly as a west
project in the main :file:`west.yml` manifest. Therefore, this section does not
apply to 3rd-party tooling such as toolchains, simulators or others, which may
still be referenced by the Zephyr build system or docs without being included in
Zephyr.

Tooling components must be released under a license approved by the
`Open Source Initiative (OSI)`_.

Just like with regular external components, tooling that is imported from
another project can be integrated either in the main tree or as a :ref:`west
project <west-workspace>`. Note that in this case the corresponding west project
will not be a :ref:`module <modules>`, because tooling does not make use of the
Zephyr build system and does not need to be processed by it. Please see
:ref:`modules-vs-projects` for additional information on the differences.

If the tool is integrated in the main tree it should be placed under the
:file:`scripts/` folder.
If the tool is integrated as a west project, then the project repository can be
hosted outside the zephyrproject-rtos GitHub organization, provided that the
project is made optional via the ``group-filter:`` field in the main
:file:`west.yml` manifest. More info on optional projects can be found in
:ref:`this section <west-manifest-groups>`.

The TSC must approve every Pull Request that introduces a new external tooling
component. This will be done on a case-by-case, individual analysis of the
proposed addition by the TSC representatives.

Additional considerations about the main manifest
*************************************************

In general, any additions or removals whatsoever to the ``projects:`` section of
the `main manifest file`_ requires TSC approval. This includes, but is not
limited to:

- Adding and removing groups and group filters
- Adding and removing projects
- Adding and removing ``import`` statements

.. _main manifest file:
   https://github.com/zephyrproject-rtos/zephyr/blob/main/west.yml

Part 3

한국어 전문 번역

External component 기여

다른 open-source project에 이미 있는 기본 기능이나 feature를 다시 구현하지 않기 위해 기존 외부 source code를 활용하는 것이 바람직한 경우가 있습니다.

이 절은 외부 source code를 Zephyr로 가져올 수 있는 조건과 포함을 관리하는 절차를 설명합니다.

포함 요청을 수락할지는 software license, 기술적 merit, integration mode라는 세 가지 주요 요소를 검토해 결정합니다.

이 페이지 대부분은 compile·link되어 최종 image에 들어가고 target hardware에 programming되는 외부 component를 다룹니다. Compile, code analysis, test, simulation 때만 쓰는 external tooling은 페이지 뒤의 해당 절을 참고합니다.

Software License

Apache 2.0이 아닌 license를 쓰는 다른 project의 code를 Zephyr Project에 통합하려면 맥락을 완전히 이해하고 Zephyr governing board의 승인을 받아야 합니다. 절차는 Zephyr project charter에 정의되어 있습니다. Board는 Open Source Initiative(OSI)가 승인하지 않은 license를 자동으로 거부합니다.

잠재적 기여를 꼼꼼히 검토하고 기여 code에 DCO를 강제해, Zephyr community가 patent나 copyright 문제를 걱정하지 않고 제품을 개발할 수 있게 합니다.

Merit

외부 code가 포함된 기여도 일반 기여처럼 가치와 타당성을 평가해야 합니다. 기존 project에서 온 code에는 수락 전에 답해야 할 추가 질문이 있습니다. Technical Steering Committee(TSC)는 다음 사항을 주의 깊게 평가합니다.

  • 이 기능을 project에 도입하는 최적의 방법입니까? 내부 구현 비용과 외부 개발 codebase의 유지보수 비용을 모두 평가해야 합니다.
  • 외부 project가 활발히 유지보수되고 있습니까? Security나 cryptography를 다루는 source code에서는 특히 중요합니다.
  • 제안 구현의 대안을 검토했습니까? 같은 기능을 구현한 다른 open-source project가 있습니까?

Integration mode

외부 source code를 Zephyr Project에 통합하는 방법은 두 가지이며 각 사례에 적합한 방식을 신중히 선택해야 합니다.

Main tree에 통합

첫 방법은 source code file을 main zephyr repository로 직접 가져오는 것입니다. 가져온 code가 mainline codebase의 일부가 되므로 다음 요구 사항이 적용됩니다.

  • Zephyr coding style에 맞게 format합니다.
  • Project coding guidelines을 준수합니다.
  • Static analysis를 포함해 main tree의 나머지 code와 같은 check·verification 요구 사항을 적용합니다.
  • 모든 file에 이미 없다면 SPDX tag를 넣습니다.
  • Source가 Apache 2.0이 아니라면 licensing page에 entry를 추가합니다.

이 방식은 작은 외부 codebase와 큰 codebase 모두에 적용할 수 있지만 보통 작은 쪽에 더 자주 사용합니다.

Module로 통합

둘째 방법은 third-party open-source project 전체 또는 일부를 별도 repository로 가져온 뒤 module 형태로 포함하는 것입니다. 이 방식의 code는 외부에서 개발되는 것으로 보므로 앞 절의 요구 사항이 자동 적용되지는 않습니다.

Main manifest file(west.yml)에 통합

Main west.yml manifest에 넣는 외부 code는 Zephyr subsystem의 library, platform, driver(HAL), 또는 Zephyr component를 test·build하는 데 필요한 tooling으로 제한합니다.

이 group의 module integration은 Zephyr project CI가 검증하고 각 Zephyr release에서 동작함을 확인합니다.

통합된 module은 자세한 migration plan 없이 tree에서 제거하지 않습니다.

Optional module로 통합

Incoming dependency가 없는 standalone 또는 느슨한 module/project integration은 optional로 만들어 standalone 상태를 유지해야 합니다. 사용자에게 직접 또는 Zephyr subsystem·platform을 통해 가치를 제공하는 optional project는 기본적으로 filter되는 optional manifest submanifests/optional.yml에 추가합니다.

Optional project는 자체 repository에 sample과 test를 포함할 수 있습니다.

Zephyr code tree(Git repository)에 직접 dependency를 추가하면 안 되며 모든 sample·test code는 module 일부로 유지보수해야 합니다.

External module로 통합

Optional module과 비슷하지만 미리 정의된 template을 사용하는 documentation entry로 Zephyr project에 추가합니다. 이 module은 Zephyr project manifest 밖에 존재하며 documentation이 사용자와 developer에게 기능 통합 방법을 안내합니다.

지속적인 유지보수

Integration mode와 무관하게 Zephyr에 통합한 외부 source code에는 정기적이고 지속적인 유지보수가 필요합니다. 제안 제출자는 예측 가능한 미래 동안 integration을 유지보수하겠다고 약속해야 합니다.

절차 일부로 MAINTAINERS.yml entry를 추가해야 할 수 있습니다.

제출과 review 절차

외부 source code를 project에 포함하기 전에 TSC가 review하고 수락해야 하며 일부 경우 Zephyr governing board 승인도 필요합니다.

Zephyr project GitHub issue tracking system에 새 issue를 만들고 source code 및 project 통합 방법의 자세한 내용을 적어 integration을 요청합니다.

초기 제출 절차:

  1. TSC와 board가 요청을 승인·거부하는 기준을 이해하도록 External Contributions 절 전체를 자세히 읽습니다.
  2. New External Source Code Issue template으로 issue를 엽니다.
  3. 필수 section을 모두 작성하고 TSC가 요청의 merit을 평가할 충분한 detail을 제공합니다. 선택적으로 integration을 보여 주는 Pull Request를 만들고 issue에서 link할 수 있습니다.
  4. TSC feedback을 기다리고 GitHub issue comment의 추가 질문에 답합니다.

TSC가 외부 source code 통합이 최선이고 license가 Apache-2.0이라고 결론 내리면 제출 절차가 완료되어 통합할 수 있습니다.

Apache-2.0이 아닌 license라면 다음 단계도 수행합니다.

  1. TSC chair가 초기 제출에서 만든 GitHub issue link를 Zephyr governing board에 보내 추가 review를 요청합니다.
  2. Board는 2주 동안 review하고 질문할 수 있습니다.
    • 반대가 없으면 사안을 종료합니다. 2주가 지나기 전이라도 board 전원이 승인하면 절차를 앞당길 수 있습니다.
    • Board member가 email로 해결할 수 없는 이의를 제기하면 board가 meeting을 열어 TSC 승인을 뒤집을지 또는 이의를 해결할 다른 방법을 찾을지 논의합니다.
  3. Zephyr TSC와 governing board가 승인하면 제출 절차가 완료됩니다.

다음 flowchart는 위 절차의 전체 흐름을 보여 줍니다.

External source contribution approval flowchart
External source code 제출 절차. Zephyr v3.7.0 공식 flowchart.

External Tooling 기여

이 절에서 tooling은 compile, test, simulation을 돕지만 최종 image에 compile·link되는 code의 일부가 되지 않는 software입니다. 여기서 inclusion은 scripts/ 아래 main tree 또는 main west.yml manifest의 west project로 Zephyr default distribution에 들어가는 것을 뜻합니다. Build system이나 documentation에서 참조만 하는 third-party toolchain·simulator에는 이 절이 적용되지 않습니다.

Tooling component는 OSI 승인 license로 release해야 합니다.

다른 project에서 가져온 tooling도 main tree 또는 west project로 통합할 수 있습니다. Tooling은 Zephyr build system을 사용하거나 그 처리가 필요하지 않으므로 이 west project는 Zephyr module이 아닙니다.

Main tree에 통합하면 scripts/ folder 아래에 둡니다.

West project로 통합하면 project를 group-filter: field로 optional로 만든다는 조건 아래 zephyrproject-rtos GitHub organization 밖에 repository를 host할 수 있습니다. Optional project의 자세한 내용은 west manifest groups를 참고하십시오.

새 external tooling component를 도입하는 모든 Pull Request는 TSC가 승인해야 하며, TSC representative가 제안 추가를 사례별로 개별 분석합니다.

Main manifest 추가 고려 사항

Main manifest file의 projects: section을 추가하거나 제거하는 모든 변경에는 원칙적으로 TSC 승인이 필요합니다. 다음 변경을 포함하지만 이에 한정되지는 않습니다.

  • Group과 group filter 추가·제거
  • Project 추가·제거
  • import statement 추가·제거

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.