4 ms·
That's not at all how it works. The compiler emits dependency files that the build system can then read in on the subsequent passes to know if any dependencies
by hermitdev 8y ago
That's not at all how it works. The compiler emits dependency files that the build system can then read in on the subsequent passes to know if any dependencies changed. There's no special knowledge of "these are all of the headers in the world we care about".
- gnufx 8y agoIt is patently how it works. All the files, not just headers, the build cares about have to be available in the build chroot.
- hermitdev 8y agoI disagree. The compiler knows about possible include paths from the -I directive. Any include is searched using these. There are a few assumed directories on Unix such as "/usr/include", but the compiler doesn't inherently know about "all includes". If you doubt me, do an strafe on a compilation and just look at how it finds headers. It doesn't know anything, it searches the include paths.
- gnufx 8y agoI hadn't noticed this comment at the time. I said "patently" as in easy to check even if you think the docs are fiction, so for archives' sake: GNU's not Unix and there isn't a /usr/include in the build chroot; see the manual about that and profiles. $ cat x.c #include <stdlib.h> $ guix environment gcc $ gcc -Wp,-H x.c |& grep stdlib.h . /gnu/store/fc363b1hsid7pfdxh18m4a1i1r04i5fl-profile/include/stdlib.h $ readlink . /gnu/store/fc363b1hsid7pfdxh18m4a1i1r04i5fl-profile/include/stdlib.h /gnu/store/4sqaib7c2dfjv62ivrg9b8wa7bh226la-glibc-2.26.105-g0890d5379c/include/stdlib.h