]> git.ipfire.org Git - thirdparty/pdns.git/blame - BUILDING-PACKAGES.md
Meson: Use include_directories for pgsqlbackend
[thirdparty/pdns.git] / BUILDING-PACKAGES.md
CommitLineData
9d89cf23
RG
1Building packages
2=================
3
4PowerDNS uses the pdns-builder tool to generate packages for its products. The actual workflow can be found in the [builder-support](https://github.com/PowerDNS/pdns/tree/master/builder-support) directory of the git repository.
5The [build-tags.yml](https://github.com/PowerDNS/pdns/blob/master/.github/workflows/build-tags.yml) workflow automatically builds packages when a tag is pushed, so there is no need to trigger a manual build for releases, and actually doing so would be worse from a provenance point of view where full automation is always better.
6
7Building packages on your own computer
8--------------------------------------
9
6b845683
RG
10This requires a working Docker installation.
11
9d89cf23
RG
121. Clone our git repo (`git clone https://github.com/PowerDNS/pdns.git`)
132. Check out the version you want, it can be a git tag like dnsdist-1.8.1, a git commit ID or branch
143. Update submodules (`git submodule update --init --recursive`)
154. Execute `builder/build.sh` to see what arguments it supports
a85c9834 165. Then run `builder/build.sh` with the arguments you want (for example, `builder/build.sh -m recursor debian-bookworm`)
9d89cf23
RG
17
18Building packages from GitHub actions
19-------------------------------------
20
21You can build packages from your own fork of the PowerDNS repository. Go to the [PowerDNS/pdns](https://github.com/PowerDNS/pdns) repository and click on `Fork` at the top right of the screen. When asked if you would like to only copy the master branch, say no, as otherwise you will not be able to build packages from tagged releases. If you have already done so and have not done any modification to your fork, the easiest way is to delete and recreate it.
22
23On your fork, go to the `Actions` tab. You will be greeted by a message stating `Workflows aren’t being run on this forked repository`. You can click `I understand my workflows, go ahead and enable them`.
24
25Please be aware that by default some of the workflows are executed once every day, and enabling them will consume billing time our of your GitHub actions quota, although at the moment GitHub disables these by default: `This scheduled workflow is disabled because scheduled workflows are disabled by default in forks`.
26
27On the left side, click on `Trigger specific package build`.
28
29Locate the `Run workflow` dropdown item on the top right side of the screen, inside the blue region stating `This workflow has a workflow_dispatch event trigger.` It will open a menu with several options:
d74dda8a 30- `Branch`: you can keep `master` here, unless you need to build for an operating system which is not in the list, in which case you will have to create a new branch and add the required file(s) for this OS. See `Adding a new OS` below.
9d89cf23
RG
31- `Product to build`: select the product you want to build packages for, for example `dnsdist`
32- `OSes to build for, space separated`: keep one or more OSes you want to build packages for, for example `ubuntu-focal`
33- `git ref to checkout`: the exact version you want to build. It can be the name of branch, a git tag or a git commit ID. Most likely you will be willing to build from a tagged release, like `dnsdist-1.8.1`.
34- `is this a release build?`: Keep `NO`
35
36Click `Run workflow` to start the build.
37
38If you reload the page, you should now see your build in progress as a `Trigger specific package build` workflow run. It will take some time to finish, but you can look at the progress by clicking on it.
39
40Once it's done, you can retrieve the generated package in the list of artifacts on the `Summary` page of the workflow run, by clicking on the `Summary` link on the top right of the screen.
41
42Adding a new OS to the list
43---------------------------
44
45Adding a new OS is usually easy, provided that it does not differ too much from an existing one. For example, to add support for Debian Bookworm (already present in the current repository), one had to:
46
47Copy the existing instructions for Debian Buster:
48```
49cp builder-support/dockerfiles/Dockerfile.target.debian-buster builder-support/dockerfiles/Dockerfile.target.debian-bookworm
50```
51
52In the new `builder-support/dockerfiles/Dockerfile.target.debian-bookworm` file, replace every occurence of `debian-buster` by `debian-bookworm`, and of `debian:buster` by `debian:bookworm`
53
54Create symbolic links for the amd64 and arm64 versions:
55```
56ln -s builder-support/dockerfiles/Dockerfile.target.debian-bookworm builder-support/dockerfiles/Dockerfile.target.debian-bookworm-amd64
57ln -s builder-support/dockerfiles/Dockerfile.target.debian-bookworm builder-support/dockerfiles/Dockerfile.target.debian-bookworm-arm64
58```
59
60Then add the new target to the list of OSes in the `.github/workflows/builder-dispatch.yml` workflow file:
61```
62default: >-
63 el-7
64 el-8
65 el-9
66 debian-buster
67 debian-bullseye
68 debian-bookworm
69 ubuntu-focal
70 ubuntu-jammy
71```
72
73If release packages should be automatically built for this new target, then `.github/workflows/build-packages.yml` has to be updated as well:
74``
75```
76default: >-
77 el-7
78 el-8
79 el-9
80 debian-buster
81 debian-bullseye
82 debian-bookworm
83 ubuntu-focal
84 ubuntu-jammy
85```
86
87Not forgetting to update the list of hashes later in the same file:
88```
89pkghashes-el-7: ${{ steps.pkghashes.outputs.pkghashes-el-7 }}
90pkghashes-el-8: ${{ steps.pkghashes.outputs.pkghashes-el-8 }}
91pkghashes-el-9: ${{ steps.pkghashes.outputs.pkghashes-el-9 }}
92pkghashes-debian-buster: ${{ steps.pkghashes.outputs.pkghashes-debian-buster }}
93pkghashes-debian-bullseye: ${{ steps.pkghashes.outputs.pkghashes-debian-bullseye }}
94pkghashes-debian-bookworm: ${{ steps.pkghashes.outputs.pkghashes-debian-bookworm }}
95pkghashes-ubuntu-focal: ${{ steps.pkghashes.outputs.pkghashes-ubuntu-focal }}
96pkghashes-ubuntu-jammy: ${{ steps.pkghashes.outputs.pkghashes-ubuntu-jammy }}
97```