21700: Install Bundler system-wide in Rails postinst
[arvados.git] / build / README
1 Prerequisites
2 =============
3
4 In order to build packages, you will need:
5
6 * Docker installed
7 * permission to run Docker commands
8 * the `WORKSPACE` environment variable set to the absolute path of an
9   Arvados Git work tree
10
11 Quickstart
12 ==========
13
14 Build and test all the packages for a distribution on your architecture by
15 running:
16
17     ./run-build-test-packages-one-target.sh --target DISTRO
18
19 This will build package build and test Docker images for the named target
20 distribution, build all packages in a build container, then test all
21 packages in a test container.
22
23 Limit the build to a single architecture by adding the `--arch ARCH`
24 option. Supported architectures are amd64 and arm64. Note cross-compilation
25 from amd64 to arm64 is currently only supported on Debian 11+.
26
27 Limit the build to a single package by adding the `--only-build
28 PACKAGE_NAME` option. This is helpful when a build is mostly in good shape
29 and you're tracking down last bugs in one or two packages.
30
31 Get more verbose output by adding the `--debug` option.
32
33 By default the script avoids rebuilding or retesting packages that it
34 detects have already been done in past runs. You can force the script to
35 rebuild or retest package(s) with the `--force-build` and `--force-test`
36 options, respectively.
37
38 Run the script with `--help` for more information about other options.
39
40 Scripts in this directory
41 =========================
42
43 run-tests.sh                             Run unit and integration test suite.
44
45 run-build-test-packages-one-target.sh    Entry point, wraps
46                                          run-build-packages-one-target.sh to
47                                          perform package building and testing
48                                          inside Docker.
49
50 run-build-packages-one-target.sh         Build packages for one target inside Docker.
51
52 run-build-packages-all-targets.sh        Run run-build-packages-one-target.sh
53                                          for every target.
54
55 run-build-packages.sh                    Actually build packages.  Intended to run
56                                          inside Docker container with proper
57                                          build environment.
58
59 run-build-packages-python-and-ruby.sh    Build Python and Ruby packages suitable
60                                          for upload to PyPi and Rubygems.
61
62 run-build-docker-images.sh               Build arvbox Docker images.
63
64 run-build-docker-jobs-image.sh           Build arvados/jobs Docker image
65                                          (uses published debian packages)
66
67 build-dev-docker-jobs-image.sh           Build developer arvados/jobs Docker image
68                                          (uses local git tree)
69
70 run-library.sh                           A library of functions shared by the
71                                          various scripts in this
72                                          directory.
73
74 Adding a new target
75 ===================
76
77 In order to build packages on a new distribution, you MUST:
78
79 * Add a rule for `TARGET/generated` to `package-build-dockerfiles/Makefile`.
80 * Add the new `TARGET/generated` rule to the `all` target in
81   `package-build-dockerfiles/Makefile`.
82 * Write `package-build-dockerfiles/TARGET/Dockerfile`.
83 * Add a rule for `TARGET/generated` to `package-test-dockerfiles/Makefile`.
84 * Add the new `TARGET/generated` rule to the `all` target in
85   `package-test-dockerfiles/Makefile`.
86 * Write `package-test-dockerfiles/TARGET/Dockerfile`.
87 * Create `package-testing/test-packages-TARGET.sh`, ideally by making it a
88   symlink to `FORMAT-common-test-packages.sh`.
89 * Update the package download code near the bottom of `test_package_presence`
90   in `run-library.sh` so it can download packages for the new distribution.
91
92 Of course, any part of our package build or test infrastructure may need to
93 be updated to accommodate the process for new distributions. If you're
94 having trouble building lots of packages, consider grepping these build
95 scripts for the identifier of the closest working target, and see if you may
96 need to add branches or similar hooks for your target. If you're having
97 trouble building specific packages, consider doing the same for those
98 packages' `fpm-info.sh` files.