brazil Flashcards
What is the Brazil Build System and why it exist?
The Brazil Build System is a set of source repositories, a set of policies, and a set of build and deployment tools. It exists to manage the complexity of Amazon’s ever-growing codebase.
What is a brazil packages?
A Brazil Package is the smallest buildable/deployable unit. Packages are structured as code with similar function and should be built and deployed together, and is often a library that performs some function or an application that is actually run. A package may have multiple Major Versions and multiple Branches, and declares its external dependencies in the Brazil Config file.
What to do after you change your code ?
Once you’ve made some changes, you need to “build” the artifacts of your package. This is done through the Brazil CLI, which includes a brazil-build command. This command looks at your package, finds the build tool you’ve defined in your Config file, and executes it. This produces a set of build artifacts.
How is the package release to live?
Once your modifications are complete, tested, and ready to be released, the package is submitted into Package Builder through the Builder website or the Brazil CLI, where it can be released into live. The Package Builder will re-run your build in a completely sandboxed environment and produce an authoritative set of artifacts which are deterministically related to the commit you chose to build. It is these artifacts which are then released into the version set. Once complete, the changes made in the package can now be used by others.
What is a dependecy in brazil?
In Brazil, a dependency is a package that provides functionality that your package requires to be compiled, tested, or run.
A package may have zero or more dependencies. Each dependency may in turn have zero or more dependencies of their own, and so on. Dependencies explicitly declared by your package are referred to as direct dependencies, and their dependencies are transitive dependencies.
What are restrictions of the brazil dependecy
Dependency cycles are prohibited – a package cannot depend on itself or any of its own direct or indirect consumers. Thus a package and its dependencies form a directed acyclic graph.
When you declare a dependency on a package, you must select a distinct major version of that package. If the major version that you select conflicts with the major version(s) selected by one or more of your direct or transitive dependencies, you will need to resolve the major version conflict.
Are dependecy transitive in brazil ?
NO
When you declare a dependency on another package, not all of its dependencies are visible to your package. This is due to the fact that not all dependency types in Brazil are transitive.
As a best practice, you should always declare a direct dependency on any package that your package makes direct code references to, even if one of your existing direct dependencies causes that package to be a transitive dependency of your package.
What are different type of dependency you can put in your Config?
Dependency Type Config Key Transitive? Description
Library (aka Normal) dependencies yes Your package’s source code makes direct references to code contained in these packages.
Test test-dependencies no Your package’s test code makes direct references to code contained in these packages.
Build Tool build-tools no Your package’s build logic requires these packages to provide code-generation, compilation, or other build-time functionality.
Runtime runtime-dependencies yes Your package doesn’t need these packages at compile time, but they are needed at runtime.
Resolves Conflict resolves-conflict-dependencies yes Pseudo-dependency used only to resolve a major version conflict. Does not affect build-tool handling!
Remove Dependency remove-dependencies yes Pseudo-dependency used only to remove transitive dependencies. Ignored if the dependency to be removed is not found in the dependency graph of this package. Does not affect build-tool handling!
Synonym synonym-for yes Brazil substitutes the synonym-for target for all appearances of this package.
Rebuild rebuild-when-dependency-changes no Causes the declaring package to be rebuilt in PackageBuilder whenever the depended-on package is rebuilt.
What are the tool to debug dependencies errors?
1 GordianKnot 2 brazil-graph 3 brazil-path 4 Brazil CLI 5 Brazil Version Set Directory
What is GordianKnot?
GordianKnot is a set of command-line tools to simplify and automate the management of Brazil dependencies.
What is brazil graph ?
brazil-graph can build graphical views of your dependencies.
What is a version set?
A version set is a data structure that contains all of a package’s dependencies and their versions.
Your software project will often need to use software written by other people. These dependencies can be libraries, build tools, or other programs (in Brazil, all these different types of dependencies are packages). Your software’s dependencies often also have their own dependencies. Additionally, you must track and control the versions of your dependencies in order to prevent introducing unexpected changes (this is really important).
how do you list packages in the version set?
brazil vs print -vs live | more
how do you get the history log of a version set?
brazil vs history -vs Fubar/test1
How do you add a package to the version set?
# Add a package from the tracking version set: brazil vs merge --destination VersionSet/mainline --addNewPackage PackageName1-1.0 --addNewPackage OtherPackage-2.x
# Make sure to sync your workspace after the merge is done (see url printed by 'brazil vs merge') brazil ws sync --md
# Build brazil-build