src/native/external/README.md
This folder contains the source code of vendored third party native libraries that are used as dependencies for dotnet/runtime.
Vendored libraries are copies of third-party dependencies that are included in the project repository. These copies are built alongside the rest of the repository. The document describing our approach for vendored libraries can be found here: https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/VMR-Strategy-For-External-Source.md
Each native library is roughly structured the following way:
library-folder/
library-source-code-files
library.cmake
library-version.txt
cgmanifest.json
library-folder/ is where the native source code lives.library.cmake is the main cmake file we add to build this library from anywhere in this repo.library-version.txt contains all the detailed release information for this library, as well as information about any local patches applied to the library.cgmanifest.json is the official file that describes the source code provenance for each one of the external libraries we consume.Consult with the .NET Security experts to make sure we meet all of Microsoft's Open Source guidance, especially regarding security updates and timeline expectations. This step can only be performed by the .NET team.
Download a copy of the source code from an official public release and extract it inside the library folder under src/native/external/<library-name>.
https://github.com/org/repo/releases.Open the cgmanifest.json file. Add or modify the entry for this library to indicate the commit hash from which the copy of this release was obtained. The entry looks like this:
"Registrations": [
{
"Component": {
"Type": "git",
"Git": {
"RepositoryUrl": "https://github.com/org/repo",
"CommitHash": "<commit from which the source code was obtained>"
}
}
}
]
License notice for <library name>
-----------------------
<link to GitHub commit from which the license was obtained>
<library>-version.txt file under src/native/external. This file should contain:https://github.com/org/repo/releases/tag/<version_number>Make any cmake changes to properly consume the source code, if needed. The information about these changes should be included in <library>-version.txt file. The same changes should be proposed for the library upstream so that they are not necessary during the next library update.
Submit a PR tagging the area owners as well as the @dotnet/runtime-infrastructure team.
Find ways to get notified about new releases for the external dependency. For example, if the source code comes from a GitHub repo, you can subscribe to new releases:
Validate that CG detects the dependency correctly. This step can only be performed by the .NET team.