mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-30 03:37:44 +00:00
Clarify cgmanifest.json update process. (#9664)
This commit is contained in:
parent
90de3c8e7c
commit
a355bcbd73
5 changed files with 21 additions and 12 deletions
|
|
@ -1,21 +1,27 @@
|
|||
# CGManifest Files
|
||||
This directory contains CGManifest (cgmanifest.json) files.
|
||||
See here for details: https://docs.opensource.microsoft.com/tools/cg/cgmanifest.html
|
||||
See [here](https://docs.opensource.microsoft.com/tools/cg/cgmanifest.html) for details.
|
||||
|
||||
`cgmanifests/cgmanifest.json` contains entries that don't belong in more specific categories (e.g., git submodules).
|
||||
## `cgmanifests/generated/cgmanifest.json`
|
||||
This file contains generated CGManifest entries.
|
||||
|
||||
## Git Submodules
|
||||
`cgmanifests/submodules/cgmanifest.json` contains entries for git submodules.
|
||||
It can be generated like this:
|
||||
It covers these dependencies:
|
||||
- git submodules
|
||||
- dependencies from the Dockerfile `tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11`
|
||||
|
||||
If any of these dependencies change, this file should be updated.
|
||||
**When updating, please regenerate instead of editing manually.**
|
||||
|
||||
### How to Generate
|
||||
1. Change to the repository root directory.
|
||||
2. Ensure the submodules are checked out. For example, with:
|
||||
2. Ensure the git submodules are checked out and up to date. For example, with:
|
||||
```
|
||||
$ git submodule update --init --recursive
|
||||
```
|
||||
3. Run the generator script:
|
||||
```
|
||||
$ python cgmanifests/submodules/generate_submodule_cgmanifest.py > cgmanifests/submodules/cgmanifest.json
|
||||
$ python cgmanifests/generate_cgmanifest.py
|
||||
```
|
||||
|
||||
Please update this cgmanifest.json file when any git submodules change.
|
||||
## `cgmanifests/cgmanifest.json`
|
||||
This file contains non-generated CGManifest entries. Please edit directly as needed.
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import re
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||
REPO_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, "..", ".."))
|
||||
REPO_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, ".."))
|
||||
|
||||
package_name = None
|
||||
package_filename = None
|
||||
|
|
@ -16,7 +16,7 @@ package_url = None
|
|||
registrations = []
|
||||
|
||||
with open(os.path.join(REPO_DIR, 'tools', 'ci_build', 'github', 'linux', 'docker', 'Dockerfile.manylinux2014_cuda11'),
|
||||
"r") as f:
|
||||
mode="r") as f:
|
||||
for line in f:
|
||||
if not line.strip():
|
||||
package_name = None
|
||||
|
|
@ -95,4 +95,5 @@ for submodule_line in submodule_lines:
|
|||
|
||||
cgmanifest = {"Version": 1, "Registrations": registrations}
|
||||
|
||||
print(json.dumps(cgmanifest, indent=2))
|
||||
with open(os.path.join(SCRIPT_DIR, "generated", "cgmanifest.json"), mode="w") as generated_cgmanifest_file:
|
||||
print(json.dumps(cgmanifest, indent=2), file=generated_cgmanifest_file)
|
||||
2
cgmanifests/generated/README.md
Normal file
2
cgmanifests/generated/README.md
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
`cgmanifests/generated/cgmanifest.json` is a generated file. Please do not edit it directly.
|
||||
More info [here](../README.md).
|
||||
Loading…
Reference in a new issue