Building All Packages Locally with GBS

8 mins read

Building 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

Cloning 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.

Cloning 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
    

    <tizen branch> is tizen for Tizen 5.0, tizen_4.0 for Tizen 4.0 and tizen_3.0 for Tizen 3.0.

    For example:

    • Tizen 5.0 Unified / standard

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

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

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

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

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_4.0 -m unified_emulator.xml
      
    • Tizen 3.0 Common / arm-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m common_arm-wayland.xml
      
    • Tizen 3.0 Common / arm64-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m common_arm64-wayland.xml
      
    • Tizen 3.0 Common / emulator32-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m common_emulator32-wayland.xml
      
    • Tizen 3.0 Common / ia32-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m common_ia32-wayland.xml
      
    • Tizen 3.0 Common / x86_64-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m common_x86_64-wayland.xml
      
    • Tizen 3.0 Mobile / arm-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m mobile_arm-wayland.xml
      
    • Tizen 3.0 Mobile / emulator-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m mobile_emulator-wayland.xml
      
    • Tizen 3.0 Mobile / target-TM1

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m mobile_target-TM1.xml
      
    • Tizen 3.0 TV / arm-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m tv_arm-wayland.xml
      
    • Tizen 3.0 TV / emulator32-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m tv_emulator32-wayland.xml
      
    • Tizen 3.0 TV / emulator64-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m tv_emulator64-wayland.xml
      
    • Tizen 3.0 Wearable / emulator-circle

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m wearable_emulator-circle.xml
      
    • Tizen 3.0 Wearable / target-circle

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m wearable_target-circle.xml
      
    • Tizen 3.0 Wearable / emulator32-wayland

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m wearable_emulator32-wayland.xml
      
    • Tizen 3.0 IVI /arm

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m ivi_arm.xml
      
    • Tizen 3.0 IVI / emulator

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_3.0 -m ivi_emulator.xml
      
  3. Clone the specific snapshot source of all projects over SSH (optional). 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
    $ sed -i '3,4d' .repo/manifests/<profile>/<repository>/projects.xml
    

    For example:

    • Tizen 5.0 Unified / standard

      $ wget http://download.tizen.org/releases/weekly/tizen/unified/tizen-unified_20170928.1/builddata/manifest/tizen-unified_20170928.1_standard.xml -O .repo/manifests/unified/standard/projects.xml
      $ sed -i '3,4d' .repo/manifests/unified/standard/projects.xml
      
    • Tizen 4.0 Unified / emulator

      $ wget http://download.tizen.org/releases/weekly/tizen/4.0-unified/tizen-4.0-unified_20171027.1/builddata/manifest/tizen-4.0-unified_20171027.1_emulator.xml -O .repo/manifests/unified/standard/projects.xml
      $ sed -i '3,4d' .repo/manifests/unified/standard/projects.xml
      
    • Tizen 3.0 Common / arm64-wayland

      $ wget  http://download.tizen.org/snapshots/tizen/3.0-common/tizen-3.0-common_20170627.1/builddata/manifest/tizen-3.0-common_20170627.1_arm64-wayland.xml -O .repo/manifests/common/arm64-wayland/projects.xml
      $ sed -i '3,4d' .repo/manifests/common/arm64-wayland/projects.xml
      
    • Tizen 3.0 Mobile / target-TM1

      $ wget  http://download.tizen.org/snapshots/tizen/3.0-mobile/tizen-3.0-mobile_20170627.1/builddata/manifest/tizen-3.0-mobile_20170627.1_target-TM1.xml -O .repo/manifests/mobile/target-TM1/projects.xml
      $ sed -i '3,4d' .repo/manifests/mobile/target-TM1/projects.xml
      
    • Tizen 3.0 TV / arm-wayland

      $ wget  http://download.tizen.org/snapshots/tizen/3.0-tv/tizen-3.0-tv_20170627.1/builddata/manifest/tizen-3.0-tv_20170627.1_arm-wayland.xml -O .repo/manifests/tv/arm-wayland/projects.xml
      $ sed -i '3,4d' .repo/manifests/tv/arm-wayland/projects.xml
      
    • Tizen 3.0 Wearable / emulator-circle

      $ wget  http://download.tizen.org/snapshots/tizen/3.0-wearable/tizen-3.0-wearable_20170627.1/builddata/manifest/tizen-3.0-wearable_20170627.1_emulator-circle.xml -O .repo/manifests/wearable/emulator-circle/projects.xml
      $ sed -i '3,4d' .repo/manifests/wearable/emulator-circle/projects.xml
      
    • Tizen 3.0 IVI / arm

      $ wget  http://download.tizen.org/snapshots/tizen/3.0-ivi/tizen-3.0-ivi_20170627.1/builddata/manifest/tizen-3.0-ivi_20170627.1_arm.xml -O .repo/manifests/ivi/arm/projects.xml
      $ sed -i '3,4d' .repo/manifests/ivi/arm/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
    

Cloning 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:

  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 5.0, tizen_4.0 for Tizen 4.0 and tizen_3.0 for Tizen 3.0.

    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 5.0 Unified / standard

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m unified_standard.xml
      
    • Tizen 4.0 Unified / emulator

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen_4.0 -m unified_emulator.xml
      
    • Tizen 3.0 Common / arm64-wayland

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen_3.0 -m common_arm64-wayland.xml
      
    • Tizen 3.0 Mobile / target-TM1

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen_3.0 -m mobile_target-TM1.xml
      
    • Tizen 3.0 TV / arm-wayland

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen_3.0 -m tv_arm-wayland.xml
      
    • Tizen 3.0 Wearable / emulator-circle

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen_3.0 -m wearable_emulator-circle.xml
      
    • Tizen 3.0 IVI /arm

      $ repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen_3.0 -m ivi_arm.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. Clone the specific snapshot source of all projects over HTTPS (optional).

    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
    $ sed -i '3,4d' .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
    

Building 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 i586 --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

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.