Giter VIP home page Giter VIP logo

bob-build's Introduction

⚠ Deprecation Notice ⚠

Bob will be deprecated when Android moves to Bazel.

We recommend that new projects use Bazel instead.

We will be introducing stricter build rules in Bob to improve Bazel alignment.

This may cause existing builds to break.

Bob Build System

CI

Introduction

Bob is a declarative build system intended to build C/C++ software for both Linux and Android.

Bob has a configuration system that works in a similar way to the Linux Kernel's Kconfig.

Build definitions use a JSON-like syntax to describe the modules to build.

Bob uses Google's Blueprint to do the heavy lifting. As such it has similarities with Soong.

Requirements

To use Bob you will need:

  • golang (>=1.11)
  • ninja-build (>=1.8)
  • python3 (>=3.6)
  • python3-ply

License

The software is provided under the Apache 2.0 license. Contributions to this project are accepted under the same license.

Usage

Setting up a project

Refer to the documentation for instructions on how to setup a project to use Bob.

Config file format

The config file format is simplified Kconfig, with bool, int and string types.

config USE_LOCALES
    bool "Use Locales"
    default y

config DEFAULT_LOCALE
    string "Default Locale"
    depends on USE_LOCALES
    default "sv_SE"

For more information see the documentation.

Build file format

The build files are very simple. There are no conditional or control flow statements.

bob_defaults {
    name: "common_libs",
    ldlibs: ["-lncurses"],
}

bob_binary {
    name: "less",
    defaults: ["common_libs"],
    srcs: ["src/less.c"],

    // use_locales is a feature. When enabled in the configuration
    // src/locales.c will be compiled and linked.
    use_locales: {
        srcs: ["src/locales.c"],
        cflags: ["-DDEFAULT_LOCALE={{.default_locale}}"],
    }
}

For more information see the documentation.

Development

Directory structure

blueprint - this is a git submodule containing the required version of Blueprint

config_system - contains the Python-based configuration system

docs - project documentation

example - example files for project setup

scripts - miscellaneous scripts

tests - contains build tests

Go code directories

cmd - contains the Go code for command line tools

core - contains the core Go code

internal - contains Go packages for internal use

plugins - contains plugins for Soong

Developing for Bob

To load Bob code in a Go-aware IDE, create a workspace directory outside the Bob tree and run:

apt-get install bindfs
export GOPATH=<workspace>
bob/scripts/setup_workspace_for_bob.bash

Bazel

Bob has the minimal support for building with Bazel via Gazelle.

To build Bob:

bazelisk build //...

To run the Go unit tests:

bazelisk test //...

To update build files:

bazelisk run //:gazelle

To update deps.bzl:

bazelisk run //:gazelle-update-repos

Generating Coverage

Generate the LCOV files:

bazelisk coverage --instrument_test_targets --@io_bazel_rules_go//go/config:cover_format=lcov --combined_report=lcov //...

Generate a html report:

genhtml --output genhtml "$(bazelisk info output_path)/_coverage/_coverage_report.dat"

Documentation

Detailed documentation is in the docs directory of the repository.

bob-build's People

Contributors

a-khabarov avatar auselen avatar birunts avatar brandonthomasjonesarm avatar chrisdiamand avatar dliviu avatar fangfufu avatar francois-berder avatar gelldur avatar jbauman42 avatar kilroyd avatar lukokr-aarch64 avatar m-atanassov avatar mattyclarkson avatar micprz avatar sampercival avatar silverclaw avatar teekay-1984 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bob-build's Issues

test automation

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu 18.0.4]
  • Version [e.g. 22]
  • bob-build SHA

Additional context
Add any other context about the problem here.

module_dir replaced twice

Isn't a mistake? module_dir replaced twice, in genrule bob is not necessary, or even incorrect, since ModuleDir() will be then pointing at main Android.bp file basedir?

Name already taken

Hi,

i just wanted to let you know that there's already a build tool called Bob. It targets mainly cross-platform building in different variants independent of source languages and the actual compilers, but nevertheless it's a build tool, as well.

Since you seem to be not that far into development, maybe you should consider renaming your tool or at least get in touch with the developers of the "other" Bob.

Regards

build fail when there is no python

Describe the bug
build fail on ubuntu2204 when there is no /usr/bin/python, but exists /usr/bin/python3.

To Reproduce

  1. install only python3 in the ubuntu
  2. rename /usr/bin/python to /usr/bin/python.mv
  3. ./bootstrap_linux.bash
    BUILDDIR is not set - using .
    CONFIGNAME is not set - using bob.config
    ./pathtools.bash: line 42: python: command not found
    ./pathtools.bash: line 42: python: command not found
    ./bootstrap.bash: line 132: ./blueprint/bootstrap.bash: No such file or directory

Expected behavior
no error output

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu 22.04.3]
  • Version [e.g. 22]
  • bob-build SHA

Additional context
should replace python with python3 in pathtools.bash file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.