|
3 | 3 | { |
4 | 4 | sources, |
5 | 5 | sanitizers, |
6 | | - target, |
| 6 | + platform, |
7 | 7 | profile, |
8 | 8 | }: |
9 | 9 | final: prev: |
|
17 | 17 | adapt = final.stdenvAdapters; |
18 | 18 | bintools = final.pkgsBuildHost.llvmPackages.bintools; |
19 | 19 | lld = final.pkgsBuildHost.llvmPackages.lld; |
20 | | - added-to-env = helpers.addToEnv target.platform.override.stdenv.env profile; |
| 20 | + added-to-env = helpers.addToEnv platform.override.stdenv.env profile; |
21 | 21 | stdenv' = adapt.addAttrsToDerivation (orig: { |
22 | 22 | doCheck = false; |
23 | 23 | separateDebugInfo = true; |
|
28 | 28 | ]; |
29 | 29 | }) final.llvmPackages.stdenv; |
30 | 30 | dataplane-dep = pkg: pkg.override { stdenv = stdenv'; }; |
| 31 | + fenix = import sources.fenix { }; |
| 32 | + rust-toolchain = fenix.fromToolchainFile { |
| 33 | + file = ../../rust-toolchain.toml; |
| 34 | + sha256 = (builtins.fromJSON (builtins.readFile ../.rust-toolchain.manifest-lock.json)).hash.sha256; |
| 35 | + }; |
31 | 36 | in |
32 | 37 | { |
33 | 38 | inherit stdenv' added-to-env; |
|
219 | 224 | # Also, while this library has a respectable security track record, this is also a super strong candidate for |
220 | 225 | # cfi, safe-stack, and cf-protection. |
221 | 226 | dpdk = dataplane-dep ( |
222 | | - final.callPackage ../pkgs/dpdk ( |
223 | | - target.platform.override.dpdk.buildInputs // { src = sources.dpdk; } |
224 | | - ) |
| 227 | + final.callPackage ../pkgs/dpdk (platform.override.dpdk.buildInputs // { src = sources.dpdk; }) |
225 | 228 | ); |
226 | 229 |
|
227 | 230 | # DPDK is largely composed of static-inline functions. |
|
230 | 233 | # This wrapping process does not really cause any performance issue due to lto; the compiler is going to "unwrap" |
231 | 234 | # these methods anyway. |
232 | 235 | dpdk-wrapper = dataplane-dep (final.callPackage ../pkgs/dpdk-wrapper { }); |
| 236 | + |
| 237 | + # TODO: doc this |
| 238 | + rustPlatform = final.makeRustPlatform { |
| 239 | + cargo = rust-toolchain; |
| 240 | + rustc = rust-toolchain; |
| 241 | + }; |
233 | 242 | } |
0 commit comments