| 15 Nov 2024 |
emily | 1e26d33371a4a7238a644c49ddae49a4009c927f is the patch with the reproducer btw | 09:02:53 |
emily | I say the criteria for replacing the patch is to not regress that example and unwrapped compilers can behave however | 09:03:09 |
emily | anyway, I chased back the -nostdlibinc through Git blame before, let me do it again now that I'm not just venting to the macOS room 😅 | 09:03:34 |
emily | it broke things for us because libclang is essentially unwrapped | 09:03:46 |
emily | which is its own problem | 09:03:50 |
emily | and a good reason we need to move off wrappers in time | 09:04:00 |
p14 | There are old patches which mess with this. https://github.com/NixOS/nixpkgs/commit/006d8dcdc1127808d6c68f3b72f8c3d0d8e79014 | 09:04:49 |
p14 | This was the first match for DriverArgs.hasArg via git log -G DriverArgs.hasArg ./pkgs/development/compilers/llvm/. | 09:05:15 |
emily | uh, wow | 09:05:27 |
emily | hm this looks different | 09:05:40 |
emily | well | 09:05:46 |
p14 | Might be some legacy here 😅 | 09:05:58 |
emily | I guess it's similar in effect | 09:05:59 |
emily | yeah… | 09:06:06 |
emily | I mean how about we just move it to the wrapper? | 09:06:18 |
emily | it's still not the Right Thing IMO, but it causes a lot less damage in the wrapper | 09:06:35 |
emily | FWIW the wrapper has a gross "purity filter" thing that tries to reparse the command line and filter out /usr paths | 09:06:56 |
emily | we have like 5 layers of defence against system paths reaching compilers | 09:07:07 |
emily | it's really silly | 09:07:08 |
p14 | I'm unclear on what should move to the wrapper or how to move it - how do we prevent the compiler from adding doing something internally? | 09:07:39 |
p14 | * I'm unclear on what should move to the wrapper or how to move it - how do we prevent the compiler from adding paths internally? | 09:07:46 |
emily | our current patch literally just hacks up the command line parser to forcibly insert -nostdlibinc | 09:07:58 |
emily | we could just … pass -nostdlibinc in the wrapper (with the Darwin exception) | 09:08:07 |
emily | that's not A Solution, but it accomplishes the same behaviour as currently for wrapped compilers without rebuilding Clang | 09:08:23 |
emily | * that's not A Solution, but it accomplishes the same behaviour as currently for wrapped compilers without rebuilding Clang for different targets | 09:08:28 |
emily | and, yeah, it changes unwrapped compiler behaviour. but it changes it to be more normal and more upstream and I think that's good? | 09:08:48 |
p14 | Oh. Right. Brain was in the wrong mode. I now comprehend the silliness of the patch. | 09:09:22 |
p14 | At least ISTM that it can move to the wrapper and I follow your rationale for it. | 09:09:49 |
emily | yeah so when I investigated this last I think I just misinterpreted that bug you linked as talking about an unwrapped compiler | 09:10:05 |
emily | seeing how ancient these patches are, I now believe that the reason it's applied to the unwrapped compiler is "shrug" | 09:10:24 |