Build all Packages Locally with GBS

You can perform a build for all Tizen packages using the Git Build System (GBS).

Before performing the build, study the following instructions:

Note

Clone all Tizen projects

You can clone all Tizen projects over SSH or HTTPS.

Note

Procedures to clone all projects over SSH and HTTPS are almost identical, the only difference being the Git cloning protocol. However, you can only contribute code to Tizen using the SSH method.

Clone all projects over SSH

You can clone the source of all projects over SSH, including the latest source and the snapshot source.

Note

Make sure the SSH configuration file is correctly configured according to Setting up the Development Environment. Otherwise, synchronization cannot be performed successfully and the following error message is displayed:

...
nc: connection failed, SOCKS error 1
ssh_exchange_identification: Connection closed by remote host
nc: connection failed, SOCKS error 1
...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

To clone the latest sources of all projects over SSH:

Note

The latest source does not mean the latest sources in the Gerrit server, but the reference snapshot sources where images generated by the reference snapshot are guaranteed by passing all test cases.

  1. Create a new directory for Tizen and switch to it:

    $ mkdir ~/<Tizen_Project> && cd ~/<Tizen_Project>
    
  2. Create a .repo/ directory that contains all the information - for example, Git repositories, commit IDs, and remote URLs - to download all Git repositories to construct all Tizen projects. Initialize the repository by executing the following command:

    $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b <tizen branch> -m <profile>_<repository>.xml
    
    Note

    For information on installing and setting up the repo tool, see Setting Up the Repo Tool.

    <tizen branch> is tizen for Tizen latest version, and other tizen_<version> branches are tizen <version> for specific Tizen version, including older versions.

    For example:

    • Tizen Unified / standard:

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen -m unified_standard.xml
      
    • Tizen Unified / emulator:

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen -m unified_emulator.xml
      
  3. (optional) Clone the specific snapshot source of all projects over SSH. Replace the latest manifest with a snapshot manifest and make proper modifications by executing the following commands, as appropriate:

    $ wget  <Snapshot_Manifest_URL> -O .repo/manifests/<profile>/<repository>/projects.xml
    

    For example:

    • Tizen Unified / standard:

      $ wget http://download.tizen.org/releases/weekly/tizen/unified/tizen-unified_20201020.1/builddata/manifest/tizen-unified_tizen-unified_20201020.1_standard.xml -O .repo/manifests/unified/standard/projects.xml
      
  4. Synchronize the files for all the projects based on the information downloaded by the repo init command by executing the following command:

    $ repo sync
    
    Note

    You can use several options to increase synchronization speed.

    For example:

    $ repo sync -j 4
    

    You can control jobs number using -j option.

Clone all projects over HTTPS

You can clone the source of all projects over HTTPS, including the latest source and the snapshot source.

To clone the latest sources of all projects over HTTPS, follow the steps below:

  1. Create a new directory for Tizen and switch to it:

    $ mkdir ~/<Tizen_Project> && cd ~/<Tizen_Project>
    
  2. Create a .repo/ directory. Initialize the repository by executing the following command:

    $ repo init -u https://git.tizen.org/cgit/scm/manifest -b <tizen branch> -m unified_<repository>.xml
    

    <tizen branch> is tizen for Tizen latest version, and other tizen_<version> branches are tizen <version> for specific Tizen version, including older versions.

    Note

    The repo init command using HTTPS is almost identical to that of using SSH. The only difference is the parameter of the '-u' option. Replace 'ssh://<Username>@review.tizen.org:29418/scm/manifest' with 'https://git.tizen.org/cgit/scm/manifests'.

    For example:

    • Tizen Unified / standard:

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m unified_standard.xml
      
  3. Replace the remote ‘fetch url’ in the _remote.xml file by executing the following command:

    $ sed -i 's/ssh://review.tizen.org/https://git.tizen.org//cgit/' .repo/manifests/_remote.xml
    

    This changes the ‘fetch url’ from fetch="ssh://review.tizen.org/" to fetch="https://git.tizen.org/cgit/".

  4. (optional) Clone the specific snapshot source of all projects over HTTPS.

    Replace the latest manifest with a snapshot manifest and make proper modifications by executing the following commands, as appropriate:

    $ wget <Snapshot_Manifest_URL> -O .repo/manifests/<profile>/<repository>/projects.xml
    
    Note

    This procedure is the same as for SSH.

  5. Synchronize the files for all the projects based on the information downloaded by the repo init command by executing the following command:

    $ repo sync
    

Build all packages

Build all packages by executing the following commands:

$ cd <Tizen_Project>
$ gbs build <gbs build option>

For example:

$ cd <Tizen_Project>
$ gbs build -A armv7l --threads=4 --clean-once
Note

Since the GBS configuration file (.gbs.conf) and build configuration file (build.conf) are also included in scm/manifests, they are automatically downloaded in the following paths after the repo sync:

  • .gbs.conf: ~/<Tizen_Project>/.gbs.conf
  • build.conf: ~/<Tizen_Project>/scm/meta/build-config/<Tizen version>/<profile>/<repository>_build.conf

For information on increasing the build speed, see Development Tips.

GBS build concepts

The following build concepts help you understand the full build commands:

  • Dependency cycles
    • In Tizen versions 2.4 and higher, packages with dependency cycles are only included in the Tizen:[<Tizen version>]:Base OBS project. Since building packages with dependency cycles is not supported by GBS, it is impossible to build all packages locally with GBS for Tizen:[<Tizen version>]:Base. Therefore, a remote repo which contains RPMs built by OBS for Tizen:[<Tizen version>]:Base needs to be added in the .gbs.conf file.
    • In Tizen versions lower than Tizen 2.3, there is only 1 OBS project and packages with dependency cycles are included in it. To continue the build by breaking the dependency cycles for Tizen versions lower than Tizen 2.3, see Excluding Specific Packages.
  • Accelerator packages
    • Tizen provides cross-compilers and other accelerator packages. For Tizen versions 2.4 and higher, these accelerator packages are included in the Tizen:[<Tizen version>]:Base OBS project.
    • For Tizen versions lower than Tizen 2.3, there is only 1 OBS project and the accelerator packages are included in it. These packages have names ending with -x64 and need to be excluded to build locally with GBS. Otherwise, built out packages are installed and used, and the accelerator packages fail to work. To exclude these accelerator packages for Tizen versions lower than Tizen 2.3, see Excluding Specific Packages.