SlideShare ist ein Scribd-Unternehmen logo
1 von 21
PRESENTED BY
S. SOWMIYA DHARSHNI
V. DEEPIKA
WHAT IS BAZEL?
• An open-source build and test tool
similar to Make, Maven, and Gradle.
• Uses a human-readable, high-level
build language.
• Supports projects in multiple languages.
• Supports large codebases across multiple repositories,
and large numbers of users.
HISTORY OF BAZEL
• Developed by Google in MARCH 2015.
• Written in Java and can work on any cross platform.
• Has provided its users with an official website called
bazel.build.
WHO USE BAZEL?
Nearly 17 companies reportedly use Bazel in their tech
stacks, including Google, Asana, and Square.
WHY TO USE BAZEL?
• Produces deterministic results.
• Eliminates skew between incremental and clean
builds, laptop and CI system, etc.
• It can build different client and server apps with
the same tool from the same workspace.
LOGO AND TAGLINE
• Initial release the logo was a green letter "b" stylized into a stem
of a basil plant with two leaves.
• On July 5, 2017, the Bazel Blog announced a new logo,
consisting of three green building blocks arranged to shape a
heart.
• Bazel advertises itself with the tagline “{Fast, Correct} –
Choose two”.
Versions of BAZEL
• Initial version - 0.17.1
• Latest version - 3.5.0, Master
• Intermediate version - 3.4.0 · 3.3.0 · 3.2.0 · 3.1.0 ·
3.0.0 · 2.2.0 · 2.1.0 · 2.0.0 · 1.2.0 · 1.1.0 · 1.0.0 ·
0.29.1 · 0.29.0 · 0.28.0 · 0.27.0 · 0.26.0 · 0.25.0 ·
0.24.0 · 0.23.0 · 0.22.0 · 0.21.0 · 0.20.0 · 0.19.2 ·
0.19.1 · 0.18.1 · 0.17.2
• Some versions of Bazel contain a bundled
version of OpenJDK.
WHY IS BAZEL WRITTEN IN JAVA?
Bazel is being developed in java
because; Java builds are so larded with user-
defined annotation processors and Error
Prone checks.
HOW DO I USE BAZEL?
• Set up Bazel. Download and install BAZEL.
• Set up a project workspace.
• Write a build file, which tells Bazel what to
build and how to build it.
• Write your file by declaring build targets using
starlack , a domain-specific language.
• A build target specifies a set of input artifacts
that Bazel will build plus their dependencies,
the build rule Bazel will use to build it.
• A build rule specifies the build tools Bazel will use, such
as compilers and linkers, and their configurations.
• Bazel ships with a number of build rules covering the
most common artifact types in the supported languages on
supported platforms.
• Finally run BAZEL, from the command line. Bazel places
your outputs within the workspace.
UNDERSTANDING BAZEL
• LOADS – Load the relevant build file respective to target.
• ANALYZES – Examine the inputs and their dependencies, and then
perform the specified build rules, and produces an action graph.
• EXECUTES – Run the build actions until final build outputs are
provided.
• BUILD – Files which tell Bazel how to build various parts of the
project which is defined by rules and these rules are called targets.
• WORKSPACE – File, and similar to BUILD files, there can only be
one WORKSPACE in a package. It keeps track of the external
dependencies of the project, and some rule adds each external
dependency.
Bazel is rich in languages supports, platform supports, and have some
fantastic tools; some are mentioned below –
• Bazel-watcher – Automatically run commands when source files
change.
• Dazel – For running Bazel inside the Docker container.
• Spotify/bazel-tools – Tools for dealing with substantial Bazel-
managed repo.
BAZEL TOOLS
First clone the provided repository by Bazel and
check the folders inside github.
Create a WORKSPACE text file. As we know we put our
workspace file in the root folder, so here, we are putting out a
file inside the tutorial folder.
Now create library modules. Go to
src/main/java/com/example/bazel/ and create BUILD text file
under it.
Now, we want to add the android_binary which builds the APK file.
For this, we had to add one more top-level BUILD text file. Go to
src/main and create the file under it.
BUILDING AN ANDROID APP
 Now, we are ready to build our application. Go to the tutorial folder again on
your terminal and run bazel build //src/main:app . Or you can open this project
inside android studio by following steps. This will generate three folders:
 bazel-bin stores.apk
 bazel-genfiles stores intermediary source files that are
generated by bazel rules.
 bazel-out stores other types of build outputs
THE BAZEL QUERY REFERENCE
 Bazel comes with a query language for the dependency graph.
When you use bazel query to analyze build dependencies, you use
a little language, the Bazel Query Language. This document is the
reference manual for that language. This document also describes
the output formats that bazel query supports.
 Traditional bazel query runs on the post-loading phase target graph
and therefore has no concept of configurations and their related
concepts. Notably, this means it does not correctly resolve select
statements and rather returns all possible resolutions of selects. A
newer query environment, cquery, properly handles configurations
but doesn't provide all of the functionality of this original query.
ADVANTAGES OF BAZEL
Bazel is fast, reliable, support human-readable languages, and have
lots of other benefits too –
 High-level build language – It uses human-readable language to
describe the build properties of someone’s project. It operates on the
concepts of binaries, libraries, data sets, and scripts.
 Fast and correct – It can cache build results and only rebuild what it
needs to, which make it fast.
 Platform independent – It can run on Linux, macOS, Windows.
 Scales – It can handle large source files easily. It works with various
repositories and user bases in the tens of thousands.
 Flexible – Build and test C/C++, Objective-C, Java, Python, and
Bourne Shell scripts and a wide variety of other language platforms.
Comparing with other tools like Gradle, and its configuration files are
more structured and allow Bazel to understand each action clearly, which
result in better reproducibility. It has many built-in commands which make it
fast and easy to use, such as command like “mobile-install,” which allows for
agile and iterative development of Android apps.
DISADVANTAGES OF BAZEL
 Bazel does not have a high level declarative build language that makes
the build easy to use for developers. At Google this can be compensated
with a specialized service team that owns the build tool.
 Bazel is not built for extensibility (although the Bazel development team
has since countered this with assurances that they are working on
extensibility).
 Speed is optimized around the idea that all transitive dependencies are
stored in one big repo; all libraries and tools are checked in to this
central repository. Most Enterprises have more distributed dependency
management requirements.
 When compared with gradle which is an alternate to bazel, gradle has
built-in support for both Maven and Ivy repositories. Bazel provides
an official rule with support only for Maven repositories, with some
boilerplate code is required to use it.
 Bazel does not run on Windows. This eliminates a large number of
potential Enterprises.
 There is no plugin ecosystem in bazel whereas, Plugins are the central
feature of Maven that allow for the reuse of common build logic
across multiple projects.
DEBUGGING IN BAZEL
For debugging the C++ client you can just run it from gdb or lldb
as you normally would. But if you want to debug the Java code, you
must attach to the server using the following:
Run Bazel with debugging option --host_jvm_debug before the
command (e.g., bazel --host_jvm_debug build //src:bazel).
CONCLUSION
 Thus the goal of Bazel is to create a build system where build
target inputs and outputs are fully specified and therefore precisely
known to the build system. This allows a more accurate analysis and
determination of out-of-date build artifacts in build
system's dependency graph.
 And making the dependency graph analysis more deterministic
leads to potential improvements in build times by avoiding re-
executing unnecessary build targets. Build reliability is
improved by avoiding errors where build targets might depend on
out-of-date input artifacts.
THANK YOU

Weitere ähnliche Inhalte

Ähnlich wie GOOGLE_BAZEL.pptx

Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Kalkey
 
APACHE
APACHEAPACHE
APACHE
ARJUN
 

Ähnlich wie GOOGLE_BAZEL.pptx (20)

Jasper report dependencies [by sc]
Jasper report dependencies [by sc]Jasper report dependencies [by sc]
Jasper report dependencies [by sc]
 
kishore_Nokia
kishore_Nokiakishore_Nokia
kishore_Nokia
 
"Dude, where’s my boilerplate? ", Oleksii Makodzeba
"Dude, where’s my boilerplate? ", Oleksii Makodzeba"Dude, where’s my boilerplate? ", Oleksii Makodzeba
"Dude, where’s my boilerplate? ", Oleksii Makodzeba
 
ReactJS Workflows
ReactJS WorkflowsReactJS Workflows
ReactJS Workflows
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
ABC: Angular, Bazel, CLI
ABC: Angular, Bazel, CLIABC: Angular, Bazel, CLI
ABC: Angular, Bazel, CLI
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Vc++
Vc++Vc++
Vc++
 
Creating and Maintaining an Open Source Library
Creating and Maintaining an Open Source LibraryCreating and Maintaining an Open Source Library
Creating and Maintaining an Open Source Library
 
Continuous Integration & Continuous Delivery
Continuous Integration & Continuous DeliveryContinuous Integration & Continuous Delivery
Continuous Integration & Continuous Delivery
 
Rene Groeschke
Rene GroeschkeRene Groeschke
Rene Groeschke
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New Update
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Presentation day1oracle 12c
Presentation day1oracle 12cPresentation day1oracle 12c
Presentation day1oracle 12c
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
APACHE
APACHEAPACHE
APACHE
 
NDK Programming in Android
NDK Programming in AndroidNDK Programming in Android
NDK Programming in Android
 
Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

GOOGLE_BAZEL.pptx

  • 1. PRESENTED BY S. SOWMIYA DHARSHNI V. DEEPIKA
  • 2. WHAT IS BAZEL? • An open-source build and test tool similar to Make, Maven, and Gradle. • Uses a human-readable, high-level build language. • Supports projects in multiple languages. • Supports large codebases across multiple repositories, and large numbers of users.
  • 3. HISTORY OF BAZEL • Developed by Google in MARCH 2015. • Written in Java and can work on any cross platform. • Has provided its users with an official website called bazel.build. WHO USE BAZEL? Nearly 17 companies reportedly use Bazel in their tech stacks, including Google, Asana, and Square.
  • 4. WHY TO USE BAZEL? • Produces deterministic results. • Eliminates skew between incremental and clean builds, laptop and CI system, etc. • It can build different client and server apps with the same tool from the same workspace.
  • 5. LOGO AND TAGLINE • Initial release the logo was a green letter "b" stylized into a stem of a basil plant with two leaves. • On July 5, 2017, the Bazel Blog announced a new logo, consisting of three green building blocks arranged to shape a heart. • Bazel advertises itself with the tagline “{Fast, Correct} – Choose two”.
  • 6. Versions of BAZEL • Initial version - 0.17.1 • Latest version - 3.5.0, Master • Intermediate version - 3.4.0 · 3.3.0 · 3.2.0 · 3.1.0 · 3.0.0 · 2.2.0 · 2.1.0 · 2.0.0 · 1.2.0 · 1.1.0 · 1.0.0 · 0.29.1 · 0.29.0 · 0.28.0 · 0.27.0 · 0.26.0 · 0.25.0 · 0.24.0 · 0.23.0 · 0.22.0 · 0.21.0 · 0.20.0 · 0.19.2 · 0.19.1 · 0.18.1 · 0.17.2 • Some versions of Bazel contain a bundled version of OpenJDK.
  • 7. WHY IS BAZEL WRITTEN IN JAVA? Bazel is being developed in java because; Java builds are so larded with user- defined annotation processors and Error Prone checks.
  • 8. HOW DO I USE BAZEL? • Set up Bazel. Download and install BAZEL. • Set up a project workspace. • Write a build file, which tells Bazel what to build and how to build it. • Write your file by declaring build targets using starlack , a domain-specific language. • A build target specifies a set of input artifacts that Bazel will build plus their dependencies, the build rule Bazel will use to build it.
  • 9. • A build rule specifies the build tools Bazel will use, such as compilers and linkers, and their configurations. • Bazel ships with a number of build rules covering the most common artifact types in the supported languages on supported platforms. • Finally run BAZEL, from the command line. Bazel places your outputs within the workspace.
  • 10. UNDERSTANDING BAZEL • LOADS – Load the relevant build file respective to target. • ANALYZES – Examine the inputs and their dependencies, and then perform the specified build rules, and produces an action graph. • EXECUTES – Run the build actions until final build outputs are provided. • BUILD – Files which tell Bazel how to build various parts of the project which is defined by rules and these rules are called targets. • WORKSPACE – File, and similar to BUILD files, there can only be one WORKSPACE in a package. It keeps track of the external dependencies of the project, and some rule adds each external dependency.
  • 11. Bazel is rich in languages supports, platform supports, and have some fantastic tools; some are mentioned below – • Bazel-watcher – Automatically run commands when source files change. • Dazel – For running Bazel inside the Docker container. • Spotify/bazel-tools – Tools for dealing with substantial Bazel- managed repo. BAZEL TOOLS
  • 12. First clone the provided repository by Bazel and check the folders inside github. Create a WORKSPACE text file. As we know we put our workspace file in the root folder, so here, we are putting out a file inside the tutorial folder. Now create library modules. Go to src/main/java/com/example/bazel/ and create BUILD text file under it. Now, we want to add the android_binary which builds the APK file. For this, we had to add one more top-level BUILD text file. Go to src/main and create the file under it. BUILDING AN ANDROID APP
  • 13.  Now, we are ready to build our application. Go to the tutorial folder again on your terminal and run bazel build //src/main:app . Or you can open this project inside android studio by following steps. This will generate three folders:  bazel-bin stores.apk  bazel-genfiles stores intermediary source files that are generated by bazel rules.  bazel-out stores other types of build outputs
  • 14. THE BAZEL QUERY REFERENCE  Bazel comes with a query language for the dependency graph. When you use bazel query to analyze build dependencies, you use a little language, the Bazel Query Language. This document is the reference manual for that language. This document also describes the output formats that bazel query supports.  Traditional bazel query runs on the post-loading phase target graph and therefore has no concept of configurations and their related concepts. Notably, this means it does not correctly resolve select statements and rather returns all possible resolutions of selects. A newer query environment, cquery, properly handles configurations but doesn't provide all of the functionality of this original query.
  • 15. ADVANTAGES OF BAZEL Bazel is fast, reliable, support human-readable languages, and have lots of other benefits too –  High-level build language – It uses human-readable language to describe the build properties of someone’s project. It operates on the concepts of binaries, libraries, data sets, and scripts.  Fast and correct – It can cache build results and only rebuild what it needs to, which make it fast.  Platform independent – It can run on Linux, macOS, Windows.  Scales – It can handle large source files easily. It works with various repositories and user bases in the tens of thousands.  Flexible – Build and test C/C++, Objective-C, Java, Python, and Bourne Shell scripts and a wide variety of other language platforms.
  • 16. Comparing with other tools like Gradle, and its configuration files are more structured and allow Bazel to understand each action clearly, which result in better reproducibility. It has many built-in commands which make it fast and easy to use, such as command like “mobile-install,” which allows for agile and iterative development of Android apps.
  • 17. DISADVANTAGES OF BAZEL  Bazel does not have a high level declarative build language that makes the build easy to use for developers. At Google this can be compensated with a specialized service team that owns the build tool.  Bazel is not built for extensibility (although the Bazel development team has since countered this with assurances that they are working on extensibility).  Speed is optimized around the idea that all transitive dependencies are stored in one big repo; all libraries and tools are checked in to this central repository. Most Enterprises have more distributed dependency management requirements.
  • 18.  When compared with gradle which is an alternate to bazel, gradle has built-in support for both Maven and Ivy repositories. Bazel provides an official rule with support only for Maven repositories, with some boilerplate code is required to use it.  Bazel does not run on Windows. This eliminates a large number of potential Enterprises.  There is no plugin ecosystem in bazel whereas, Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects.
  • 19. DEBUGGING IN BAZEL For debugging the C++ client you can just run it from gdb or lldb as you normally would. But if you want to debug the Java code, you must attach to the server using the following: Run Bazel with debugging option --host_jvm_debug before the command (e.g., bazel --host_jvm_debug build //src:bazel).
  • 20. CONCLUSION  Thus the goal of Bazel is to create a build system where build target inputs and outputs are fully specified and therefore precisely known to the build system. This allows a more accurate analysis and determination of out-of-date build artifacts in build system's dependency graph.  And making the dependency graph analysis more deterministic leads to potential improvements in build times by avoiding re- executing unnecessary build targets. Build reliability is improved by avoiding errors where build targets might depend on out-of-date input artifacts.