Nix + dotnet | 127 Members | |
| 24 Servers |
| Sender | Message | Time |
|---|---|---|
| 12 Dec 2024 | ||
* And we add the required libraries in LD_LIBRARY_PATH in makeWrapper (after the project has been built) instead of at build time, so even if there was a tool to block the build if the native library isn't found, it'd have to be very nix specific as we'd have to have an env-var or MSBuild property to indicate where it should search for said libraries on. | 00:04:21 | |
| no, because we'd need to have something to:
| 00:05:50 | |
| it'd be as much work as making something like a tool to patch those after the fact | 00:06:08 | |
| so it's just easier to make a tool to patch it since it'll work with both source builds and prebuilt binaries | 00:06:28 | |
| * not easily, because we'd need to have something to:
| 00:06:37 | |
| actually this made me think, GGG how would patchcil handle nativeaot builds? | 00:08:31 | |
| it can't, out of scope | 00:08:41 | |
we'd just have to use LD_LIBRARY_PATH instead | 00:08:51 | |
In reply to @gggkiller:matrix.orgpatchcil would solve 1. here, but for 2. and 3. would be in the nix script | 00:08:55 | |
* we'd just have to use LD_LIBRARY_PATH instead like we do currently | 00:08:56 | |
In reply to @gggkiller:matrix.org* for what I was thinking, patchcil would solve 1. here, but for 2. and 3. would be in the nix script | 00:09:09 | |
it'd actually solve the whole process when running in autoPatchcilHook mode | 00:09:15 | |
| which is the more "useful" mode I think | 00:09:31 | |
In reply to @gggkiller:matrix.orgit can for source builds | 00:09:51 | |
| just run patchcil before naot | 00:09:58 | |
| with a msbuild target | 00:10:03 | |
| the issue is how you pass in what libraries you want from nix | 00:10:15 | |
| it'd be quite a bit of work though, I wouldn't put it in as a requirement for the MVP | 00:10:29 | |
| maybe a 1.1 release or something | 00:10:38 | |
| no work would be needed in patchcil itself | 00:10:57 | |
| it doesn't care about what you do with the dlls after the fact | 00:11:06 | |
| the issue here is on nix build system side | 00:11:25 | |
| I guess you could run autoPatchcil inside an msbuild hook? but then how would you do manual depends injection etc | 00:12:49 | |
| well, it'd be possible to run it inside of a msbuild target | 00:15:21 | |
| that runs before the NativeAOT one | 00:15:27 | |
we could even make it part of buildDotnetModule itself and it'd inject the msbuild target whenever possible (i.e. when people haven't specified a solution instead of a csproj or not specified one at all) | 00:16:25 | |
In reply to @6pak:matrix.orgthere is no cil then, you'd probably just patchelf if needed | 00:16:26 | |
| there is CIL before it compiles it to native | 00:16:43 | |
| well that, sure | 00:16:50 | |
| and nativeaot only uses the system linker if you explicitly mark the imports as DirectPInvoke | 00:17:11 | |