-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
299 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,75 @@ | ||
|
||
# Build Process | ||
|
||
Each package has a Config file in the JSON format. (Config file details in [Context Directory Structure]) | ||
Each Package has a Config file in the JSON format (Config file details in [Context Structure]). | ||
|
||
## Build All packages | ||
## Build All Packages | ||
|
||
### Config phase for all packages | ||
### Config phase for all Packages | ||
|
||
- the default Package config structure is created (with defaults filled in, look for `Config` | ||
in the config module). | ||
- the JSON config for the package is read into Go structure. | ||
- the default Package config is merged with the confile read from file. The config file | ||
- the default Package Config structure is created (with defaults filled in, look for `Config` | ||
in the bringauto_config module). | ||
- the JSON Config for the Package is read into Go structure. | ||
- the default Package Config is merged with the Config read from file. The Config file | ||
data has a precedence over Default one. | ||
|
||
### Build phase for all packages | ||
### Build phase for all Packages | ||
|
||
- the package configs are stored in linear list | ||
- package config are topological sorted by `Dependencies`, | ||
- the packages are build from first item of the list (head of the list) to the last package of the list. | ||
- All Package Configs are stored in linear list | ||
- All Configs are topological sorted by `Dependencies`, | ||
- the Packages are build from first item of the list (head of the list) to the last Package of the | ||
list. | ||
|
||
During the build the package files installed by installation feature of the CMake are copied | ||
to the `install_sysroot` directory located in the working directory of the builder. | ||
During the build the Package files installed by installation feature of the CMake are copied | ||
to the `install_sysroot` directory located in the working directory of the builder. If Package | ||
build files would overwrite any files already present in sysroot, the build fails (more in | ||
[Sysroot]). | ||
|
||
Each package has a `IsDebug` flag. If the flag is true the package is considered as Debug package. | ||
If the package is false the package is considered as Release. | ||
Each Package has a `IsDebug` flag. If the flag is true the Package is considered as Debug Package. | ||
If the Package is false the Package is considered as Release. | ||
|
||
Packages that are marked as Debug has separate sysroot dir in `install_sysroot` directory. So the Debug and release | ||
packages are not mixed together. | ||
Packages that are marked as Debug has separate sysroot dir in `install_sysroot` directory. So the | ||
Debug and Release Packages are not mixed together. | ||
|
||
## Build single package | ||
If there is any circular dependency between Packages in build list, the build fails. | ||
|
||
### Config phase for single package | ||
## Build single Package | ||
|
||
Same as for All build except that only configs for given `package_group` are read and managed. | ||
### Config phase for single Package | ||
|
||
### Build phase for single package | ||
Same as for All build except that only Configs for given Package Group are read and managed. | ||
|
||
### Build phase for single Package | ||
|
||
Same as for All build except that the dependencies are ignored. (so if you have not initialized | ||
`install_sysroot` then the package build may fail) | ||
`install_sysroot` then the Package build may fail) | ||
|
||
If you want to build Package with all dependencies, you can add `--build-deps` option to script | ||
call. | ||
|
||
## Build single Package with its dependencies | ||
|
||
### Config phase for single Package | ||
|
||
Same as for All build except that only Configs for given Package Group and all dependencies in | ||
these Configs recursively are read and managed. | ||
|
||
### Build phase for single Package | ||
|
||
Same as for All build. | ||
|
||
## Build Packages which depends on a Package | ||
|
||
### Config phase for single Package | ||
|
||
Same as for All build except that only Configs of Packages which depends on given Package and its | ||
dependencies are read and managed. If the recursive option is triggered, the process is done | ||
recursively (More in [Use Case Scenarios]). | ||
|
||
### Build phase for single Package | ||
|
||
If you want to build package with all dependencies, you can add `--build-deps` flag to script call. | ||
Same as for All build. | ||
|
||
[Context Directory Structure]: ./ContextDirectoryStructure.md | ||
[Context Structure]: ./ContextStructure.md | ||
[Sysroot]: ./Sysroot.md | ||
[Use Case Scenarios]: ./UseCaseScenarios.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
# Context Structure | ||
|
||
Context structure is a directory structure that gathers Configs needed for BAP to | ||
work. | ||
|
||
In the Context the definitions of Packages (Configs) and Docker images are stored. | ||
|
||
``` plaintext | ||
<context_directory>/ | ||
docker/ | ||
<docker_name>/ | ||
Dockerfile | ||
... | ||
package/ | ||
<package_group_name>/ | ||
<package_config_a>.json | ||
<package_config_b>.json | ||
... | ||
... | ||
``` | ||
|
||
## Docker Name | ||
|
||
The image name is recognized by a name of a directory in the `docker/` directory. | ||
|
||
Docker image built by Dockerfile in <docker_name> directory must be tagged by <docker_name>. | ||
|
||
You can use `bap-builder build-image` feature to build docker images instead of directly invoke `docker` command. | ||
|
||
## Package Group Name | ||
|
||
Each Package Group can have multiple Configs. | ||
|
||
Each Config represents one Package. | ||
|
||
Each Config is a json file. | ||
|
||
Each Config must have '.json' extension. | ||
|
||
The Config format is described by [ConfigStructure] | ||
|
||
[ConfigStructure]: ./ConfigStructure.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Package Repository | ||
|
||
The Package Repository is used for storage of built Packages. It is a git repository at the same time. | ||
The git tool is used for managing consistent storage of Packages. | ||
|
||
## Behaviour | ||
|
||
At the start of `build-package` and `create-sysroot` commands the Package Repository consistency | ||
check is performed. If the git status in Package Repository is not empty, the state of Repository | ||
is considered as non-consistent and the script ends with error. The user should then clean the | ||
Repository and continue. It is a bug if the non-consistent state is caused by `bap-builder` itself. | ||
Afterwards the check is comparing Configs currently in Context and built Packages in Package | ||
Repository. If in Package Repository there is any version of Package which is not in Context, the | ||
Package Repository is considered as non-consistent and the script ends with error. User needs to | ||
fix this problem manually and then continue. If some Packages are in Context and are not in Package | ||
Repository, only warning is printed. All files in `<DISTRO_NAME>/<DISTRO_VERSION/MACHINE_TYPE>` are | ||
checked, so any other files in this directory (alongside Package directories) will be counted as an | ||
error. User can't add any files here manually. | ||
|
||
During `build-package` command Packages are built in order. Each succesfully built Package is | ||
copied to Package Repository (specified with cli flag) to specific path - | ||
`<DISTRO_NAME>/<DISTRO_VERSION/MACHINE_TYPE/PACKAGE_NAME>`. In the end after all Packages are | ||
succesfully built, all copied files in Package Repository are git committed and remain in | ||
Repository. If any build fails or the script is interrupted, all copied Packages are removed from | ||
Repository. This mechanism ensures that the Package Repository is always consistent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
|
||
# Platform String | ||
|
||
Platform string is a string in form `machine`-`distro` | ||
|
||
TODO: detailed description | ||
Platform string is a string in form `DISTRO_NAME` - `DISTRO_VERSION` - `MACHINE`. It is used for | ||
Package zip filenames and paths in Package Repository and sysroot directory. |
Oops, something went wrong.