Bees and brtfs deduplication

Houla that was a long ride to arrive to this point (still needing help though, not building yet with no debug information to chew on).

I finally was able to use qusal to deploy qubes-builderv2 (Qubes Salt Beginner's Guide - #42 by Insurgo)

  • Note: Following BOOTSTRAPPING.md is required to deploy dom0 requirements in proper order. The order of installing dependencies is not that clear for salt beginners and things fail if dom0 requirements aren’t filled (will try to open issues or PR soon enough there)

Once qubes-builderv2 is deployed (and confirmed working), I tried to follow guidelines I inferred from other builderv2 migrated from builderv1 to the point of having the following, which doesn’t build anything as of now. @marmarek @fepitre if you have any insights, that would be awesome.

qubes-builderv2’s builder.conf:

git:
  baseurl: https://github.com
  prefix: QubesOS/qubes-
  branch: release4.2
  maintainers:
    # marmarek
    - '0064428F455451B3EBE78A7F063938BA42CFA724'
    # simon
    - '274E12AB03F2FE293765FC06DA0434BC706E1FCF'

backend-vmm: xen
debug: true
verbose: true
qubes-release: r4.2

distributions:
  - host-fc37

artifacts-dir: /home/user/src/qubes-builderv2/artifacts

components:
  - builder-rpm:
      branch: main
      packages: False
  - bees:
      branch: main
      packages: False
      url: https://github.com/tlaurion/qubes-bees
      maintainers:
        - '0ACCB2B664EE17E054B05E0B4A38DA8BEB9C8396'

executor:
  type: qubes
  options:
    dispvm: "dom0"

stages:
  - fetch
  - prep
  - build
  - post
  - verify
  - sign:
      executor:
        type: local
  - publish:
      executor:
        type: local
  - upload:
      executor:
        type: local

I deployed my public key (which signed commits and tags: keys.openpgp.org) under qubesbuilder/plugins/fetch/keys/ which is recognized properly. It fetches, verifies tag and puts content of git repo correctly under bees directory, but it seems i’m missing something under .qubesbuilder (Makefile.builder not required anymore, I inferred where only that file is required + bees.spec) since bees tarball is not put in place as can be seen later on.

The builder only does the following (putting git repo content at the right place but not telling anything else):

[user@qubes-builder ~/src/qubes-builderv2(main)]
(130)$ ./qb --verbose -c bees package all
Running stage: fetch
13:27:23,198 [fetch] bees: source already fetched. Updating.
13:27:53,774 [executor:qubes:disp8379] copy-in (cmd): /usr/lib/qubes/qrexec-client-vm -- disp8379 qubesbuilder.FileCopyIn+-2Fbuilder-2Fbees /usr/lib/qubes/qfile-agent /home/user/src/qubes-builderv2/artifacts/sources/bees
13:27:55,040 [executor:qubes:disp8379] copy-in (cmd): /usr/lib/qubes/qrexec-client-vm -- disp8379 qubesbuilder.FileCopyIn+-2Fbuilder-2Fplugins-2Ffetch /usr/lib/qubes/qfile-agent /home/user/src/qubes-builderv2/qubesbuilder/plugins/fetch
13:28:00,838 [executor:qubes:disp8379] Executing '/usr/bin/qvm-run-vm -- disp8379 env -- VERBOSE=1 DEBUG=1 BACKEND_VMM=xen bash -c 'cd /builder && /builder/plugins/fetch/scripts/get-and-verify-source.py https://github.com/tlaurion/qubes-bees /builder/bees /builder/keyring /builder/plugins/fetch/keys --git-branch main --minimum-distinct-maintainers 1 --maintainer 0ACCB2B664EE17E054B05E0B4A38DA8BEB9C8396''.
13:28:02,241 [executor:qubes:disp8379] output: --> Verifying tags...
13:28:02,241 [executor:qubes:disp8379] output: ---> Good tag 596a650b16a908562e210638a03eb90fec7a759c.
13:28:02,241 [executor:qubes:disp8379] output: Enough distinct tag signatures. Found 1, mandatory minimum is 1.
13:28:02,241 [executor:qubes:disp8379] output: --> Merging...
13:28:02,266 [executor:qubes:disp8379] copy-out (cmd): /usr/lib/qubes/qrexec-client-vm disp8379 qubesbuilder.FileCopyOut+-2Fbuilder-2Fbees /usr/bin/qfile-unpacker 1000 /home/user/src/qubes-builderv2/artifacts/sources
Running stage: prep
Running stage: build
Running stage: post
Running stage: verify
Running stage: sign
Running stage: publish
Running stage: upload
13:28:12,339 [upload] host-fedora-37.x86_64: No remote location defined. Skipping.
[user@qubes-builder ~/src/qubes-builderv2(main)]

What am I missing under .qubesbuilder? It seems that the bees.spec is not considered, nor the downloading of prerequisites also specified into .quebesbuilder file above. Only content of the git repo is properly deployed, as can be seen here:

(130)$ ls -al /home/user/src/qubes-builderv2/artifacts/sources/bees/
total 72K
drwxr-xr-x 4 user user 4.0K Feb  9 13:05 ./
drwxr-xr-x 8 user user 4.0K Feb  9 13:28 ../
drwxr-xr-x 8 user user 4.0K Feb  9 13:28 .git/
drwxr-xr-x 2 user user 4.0K Feb  9 10:01 rpm_spec/
-rw-r--r-- 1 user user 4.2K Feb  9 10:01 bees.changes
-rw-r--r-- 1 user user  35K Feb  9 10:01 LICENSE
-rw-r--r-- 1 user user  250 Feb  9 13:05 .qubesbuilder
-rw-r--r-- 1 user user  102 Feb  9 10:01 README.md
-rw-r--r-- 1 user user   65 Feb  9 10:01 v0.10.tar.gz.sha256
[user@qubes-builder ~/src/qubes-builderv2(main)]

At the time of writing, here is the content of my .qubesbuilder under git repo:

$ cat /home/user/src/qubes-builderv2/artifacts/sources/bees/.qubesbuilder
host:
  rpm:
    build:
    - rpm_spec/bees.spec
source:
  modules:
  - gcc-c++
  - libbtrfs-devel
  - libuuid-devel
  - make
  - autotools
  files:
  - url: https://github.com/Zygo/bees/archive/refs/tags/v0.10.tar.gz
    sha256: v0.10.tar.gz.sha256

The repo (changing since not working) is at GitHub - tlaurion/qubes-bees: Best effort BRTFS offline deduplication, based on OpenSuse Tumbleweed rpm spec inclusion
Any advice welcome: i’m not understanding what i’m missing from linux example at GitHub - QubesOS/qubes-builderv2: Next generation of Qubes OS builder