From 919999bea4c870cc7c8524705b8c2e832f796c6d Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 17:39:55 +0000 Subject: [PATCH 01/17] Set up a CI job to build and test the Debian packaging Refs [ticket: 4150](https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4150) --- .circleci/config.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69990798a..c17908423 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,6 +117,10 @@ workflows: - "another-locale": {} + # Test our sources with the packaging for Debian Testing + # https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4150 + - "debian-trixie-package" + - "windows-server-2022": name: "Windows Server 2022, CPython <>" matrix: @@ -542,6 +546,60 @@ jobs: <<: *UTF_8_ENVIRONMENT TAHOE_LAFS_TOX_ENVIRONMENT: "py310" + debian-trixie-package: + docker: + - <<: *DOCKERHUB_AUTH + image: "debian:trixie" + steps: + - run: + name: "Get latest Debian repository index and install essentials" + command: | + apt update + apt-get install --no-install-recommends --yes \ + git \ + ca-certificates \ + quilt + - run: + name: "Download sources for Tahoe-LAFS and @merkys Debian packaging" + command: | + mkdir /tmp/debian-trixie-package + cd /tmp/debian-trixie-package + # Take Tahoe-LAFS source + git clone https://github.com/tahoe-lafs/tahoe-lafs.git + # Take debian/ directory from Debian packaging repository + git clone https://salsa.debian.org/merkys/tahoe-lafs.git merkys-tahoe-lafs + cd tahoe-lafs/ + ln -s ../merkys-tahoe-lafs/debian + ln -s ../merkys-tahoe-lafs/debian/patches + - run: + name: "Install Tahoe-LAFS dependencies from the Debian repositories" + command: | + # 'apt-get install' dependencies from debian/control + apt-get install --no-install-recommends --yes $(awk ' + /^(Build-)?Depends:/ || /^ / && deps { + sub(/^[^ ]+: /, "") + deps = 1 + dep_str = dep_str ", " $0 + next + } + { deps=0 } + END { + split(dep_str, dep_array, /[,|] */) + for (d in dep_array) { + dep = dep_array[d] + gsub(/[^a-z0-9_.+-].*$/, "", dep) + if (dep && !seen[dep]++) print dep + } + }' debian/control) + - run: + name: "Apply the Debian package's patches" + command: | + quilt push -a + - run: + name: "Build & run tests" + command: | + make -f debian/rules binary + nixos: parameters: nixpkgs: From 6f3af15bf266262db9a5741abd246adcc3c07124 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 17:53:10 +0000 Subject: [PATCH 02/17] Do the empty curlies convince CircleCI to work on my job? --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c17908423..ff977ce08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,7 +119,8 @@ workflows: # Test our sources with the packaging for Debian Testing # https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4150 - - "debian-trixie-package" + - "debian-trixie-package": + {} - "windows-server-2022": name: "Windows Server 2022, CPython <>" From b9283fd8b18bab779b83be7efb440ef2e130e264 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 17:58:14 +0000 Subject: [PATCH 03/17] I thought CircleCI might stay in the directory in between steps but maybe not? --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff977ce08..b1eeb09f8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -591,14 +591,16 @@ jobs: gsub(/[^a-z0-9_.+-].*$/, "", dep) if (dep && !seen[dep]++) print dep } - }' debian/control) + }' /tmp/debian-trixie-package/tahoe-lafs/debian/control) - run: name: "Apply the Debian package's patches" command: | + cd /tmp/debian-trixie-package/tahoe-lafs/ quilt push -a - run: name: "Build & run tests" command: | + cd /tmp/debian-trixie-package/tahoe-lafs/ make -f debian/rules binary nixos: From adf7cbf2b322d3ac701238e4b7de89457f392b4e Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 18:05:37 +0000 Subject: [PATCH 04/17] For kicks - try what happens if we don't stop when Quilt fails --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1eeb09f8..81b534e27 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -596,7 +596,8 @@ jobs: name: "Apply the Debian package's patches" command: | cd /tmp/debian-trixie-package/tahoe-lafs/ - quilt push -a + # TODO decide: Should we honour quilt's opinion about this build? + quilt push -a || true - run: name: "Build & run tests" command: | From 88608fb04406494b29896c6cf5eaef06d6158d99 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 18:26:57 +0000 Subject: [PATCH 05/17] Store artefact (built deb package) --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 81b534e27..52eb54332 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -603,6 +603,8 @@ jobs: command: | cd /tmp/debian-trixie-package/tahoe-lafs/ make -f debian/rules binary + - store_artifacts: + path: "/tmp/*.deb" nixos: parameters: From abd0b3ac1a68053c32aae8e9e246b847fef4b768 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 18:31:27 +0000 Subject: [PATCH 06/17] Debian Trixie is Debian 13 --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 52eb54332..467333a66 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,9 +117,9 @@ workflows: - "another-locale": {} - # Test our sources with the packaging for Debian Testing + # Test our sources with the packaging for Debian 13 (Trixie) # https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4150 - - "debian-trixie-package": + - "debian-13-package": {} - "windows-server-2022": @@ -547,7 +547,7 @@ jobs: <<: *UTF_8_ENVIRONMENT TAHOE_LAFS_TOX_ENVIRONMENT: "py310" - debian-trixie-package: + debian-13-package: docker: - <<: *DOCKERHUB_AUTH image: "debian:trixie" @@ -563,8 +563,8 @@ jobs: - run: name: "Download sources for Tahoe-LAFS and @merkys Debian packaging" command: | - mkdir /tmp/debian-trixie-package - cd /tmp/debian-trixie-package + mkdir /tmp/debian-13-package + cd /tmp/debian-13-package # Take Tahoe-LAFS source git clone https://github.com/tahoe-lafs/tahoe-lafs.git # Take debian/ directory from Debian packaging repository @@ -591,17 +591,17 @@ jobs: gsub(/[^a-z0-9_.+-].*$/, "", dep) if (dep && !seen[dep]++) print dep } - }' /tmp/debian-trixie-package/tahoe-lafs/debian/control) + }' /tmp/debian-13-package/tahoe-lafs/debian/control) - run: name: "Apply the Debian package's patches" command: | - cd /tmp/debian-trixie-package/tahoe-lafs/ + cd /tmp/debian-13-package/tahoe-lafs/ # TODO decide: Should we honour quilt's opinion about this build? quilt push -a || true - run: name: "Build & run tests" command: | - cd /tmp/debian-trixie-package/tahoe-lafs/ + cd /tmp/debian-13-package/tahoe-lafs/ make -f debian/rules binary - store_artifacts: path: "/tmp/*.deb" From ac47e299d2e7db1d1885bc727aaa45c77a4caf78 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 18:43:50 +0000 Subject: [PATCH 07/17] Wtf, CircleCI doesn't support globbing for collecting artifacts --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 467333a66..663e627eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -604,7 +604,7 @@ jobs: cd /tmp/debian-13-package/tahoe-lafs/ make -f debian/rules binary - store_artifacts: - path: "/tmp/*.deb" + path: "/tmp/tahoe-lafs_1.20.0-1_all.deb" nixos: parameters: From f58eb85398d8af3373b9f6bfecec1d99b16eb8f3 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 10 Jan 2025 18:48:06 +0000 Subject: [PATCH 08/17] Hey Towncrier we have a working Debian package again! --- newsfragments/4150.installation | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/4150.installation diff --git a/newsfragments/4150.installation b/newsfragments/4150.installation new file mode 100644 index 000000000..a6bf5ca15 --- /dev/null +++ b/newsfragments/4150.installation @@ -0,0 +1 @@ +A package for the upcoming Debian Trixie has been created and successfully submitted by @merkys (thanks!) From cc86876fe288bbb66f3df108ae23df0bf14fe2d0 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Sun, 12 Jan 2025 05:56:38 +0000 Subject: [PATCH 09/17] Don't apply packaging's patches - we want vanilla tahoe to be compatible with Debian-13. --- .circleci/config.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 663e627eb..a4ea7f788 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -592,12 +592,15 @@ jobs: if (dep && !seen[dep]++) print dep } }' /tmp/debian-13-package/tahoe-lafs/debian/control) - - run: - name: "Apply the Debian package's patches" - command: | - cd /tmp/debian-13-package/tahoe-lafs/ - # TODO decide: Should we honour quilt's opinion about this build? - quilt push -a || true + # Don't apply the patches in the package. We aim for + # compatibility without need for downstream patches. + # + # - run: + # name: "Apply the Debian package's patches" + # command: | + # cd /tmp/debian-13-package/tahoe-lafs/ + # # TODO decide: Should we honour quilt's opinion about this build? + # quilt push -a || true - run: name: "Build & run tests" command: | From e81fc53e8bda6459bd4f3eea7ef48425b3dc3643 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Sun, 12 Jan 2025 06:04:35 +0000 Subject: [PATCH 10/17] Clean up the patching from the CI job. --- .circleci/config.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a4ea7f788..de2260174 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -558,8 +558,7 @@ jobs: apt update apt-get install --no-install-recommends --yes \ git \ - ca-certificates \ - quilt + ca-certificates - run: name: "Download sources for Tahoe-LAFS and @merkys Debian packaging" command: | @@ -571,7 +570,6 @@ jobs: git clone https://salsa.debian.org/merkys/tahoe-lafs.git merkys-tahoe-lafs cd tahoe-lafs/ ln -s ../merkys-tahoe-lafs/debian - ln -s ../merkys-tahoe-lafs/debian/patches - run: name: "Install Tahoe-LAFS dependencies from the Debian repositories" command: | @@ -592,15 +590,6 @@ jobs: if (dep && !seen[dep]++) print dep } }' /tmp/debian-13-package/tahoe-lafs/debian/control) - # Don't apply the patches in the package. We aim for - # compatibility without need for downstream patches. - # - # - run: - # name: "Apply the Debian package's patches" - # command: | - # cd /tmp/debian-13-package/tahoe-lafs/ - # # TODO decide: Should we honour quilt's opinion about this build? - # quilt push -a || true - run: name: "Build & run tests" command: | From a6f9b2b3fa5f0be252872dd87fd0043de3102a09 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Sun, 12 Jan 2025 06:10:14 +0000 Subject: [PATCH 11/17] Install the package and run the CLI once --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index de2260174..426cd461c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -595,8 +595,14 @@ jobs: command: | cd /tmp/debian-13-package/tahoe-lafs/ make -f debian/rules binary + - run: + name: "Install the built package" + command: dpkg -i /tmp/tahoe-lafs_1.20.0-1_all.deb + - run: + name: "Run our newly system-wide installed tahoe" + command: tahoe --version - store_artifacts: - path: "/tmp/tahoe-lafs_1.20.0-1_all.deb" + path: /tmp/tahoe-lafs_1.20.0-1_all.deb nixos: parameters: From e58609e16d8cf7d3c5bba83a44a3c7f9160d944b Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Sun, 12 Jan 2025 07:21:10 +0000 Subject: [PATCH 12/17] Try to get .deb output path right --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 426cd461c..4cf6a7aa3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -597,12 +597,12 @@ jobs: make -f debian/rules binary - run: name: "Install the built package" - command: dpkg -i /tmp/tahoe-lafs_1.20.0-1_all.deb + command: dpkg -i /tmp/debian-13-package/tahoe-lafs_1.20.0-1_all.deb - run: name: "Run our newly system-wide installed tahoe" command: tahoe --version - store_artifacts: - path: /tmp/tahoe-lafs_1.20.0-1_all.deb + path: /tmp/debian-13-package/tahoe-lafs_1.20.0-1_all.deb nixos: parameters: From f4082468f9502153cfb5ccff0a74758da3e12eca Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 17 Jan 2025 10:54:46 +0000 Subject: [PATCH 13/17] Trigger CI --- newsfragments/4150.installation | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newsfragments/4150.installation b/newsfragments/4150.installation index a6bf5ca15..59f373861 100644 --- a/newsfragments/4150.installation +++ b/newsfragments/4150.installation @@ -1 +1 @@ -A package for the upcoming Debian Trixie has been created and successfully submitted by @merkys (thanks!) +A package for upcoming Debian Trixie has been created and successfully submitted by @merkys (thanks!) From d77f09087d891d27ac53ca513d87656f30726cf8 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Thu, 23 Jan 2025 18:26:41 +0000 Subject: [PATCH 14/17] Work around CircleCI not supporting globbing for artifacts --- .circleci/config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4cf6a7aa3..c17feca23 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -597,12 +597,17 @@ jobs: make -f debian/rules binary - run: name: "Install the built package" - command: dpkg -i /tmp/debian-13-package/tahoe-lafs_1.20.0-1_all.deb + command: | + # Work around CircleCI not supporting globbing in store_artifacts + mkdir -p /tmp/debian-13-package/dist + rm /tmp/debian-13-package/dist/tahoe-lafs_*.deb + mv /tmp/debian-13-package/tahoe-lafs_*.deb /tmp/debian-13-package/dist/ + dpkg -i /tmp/debian-13-package/dist/tahoe-lafs_*.deb - run: name: "Run our newly system-wide installed tahoe" command: tahoe --version - store_artifacts: - path: /tmp/debian-13-package/tahoe-lafs_1.20.0-1_all.deb + path: /tmp/debian-13-package/dist nixos: parameters: From 7b8c5d035864018903112af2aea35af0dbbdec6a Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Thu, 23 Jan 2025 18:47:50 +0000 Subject: [PATCH 15/17] Don't fail on trying to remove nonexisting file --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c17feca23..5376ef61b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -600,7 +600,7 @@ jobs: command: | # Work around CircleCI not supporting globbing in store_artifacts mkdir -p /tmp/debian-13-package/dist - rm /tmp/debian-13-package/dist/tahoe-lafs_*.deb + rm -f /tmp/debian-13-package/dist/tahoe-lafs_*.deb mv /tmp/debian-13-package/tahoe-lafs_*.deb /tmp/debian-13-package/dist/ dpkg -i /tmp/debian-13-package/dist/tahoe-lafs_*.deb - run: From 7406d2d4112d319a849d4edd0729fb23c9ea6c15 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 24 Jan 2025 14:48:09 +0000 Subject: [PATCH 16/17] Install dependency step - insert URL with source for the AWK --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5376ef61b..f8b570323 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -574,6 +574,7 @@ jobs: name: "Install Tahoe-LAFS dependencies from the Debian repositories" command: | # 'apt-get install' dependencies from debian/control + # Via https://stackoverflow.com/a/47707412 apt-get install --no-install-recommends --yes $(awk ' /^(Build-)?Depends:/ || /^ / && deps { sub(/^[^ ]+: /, "") From 50ecf30bcd65269cfc568676394ba4c7cb1ea0e7 Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 24 Jan 2025 15:11:18 +0000 Subject: [PATCH 17/17] Cleanup / Less defensive programming. If these assumptions fail the build *should* fail. --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8b570323..a2446b55c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -600,8 +600,7 @@ jobs: name: "Install the built package" command: | # Work around CircleCI not supporting globbing in store_artifacts - mkdir -p /tmp/debian-13-package/dist - rm -f /tmp/debian-13-package/dist/tahoe-lafs_*.deb + mkdir /tmp/debian-13-package/dist mv /tmp/debian-13-package/tahoe-lafs_*.deb /tmp/debian-13-package/dist/ dpkg -i /tmp/debian-13-package/dist/tahoe-lafs_*.deb - run: