fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 lib,
3 stdenv,
4
5 fetchFromGitHub,
6
7 cmake,
8 ninja,
9 sanitiseHeaderPathsHook,
10
11 folly,
12 gflags,
13 glog,
14
15 fizz,
16
17 gtest,
18
19 nix-update-script,
20}:
21
22stdenv.mkDerivation (finalAttrs: {
23 pname = "mvfst";
24 version = "2025.04.21.00";
25
26 outputs = [
27 "bin"
28 "out"
29 "dev"
30 ];
31
32 src = fetchFromGitHub {
33 owner = "facebook";
34 repo = "mvfst";
35 tag = "v${finalAttrs.version}";
36 hash = "sha256-/84smnZ2L1zDmkO1w9VQzVhXKt/S5azQr7Xpr8/dOA4=";
37 };
38
39 patches = [
40 ./glog-0.7.patch
41 ];
42
43 nativeBuildInputs = [
44 cmake
45 ninja
46 sanitiseHeaderPathsHook
47 ];
48
49 buildInputs = [
50 folly
51 gflags
52 glog
53 ];
54
55 propagatedBuildInputs = [
56 fizz
57 ];
58
59 checkInputs = [
60 gtest
61 ];
62
63 hardeningDisable = [
64 # causes test failures on aarch64
65 "pacret"
66 # causes empty cmake files to be generated
67 "trivialautovarinit"
68 ];
69
70 cmakeFlags = [
71 (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
72
73 (lib.cmakeBool "CMAKE_INSTALL_RPATH_USE_LINK_PATH" true)
74
75 (lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck)
76
77 (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "dev"))
78 ]
79 ++ lib.optionals stdenv.hostPlatform.isDarwin [
80 # Homebrew sets this, and the shared library build fails without
81 # it. I don‘t know, either. It scares me.
82 (lib.cmakeFeature "CMAKE_SHARED_LINKER_FLAGS" "-Wl,-undefined,dynamic_lookup")
83 ];
84
85 __darwinAllowLocalNetworking = true;
86
87 doCheck = true;
88
89 postPatch = ''
90 # Make sure the libraries the `tperf` binary uses are installed.
91 printf 'install(TARGETS mvfst_test_utils)\n' >> quic/common/test/CMakeLists.txt
92 printf 'install(TARGETS mvfst_dsr_backend)\n' >> quic/dsr/CMakeLists.txt
93 '';
94
95 checkPhase = ''
96 runHook preCheck
97
98 ctest -j $NIX_BUILD_CORES --output-on-failure ${
99 lib.optionalString stdenv.hostPlatform.isLinux (
100 lib.escapeShellArgs [
101 "--exclude-regex"
102 (lib.concatMapStringsSep "|" (test: "^${lib.escapeRegex test}$") [
103 "*/QuicClientTransportIntegrationTest.NetworkTest/*"
104 "*/QuicClientTransportIntegrationTest.FlowControlLimitedTest/*"
105 "*/QuicClientTransportIntegrationTest.NetworkTestConnected/*"
106 "*/QuicClientTransportIntegrationTest.SetTransportSettingsAfterStart/*"
107 "*/QuicClientTransportIntegrationTest.TestZeroRttSuccess/*"
108 "*/QuicClientTransportIntegrationTest.ZeroRttRetryPacketTest/*"
109 "*/QuicClientTransportIntegrationTest.NewTokenReceived/*"
110 "*/QuicClientTransportIntegrationTest.UseNewTokenThenReceiveRetryToken/*"
111 "*/QuicClientTransportIntegrationTest.TestZeroRttRejection/*"
112 "*/QuicClientTransportIntegrationTest.TestZeroRttNotAttempted/*"
113 "*/QuicClientTransportIntegrationTest.TestZeroRttInvalidAppParams/*"
114 "*/QuicClientTransportIntegrationTest.ChangeEventBase/*"
115 "*/QuicClientTransportIntegrationTest.ResetClient/*"
116 "*/QuicClientTransportIntegrationTest.TestStatelessResetToken/*"
117 ])
118 ]
119 )
120 }
121
122 runHook postCheck
123 '';
124
125 passthru.updateScript = nix-update-script { };
126
127 meta = {
128 description = "Implementation of the QUIC transport protocol";
129 homepage = "https://github.com/facebook/mvfst";
130 license = lib.licenses.mit;
131 platforms = lib.platforms.unix;
132 maintainers = with lib.maintainers; [
133 ris
134 emily
135 techknowlogick
136 ];
137 };
138})