Skip to content

matrix-tuwunel: run tests in debug profile - #528878

Merged
pbsds merged 1 commit into
NixOS:masterfrom
scvalex:tuwunel-no-check-on-aarch64
Jun 30, 2026
Merged

matrix-tuwunel: run tests in debug profile#528878
pbsds merged 1 commit into
NixOS:masterfrom
scvalex:tuwunel-no-check-on-aarch64

Conversation

@scvalex

@scvalex scvalex commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

The tuwunel build is timing out intermittently on both aarch64 and x86-64.

The specific step that causes the timeout is the Compiling tuwunel v1.7.1 (/build/source/src/main) step during checkPhase. So, we're timing out building the tests and not running them.

This is caused by tuwunel having 16 integration tests. Cargo compiles each of them as a separate binary which statically links 110 MB worth of tuwunel. Linking 16 big binaries like this takes a really long time in "release" profile.

Building the tests in debug profile reduces the package build from 44min to 12min on my machine. So, let's do that.

The previous version of this PR just disabled the tests, hence the first few comments below. We don't need to do that anymore.

Things done

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Jun 6, 2026

@PedroHLC PedroHLC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe all aarch64

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Jun 6, 2026
@scvalex
scvalex force-pushed the tuwunel-no-check-on-aarch64 branch from 5604893 to 6e42620 Compare June 7, 2026 06:42
@scvalex

scvalex commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Maybe all aarch64

Good point. Done.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Jun 7, 2026
@scvalex scvalex mentioned this pull request Jun 11, 2026
14 tasks
@scvalex
scvalex marked this pull request as draft June 17, 2026 16:52
@scvalex

scvalex commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

The builds on 1.7.0 aren't timing out anymore. Let's wait an see what happens with the newly merged 1.7.1. If those don't time out either, I'll just close this PR.

@scvalex

scvalex commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

We're now seeing timeouts on x86-64 too, so this PR should probably disable check phase on all platforms.

I've opened an issue with upstream to see if they have any ideas because thinking some more, 2h11m for a successful build on x86-64 does seem suspiciously long.

@scvalex

scvalex commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

I think I understand what is happening:

  • On my machine, building the nixpkgs tuwunel build takes 8m without tests and 44m with tests. The hydra machines are likely slower and busier than my workstation, so they could easily take 3x longer.
  • The thing that was confusing me was that the timeout was happening while compiling the tests rather than when running them. I was looking at processes while the build was happening and it was indeed spending a huge amount of time running rustc.
  • Tuwunel has 16 integration tests. The way cargo test works is that it compiles every one of the integration tests into a separate binary and each of these statically links the full 110 MB worth of tuwunel.
  • By default, nixpkgs builds the tests in release mode in an attempt to not recompile the library. Linking 16 tuwunels in release mode takes a really long time.
  • If I configure the tests to build in debug mode, the full nixpkgs build+test takes 12m.

So, new plan is to just set checkType = "debug" for all platforms and run tests for all platforms. I'll make the changes in this PR.

@scvalex
scvalex force-pushed the tuwunel-no-check-on-aarch64 branch from 6e42620 to 9828255 Compare June 24, 2026 14:10
@scvalex scvalex changed the title matrix-tuwunel: disable check phase on aarch64 matrix-tuwunel: run tests in debug profile Jun 24, 2026
@scvalex
scvalex marked this pull request as ready for review June 24, 2026 14:18
@scvalex
scvalex force-pushed the tuwunel-no-check-on-aarch64 branch from 9828255 to 24bb6a0 Compare June 24, 2026 14:18
@scvalex
scvalex requested a review from PedroHLC June 24, 2026 14:31
@PedroHLC

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 528878
Commit: 24bb6a0c44cd68bae9b9ea6eee309d08cbcd6e0c


x86_64-linux

✅ 1 package built:
  • matrix-tuwunel

@PedroHLC PedroHLC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't be ablt to test it in aarch64-linux so soon

╰─λ ./results/matrix-tuwunel-x86_64-linux/bin/tuwunel --version
tuwunel 1.7.1

╰─λ du -h (readlink ./results/matrix-tuwunel-x86_64-linux)
51M     /nix/store/4j2wncgw94ah3ixd33zg6fbpynwgllrr-matrix-tuwunel-1.7.1/bin
51M     /nix/store/4j2wncgw94ah3ixd33zg6fbpynwgllrr-matrix-tuwunel-1.7.1`

@scvalex

scvalex commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Oh, right. That would be a good test.

I built on aarch64 and deployed to my server. Everything works as expected since this PR doesn't change anything about the final artifacts. It was however much faster to build: this normally takes around 4h on a tiny 2 CPU VM from Hetzner, but now it took only 70m on the same hardware.

@pbsds
pbsds added this pull request to the merge queue Jun 30, 2026
Merged via the queue into NixOS:master with commit 9f6387a Jun 30, 2026
30 of 32 checks passed
@scvalex

scvalex commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@pbsds Thank you!

@nixpkgs-ci

nixpkgs-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-26.05:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label Jun 30, 2026
@scvalex

scvalex commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

To close this off, the 1.7.1 build was successful on both aarch64 and x86-64. The former took 1h2m and the latter 47m, so we're hopefully well within the timeout threshold now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 1 This PR was reviewed and approved by one person. backport release-26.05 Backport PR automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants